function geby(id){
	return document.getElementById(id);
}

function ltrim( source ){
     var index = 0;
     while( source.charAt(index) == " " ) index++;
     return source.substr(index);
}


function wop1(im,hd,w,h,scroll){
   var pic='"'+hd+'"'+" HEIGHT="+'"'+h+'"'+" SRC="+'"'+im+'"'+" WIDTH="+'"'+w+'"';
   ww=w+10;
   hw=h+10;
   width = "" + (screen.width - ww)/2;
   height = "" + (screen.height - hw)/2;
   var wn="width="+ww+","+"height="+hw+","+"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" style="margin:5px;" width='+w+' height='+h+' border="0" bordercolor="#cccccc"  ALT='+pic+'></a>')
   myWin.document.write('</BODY>');
   myWin.document.write('</HTML>');
}
function wop_cl(im,hd,w,h,scroll){
   var pic='"'+hd+'"'+" HEIGHT="+'"'+h+'"'+" SRC="+'"'+im+'"'+" WIDTH="+'"'+w+'"';
   ww=w+15;
   hw=h+45;
   scroll=1;
   width = "" + (screen.width - ww)/2;
   height = "" + (screen.height - hw)/2;
   var wn="width="+ww+","+"height="+hw+","+"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><style type="text/css"> a {font: 15px Arial,Tahoma, Verdana, sans-serif bold; color: #054187; text-decoration: underline; }</style></HEAD>');
   myWin.document.write('<BODY LEFTMARGIN="0" TOPMARGIN="0" bottommargin="0" rightmargin="0">');
   myWin.document.write('<a href="javascript:window.close();" ><IMG ALIGN="center" style="border:1px solid #DDDDDD; margin:6px 6px 0px 6px;" width='+w+' height='+h+' border="0" bordercolor="#cccccc"  ALT='+pic+'></a>')    //<p ALIGN="center" ></p><a href="javascript:window.close();" >Закрыть</a>
   myWin.document.write('</BODY>');
   myWin.document.write('</HTML>');
}

function wop_flag_text(im,hd,w,h,scroll,text){
   text=text||""
   var pic='"'+hd+'"'+" HEIGHT="+'"'+h+'"'+" SRC="+'"'+im+'"'+" WIDTH="+'"'+w+'"';
   ww=w+40;
   if (text=="") hw=h+60;
   else hw=h+200;
   width = "" + (screen.width - ww)/2;
   height = "" + (screen.height - hw)/2;
   var wn="width="+ww+","+"height="+hw+","+"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> <style type="text/css"> a {font: 12px Arial,Tahoma, Verdana, sans-serif; color: #2E2F30; text-decoration: none;}</style></HEAD>');
   myWin.document.write('<BODY LEFTMARGIN="10" TOPMARGIN="5" bottommargin="5" rightmargin="10">');
   myWin.document.write('<a href="javascript:window.close();" title="Закрыть"><IMG style="margin:5px;"  width='+w+' height='+h+' border="0" bordercolor="#cccccc"  ALT='+pic+'><p align=center style="text-align:center;"><strong>'+hd+'</strong></a></p><p style="text-align:justify;">'+text+'</p>')
   myWin.document.write('</BODY>');
   myWin.document.write('</HTML>');
}
function wop(im,hd,w,h,scroll,text){
   text=text||""
   var pic='"'+hd+'"'+" HEIGHT="+'"'+h+'"'+" SRC="+'"'+im+'"'+" WIDTH="+'"'+w+'"';
   ww=w+40;
   if (text=="") hw=h+60;
   else hw=h+200;
   width = "" + (screen.width - ww)/2;
   height = "" + (screen.height - hw)/2;
   var wn="width="+ww+","+"height="+hw+","+"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> <style type="text/css"> a {font: 12px Arial,Tahoma, Verdana, sans-serif; color: #2E2F30; text-decoration: none;}</style></HEAD>');
   myWin.document.write('<BODY LEFTMARGIN="10" TOPMARGIN="5" bottommargin="5" rightmargin="10">');
   myWin.document.write('<a href="javascript:window.close();" title="Закрыть"><IMG style="margin:5px;"  width='+w+' height='+h+' border="0" bordercolor="#cccccc"  ALT='+pic+'><p align=center style="text-align:center;"><strong>'+hd+'</strong></a></p><p style="text-align:justify;">'+text+'</p>')
   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();
}
function maillink(mailprefix, maildomain, mailsuffix, mailname)
{
if (mailname == null) { mailname = "sales@megaflag.ru"; }

document.write('<a href="mailto:' + mailprefix + '%40' + maildomain + '.' + mailsuffix + '">' + mailname + '</a>');
}

