function popupWindow1(url , x , y) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+x+',height='+y+',screenX=150,screenY=150,top=150,left=150')
}

function popupWindow(url , w , h) {
 
	var wWidth = w;
	var wHeight = h;

	isSafari3 = false;
	if(window.devicePixelRatio) isSafari3 = true;

	if(isSafari3){			
		wWidth = wWidth + 0;
		wHeight = wHeight + 4;
	}
	

	var sb = 'no';
	if (wWidth > screen.width)
	{
		wWidth = screen.width - 100;
		sb = 'yes';
	}
	if (wHeight > screen.height)
	{
		wHeight = screen.height - 200;
		sb = 'yes';
	}



	var IE = navigator.userAgent.indexOf("MSIE") >= 0;
	if (IE){
		IE7 = navigator.userAgent.indexOf("MSIE 7.0") < 0;
	  if(IE7){
			window.open(url, "imgWin", 'width=' + wWidth + ',height=' + wHeight + ',resizable=no,scrollbars='+sb+',toolbar=no,menubar=no');
			return;
	  }
	}
	

	wnd=window.open("", "imgWin", 'width=' + wWidth + ',height=' + wHeight + ',resizable=no,scrollbars='+sb+',toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
	wnd.document.write('<html><head><title></title></head><body style="margin:0; padding:0;">');
	//wnd.document.write('<div align="center" style="width:100%">');
	wnd.document.write('<a href="javascript:window.close();"><img src="' + url + '" width="' + w + '" height="' + h + '" border="0" alt="" /></a><br />');	
	//wnd.document.write('</div>');
	wnd.document.write('</body></html>');
	wnd.document.close();
	wnd.focus();
}


	function submit_form(theform , val) {		
				
		 sr = eval("document."+theform);
		 if(val) sr.what.value = 'zakaz';
		 sr.submit();
	}

	function menu_div(x){
		if(document.getElementById('d'+x).style.display == "block")
			document.getElementById('d'+x).style.display = "none";
		else
			document.getElementById('d'+x).style.display = "block"
	}

function subsub1(){
	
	if(document.create_account.subsub.disabled)
		document.create_account.subsub.disabled=false;
	else
		document.create_account.subsub.disabled = true;
}



function show_title(e,txt) {
if (!e) var e = window.event;
if (e.pageX || e.pageY)
{
  posx = e.pageX;
  posy = e.pageY;
}
else if (e.clientX || e.clientY)
{
  posx = e.clientX + document.body.scrollLeft;
  posy = e.clientY + document.body.scrollTop;
}
document.getElementById('show_title').style.left=posx-10;
document.getElementById('show_title').style.top=posy+30;
document.getElementById('show_title').innerHTML=txt;
document.getElementById('show_title').style.display='block';
}
function hide_title(){
  document.getElementById('show_title').style.display='none';
}




function m( url ){
	
	var width, height;
	var tt = 0;
	var proc = 80;
	var w = screen.width;
	var h = screen.height;
	if( w <= 1024 )tt = 20;
	if( h > 1024 )proc = 70;
	
	height = parseInt( h / 100 * proc );	
	width = 886;
	if( w <= 900 )width = 780;

	
	var l = ( w - width )/2 -15;
	var t = ( h - height )/2 - tt;
	
	
	window.open( url, "_blank", "toolbar=0,scrollbars=1,resizable=1,left="+l+",top="+t+",width="+width+",height="+height );
	
	
	return false;
}
