var utilVars={};
/*function openSupportWindow(u){
	u=u||'out.php?id=livesupport';
	if(!utilVars.support_window || utilVars.support_window.closed){
		utilVars.support_window=popItUp(u,'support_window',500,560);
	}else{
		utilVars.support_window.focus();
	}
}
*/

var seYPWr=document.createElement("script");
seYPWr.type="text/javascript";
var seYPWrs=(location.protocol.indexOf("https")==0?"https://secure.providesupport.com/image":"http://image.providesupport.com")+"/js/stimul-cash/safe-standard.js?ps_h=YPWr\u0026ps_t="+new Date().getTime();
function openSupportWindow(){
setTimeout("window.seYPWr.src=window.seYPWrs;document.getElementById(\'live_support\').appendChild(window.seYPWr)",1);
var url = "http://messenger.providesupport.com/messenger/stimul-cash.html?ps_s=" + window.psYPWrsid /*+ "&amp;ps_mht=" + psYPWrmht + ""*/;
window.open(url, "_blank", "menubar=0,location=0,scrollbars=auto,resizable=1,status=0,width=500,height=500");
}

function reloadImageCode(){
	var img=document.getElementById('vcode_img');
	if(!utilVars.imgCodeUrl) utilVars.imgCodeUrl=img.src;
	img.src=utilVars.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(u){
	u=u||'out.php?id=certificates_url';
	if(!utilVars.cert_window || utilVars.cert_window.closed){
		utilVars.cert_window=popItUp(u,'cert_window',500,350);
	}else{
		utilVars.cert_window.focus();
	}
}
function showSpecialOffer(u){
	u=u||'out.php?id=special_offer_url';
	if(!utilVars.spo_window || utilVars.spo_window.closed){
		utilVars.spo_window=popItUp(u,'spo_window',620,620);
	}else{
		utilVars.spo_window.focus();
	}

}

/* ------------- */

function qsOnBlur(){
	if(this.value=='')this.value=this.defaultValue;
}
function qsOnFocus(el){
	if(el.value==el.defaultValue)el.value='';
	if(!el.onblur)el.onblur=qsOnBlur;
}

function prodInfoSwitch(el){
	var t = document.getElementById('product_info');
	t.style.display = (t.style.display == 'none') ? '' : 'none';
	return false;
}
