<!-- // SITE MASK LOGIC
filter=/(signup|testimonials\.html)/g;
timer=false;
mask_state=0;
if(!filter.test(location.href)){
	timer=30;//<# timer for the popup 90
}
signup_safe=(location.href.indexOf('SecureSignUp')!=-1 && location.search.indexOf('s=2')==-1 && location.search.indexOf('s=3')==-1 && location.search.indexOf('s=4')==-1);
if(signup_safe || location.href=="http://www.ifcnow.com/" || location.href=="http://www.ifcnow.org/"){
	timer=30; // 120
}
function site_mask(){
	if(!getCookie('sitemask')){
		show('site_mask_bg,phone_mask_bg,phone_mask');
		toggle_tags(0);
		mask_state=1;
		cm(1);
		setCookie('sitemask','masked',0);
	}
}
function hide_mask(){
	hide('site_mask_bg,mask_close');
	mask_state=2;
	toggle_tags(1);
}
function toggle_tags(x){
	var objs=document.getElementsByTagName('object');
	for(i=0;i<objs.length;i++){
		objs[i].style.display=x ? "block" : "none";
	}
	var frms=document.getElementsByTagName('select');
	for(i=0;i<frms.length;i++){
		frms[i].style.display=x ? "block" : "none";
	}
	//if(typeof $('carrier') == 'object')show('carrier');
}
function idle(){
	timer--;
	if(timer==0){
		site_mask();
	}else{
		setTimeout("idle()",1000);
	}
}
start_top=0;
start_left=0;
function cm(ob) {
	if(ob){
		myWidth=myHeight=scrOfX=scrOfY=0;
		if(typeof(window.innerWidth) == 'number'){
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		}else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		}else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		if(typeof(window.pageYOffset) == 'number'){
			//Netscape compliant
			scrOfY = window.pageYOffset;
			scrOfX = window.pageXOffset;
		}else if(document.body && (document.body.scrollLeft || document.body.scrollTop)){
			//DOM compliant
			scrOfY = document.body.scrollTop;
			scrOfX = document.body.scrollLeft;
		}else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)){
			//IE6 standards compliant mode
			scrOfY = document.documentElement.scrollTop;
			scrOfX = document.documentElement.scrollLeft;
		}
		scrTop=scrOfY;
		scrOfY=scrOfY*1+myHeight/2;
		scrOfX=myWidth/2;
		if(mask_state==2 || mask_state==3){
			leftpos=(myWidth<780) ? 920 : ((myWidth-780)/2)+920;
			//720 862 , 760 920
		}else{
			leftpos=scrOfX;
		}
		toppos=scrOfY;
		var pm_bg=document.getElementById('phone_mask_bg').style;
		var sm_bg=document.getElementById('site_mask_bg').style;
		var pm=document.getElementById('phone_mask').style;
		if(mask_state==1 || mask_state==2){
			sm_bg.top=scrTop+'px';
			//pm_bg.left=pm.left=scrOfX+'px';
			if(!start_top)start_top=toppos;
			if(!start_left)start_left=scrOfX;
			if(start_top!=toppos){
				if(start_top<toppos){
					diff=Math.ceil((toppos-start_top)/20);
					start_top=(start_top+diff)<toppos?start_top+diff:toppos;
				}else{
					diff=Math.ceil((start_top-toppos)/20);
					start_top=(start_top-diff)>toppos?start_top-diff:toppos;//<
				}
				pm_bg.top=pm.top=start_top+'px';
			}else{
				pm_bg.top=pm.top=toppos+'px';
			}
			if(start_left!=leftpos){
				if(start_left<leftpos){
					diff=Math.ceil((leftpos-start_left)/20);
					start_left=(start_left+diff)<leftpos?start_left+diff:leftpos;
				}else{
					diff=Math.ceil((start_left-leftpos)/20);
					start_left=(start_left-diff)>leftpos?start_left-diff:leftpos;//<
				}
				pm_bg.left=pm.left=start_left+'px';
			}else{
				pm_bg.left=pm.left=leftpos+'px';
			}
		}else if(mask_state==3){
			pm_bg.top=pm.top=scrOfY+'px';
			pm_bg.left=pm.left=leftpos+'px';
			start_left=leftpos;
			mask_state=2;
		}
		if(mask_state)setTimeout("cm(1)",10);
	}else{
		return false;
	}
}
if(!getCookie('sitemask')){
	if(timer)idle();
}else{
	filter=/(signup|testimonials\.html)/g;
	if(!filter.test(location.href)){
		mask_state=3;
		show('phone_mask_bg,phone_mask');
		hide('mask_close');
		cm(1);
	}
}
//-->