﻿var eosv={};
try{document.execCommand('BackgroundImageCache',false,true)}catch(e){}
var psEOSrsid;
function initSupportWindow(){
	var src=(location.protocol.indexOf("https")==0?"https://secure.providesupport.com/image":"http://image.providesupport.com")+"/js/rx-partners/safe-standard.js?ps_h=EOSr\u0026ps_t="+new Date().getTime();
	var js = document.createElement('script');
	js.setAttribute('language', 'javascript');
	js.setAttribute('type', 'text/javascript');
	js.setAttribute('src', src);
	document.getElementById('live_support').appendChild(js);
}
function openSupportWindow(){
	if(psEOSrsid){
		if(!eosv.support_window || eosv.support_window.closed){
			eosv.support_window=popItUp('http://messenger.providesupport.com/messenger/rx-partners.html?ps_s=' + psEOSrsid + '&ps_mht=' + psEOSrmht,'support_window',500,560);
		}else{
			eosv.support_window.focus();
		}
	}else{
		popItUp('about:blank','support_window',500,560);
		initSupportWindow();
		var timer = setInterval(function(){
			if(psEOSrsid){
				clearInterval(timer);
				openSupportWindow();
			}
		}, 5);
	}
}
var imgCodeUrl;
function reloadImageCode(){
	var img=document.getElementById('vcode_img');
	if(!imgCodeUrl) imgCodeUrl=img.src;
	img.src=imgCodeUrl+'?'+Math.random();
}

function popItUp(u,n,w,h){
	var l=(screen.availWidth  - w) / 2, t=(screen.availHeight - h) / 2
	,op='toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+w+',height='+h+',left='+l+',top='+t
	,n=n||'_blank';
	return window.open(u,n,op);
}
function showCertificate(){
	if(!eosv.cert_window || eosv.cert_window.closed){
		eosv.cert_window=popItUp('https://mysecurebilling.com/certificates.php','cert_window',500,350);
	}else{
		eosv.cert_window.focus();
	}
}

function cookieCheck(){
   	document.cookie = "isEnabled=true";
	if (document.cookie.indexOf("isEnabled=true") == -1){
		document.getElementById('no_cookies').style.display="";
	}
};
var oldonload = window.onload;
if (typeof window.onload != 'function'){
	window.onload = cookieCheck;
}else{
	window.onload = function(){oldonload(); cookieCheck();}
}
