function geby(id){
	return document.getElementById(id);
}

function ltrim( source ){
     var index = 0;
     while( source.charAt(index) == " " ) index++;
     return source.substr(index);
}


function wop(im,hd,w,h,scroll){
   var pic='"'+hd+'"'+" HEIGHT="+'"'+h+'"'+" SRC="+'"'+im+'"'+" WIDTH="+'"'+w+'"';
   width = "" + (screen.width - w)/2;
   height = "" + (screen.height - h)/2;
   var wn="width="+w+","+"height="+h+","+"status=no,toolbar=no,menubar=no,scrollbars="+ (scroll?'yes':'no') +",left="+width+",top="+height;
   myWin=open("","_blank",wn);
   myWin.document.write('<HTML>');
   myWin.document.write('<HEAD><TITLE>'+hd+'</TITLE></HEAD>');
   myWin.document.write('<BODY LEFTMARGIN="0" TOPMARGIN="0" bottommargin="0" rightmargin="0">');
   myWin.document.write('<a href="javascript:window.close();" ><IMG ALIGN="center"  width='+w+' height='+h+' border="0" bordercolor="#cccccc"  ALT='+pic+'></a>')
   myWin.document.write('</BODY>');
   myWin.document.write('</HTML>');
}

function show_comm(){
   //var pic='"'+hd+'"'+" HEIGHT="+'"'+h+'"'+" SRC="+'"'+im+'"'+" WIDTH="+'"'+w+'"';
   
   var wn="width=600, height=500,status=no,toolbar=no,menubar=no,scrollbars=yes,left=50,top=50";
   myWin=open("","_blank",wn);
   myWin.document.write('<HTML>');
   myWin.document.write('<HEAD><TITLE>Коммерческое предложение</TITLE></HEAD>');
   myWin.document.write('<BODY LEFTMARGIN="0" TOPMARGIN="0" bottommargin="0" rightmargin="0">');
   myWin.document.write('<a href="javascript:window.close();" ><IMG src="/images/uploaded/kp_biar_8mart.jpg" ALIGN="center"  width=575 height=820 border="0" bordercolor="#cccccc"  ></a>')
   myWin.document.write('</BODY>');
   myWin.document.write('</HTML>');
}




function w_open ()
{
	url = w_open.arguments[0];
	if (w_open.arguments[1]) 
	{
		w = w_open.arguments[1];
	} else
	{
		w = screen.width - 10;
	} 
	if (w_open.arguments[2]) 
	{
		var h = w_open.arguments[2];
	} else
	{
		h = screen.height - 100;
	}
	if (w_open.arguments[3]) 
	{
		var scr = w_open.arguments[3];
	} else
	{
		scr = 'no';
	}
	if (w_open.arguments[4]) 
	{
		var res = w_open.arguments[4];
	} else
	{
		res = 'no';
	}
	wn = 'wname' + Math.round (Math.random () * 10000);
	settings = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scr+',resizable='+res+',left=250,top=100,width='+w+',height='+h;
	openedWindow = window.open (url, wn, settings);
	if (openedWindow.opener == null) openedWindow.opener = self;
	openedWindow.focus();
}