﻿var hideTimer=null;var switchTimer=null;var activeWindow=null;var opsWindowActive=null;var doneState=null;var scrollTimer=null;function positionOps(div,bck){if(typeof(window.innerWidth)=='number'){var ww=window.innerWidth;var wh=window.innerHeight;var bgX=window.pageXOffset;var bgY=window.pageYOffset;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){var ww=document.documentElement.clientWidth;var wh=document.documentElement.clientHeight;var bgX=document.documentElement.scrollLeft;var bgY=document.documentElement.scrollTop;}else{var ww=document.body.clientWidth;var wh=document.body.clientHeight;var bgX=document.body.scrollLeft;var bgY=document.body.scrollTop;}opsDiv=document.getElementById(div);bckDiv=document.getElementById(bck);opsDiv.style.left=(bgX+((ww-300)/2))+'px';opsDiv.style.top=(bgY+((wh-240)/2))+'px';bckDiv.style.left=bgX+'px';bckDiv.style.top=bgY+'px';bckDiv.style.width=ww;bckDiv.style.height=wh;if(window.captureEvents){window.captureEvents(Event.scroll);}window.onscroll=scrollPosition;};function scrollPosition(doIt){if(doneState==false){return;}doneState=false;clearTimeout(scrollTimer);scrollTimer=setTimeout('scrollPosition(true)',10);if(doIt){doneState=true;positionOps('cnt','bck');}};function notOpera(){if(navigator.userAgent.indexOf("Opera")!= -1){var versionindex=navigator.userAgent.indexOf("Opera")+6;if(parseInt(navigator.userAgent.charAt(versionindex))>=8){return false;}}else{return true;}};function getFormDelay(div,contactId,refId,offsetX,offsetY){if(activeWindow){if(hideTimer){clearTimeout(hideTimer);}document.getElementById(div).display='none';document.getElementById(div).innerHTML='';x_getAskForm(div,contactId,refId,offsetX,offsetY);}else{if(switchTimer){clearTimeout(switchTimer);}switchTimer=setTimeout("x_getAskForm('"+div+"', '"+contactId+"', '"+refId+"', "+offsetX+", "+offsetY+")",1000);}};function hideCnt(div,ms){if(!opsWindowActive){if(ms==undefined){ms=1000}if(switchTimer){clearTimeout(switchTimer);}hideTimer=setTimeout("autoHideCnt('"+div+"')",ms);}};function autoHideCnt(div){if(!opsWindowActive){clearTimeout(hideTimer);hideTimer=null;activeWindow=null;document.getElementById(div).style.display='none';document.getElementById(div).innerHTML='';switchBck(0);}};function holdCnt(){if(hideTimer){clearTimeout(hideTimer);}};function switchBck(type){if(type==1){if(document.getElementById('coverSel')){document.getElementById('coverSel').style.display='none';}document.getElementById('bck').style.display='block';}else{if(document.getElementById('coverSel')){document.getElementById('coverSel').style.display='block';}document.getElementById('bck').style.display='none';}};function cancelCnt(div){opsWindowActive=null;autoHideCnt(div);};function runOps(div){autoHideCnt(div);if(notOpera()){switchBck(1);}};function cancelOps(div){document.getElementById(div).style.display='none';switchBck(0);clearTimeout(scrollTimer);window.onscroll=null;opsWindowActive=false;}
