//*-----JQUERY FUNCTIONS-----*//

$(document).ready(function(){

	//*-----INVITE TAB FUNCTION-----*//
						   
	$('a.invite').hover(
		function(){
			$(this).stop().animate({ marginTop: '0' }, 'fast');
		},
		function(){
			$(this).stop().animate({ marginTop: '-10' }, 'fast');
		}
	);
	
	//*-----COLUMNIZER FUNCTION-----*//
	
	$('.columnize').columnize({ columns: 2 });
	
	//*-----IE BOX SHADOW FUNCTION-----*//
	
/*	if ($.browser.msie) {
		$('#Speakers li img, #Leaders li img, #HomeSpeakers .shadow').boxShadow( 0, 0, 3, "BBB");
	}*/
	
	//*-----COLOR ALTERNATING FUNCTION-----*//
	
	$('#Program li:nth-child(4n), #Program li:nth-child(4n-1)').addClass('brown');
	
	//*-----TOOLTIP FUNCTION-----*//
	
	/*$('#Partners li, #HomePartners li').hover(
		function(){
			var thisTip = $(this).children('.tooltip');
			var thisHeight = thisTip.height() + 50;
			thisTip.css({ marginTop: -thisHeight + 'px' });
			thisTip.show();
		},
		function(){
			$(this).children('.tooltip').hide();
		}
	);*/
	
	// MARGINS 
	
	$('#NavBlock ul li:nth-child(4)').css('width', '138px');
	$('#NavBlock ul li:nth-child(5)').css('width', '136px');
	$('#NavBlock ul li:nth-child(6)').css('width', '138px');
	$('#HomeSpeakers li:nth-child(2n)').addClass('black');
	$('#HomePartners li:nth-child(4n)').css('margin-right', '0px'); 
	
	//*-----ABOUT CYCLE FUNCTION-----*//
	
	$('.slideshow').cycle({
		fx: 'fade',
		speed: 'slow',
		timeout: 4000
	});
	
	$('.home_about_slideshow').cycle({
		fx: 'fade',
		speed: 'slow',
		timeout: 4000
	});
	
	//*-----KEYNOTE LIST FUNCTION-----*//
	
/*	$('#HomeSpeakers ul').makeacolumnlists({ cols: 2, colWidth: 161, equalHeight: false, startN: 1 });*/
	
	//*-----TESTIMONIALS LIST FUNCTION-----*//
	
	$('#Testimonials ul').makeacolumnlists({ cols: 2, colWidth: 455, equalHeight: false, startN: 1 });
	
	// vertical align hack 
	
	var leftheight = ($('div.home_speakers_left').height()) + 30; 
	var topmargin = (leftheight - 183)/2; 
	$('div.home_speakers_right').css('margin-top', topmargin); 
	
	var deviceAgent = navigator.userAgent.toLowerCase();
		var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
		if (agentID) {

	        $('#Header').css('background-image', 'none'); 
			$('#Header').css('background', 'transparent');
			$('body').css('background', 'URL(/wp-content/themes/k12tech/im/bookshelf-tile.jpg) fixed #333'); 
			$('#Nav ul').css('margin-left', '0px'); 
			$('#Header .header_logo').css('background', 'URL(/wp-content/themes/k12tech/im/logo.png) top left no-repeat'); 
		}

});

