
/* ---- common utils ---- */
var ttVars={};
var psTT1rsid;

/*
function initSupportWindow(){
	var src=(location.protocol.indexOf("https")==0?"https://secure.providesupport.com/image":"http://image.providesupport.com")+"/js/"+ttVars.projName+"/safe-standard.js?ps_h=TT1r\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(psTT1rsid){
		if(!ttVars.support_window || ttVars.support_window.closed){
			ttVars.support_window=popItUp('http://messenger.providesupport.com/messenger/'+ttVars.projName+'.html?ps_s='+psTT1rsid,'support_window',500,560);
		}else{
			ttVars.support_window.focus();
		}
	}else{
		popItUp('about:blank','support_window',500,560);
		initSupportWindow();
		var timer = setInterval(function(){
			if(psTT1rsid){
				clearInterval(timer);
				openSupportWindow();
			}
		}, 5);
	}
}*/
function reloadImageCode(){
	var img=document.getElementById('vcode_img');
	if(!ttVars.imgCodeUrl) ttVars.imgCodeUrl=img.src;
	img.src=ttVars.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(!ttVars.cert_window || ttVars.cert_window.closed){
		ttVars.cert_window=popItUp(u,'cert_window',500,350);
	}else{
		ttVars.cert_window.focus();
	}
}
function showSpecialOffer(u){
	u=u||'out.php?id=special_offer_url';
	if(!ttVars.spo_window || ttVars.spo_window.closed){
		ttVars.spo_window=popItUp(u,'spo_window',620,620);
	}else{
		ttVars.spo_window.focus();
	}
}

function popImg(){
	var u='imgs/pills/blisters/'+jQ(this).attr('prod')+'.jpg';
	var h='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">'
	+'<head><title></title>'
	+'<style>html,body,table{margin:0;padding:0;height:100%;width:100%;text-align:center}</style>'
	+'</head><body onclick="close();"><table><tr><td><img src="'+u+'" /></td></tr></table></body></html>';
	var wnd=popItUp('','img_window'+Math.random(),510,510);
	wnd.document.write(h);
	wnd.focus();
	return false;
}

function makeBookmark(){
	var host=document.location.host,
	u='http://'+host+'/';
	try{
		if (window.sidebar){
		window.sidebar.addPanel(this.title, u, '');
		}else if(document.all){
		window.external.AddFavorite(u, this.title);
		}
	}catch(ex){alert(ex.message);}
	return false;
}

function showLiveSupport(){popItUp('./out.php?id=live_support_url',620,620); return void(0);}

var utilVars={projName:'Ð¸Ð¼ÑÐ´Ð¾Ð¼ÐµÐ½Ð°'}, psWWWrsid; 
function showWindow(id,u,w,h){
        if(!utilVars[id] || utilVars[id].closed){
                        utilVars[id]=popItUp(u,id,w,h);
                                }
                                        utilVars[id].focus();
                                        }
function openSupportWindow(){ showWindow('support_window','/out/?id=live_support_url',500,560); }
