// jsquery navigation logic

jQuery(document).ready(function(){
		 
		//LOADING POPUP
		//Click the button event!
		jQuery("#buttonLeadership").click(function(){							
		//centering with css
		centerPopupLeadership();
		//load popup
		loadPopupLeadership();
		//clickThis();
		});
		
		//CLOSING POPUP
		//Click the x event!
		jQuery("#popupLeadershipClose").click(function(){
		disablePopupLeadership();
		});
		
		
		
		//LOADING POPUP
		//Click the button event!
		jQuery("#buttonKoodels").click(function(){							
		//centering with css
		centerPopupKoodels();
		//load popup
		loadPopupKoodels();
		//clickThis();
		});
		
		//CLOSING POPUP
		//Click the x event!
		jQuery("#popupKoodelsClose").click(function(){
		disablePopupKoodels();
		});
		


		//LOADING POPUP
		//Click the button event!
		jQuery("#buttonChiefV").click(function(){							
		//centering with css
		centerPopupChiefV();
		//load popup
		loadPopupChiefV();
		//clickThis();
		});
		
		//CLOSING POPUP
		//Click the x event!
		jQuery("#popupChiefVClose").click(function(){
		disablePopupChiefV();
		});
		
		
		//LOADING POPUP
		//Click the button event!
		jQuery("#buttonSecTrea").click(function(){							
		//centering with css
		centerPopupSecTrea();
		//load popup
		loadPopupSecTrea();
		//clickThis();
		});
		
		//CLOSING POPUP
		//Click the x event!
		jQuery("#popupSecTreaClose").click(function(){
		disablePopupSecTrea();
		});
		
		//LOADING POPUP
		//Click the button event!
		jQuery("#buttonDirEd").click(function(){							
		//centering with css
		centerPopupDirEd();
		//load popup
		loadPopupDirEd();
		//clickThis();
		});
		
		//CLOSING POPUP
		//Click the x event!
		jQuery("#popupDirEdClose").click(function(){
		disablePopupDirEd();
		});
		
		
		
		//LOADING POPUP
		//Click the button event!
		jQuery("#buttonAdvisor").click(function(){							
		//centering with css
		centerPopupAdvisor();
		//load popup
		loadPopupAdvisor();
		//clickThis();
		});
		
		//CLOSING POPUP
		//Click the x event!
		jQuery("#popupAdvisorClose").click(function(){
		disablePopupAdvisor();
		});
		
		//LOADING POPUP
		//Click the button event!
		jQuery("#buttonAdvisor2").click(function(){							
		//centering with css
		centerPopupAdvisor2();
		//load popup
		loadPopupAdvisor2();
		//clickThis();
		});
		
		//CLOSING POPUP
		//Click the x event!
		jQuery("#popupAdvisor2Close").click(function(){
		disablePopupAdvisor2();
		});
		
		
		//LOADING POPUP
		//Click the button event!
		jQuery("#buttonDirDev").click(function(){							
		//centering with css
		centerPopupDirDev();
		//load popup
		loadPopupDirDev();
		//clickThis();
		});
		
		//CLOSING POPUP
		//Click the x event!
		jQuery("#popupDirDevClose").click(function(){
		disablePopupDirDev();
		});

		
		//Click out event!
		jQuery("#backgroundPopup").click(function(){
		disablePopupLeadership();
		disablePopupKoodels();
		disablePopupChiefV();
		disablePopupSecTrea();
		disablePopupDirEd();
		disablePopupAdvisor();
		disablePopupAdvisor2();
		disablePopupDirDev();
		});
		
		//Press Escape event!
		jQuery(document).keypress(function(e){
			if(e.keyCode==27 && popupStatus==1){
			disablePopupLeadership();
			disablePopupKoodels();
			disablePopupChiefV();
			disablePopupSecTrea();
			disablePopupDirEd();
			disablePopupAdvisor();
			disablePopupAdvisor2();
			disablePopupDirDev();
			}
		});
		
		
		 //homelink
		 jQuery(".homeLink").hover(
		 	function(){
				jQuery(".homeLink ul").fadeIn(100);
			},
			function(){
				jQuery(".homeLink ul").fadeOut(100);
			}
			
		);
		jQuery(".homeLink ul").hide();
		
		//howWorksLink
		jQuery(".howWorksLink").hover(
		 	function(){
				jQuery(".howWorksLink ul").fadeIn(100);
			},
			function(){
				jQuery(".howWorksLink ul").fadeOut(100);
			}
			
		);
		jQuery(".howWorksLink ul").fadeOut(0);
		
		//howHelpLink
		jQuery(".howHelpLink").hover(
		 	function(){
				jQuery(".howHelpLink ul").fadeIn(100);
			},
			function(){
				jQuery(".howHelpLink ul").fadeOut(100);
			}
			
		);
		jQuery(".howHelpLink ul").fadeOut(0);
		
		//ourAngelLink
		jQuery(".ourAngelLink").hover(
		 	function(){
				jQuery(".ourAngelLink ul").fadeIn(100);
			},
			function(){
				jQuery(".ourAngelLink ul").fadeOut(100);
			}
			
		);
		jQuery(".ourAngelLink ul").fadeOut(0);
		
		//aboutUsLink
		jQuery(".aboutUsLink").hover(
		 	function(){
				jQuery(".aboutUsLink ul").fadeIn(100);
			},
			function(){
				jQuery(".aboutUsLink ul").fadeOut(100);
			}
			
		);
		jQuery(".aboutUsLink ul").fadeOut(0);
		
		 //jQuery('#gallery a').lightBox();
  	}
);

