function onThumbRollOver() {
		$(this).css({zIndex:"101"});
		$(this).stop();
		$(this).animate({
			width : '160',
			height : '120',				
			marginTop:'-32',
			marginLeft:'-42'
		
		}, 400 , "easeOutBack");
	
	}
	
	function onThumbRollOut() {
		$(this).css({zIndex:"100"});
		$(this).stop();
		$(this).animate({
			width : '80',
			height : '60',				
			marginTop:'0',
			marginLeft:'0'
		},600 , "easeOutBounce");
	
	}
	
	function addThumbEvents() {

		$(".v_thumb").hover( onThumbRollOver , onThumbRollOut );
	
		$('.v_thumb a').fancybox({ 
			'hideOnContentClick': true,
			"frameWidth":"160",
			"frameHeight":"120",
			"overlayShow":true,
			"overlayOpacity":0,
			"zoomSpeedIn":0,
			"zoomSpeedOut":0
			});
		$('#demos a, #demo_l1 a, #demo_l2 a, #demo_l3 a, #demo_l4 a,').fancybox({ 
			'hideOnContentClick': true,
			"frameWidth":"480",
			"frameHeight":"325",
			"overlayShow":true,
			"overlayOpacity":0,
			"zoomSpeedIn":0,
			"zoomSpeedOut":0
			}); 
		$('#overview_link_m,#overview_link,#skeptic_link').fancybox({ 
					'hideOnContentClick': true,
					"frameWidth":"320",
					"frameHeight":"370",
					"overlayShow":true,
					"overlayOpacity":0,
					"zoomSpeedIn":0,
					"zoomSpeedOut":0
					});
		// $('#vista_facts').fancybox({
		// 	
		// 	"frameWidth":"966",
		//  	"frameHeight":"1200",
		// 	"overlayShow":true,
		// 	"zoomSpeedIn":0,
		// 	"zoomSpeedOut":0
		// })
			$(".facts_link1").click( function() {
				showPopUp("facts1.html");
			});
			$(".facts_link2").click( function() {
				showPopUp("facts2.html");
			});
			$("#mojave_details").click( function() {
				showPopUp("details.html");
			});
			$("#top_gradient_clk").fancybox({
				'hideOnContentClick': true,
				
				

				"frameWidth":"480",
				"frameHeight":"284",
				"overlayShow":true,
				"overlayOpacity":0,
				"zoomSpeedIn":0,
				"zoomSpeedOut":0
			})
			
			//$('.v_thumb a').css({display:"none"});
		//	alert( $("#overview_link").attr("href") );
		$.fn.fancybox.start($("#overview_link_m"), {
								'hideOnContentClick': true,
								"frameWidth":"320",
								"frameHeight":"405",
								"overlayShow":true,
								"overlayOpacity":0,
								"zoomSpeedIn":0,
								"zoomSpeedOut":0});
	}
	function showPopUp(url) {
	
		$("body").append("<div id='detail_overlay'></div><div id='detail' ><div id='detail_close'></div></div>");
		$("#detail").append('<iframe id="detail_frame" allowtransparency="true"  name="detail_iframe' + Math.round(Math.random()*1000) + '" frameborder="0" scrolling="no" hspace="0" src="' + url + '"></iframe>');
		$("#detail_close").click(function() {$("#detail").remove(); $("#detail_overlay").remove()});
		$("#detail_overlay").click(function() {$("#detail").remove(); $("#detail_overlay").remove()});
		$("#detail_overlay").css({'width': $(window).width(), 'height': $(document).height(), 'opacity': 0});
	}
	function accordianInit() {
		$(".toggler").click( function() {expandSection($(this))});
		$("#ll_see").next().hide();
		$("#ll_decide").next().hide();
	}
	function expandSection( el ) {
	//	el.next().css({"visibility":"visible"});
		el.next().slideToggle("normal");
	}
	$(document).ready( addThumbEvents );
 	$(document).ready( accordianInit );
