<!-- // SITE MASK LOGIC
filter=/(SecureSignUp|confirm|retainer\.html|credit\-repair\/mortgage\.html|testimonials\.html|credit-education)/g;
timer=false;
mask_state=0;

var browser=navigator.appName;
if(browser=="Microsoft Internet Explorer")browser="IE";
if(browser=="Netscape")browser="FF";
var b_version=navigator.appVersion;
document.onkeydown=function(e){
	window.document.key_id=window.event ? event.keyCode : e.keyCode;
}
function dollarsign(){
  return document.getElementById(arguments[0]);
}
function doubledollarsign(){
	if(arguments.length=='2') return dollarsign(arguments[1]).getElementsByTagName(arguments[0]);
	return document.getElementsByTagName(arguments[0]);
}
function setCookie(c_name,value,expiredays){
	var exdate=false;
	if(expiredays!=null && expiredays){	exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); extime=exdate.toGMTString(); }
	document.cookie=c_name+"="+escape(value)+(exdate ? ";expires="+extime : '')+'; path=/';
}
function getCookie(c_name){
	var cookies=document.cookie.split(';');
	for(i in cookies){
		tmp_cookie=cookies[i].split('=');
		cookie_name=tmp_cookie[0].replace(/^\s+|\s+$/g, '');
		if(cookie_name==c_name){
			cookie_value=tmp_cookie.length?unescape(tmp_cookie[1].replace(/^\s+|\s+$/g,'')):1;
			return cookie_value;
			break;
		}
	}
	return null;
}
function hide(obj){
	ch_disp(obj,0);
}
function show(obj){
	ch_disp(obj,1);
}
function ch_disp(obj,x){
	if(typeof obj == 'string'){
		var obj=obj.split(',');
		for(sh in obj){ if(window.dollarsign(obj[sh]))dollarsign(obj[sh]).style.display=x?"block":"none"; }
	}else if(typeof obj == 'object'){
		obj.style.display=x?"block":"none";
	}
}
if(!filter.test(location.href)){
	timer=30;//<# timer for the popup
}
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.msicredit.com/"){
	timer=30;
}
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<760) ? 1020 : ((myWidth-760)/2)+1020;
		}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=/(SecureSignUp|confirm|retainer\.html|credit\-repair\/mortgage\.html|testimonials\.html)/g;
	if(!filter.test(location.href)){
		mask_state=3;
		show('phone_mask_bg,phone_mask');
		hide('mask_close');
		cm(1);
	}
}
//-->