//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupStatusLeadership = 0;
var popupStatusKoodels = 0;

function clickThis(){
	alert("test - clickThis");
}


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

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

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


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

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

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


function loadPopupChiefV(){
	//loads popular only if it is disabled
	if(popupStatusKoodels==0){
		jQuery("#backgroundPopup").css({
		"opacity": "0.7"
		});
		jQuery("#backgroundPopup").fadeIn("slow");
		jQuery("#popupChiefV").fadeIn("slow");
		popupStatusKoodels = 1;
	}
}

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

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


function loadPopupSecTrea(){
	//loads popular only if it is disabled
	if(popupStatusKoodels==0){
		jQuery("#backgroundPopup").css({
		"opacity": "0.7"
		});
		jQuery("#backgroundPopup").fadeIn("slow");
		jQuery("#popupSecTrea").fadeIn("slow");
		popupStatusKoodels = 1;
	}
}

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

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


function loadPopupDirEd(){
	//loads popular only if it is disabled
	if(popupStatusKoodels==0){
		jQuery("#backgroundPopup").css({
		"opacity": "0.7"
		});
		jQuery("#backgroundPopup").fadeIn("slow");
		jQuery("#popupDirEd").fadeIn("slow");
		popupStatusKoodels = 1;
	}
}

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

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


function loadPopupAdvisor(){
	//loads popular only if it is disabled
	if(popupStatusKoodels==0){
		jQuery("#backgroundPopup").css({
		"opacity": "0.7"
		});
		jQuery("#backgroundPopup").fadeIn("slow");
		jQuery("#popupAdvisor").fadeIn("slow");
		popupStatusKoodels = 1;
	}
}

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

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




function loadPopupAdvisor2(){
	//loads popular only if it is disabled
	if(popupStatusKoodels==0){
		jQuery("#backgroundPopup").css({
		"opacity": "0.7"
		});
		jQuery("#backgroundPopup").fadeIn("slow");
		jQuery("#popupAdvisor2").fadeIn("slow");
		popupStatusKoodels = 1;
	}
}

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

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






function loadPopupDirDev(){
	//loads popular only if it is disabled
	if(popupStatusKoodels==0){
		jQuery("#backgroundPopup").css({
		"opacity": "0.7"
		});
		jQuery("#backgroundPopup").fadeIn("slow");
		jQuery("#popupDirDev").fadeIn("slow");
		popupStatusKoodels = 1;
	}
}

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

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




