var doc = document;

var popUp_is_open;
popUp_is_open = false;

NS6 = (doc.getElementById&&!document.all);
IE = (doc.all);
NS = (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4");

if (window.opera) {
        IE = false;
        NS6 = true;
}

function popUpOpen () {
	popUp_is_open = true;
	doc.getElementById('popup').style.display = 'block';
}

function popUpClose () {
	popUp_is_open = false;
	setTimeout ('closePopUp ()', 250);
}

function closePopUp () {
	if (popUp_is_open === false) {
		doc.getElementById('popup').style.display = 'none';
		popUp_is_open = false;
	}
}

function setPopUpFlaf () { popUp_is_open = true; }
function unSetPopUpFlaf () { popUp_is_open = false; setTimeout ('closePopUp ()', 250); }

function showStoreBlock (nBlock) {
	doc.getElementById ('storeBlock_0').style.height = '20px';
	doc.getElementById ('storeBlock_1').style.height = '20px';
	doc.getElementById ('storeBlock_2').style.height = '20px';
	doc.getElementById ('storeBlock_3').style.height = '20px';
	doc.getElementById ('storeBlock_4').style.height = '20px';
	// doc.getElementById ('storeBlock_5').style.height = '20px';
	// doc.getElementById ('storeBlock_6').style.height = '20px';
	
	doc.getElementById ('storeBlock_' + nBlock).style.height = '140px';
}

function openStoreBlock (p1, p2) {
	if (doc.getElementById ('id' + p1 + '_' + p2).style.display == 'block') {
		doc.getElementById ('id' + p1 + '_' + p2).style.display = 'none';
	} else {
		doc.getElementById ('id' + p1 + '_' + p2).style.display = 'block';
	}
}

function openStorePopUp (param) {
	if (doc.getElementById ('popUpStoreID' + param).style.display == 'block') {
		doc.getElementById ('popUpStoreID' + param).style.display = 'none';
	} else {
		doc.getElementById ('popUpStoreID' + param).style.display = 'block';
	}
}

var winImage;

function showImage (name, w, h) {
	if (winImage) winImage.close ();
	winImage = window.open ('', 'myImage', 'noresize, width=' + w + ', height=' + h);	
	winImage.document.write ('<html><head><title>ÑÏÎÐÒËÀÍÄÈß</title><body style="margin: 0px; padding: 0px;">');
	winImage.document.write ('<img src="' + name + '">');
	winImage.document.write ('</body></head></html>');
	winImage.focus ();
}

var winAdvice;

function showAdvice (mid) {
	if (winAdvice) winAdvice.close ();
	winAdvice = window.open ('advice.php?id=' + mid, 'myAdvice', 'noresize, width=250, height=350');
	winAdvice.focus ();
}