﻿var eosv={};
try{document.execCommand('BackgroundImageCache',false,true)}catch(e){}
var psEOSrsid;
var utilVars={projName:'rx-partners'}, psWWWrsid;
/*
function initSupportWindow(){
	var src=(location.protocol.indexOf("https")==0?"https://secure.providesupport.com/image":"http://image.providesupport.com")
		+"/js/jewelry/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/jewelry.html?ps_s='
//				+ psEOSrsid + '&ps_mht=' + psEOSrmht,'support_window',500,560);
			eosv.support_window=popItUp('http://messenger.providesupport.com/messenger/jewelry.html','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 utilVars={projName:'rx-partners'}, psWWWrsid;
function initSupportWindow(){
        var src=(location.protocol.indexOf("https")==0?"https://secure.providesupport.com/image":"http://image.providesupport.com")+"/js/"+utilVars.projName+"/safe-standard.js?ps_h=WWWr\u0026ps_t="+new Date().getTime();
        var js = document.createElement('script');
        js.setAttribute('type', 'text/javascript');
        js.setAttribute('src', src);
        document.getElementById('live_support').appendChild(js);
}
function openSupportWindow(){
        if(psWWWrsid){
                showWindow('support_window','http://messenger.providesupport.com/messenger/'+utilVars.projName+'.html?ps_s='+psWWWrsid,500,560);
        }else{
                popItUp('about:blank','support_window',500,560);
                initSupportWindow();
                var timer = setInterval(function(){
                        if(psWWWrsid){
                                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);
}
/* NEW */
function showCertificate(u){
        u=u||'/out/?id=certificates_url';
        showWindow('cert_window',u,500,350);
}
function showSpecialOffer(u){
        u=u||'/out/?id=special_offer_url';
        showWindow('spo_window',u,620,620);
}
function showWindow(id,u,w,h){
        if(!utilVars[id] || utilVars[id].closed){
                utilVars[id]=popItUp(u,id,w,h);
        }
        utilVars[id].focus();
}
/* END */


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();}
}

function blister(domain,name) { popItUp('http://'+domain+'/imgs/pills/blisters/'+name+'.jpg',name+' blister',250,250); }
