﻿
/***************************/
//@Author: Adrian "yEnS" Mato Gondelle
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/

//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popup1Status = 0;
var popup2Status = 0;
var alekspopup = 0;
var lockspopup = 0;
var whitelightpopup = 0;
var blackmathpopup = 0;
var videopopup = 0;


//loading popup with jQuery magic!
function loadPopup(){
	//loads popup only if it is disabled
	if(popup1Status==0){
		$("#backgroundPopup").css({
			"opacity": "0.8"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupAbout").fadeIn("slow");
		popup1Status = 1;
	}
}


//loading popup with jQuery magic!
function loadPopup2(){
	//loads popup only if it is disabled
	if(popup2Status==0){
		$("#backgroundPopup").css({
			"opacity": "0.8"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupContact").fadeIn("slow");
		popup2Status = 1;
	}
}


//loading popup with jQuery magic!
function loadPopup3(){
	//loads popup only if it is disabled
	if(alekspopup==0){
		$("#backgroundPopup").css({
			"opacity": "0.8"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupAleks").fadeIn("slow");
		alekspopup = 1;
	}
}


//loading popup with jQuery magic!
function loadPopup4(){
	//loads popup only if it is disabled
	if(lockspopup==0){
		$("#backgroundPopup").css({
			"opacity": "0.8"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupLocks").fadeIn("slow");
		lockspopup = 1;
	}
}


//loading popup with jQuery magic!
function loadPopup5(){
	//loads popup only if it is disabled
	if(whitelightpopup==0){
		$("#backgroundPopup").css({
			"opacity": "0.8"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupWhiteLight").fadeIn("slow");
		whitelightpopup = 1;
	}
}


//loading popup with jQuery magic!
function loadPopup6(){
	//loads popup only if it is disabled
	if(blackmathpopup==0){
		$("#backgroundPopup").css({
			"opacity": "0.8"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupBlackMath").fadeIn("slow");
		blackmathpopup = 1;
	}
}

//loading popup with jQuery magic!
function loadPopup7(){
	//loads popup only if it is disabled
	if(videopopup==0){
		$("#backgroundPopup").css({
			"opacity": "0.8"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupVideo").fadeIn("slow");
		videopopup = 1;
	}
}



//disabling popup with jQuery magic!
function disablePopup(){
	//disables popup only if it is enabled
	if(popup1Status==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupAbout").fadeOut("slow");
		popup1Status = 0;
	}
}

//disabling popup with jQuery magic!
function disablePopup2(){
	//disables popup only if it is enabled
	if(popup2Status==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupContact").fadeOut("slow");
		popup2Status = 0;
	}
}

//disabling popup with jQuery magic!
function disablePopup3(){
	//disables popup only if it is enabled
	if(alekspopup==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupAleks").fadeOut("slow");
		alekspopup = 0;
	}
}


//disabling popup with jQuery magic!
function disablePopup4(){
	//disables popup only if it is enabled
	if(lockspopup==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupLocks").fadeOut("slow");
		lockspopup = 0;
	}
}


//disabling popup with jQuery magic!
function disablePopup5(){
	//disables popup only if it is enabled
	if(whitelightpopup==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupWhiteLight").fadeOut("slow");
		whitelightpopup = 0;
	}
}


//disabling popup with jQuery magic!
function disablePopup6(){
	//disables popup only if it is enabled
	if(blackmathpopup==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupBlackMath").fadeOut("slow");
		blackmathpopup = 0;
	}
}


//disabling popup with jQuery magic!
function disablePopup7(){
	//disables popup only if it is enabled
	if(videopopup==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupVideo").fadeOut("slow");
		videopopup = 0;
	}
}




//centering popup
function centerPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupAbout").height();
	var popupWidth = $("#popupAbout").width();
	//centering
	$("#popupAbout").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}

//centering popup
function centerPopup2(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact").height();
	var popupWidth = $("#popupContact").width();
	//centering
	$("#popupContact").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}


//centering popup
function centerPopup3(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupAleks").height();
	var popupWidth = $("#popupAleks").width();
	//centering
	$("#popupAleks").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}


//centering popup
function centerPopup4(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupLocks").height();
	var popupWidth = $("#popupLocks").width();
	//centering
	$("#popupLocks").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}


//centering popup
function centerPopup5(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupWhiteLight").height();
	var popupWidth = $("#popupWhiteLight").width();
	//centering
	$("#popupWhiteLight").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}


//centering popup
function centerPopup6(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupBlackMath").height();
	var popupWidth = $("#popupBlackMath").width();
	//centering
	$("#popupBlackMath").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}


//centering popup
function centerPopup7(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupVideo").height();
	var popupWidth = $("#popupVideo").width();
	//centering
	$("#popupVideo").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}


//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopup();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupAboutClose").click(function(){
		disablePopup();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup();
		}
	});

});


//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button2").click(function(){
		//centering with css
		centerPopup2();
		//load popup
		loadPopup2();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose").click(function(){
		disablePopup2();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup2();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup2();
		}
	});

});


//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#aleksbutton").click(function(){
		//centering with css
		centerPopup3();
		//load popup
		loadPopup3();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupAleksClose").click(function(){
		disablePopup3();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup3();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup3();
		}
	});

});


//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#locksbutton").click(function(){
		//centering with css
		centerPopup4();
		//load popup
		loadPopup4();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupLocksClose").click(function(){
		disablePopup4();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup4();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup4();
		}
	});

});



//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#whitelightbutton").click(function(){
		//centering with css
		centerPopup5();
		//load popup
		loadPopup5();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupWhiteLightClose").click(function(){
		disablePopup5();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup5();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup5();
		}
	});

});




//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#blackmathbutton").click(function(){
		//centering with css
		centerPopup6();
		//load popup
		loadPopup6();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupBlackMathClose").click(function(){
		disablePopup6();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup6();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup6();
		}
	});

});



//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#videobutton").click(function(){
		//centering with css
		centerPopup7();
		//load popup
		loadPopup7();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupVideoClose").click(function(){
		disablePopup7();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup7();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup7();
		}
	});

});














