if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
	 if (document.cookie.indexOf("iphone_redirect=false") == -1) window.location = "http://www.missedabit.com/mobile/index.htm";
}

$(document).ready ( function () 

{

$('nav ul li a').click(function () {
	$(this).addClass('linkactive');
	},function () {
$(this).removeClass('linkactive');

});

/**
$('#sideBar h2').click(function() {
	$(this).next().slideToggle('slow', function() {
    
  });
	return false;
}).next().hide();


**/
});

$(document).ready(function(){

	$("#videoclick").load("video1.htm");

	$("#video1").click(function(){
		$("#videoclick").load("video1.htm");
	});

	$("#video2").click(function(){
		$("#videoclick").load("video2.htm");
	});

	$("#video3").click(function(){
		$("#videoclick").load("video3.htm");
	});

	$("#video4").click(function(){
		$("#videoclick").load("video4.htm");
	});

	$("#video5").click(function(){
		$("#videoclick").load("video5.htm");
	});

	$("#video6").click(function(){
		$("#videoclick").load("video6.htm");
	});

	$("#sideBar h2").click(function(){
		$("#videoclick").load("empty.htm");
	});
});

$(function() {
   $('a.tab').click(function() {
       $('a.tab').removeClass('active');
       $(this).addClass('active');
   });
});

var AjaxContent = function(){
    var container_div = ''; 
	var content_div = ''; 
	return {
		getContent : function(url){
			$(container_div).animate({opacity:1}, //Turn the opacity to 0
					function(){ // the callback, loads the content with ajax
						$(container_div).load(url+" "+content_div, //only loads the selected portion
						function(){						   
						   $(container_div).animate({opacity:1},2000 ); //and finally bring back the opacity back to 1
					}
				);        
			});
		},
		ajaxify_links: function(elements){
			$(elements).click(function(){
				AjaxContent.getContent(this.href);
				return false; //prevents the link from beign followed
			});
		},
		init: function(params){ //sets the initial parameters
			container_div = params.containerDiv; 
			content_div = params.contentDiv;
			return this; //returns the object in order to make it chainable
		}
	}
}();

$(function(){
	AjaxContent.init({containerDiv:"#ajax-wrap",contentDiv:"#text"}).ajaxify_links("#bottommenu a");
});

$(document).ready ( function () 
{

$('#bottomContent section h2').click(function() {
	$(this).next().slideToggle('slow', function() {
    
  });
	return false;
}).next().show();

});

$(document).ready(function() {
	$('#mainContent aside').cycle({
		fx:    'curtainX',
		sync:   0,
		delay: -1000
	});
});


$(document).ready(function() {

	$("div").load( "nadeem.txt", callback );

});



$(document).ready(
	function() {
		$('#myFlash').flash('http://jquery.thewikies.com/swfobject/fireworks.swf');
	}
);
