﻿/***************************/
//@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 popupStatus = 0;

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

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

//loading popup with jQuery magic!
function loadPopup1(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopup1").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup1").fadeIn("slow");
		$("#popupContact1").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup1(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopup1").fadeOut("slow");
		$("#popupContact1").fadeOut("slow");
		popupStatus = 0;
	}
}

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

//disabling popup with jQuery magic!
function disablePopup2(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopup2").fadeOut("slow");
		$("#popupContact2").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupNews(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupNews").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupNews").fadeIn("slow");
		$("#popupNews").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupNews(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupNews").fadeOut("slow");
		$("#popupNews").fadeOut("slow");
		popupStatus = 0;
	}
}

//loading popup with jQuery magic!
function loadPopupNews1(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupNews1").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupNews1").fadeIn("slow");
		$("#popupNews1").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupNews1(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupNews1").fadeOut("slow");
		$("#popupNews1").fadeOut("slow");
		popupStatus = 0;
	}
}

//loading popup with jQuery magic!
function loadPopupNews2(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupNews2").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupNews2").fadeIn("slow");
		$("#popupNews2").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupNews2(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupNews2").fadeOut("slow");
		$("#popupNews2").fadeOut("slow");
		popupStatus = 0;
	}
}


//loading popup with jQuery magic!
function loadPopupCareer(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer").fadeIn("slow");
		$("#popupCareer").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer").fadeOut("slow");
		$("#popupCareer").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer2(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer2").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer2").fadeIn("slow");
		$("#popupCareer2").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer2(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer2").fadeOut("slow");
		$("#popupCareer2").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer3(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer3").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer3").fadeIn("slow");
		$("#popupCareer3").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer3(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer3").fadeOut("slow");
		$("#popupCareer3").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer4(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer4").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer4").fadeIn("slow");
		$("#popupCareer4").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer4(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer4").fadeOut("slow");
		$("#popupCareer4").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer5(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer5").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer5").fadeIn("slow");
		$("#popupCareer5").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer5(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer5").fadeOut("slow");
		$("#popupCareer5").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer6(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer6").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer6").fadeIn("slow");
		$("#popupCareer6").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer6(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer6").fadeOut("slow");
		$("#popupCareer6").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer7(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer7").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer7").fadeIn("slow");
		$("#popupCareer7").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer7(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer7").fadeOut("slow");
		$("#popupCareer7").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer8(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer8").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer8").fadeIn("slow");
		$("#popupCareer8").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer8(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer8").fadeOut("slow");
		$("#popupCareer8").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer9(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer9").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer9").fadeIn("slow");
		$("#popupCareer9").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer9(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer9").fadeOut("slow");
		$("#popupCareer9").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer10(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer10").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer10").fadeIn("slow");
		$("#popupCareer10").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer10(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer10").fadeOut("slow");
		$("#popupCareer10").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer11(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer11").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer11").fadeIn("slow");
		$("#popupCareer11").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer11(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer11").fadeOut("slow");
		$("#popupCareer11").fadeOut("slow");
		popupStatus = 0;
	}
}
//loading popup with jQuery magic!
function loadPopupCareer12(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopupCareer12").css({
			"opacity": "0.7"
		});
		$("#backgroundPopupCareer12").fadeIn("slow");
		$("#popupCareer12").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopupCareer12(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopupCareer12").fadeOut("slow");
		$("#popupCareer12").fadeOut("slow");
		popupStatus = 0;
	}
}
//centering popup
function centerPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact").height();
	var popupWidth = $("#popupContact").width();
	var popupNewsHeight = $("#popupNews").height();
	var popupNewsWidth = $("#popupNews").width();
    var popupNews1Height = $("#popupNews1").height();
	var popupNews1Width = $("#popupNews1").width();
	var popupNews2Height = $("#popupNews2").height();
	var popupNews2Width = $("#popupNews2").width();
	var popupCareerHeight = $("#popupCareer").height();
	var popupCareerWidth = $("#popupCareer").width();
	var popupCareer2Height = $("#popupCareer2").height();
	var popupCareer2Width = $("#popupCareer2").width();
	var popupCareer3Height = $("#popupCareer3").height();
	var popupCareer3Width = $("#popupCareer3").width();
	var popupCareer4Height = $("#popupCareer4").height();
	var popupCareer4Width = $("#popupCareer4").width();
	var popupCareer5Height = $("#popupCareer5").height();
	var popupCareer5Width = $("#popupCareer5").width();
	var popupCareer6Height = $("#popupCareer6").height();
	var popupCareer6Width = $("#popupCareer6").width();
	var popupCareer7Height = $("#popupCareer7").height();
	var popupCareer7Width = $("#popupCareer7").width();
	var popupCareer8Height = $("#popupCareer8").height();
	var popupCareer8Width = $("#popupCareer8").width();
	var popupCareer9Height = $("#popupCareer9").height();
	var popupCareer9Width = $("#popupCareer9").width();
	var popupCareer10Height = $("#popupCareer10").height();
	var popupCareer10Width = $("#popupCareer10").width();
	var popupCareer11Height = $("#popupCareer11").height();
	var popupCareer11Width = $("#popupCareer11").width();
	var popupCareer12Height = $("#popupCareer12").height();
	var popupCareer12Width = $("#popupCareer12").width();
	//centering
	$("#popupContact").css({
		"position": "absolute",
		"top": windowHeight/300-popupHeight/300,
		"left": windowWidth/300-popupWidth/300
	});
	//only need force for IE6
	
	$("#popupNews").css({
		"position": "absolute",
		"top": windowHeight/2-popupNewsHeight/2,
		"left": windowWidth/2-popupNewsWidth/2
	});
	
		$("#popupNews1").css({
		"position": "absolute",
		"top": windowHeight/2-popupNews1Height/2,
		"left": windowWidth/2-popupNews1Width/2
	});
		
			$("#popupNews2").css({
		"position": "absolute",
		"top": windowHeight/2-popupNews2Height/2,
		"left": windowWidth/2-popupNews2Width/2
	});
	$("#popupCareer").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareerHeight/2,
		"left": windowWidth/2-popupCareerWidth/2
	});
	$("#popupCareer2").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer2Height/2,
		"left": windowWidth/2-popupCareer2Width/2
	});
	$("#popupCareer3").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer3Height/2,
		"left": windowWidth/2-popupCareer3Width/2
	});
	$("#popupCareer4").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer4Height/2,
		"left": windowWidth/2-popupCareer4Width/2
	});
	$("#popupCareer5").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer5Height/2,
		"left": windowWidth/2-popupCareer5Width/2
	});
	$("#popupCareer6").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer6Height/2,
		"left": windowWidth/2-popupCareer6Width/2
	});
	$("#popupCareer7").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer7Height/2,
		"left": windowWidth/2-popupCareer7Width/2
	});
	$("#popupCareer8").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer8Height/2,
		"left": windowWidth/2-popupCareer8Width/2
	});
	$("#popupCareer9").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer9Height/2,
		"left": windowWidth/2-popupCareer9Width/2
	});
	$("#popupCareer10").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer10Height/2,
		"left": windowWidth/2-popupCareer10Width/2
	});
	$("#popupCareer11").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer11Height/2,
		"left": windowWidth/2-popupCareer11Width/2
	});
	$("#popupCareer12").css({
		"position": "absolute",
		"top": windowHeight/2-popupCareer12Height/2,
		"left": windowWidth/2-popupCareer12Width/2
	});
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}


