function doLoad(numimg,Width,Height) {
	Width+=20;
	Height+=20;
	if (screen.availWidth){
		b=(screen.availHeight - Height < 0) ? 0:(screen.availHeight - Height)/2-50;
		a=(screen.availWidth -Width < 0) ? 0:(screen.availWidth - Width)/2-50;
	}else{
		a=0;
		b=0;
	}
  	window.open(numimg,'','menubar=yes,scrollbars=no,resizable=no,width='+Width+',height='+Height+',top='+b+',left='+a);
	return false ;
}

function JS(menu) {
	if(document.getElementById(menu).style.display=='none'){
		document.getElementById(menu).style.display='block';
	}else{
		document.getElementById(menu).style.display='none';
	}
}

function cm(obj,kuda,server){
	a=unescape('%'+40);
	obj.location='ma'+'il'+'to'+':'+kuda+a+server+'?subject=%D3%EA%E0%E6%E8%F2%E5%20%F2%E5%EC%F3%20%EF%E8%F1%FC%EC%E0';
}


// конвертор валют

var	ie = document.all
var	dom = document.getElementById
var	ns4 = document.layers

/* прячет <select> и <applet> элементы в IE, так как они там имеют высший z-index */
function hideElement( elmID, overDiv )
{
  	if (ie)
	{
        for( i = 0; i < document.all.tags( elmID ).length; i++ )
        {
			obj = document.all.tags( elmID )[i];
			if( !obj || !obj.offsetParent )
			{
				continue;
			}

			// Find the element's offsetTop and offsetLeft relative to the BODY tag.
			objLeft   = obj.offsetLeft;
			objTop    = obj.offsetTop;
			objParent = obj.offsetParent;

			while( objParent.tagName.toUpperCase() != "BODY" && objParent.tagName.toUpperCase() != "HTML" )
			{
				objLeft  += objParent.offsetLeft;
				objTop   += objParent.offsetTop;
				objParent = objParent.offsetParent;
			}

			objHeight = obj.offsetHeight;
			objWidth = obj.offsetWidth;

			if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft );
			else if(( overDiv.offsetTop + overDiv.offsetHeight ) <= objTop );
			else if( overDiv.offsetTop >= ( objTop + objHeight ));
			else if( overDiv.offsetLeft >= ( objLeft + objWidth ));
			else
			{
				if(obj.id != 'MonthSelect'){
					obj.style.visibility = "hidden";
				}
			}
		}
	}
}

/*
 * отображает ранее скрытые <select> и <applet> (только в IE)
 */
function showElement( elmID )
{
	if (ie)
	{
		for( i = 0; i < document.all.tags( elmID ).length; i++ )
		{
			obj = document.all.tags( elmID )[i];

			if( !obj || !obj.offsetParent )
			{
				continue;
			}

			obj.style.visibility = "";
		}
	}
}
function popUpCalc(){
	newform = document.createElement('div'); 
	document.body.appendChild(newform);
	newform.innerHTML='<div id="okdiv2"></div><div id="savetel"><form name=calcucalor><p class=head>Конвертация валюты</p><table><tr><td class=lefttd>Сумма в рублях:<td><input name="ru" size="10" type="text" maxlength="10" class="inputtext"><tr><td>результирующая валюта:<td><select name="val"><option><option value="uah">украинские гривны ('+uah+')<option value="usd">доллары США ('+usd+')<option value="euro">евро ('+euro+')</select><tr><td>Сумма<td id=sum></table><p class="tar"><button class="fl" type="button" name="add" onclick="calc(); void 0">Рассчитать</button><button name="closebutton" type="button" onclick="document.body.removeChild(newform); void 0">Закрыть</button></form></div>';
	var top=document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
	var height=document.body.clientHeight ? document.body.clientHeight : window.innerHeight;
	document.getElementById('okdiv2').style.width=document.body.scrollWidth + 'px';
	document.getElementById('okdiv2').style.height=document.body.scrollHeight + 'px';
	document.getElementById('savetel').style.top=(top + height/2) + 'px';
}
function calc(el){//parseFloat
	if(document.calcucalor.val.selectedIndex){
		eval("a=parseFloat("+document.calcucalor.val[document.calcucalor.val.selectedIndex].value+")");
	}else{
		a=1;
	}
	if(document.calcucalor.ru.value && ! isNaN(document.calcucalor.ru.value)){
		document.getElementById('sum').innerHTML=a*document.calcucalor.ru.value;
	}else{
		document.getElementById('sum').innerHTML=0;
	}
}
