﻿var popupStatus=0;var Popup_List=[];function loadPopup(){if(popupStatus==0){$("#backgroundPopup").css({"opacity":"0.7"});$("#backgroundPopup").fadeIn("slow");$("#popupContact").fadeIn("slow");popupStatus=1}}function disablePopup(){if(popupStatus==1){$("#backgroundPopup").fadeOut("slow");$("#popupContact").fadeOut("slow");popupStatus=0}}function centerPopup(){var windowWidth=document.documentElement.clientWidth;var windowHeight=document.documentElement.clientHeight;var popupHeight=$("#popupContact").height();var popupWidth=$("#popupContact").width();$("#popupContact").css({"position":"absolute","top":windowHeight/2-popupHeight/2,"left":windowWidth/2-popupWidth/2});$("#backgroundPopup").css({"height":windowHeight})}$(document).ready(function(){$("#button").click(function(){centerPopup();loadPopup()});$("#popupContactClose").click(function(){disablePopup()});$(document).keypress(function(e){if(e.keyCode==27&&popupStatus==1){disablePopup()}})});var popupStatus1=0;function loadPopup1(){if(popupStatus1==0){$("#backgroundPopup1").css({"opacity":"0.7"});$("#backgroundPopup1").fadeIn("slow");$("#popupContact1").fadeIn("slow");popupStatus1=1}}function disablePopup1(){if(popupStatus1==1){$("#backgroundPopup1").fadeOut("slow");$("#popupContact1").fadeOut("slow");popupStatus1=0}}function centerPopup1(){var windowWidth=document.documentElement.clientWidth;var windowHeight=document.documentElement.clientHeight;var popupHeight=$("#popupContact1").height();var popupWidth=$("#popupContact1").width();$("#popupContact1").css({"position":"absolute","top":windowHeight/2-popupHeight/2,"left":windowWidth/2-popupWidth/2});$("#backgroundPopup1").css({"height":windowHeight})}$(document).ready(function(){$("#button1").click(function(){centerPopup1();loadPopup1()});$("#popupContactClose1").click(function(){disablePopup1()});$(document).keypress(function(e){if(e.keyCode==27&&popupStatus1==1){disablePopup1()}})});var popupStatus2=0;function loadPopup2(){if(popupStatus2==0){$("#backgroundPopup2").css({"opacity":"0.7"});$("#backgroundPopup2").fadeIn("slow");$("#popupContact2").fadeIn("slow");popupStatus2=1}}function disablePopup2(){if(popupStatus2==1){$("#backgroundPopup2").fadeOut("slow");$("#popupContact2").fadeOut("slow");popupStatus2=0}}function centerPopup2(){var windowWidth=document.documentElement.clientWidth;var windowHeight=document.documentElement.clientHeight;var popupHeight=$("#popupContact2").height();var popupWidth=$("#popupContact2").width();$("#popupContact2").css({"position":"absolute","top":windowHeight/2-popupHeight/2,"left":windowWidth/2-popupWidth/2});$("#backgroundPopup2").css({"height":windowHeight})}$(document).ready(function(){$("#button2").click(function(){centerPopup2();loadPopup2()});$("#popupContactClose2").click(function(){disablePopup2()});$(document).keypress(function(e){if(e.keyCode==27&&popupStatus2==1){disablePopup2()}})});function Popup_Setup(Popup_Name,Popup_Window,Popup_Background,Popup_Button,Popup_CloseButton){var Popup_Array=[];Popup_Array["Name"]=Popup_Name;Popup_Array["Window"]=Popup_Window;Popup_Array["Background"]=Popup_Background;Popup_Array["Button"]=Popup_Button;Popup_Array["CloseButton"]=Popup_CloseButton;Popup_Array["Status"]=0;$("#"+Popup_Array["Window"]).addClass("PopupWindow");$("#"+Popup_Array["Window"]+".h1").addClass("PopupWindowH1");$("#"+Popup_Array["Background"]).addClass("PopupBackground");$("#"+Popup_Array["Button"]).addClass("PopupButton");$("#"+Popup_Array["CloseButton"]).addClass("PopupButtonClose");Popup_Setup_Ready(Popup_Array);Popup_List[Popup_Name]=Popup_Array}function Popup_Setup_Long(Popup_Name,Popup_Window,Popup_Background,Popup_Button,Popup_CloseButton){var Popup_Array=[];Popup_Array["Name"]=Popup_Name;Popup_Array["Window"]=Popup_Window;Popup_Array["Background"]=Popup_Background;Popup_Array["Button"]=Popup_Button;Popup_Array["CloseButton"]=Popup_CloseButton;Popup_Array["Status"]=0;$("#"+Popup_Array["Window"]).addClass("PopupWindowLong");$("#"+Popup_Array["Window"]+".h1").addClass("PopupWindowH1");$("#"+Popup_Array["Background"]).addClass("PopupBackground");$("#"+Popup_Array["Button"]).addClass("PopupButton");$("#"+Popup_Array["CloseButton"]).addClass("PopupButtonClose");Popup_Setup_Ready_Long(Popup_Array);Popup_List[Popup_Name]=Popup_Array}function Popup_Load(Popup_Name){var Popup_Array=Popup_List[Popup_Name];if(Popup_Array["Status"]==0){$("#"+Popup_Array["CloseButton"]).css("display","block");$("#"+Popup_Array["Background"]).css({"opacity":"0.7"});$("#"+Popup_Array["Background"]).fadeIn("slow");$("#"+Popup_Array["Window"]).fadeIn("slow");Popup_Array["Status"]=1;Popup_List[Popup_Name]=Popup_Array}}function Popup_Disable(Popup_Name){var Popup_Array=Popup_List[Popup_Name];if(Popup_Array["Status"]==1){$("#"+Popup_Array["Background"]).fadeOut("slow");$("#"+Popup_Array["Window"]).fadeOut("slow");Popup_Array["Status"]=0;Popup_List[Popup_Name]=Popup_Array}}function Popup_Center(Popup_Name){var Popup_Array=Popup_List[Popup_Name];var windowWidth=document.documentElement.clientWidth;var windowHeight=document.documentElement.clientHeight;var popupHeight=$("#"+Popup_Array["Window"]).height();var popupWidth=$("#"+Popup_Array["Window"]).width();$("#"+Popup_Array["Window"]).css({"position":"absolute","top":windowHeight/2-popupHeight/2,"left":windowWidth/2-popupWidth/2});$("#"+Popup_Array["Background"]).css({"height":windowHeight})}function Popup_Ready(){for(var Popup_Item in Popup_List){var Popup_Array=Popup_List[Popup_Item];$("#"+Popup_Array["Button"]).click(function(){Popup_Center(Popup_Array["Name"]);Popup_Load(Popup_Array["Name"])});$("#"+Popup_Array["CloseButton"]).click(function(){Popup_Disable(Popup_Array["Name"])});$(document).keypress(function(e){if(e.keyCode==27&&Popup_Array["Status"]==1){Popup_Disable(Popup_Array["Name"])}})}}function Popup_Open(Popup_Item){var Popup_Array=Popup_List[Popup_Item];Popup_Center(Popup_Array["Name"]);Popup_Load(Popup_Array["Name"])}function Popup_Setup_Ready(Popup_Array){$("#"+Popup_Array["Button"]).click(function(){Popup_Center(Popup_Array["Name"]);Popup_Load(Popup_Array["Name"])});$("#"+Popup_Array["CloseButton"]).click(function(){Popup_Disable(Popup_Array["Name"])});$(document).keypress(function(e){if(e.keyCode==27&&Popup_Array["Status"]==1){Popup_Disable(Popup_Array["Name"])}})}function Popup_Setup_Ready_Long(Popup_Array){$("#"+Popup_Array["Button"]).click(function(){Popup_Center_Long(Popup_Array["Name"]);Popup_Load(Popup_Array["Name"])});$("#"+Popup_Array["CloseButton"]).click(function(){Popup_Disable(Popup_Array["Name"])});$(document).keypress(function(e){if(e.keyCode==27&&Popup_Array["Status"]==1){Popup_Disable(Popup_Array["Name"])}})}function Popup_Center_Long(Popup_Name){var Popup_Array=Popup_List[Popup_Name];var windowWidth=document.documentElement.clientWidth;var windowHeight=document.documentElement.clientHeight;var popupHeight=$("#"+Popup_Array["Window"]).height();var popupWidth=$("#"+Popup_Array["Window"]).width();$("#"+Popup_Array["Window"]).css({"position":"absolute","left":windowWidth/2-popupWidth/2});$("#"+Popup_Array["Window"]).vCenterTop();$("#"+Popup_Array["Background"]).css({"height":windowHeight})}(function($){$.fn.vCenter=function(options){var pos={sTop:function(){return window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop},wHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body.clientHeight}};return this.each(function(index){if(index==0){var $this=$(this);var elHeight=$this.height();var elTop=pos.sTop()+(pos.wHeight()/2)-(elHeight/2);$this.css({position:'absolute',marginTop:'0',top:elTop})}})}})(jQuery);(function($){$.fn.vTop=function(options){var pos={sTop:function(){return window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop},wHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body.clientHeight}};return this.each(function(index){if(index==0){var $this=$(this);var elHeight=$this.height();var elTop=pos.sTop();$this.css({position:'absolute',marginTop:'0',top:elTop})}})}})(jQuery);(function($){$.fn.vCenterTop=function(options){var pos={sTop:function(){return window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop},wHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body.clientHeight}};return this.each(function(index){if(index==0){var $this=$(this);var elHeight=$this.height();var elTop=pos.sTop()+10;if(elHeight<pos.wHeight()){elTop=pos.sTop()+(pos.wHeight()/2)-(elHeight/2)}$this.css({position:'absolute',marginTop:'0',top:elTop})}})}})(jQuery);

