// JavaScript Document

$(document).ready(function(){

$.fn.delay = function(time, callback){
    // Empty function:
    jQuery.fx.step.delay = function(){};
    // Return meaningless animation, (will be added to queue)
    return this.animate({delay:1}, time, callback);
}
	
function flashbutton()

{
/*
$('#pop-arrow').effect("highlight", {color:"#000"}, 1000);
$('#pop-arrow').effect("highlight", {color:"#fff"}, 1000);
$('#pop-arrow').effect("highlight", {color:"#fff"}, 1000);
$("#pop-arrow").css(  "background-image", "url(../img/Untitled-3.png)"   );	
*/

$('#pop-content-open').delay(1500, function(){




		$('#pop-arrow').hide();
		$('#pop-content').show();

		$('#pop-content').animate({
		width: '58%',
		right: '2%',
		

		//height: 'toggle'
	  }, 500, function() {
		// Animation complete.

				$("#right").css({ opacity:'0.5' });	
				$(".rights").show(); 
				$("#html-content").show(); 
				$('#html-content').animate({
				 opacity: 1
			  }, 1000, function() {
				// Animation complete.
								$("#right").css( { 	height:'100%' } );	
			  });
		
		
	  });
	  
	  
});



}

flashbutton();

	//-----------------------------------------------------

	//Hide (Collapse) the toggle containers on load
	$("#pop-content").hide(); 
	$("#html-content").hide(); 
	$(".rights").hide(); 





		
	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("#pop-content-open").click(function(){
		


		$('#pop-arrow').hide();
		$('#pop-content').show();

		$('#pop-content').animate({
		width: '54.8%',
		right: '20px',

		//height: 'toggle'
	  }, 500, function() {
		// Animation complete.
				$("#right").css({ opacity:'0.5' });	
				$(".rights").show(); 
				$("#html-content").show(); 
				$('#html-content').animate({
				 opacity: 1
			  }, 1000, function() {
				// Animation complete.
								$("#right").css( { 	height:'100%' } );	
			  });
		
		
	  });
		
		return false; //Prevent the browser jump to the link anchor
	});



	$("#pop-content-close").click(function(){
		
		$('#html-content').animate({
		opacity: 0
		
		//height: 'toggle'
	  }, 500, function() {
			// Animation complete.
			$("#right").css({ opacity:'1' });	
			$("#html-content").hide(); 
			$(".rights").hide(); 
			
			$('#pop-content').animate({
			width: '35',
			right: '0'
			
				 
			  }, 500, function() {
				// Animation complete.
				$("#pop-content").hide(); 

				$("#pop-arrow").show();
			  });


	  });


		
		//$('#menu-pop-container').css({ position: "absolute", marginLeft: 0, marginTop: 0, top: pos.top + 40, left: pos.left + 300 });
		
		
		return false; //Prevent the browser jump to the link anchor
	});







/*	//-----------Projects Popup-------------------------------------------------
	
	//Hide (Collapse) the toggle containers on load
	$("#pop-seo").hide(); 
	$("#html-seo").hide(); 
	$(".rights").hide(); 



				//---------------------------------------
		
	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("#pop-seo-open").click(function(){
		


		$('#pop-seo').show();

		$('#pop-seo').animate({
		width: '64%',

		//height: 'toggle'
	  }, 500, function() {
		// Animation complete.
				$("#right").css({ opacity:'0.5' });	
				$(".rights").show(); 
				$("#html-seo").show(); 
				$('#html-seo').animate({
				 opacity: 1
			  }, 1000, function() {
				// Animation complete.
								$("#right").css( { 	height:'100%' } );	
			  });
		
		
	  });
		
		return false; //Prevent the browser jump to the link anchor
	});



	$("#pop-seo-close").click(function(){
		
		$('#html-seo').animate({
		opacity: 0
		
		//height: 'toggle'
	  }, 500, function() {
			// Animation complete.
			$("#right").css({ opacity:'1' });	
			$("#html-seo").hide(); 

			$(".rights").hide(); 
			
			$('#pop-seo').animate({
			width: '35',
			right: '0'
			
				 
			  }, 500, function() {
				// Animation complete.
				$("#pop-seo").hide(); 


			  });


	  });


		
		//$('#menu-pop-container').css({ position: "absolute", marginLeft: 0, marginTop: 0, top: pos.top + 40, left: pos.left + 300 });
		
		
		return false; //Prevent the browser jump to the link anchor
	});





				// -----------------------------------------








		
	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("#pop-web-open").click(function(){
		


		$('#pop-web').show();

		$('#pop-web').animate({
		width: '54.8%',
		right: '20px',

		//height: 'toggle'
	  }, 500, function() {
		// Animation complete.
				$("#right").css({ opacity:'0.5' });	
				$(".rights").show(); 
				$("#html-web").show(); 
				$('#html-web').animate({
				 opacity: 1
			  }, 1000, function() {
				// Animation complete.
								$("#right").css( { 	height:'100%' } );	
			  });
		
		
	  });
		
		return false; //Prevent the browser jump to the link anchor
	});



	$("#pop-web-close").click(function(){
		
		$('#html-web').animate({
		opacity: 0
		
		//height: 'toggle'
	  }, 500, function() {
			// Animation complete.
			$("#right").css({ opacity:'1' });	
			$("#html-web").hide(); 
			$(".rights").hide(); 
			
			$('#pop-web').animate({
			width: '35',
			right: '0'
			
				 
			  }, 500, function() {
				// Animation complete.
				$("#pop-web").hide(); 


			  });


	  });


		
		//$('#menu-pop-container').css({ position: "absolute", marginLeft: 0, marginTop: 0, top: pos.top + 40, left: pos.left + 300 });
		
		
		return false; //Prevent the browser jump to the link anchor
	});



*/


	//-----------Nav Menu-------------------------------------------------
	var pos = $("#navigation").position();	



	var keep = true;

	//Hide (Collapse) the toggle containers on load
	$("#menu-pop-container").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("#a").mouseover(function(){
		keep = true;		
		$('#menu-pop-container2').hide();
		$('#menu-pop-container3').hide();

		pos = $("#navigation").position();	
			
		$('#menu-pop-container').show();
		$('#menu-pop-container').css({ position: "absolute", marginLeft: 0, marginTop: 0, top: pos.top + 40, left: pos.left + 300 });
		
		
		return false; //Prevent the browser jump to the link anchor
	});
	
	$("#menu-pop-container").mouseover(function(){
		keep = true;
		return false; //Prevent the browser jump to the link anchor
	});

	$(".menu-pop-row").mouseover(function(){
		keep = true;
		return false; //Prevent the browser jump to the link anchor
	});



	
	$("#a").mouseout(function(){
		keep = false;
		
		window.setInterval(function() {
			if (keep == false){  $('#menu-pop-container').hide();  }
		}, 1000);

		return false; //Prevent the browser jump to the link anchor
	});
	
	$("#menu-pop-container").mouseout(function(){
		keep = false;
		
		window.setInterval(function() {
			if (keep == false){  $('#menu-pop-container').hide();  }
		}, 1000);

		return false; //Prevent the browser jump to the link anchor
	});
	

	
	//-----------------------------------------------------
	
	//Hide (Collapse) the toggle containers on load
	$("#menu-pop-container2").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("#b").mouseover(function(){
		keep = true;		
		$('#menu-pop-container').hide();
		$('#menu-pop-container3').hide();

		pos = $("#navigation").position();	
			
		$('#menu-pop-container2').show();
		$('#menu-pop-container2').css({ position: "absolute", marginLeft: 0, marginTop: 0, top: pos.top + 40, left: pos.left + 300 });
		
		
		return false; //Prevent the browser jump to the link anchor
	});
	
	$("#menu-pop-container2").mouseover(function(){
		keep = true;
		return false; //Prevent the browser jump to the link anchor
	});

	$(".menu-pop-row").mouseover(function(){
		keep = true;
		return false; //Prevent the browser jump to the link anchor
	});



	
	$("#b").mouseout(function(){
		keep = false;
		
		window.setInterval(function() {
			if (keep == false){  $('#menu-pop-container2').hide();  }
		}, 1000);

		return false; //Prevent the browser jump to the link anchor
	});
	
	$("#menu-pop-container2").mouseout(function(){
		keep = false;
		
		window.setInterval(function() {
			if (keep == false){  $('#menu-pop-container2').hide();  }
		}, 1000);

		return false; //Prevent the browser jump to the link anchor
	});

	
	
	//-----------------------------------------------------
	
	
	//Hide (Collapse) the toggle containers on load
	$("#menu-pop-container3").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("#c").mouseover(function(){
		keep = true;		
		$('#menu-pop-container1').hide();
		$('#menu-pop-container2').hide();

		pos = $("#navigation").position();	
			
		$('#menu-pop-container3').show();
		$('#menu-pop-container3').css({ position: "absolute", marginLeft: 0, marginTop: 0, top: pos.top + 40, left: pos.left + 300 });
		
		
		return false; //Prevent the browser jump to the link anchor
	});
	
	$("#menu-pop-container3").mouseover(function(){
		keep = true;
		return false; //Prevent the browser jump to the link anchor
	});

	$(".menu-pop-row").mouseover(function(){
		keep = true;
		return false; //Prevent the browser jump to the link anchor
	});



	
	$("#c").mouseout(function(){
		keep = false;
		
		window.setInterval(function() {
			if (keep == false){  $('#menu-pop-container3').hide();  }
		}, 1000);

		return false; //Prevent the browser jump to the link anchor
	});
	
	$("#menu-pop-container3").mouseout(function(){
		keep = false;
		
		window.setInterval(function() {
			if (keep == false){  $('#menu-pop-container3').hide();  }
		}, 1000);

		return false; //Prevent the browser jump to the link anchor
	});
	
	
	
	
	

		
		
});
