function showDetail(pID) {	
//alert ("-=5=-");
window.open("ruMyCarDetails.aspx?ID="+pID,"","width=640,height=560,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}

function showDetailPs(pID) {	
//alert ("-=5=-");
window.open('ruMyCarDetailsP.aspx?ID='+pID+'&type=SVX',"","width=640,height=560,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}

function showDetailPr(pID) {	
//alert ("-=5=-");
window.open('ruMyCarDetailsP.aspx?ID='+pID+'&type=Reg',"","width=640,height=560,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}


function showDetail(pID,cost) {	
//alert ("=COST=");
window.open("ruMyCarDetails.aspx?ID="+pID+"&cost="+cost,"","width=640,height=560,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}


function showDetail(pID,cost,country) {	
//alert ("=COST=");
window.open("ruMyCarDetails.aspx?ID="+pID+"&cost="+cost+"&C="+country,"","width=640,height=560,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}

function showDetail2(pID) {	
	//alert ("-=5=-");
	window.open("ruMyCarDetails2.aspx?ID="+pID,"","width=640,height=560,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}

function showDetail2(pID,country) {	
	//alert ("-=5=-");
	window.open("ruMyCarDetails2.aspx?ID="+pID+"&C="+country,"","width=640,height=560,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}

function showBankin(pID) {	
//alert ("-=66=-");
	window.open("ruMyCarBankin.aspx?refno="+pID,"","width=640,height=560,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}

function showJuki(pID) {	
	window.open("ruJukDetails.aspx?ID="+pID,"SBTKK_KUKI","width=940,height=760,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}
function showReleaseSyorui(pID) {	
	window.open("SyoruiDetails.aspx?ID="+pID,"SBtrading","width=400,height=300,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}

function showConsignee(pID,car,cons,notify) {	

//alert ("-=Consignee=-");
//	var WO1;
	document.location.assign ("ruConsigneeUp.aspx?ID="+pID+"&car="+car+"&cons="+cons+"&notify="+notify);
//	WO1=window.open("ruConsigneeUp.aspx?ID="+pID+"&car="+car+"&cons="+cons,"SB_Trading","width=750,height=480,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
//	WO1.focus();
}

function MM_swapImage() { //v3.0

	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){
			document.MM_sr[j++]=x;
			if(!x.oSrc)
				x.oSrc=x.src;
			x.src=a[i+2];
		}
	}

function MM_swapImgRestore() { //v3.0

	var i,x,a=document.MM_sr; 
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function writeDate (lang){
// +
//alert("date");
	var str = '<I><font size="2">';
    if (lang=="rus")
		str += "";//Iineaaiaa iaiiaeaiea: ";
	else
		str += "Last modified: ";
//alert ("1");

var datt = ""+document.fileModifiedDate;
//alert ("2");
	datt = datt.substr (6,4)+"/"+ datt.substr (0,5);
//alert ("3");
	str += datt;
//alert ("4");
	str += "</I></font>";
//alert("date"+str);
	document.write(str);
}

function writeMenu (Menu,Lang){
//+
	Langv = Lang;
	Menuu = Menu;
//	if (Lang=="engl" | location.href.indexOf("0001") > 0)
//		PathAdd="../";

	LinkRus = new Array ("rulogin.html","about.html","order.html","ruloginChk.html","ships.html","contact.html","aboutus.html");//"english/index.htm",

	//MenuRus = new Array ("Главная");
//	MenuRus = new Array ('Главная','О компании','Автоаукцион');
//		"Автомобили в наличии","Расписание судов","Контакты","Менеджеры");


//	MenuEngl = new Array ("Home","Price","Order",
//	LinkEngl = new Array ("index.htm","price.htm","order.htm",

	//Str = "";
//alert ("Menu_JS");
	var Str = '<table height="32" width="100%" border="0" cellpadding=0 cellspacing=0 style="border-collapse:collapse; border-top: 0px solid"><TR>';

	for (j=0; j< MenuRus.length; j++){
		PrMenu = MenuRus[j];

		if (Lang=="engl")
			PrMenu = MenuEngl[j];
		PrLink = LinkRus[j];
		if (Lang=="engl")
			PrLink = LinkEngl[j];

		Str += '<TD height="32" background="pictures/top4_fon.gif" align="center" width="150">';
		Str += menuLink (PrMenu,PrLink)+'</td>';
		Str += '<td height="32" width="2"><img src="pictures/lineI.gif"></td>';
	}
//alert (Str);
	Str += "</tr></table>";
	document.write(Str);
}

function menuLink(ZagMenu,Link){
//	var Gap = '&nbsp;'
	var St = "";
//	St += Gap ;
	St += '<span class="small">';
	if (Menuu+"." != Link.substr( 0,Menuu.length+1))
		St += '<a href="'+PathAdd+Link+'">';
	St += ZagMenu;
	if (Menuu+"." != Link.substr(0,Menuu.length+1))
		St +='</a>';
	St +="</span>";
//alert("st="+St);
	return (St);
}

function getParam(sParamName){
	//+++
    var Params = location.search.substring(1).split("&");
    var variable = "";
    for (var i = 0; i < Params.length; i++){ // 
        if (Params[i].split("=")[0] == sParamName){ // 
            if (Params[i].split("=").length > 1) variable = Params[i].split("=")[1];
            return variable;
        }
    }
    return "";
}








//delete
function num2fig(Numeric){
    Numeric += '';

    var Separator = Numeric.indexOf(' ',0);
    while (Separator != -1){
        Numeric = Numeric.substring(0, Separator) + Numeric.substring(Separator+1, Numeric.length);
        Separator = Numeric.indexOf(' ',0);
    }

    var DecimalPoint = Numeric.lastIndexOf('.');
    if (DecimalPoint == -1){
        var Decimals = '';
        var Integers = Numeric + '';
    } else {
        var Decimals = Numeric.substring(DecimalPoint,Numeric.length) + '';
        var Integers = Numeric.substring(0,DecimalPoint) + '';
    }
    Blanks = Integers.length % 3;
    if (Blanks != 0){
        for (var i = 0; 3-Blanks > i ; i++){
            Integers = ' ' + Integers;
        }
    }

    FigureInteger = Integers.substring(0,3);
    var j = 2;
    if (Integers.charAt(2) == '-'){
        FigureInteger = FigureInteger + Integers.substring(3,6);
        j=4;
    }
    for (i = j; Integers.length > i ; i++){
        if (i % 3 == 0){
            FigureInteger = FigureInteger + ' ' + Integers.substring(i,i+3);
        }
    }

    while (FigureInteger.charAt(0) == ' '){
        FigureInteger = FigureInteger.substring(1,FigureInteger.length);
    }
    CommaNumber = FigureInteger + Decimals;
    return CommaNumber;
}



function showMal_Ik (){
	var name1,name2 ;
	var wind = window.showModelessDialog ("mal_Ik.htm",[name1,name2],"dialogHeight:130px; dialogWidth:300px") ;
}
function showMal_Iw (){
	var name1,name2 ;
	var wind = window.showModelessDialog ("mal_Iw.htm",[name1,name2],"dialogHeight:130px; dialogWidth:300px") ;
}

