


function doOnLoad() {
	FLAG_TO_OPEN_MENU = 1;	
	var right_ad = document.getElementById("right_ad");
	var header = document.getElementById("header");
	var ormenu = document.getElementById("ormenu");
	right_ad.style.left = getOffset(x_main_area,"offsetLeft") + 977;
	right_ad.style.display = "block";
	showLeftPromoBlocks();
}
function doOnResize() {
	var right_ad = document.getElementById("right_ad");
	right_ad.style.left = getOffset(x_main_area,"offsetLeft") + 977;
}
function showLeftPromoBlocks() {
	var i;
	for(i = 1;document.getElementById('left_promo_block' + i);i++); 
	if(i > 1) {
		var rand = (Math.round(Math.random()*1000))%(i-1)+1;
		var el = document.getElementById('left_promo_block' + rand);
		el.style.display = "block";
	}
}
function openWriteLetterPopup(url) {
	var left = (screen.width - 500) / 2;
	var top = (screen.height - 300) / 2;
	win = window.open(url, 'letter', 'width=500,height=300,left=' + left + ',top=' + top + ',menubar=0,location=0,resizable=1,scrollbars=0,directories=0,scroll=0,status=0,menubar=0,locationbar=0,statusbar=0,titlebar=0,toolbar=0');
	win.focus();
}
function openSubscriptionPopup(url) {
	var left = (screen.width - 500) / 2;
	var top = (screen.height - 300) / 2;
	win = window.open(url, 'subscr', 'width=500,height=300,left=' + left + ',top=' + top + ',menubar=0,location=0,resizable=1,scrollbars=0,directories=0,scroll=0,status=0,menubar=0,locationbar=0,statusbar=0,titlebar=0,toolbar=0');
	win.focus();
}
function openUnSubscrPopup(url) {
	var left = (screen.width - 500) / 2;
	var top = (screen.height - 300) / 2;
	win = window.open(url, 'subscr', 'width=500,height=300,left=' + left + ',top=' + top + ',menubar=0,location=0,resizable=1,scrollbars=0,directories=0,scroll=0,status=0,menubar=0,locationbar=0,statusbar=0,titlebar=0,toolbar=0');
}

function openLoginPopup() {

        var w = 320;
	var h = 220;
	var l = screen.availWidth/2 - w/2;
        var t = screen.availHeight/2 - h/2;

	win = window.open('/dn/opencms/system/modules/com.gridnine.opencms.modules.desten.estore/standalone/popup_login.jsp', 'login', 'left='+l+',top='+t+',width='+w+',height='+h+',menubar=0,location=0,resizable=0,scrollbars=0,directories=0,scroll=0,status=0,menubar=0,locationbar=0,statusbar=0,titlebar=0,toolbar=0');
}

/*********************************/

function printaddr (half1,half2,text)
{
  addr=half1+(half2||'')+"@"+"desten";
  document.write((text||(addr+".ru")).link("mailto:"+addr+".ru"));
}