//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button3").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopup();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose").click(function(){
		disablePopup();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup();
	});
});

$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button4").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupNews();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupNewsClose").click(function(){
		disablePopupNews();
	});
	//Click out event!
	$("#backgroundPopupNews").click(function(){
		disablePopupNews();
	});

});

$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#ne").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupNews();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupNewsClose").click(function(){
		disablePopupNews();
	});
	//Click out event!
	$("#backgroundPopupNews").click(function(){
		disablePopupNews();
	});

});

$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#ne1").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupNews1();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupNewsClose1").click(function(){
		disablePopupNews1();
	});
	//Click out event!
	$("#backgroundPopupNews1").click(function(){
		disablePopupNews1();
	});

});


$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#ne2").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupNews2();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupNews2Close").click(function(){
		disablePopupNews2();
	});
	//Click out event!
	$("#backgroundPopupNews2").click(function(){
		disablePopupNews2();
	});

});



$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button5").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareerClose").click(function(){
		disablePopupCareer();
	});
	//Click out event!
	$("#backgroundPopupCareer").click(function(){
		disablePopupCareer();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button6").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer2();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer2Close").click(function(){
		disablePopupCareer2();
	});
	//Click out event!
	$("#backgroundPopupCareer2").click(function(){
		disablePopupCareer2();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button7").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer3();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer3Close").click(function(){
		disablePopupCareer3();
	});
	//Click out event!
	$("#backgroundPopupCareer3").click(function(){
		disablePopupCareer3();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button8").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer4();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer4Close").click(function(){
		disablePopupCareer4();
	});
	//Click out event!
	$("#backgroundPopupCareer4").click(function(){
		disablePopupCareer4();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button9").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer5();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer5Close").click(function(){
		disablePopupCareer5();
	});
	//Click out event!
	$("#backgroundPopupCareer5").click(function(){
		disablePopupCareer5();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button10").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer6();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer6Close").click(function(){
		disablePopupCareer6();
	});
	//Click out event!
	$("#backgroundPopupCareer6").click(function(){
		disablePopupCareer6();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button11").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer7();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer7Close").click(function(){
		disablePopupCareer7();
	});
	//Click out event!
	$("#backgroundPopupCareer7").click(function(){
		disablePopupCareer7();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button12").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer8();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer8Close").click(function(){
		disablePopupCareer8();
	});
	//Click out event!
	$("#backgroundPopupCareer8").click(function(){
		disablePopupCareer8();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button13").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer9();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer9Close").click(function(){
		disablePopupCareer9();
	});
	//Click out event!
	$("#backgroundPopupCareer9").click(function(){
		disablePopupCareer9();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button14").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer10();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer10Close").click(function(){
		disablePopupCareer10();
	});
	//Click out event!
	$("#backgroundPopupCareer10").click(function(){
		disablePopupCareer10();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button15").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer11();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer11Close").click(function(){
		disablePopupCareer11();
	});
	//Click out event!
	$("#backgroundPopupCareer11").click(function(){
		disablePopupCareer11();
	});
});
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#button16").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopupCareer12();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupCareer12Close").click(function(){
		disablePopupCareer12();
	});
	//Click out event!
	$("#backgroundPopupCareer12").click(function(){
		disablePopupCareer12();
	});
});
