function openPictureWindow(Width,Height,Path,Title)
{	if(Path!="/images/map_b.gif")Path="/"+Path;
	if(Path=="/images/map_b.gif")Hei=Height+60;
	else Hei=Height;
	if (Title=="How to get to us?") print_var="print the scheme";else print_var="напечатать схему";
	WinFeatures = (Width<=screen.width && Height<=screen.height)? "top="+(screen.height-Height)/2+",left="+(screen.width-Width)/2+",width="+Width+",height="+Hei+",Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no" : "top="+(screen.height-Height)/2+",left="+(screen.width-Width)/2+",width="+(Width+20)+",height="+(Height+20)+",Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes";
	w = window.open("","PictureWindow",WinFeatures);
	w.document.open();
	w.document.write('<head><title>&quot;'+Title+'&quot;</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><link rel=stylesheet type=text/css href=/main.css></head>');
	w.document.write("<body bgcolor=white leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><a href=JavaScript:self.close(); title='Закрыть окно'><IMG src='"+Path+"' height='"+Height+"' width='"+Width+"' alt='&quot;"+Title+"&quot;' border=0>"); 
	if(Path=="/images/map_b.gif"){w.document.write("<p align=center><input type=button onClick=\"window.print();\" value='"+print_var+"' alt='"+print_var+"' title='"+print_var+"' class=knop></p>");}
	w.document.write("</a></body>");
	w.document.close();
}

function objectXY(obj) {
var dobj=eval('document.getElementById("'+obj+'")')
   var x = 0, y = 0;
do{
    x += dobj.offsetLeft;
    y += dobj.offsetTop;
  }while (typeof(dobj = dobj.offsetParent) != 'undefined' && dobj != null);
   return [x,y];
}

function get_arrow_pos(arg){
ar=objectXY(arg);
var cll=ar[0];
var clt=ar[1];
clar=[cll,clt];
}

function bg(name,color){
	name.style.backgroundColor=color;
}
function view_foto(adr,w,h){
var new_foto=window.open('/view_foto.php?adr='+adr,'','width='+w+',height='+h);
}

var cargo_info_num=1;
function add_new_cargo_info(arg){
if(arg=="ru"){var mass=new Array("Грузовое место","Габариты, см","Вес, кг","Объем","Описание груза");}
else{var mass=new Array("Cargo package","LxWxH, cm","Weight, kg","Volume","Goods description");}
	cargo_info_num++; 
	var table = document.createElement("table"),row1=table.insertRow(0);
 	table.style.width = "101%";  
	for(var i = 0; i < 2; i++) {row1.insertCell(i);}  
    	row1.cells[0].innerHTML="<table border=0 id=cargo_info_"+cargo_info_num+" cellspacing=0 cellpadding=0 bgcolor=#F7F9FB><tr><td colspan=4><b class=anons>"+mass[0]+" "+cargo_info_num+"</b></td></tr><tr><td width=25%><b class=small>"+mass[1]+":</b> <b class=red>*</b></td><td width=25%><b class=small>"+mass[2]+":</b> <b class=red>*</b></td><td width=25%><b class=small>"+mass[3]+", м<sup>3</sup>:</b> <b class=red>*</b></td><td width=25%><b class=small>"+mass[4]+":</b> <b class=red>*</b></td></tr><tr><td width=25%><textarea name=cargo_size_"+cargo_info_num+" onFocus=bg(this,'#ECF0F4'); onBlur=bg(this,''); class=inp style='width:120px;height:40px'></textarea></td><td width=25%><textarea name=cargo_weight_"+cargo_info_num+" onFocus=bg(this,'#ECF0F4'); onBlur=bg(this,''); class=inp style='width:120px;height:40px'></textarea></td><td width=25%><textarea name=cargo_capacity_"+cargo_info_num+" onFocus=bg(this,'#ECF0F4'); onBlur=bg(this,''); class=inp style='width:120px;height:40px'></textarea></td><td width=25%><textarea name=cargo_descript_"+cargo_info_num+" class=inp onFocus=bg(this,'#ECF0F4'); onBlur=bg(this,''); style='width:140px;height:40px'></textarea></td></tr></table>";

	document.getElementById('ins_cargo_info').appendChild(table); 
} 



