



function open_calc(id)
{
   	scalc=window.open("/supercalc.php?id="+id,"supercalc"+id, "toolbar=0, location=0, width=500px, height=600px");
  	scalc.moveTo(200, 50);
  	scalc.focus();

}

function open_calc_korea(id)
{
   	scalc=window.open("/supercalc_korea.php?id="+id,"supercalc_korea"+id, "toolbar=0, location=0, width=500px, height=600px");
  	scalc.moveTo(200, 50);
  	scalc.focus();

}

function calcn()
{
	var itogo=0;
	var tam_p=0;
	var price_jp=0;
	var price_deliv=0;


	document.getElementById("jp_in_rub").innerHTML='';

	var fraht=110000;
	var broker=14000;
	var komiss_jc=12000;

 document.poisk.itog_rub.value="";
 document.poisk.itog_usd.value="";

 var tam_p=parseInt(document.poisk.tam_p.value)*kurs_dol;
 var price_jp=parseInt(document.poisk.price_jp.value)*1000;
 var price_deliv=parseInt(document.poisk.price_deliv.value);

 if (price_jp==0){document.poisk.price_jp.value=""; }
 if (tam_p==0){document.poisk.tam_p.value="";}
 if (price_deliv==0){document.poisk.price_deliv.value="";}

 if (isNaN(price_deliv)){price_deliv=0;}
 if (isNaN(tam_p)){tam_p=0;}

 // Считаем стоимость авто в руб
 var price_jp_dol=price_jp/kurs_yen_doll;
 var price_jp_rub=price_jp_dol*kurs_dol; // стоимость авто в руб.


 // Считаем aфрахт
 var fraht_dol=parseInt(fraht/kurs_yen_doll);
 var fraht_rub=fraht_dol*kurs_dol;

 if (parseInt(document.poisk.price_jp.value)>0){document.getElementById("jp_in_rub").innerHTML='(' + Math.round(price_jp_rub) + ' руб.)';}else{document.getElementById("jp_in_rub").innerHTML='';}
 if (parseInt(document.poisk.tam_p.value)>0){document.getElementById("tam_in_rub").innerHTML='(' + Math.round(tam_p) + ' руб.)';}else{document.getElementById("tam_in_rub").innerHTML='';}

 var itogo_rub=Math.round(price_jp_rub+fraht_rub+broker+komiss_jc+price_deliv+tam_p);
 if (isNaN(itogo_rub)){itogo_rub="";}

 document.poisk.itog_rub.value=itogo_rub;


 document.poisk.itog_usd.value=Math.round(document.poisk.itog_rub.value/kurs_dol);

// alert (komiss_jp);
}

function calcn_korea()
{
	var itogo=0;
	var tam_p=0;
	var price_jp=0;
	var price_deliv=0;


	document.getElementById("jp_in_rub").innerHTML='';

	var fraht=1200;
	var broker=14000;
	var komiss_jc=40000;

 document.poisk.itog_rub.value="";
 document.poisk.itog_usd.value="";

	var tam_p_t=document.poisk.tam_p.value;

 var tam_p_rub=tam_p_t*kurs_dol;
 var tam_p= parseInt(tam_p_t);


 var price_jp=parseInt(document.poisk.price_jp.value);
 var price_deliv=parseInt(document.poisk.price_deliv.value);

 if (price_jp==0){document.poisk.price_jp.value=""; }
 if (tam_p==0){document.poisk.tam_p.value="";}
 if (price_deliv==0){document.poisk.price_deliv.value="";}

 if (isNaN(price_deliv)){price_deliv=0;}
 if (isNaN(tam_p)){tam_p=0;}

  var price_jp_rub=price_jp*kurs_dol;

 // Считаем aфрахт
 var fraht_dol=parseInt(fraht/kurs_yen_doll);
 var fraht_rub=fraht_dol*kurs_dol;

 if (parseInt(document.poisk.price_jp.value)>0){document.getElementById("jp_in_rub").innerHTML='(' + Math.round(price_jp_rub) + ' руб.)';}else{document.getElementById("jp_in_rub").innerHTML='';}
 if (parseInt(document.poisk.tam_p.value)>0){document.getElementById("tam_in_rub").innerHTML='(' + Math.round(tam_p_rub) + ' руб.)';}else{document.getElementById("tam_in_rub").innerHTML='';}

 var itogo_rub=Math.round((price_jp+fraht+tam_p)*kurs_dol+komiss_jc+price_deliv);
 if (isNaN(itogo_rub)){itogo_rub="";}

 document.poisk.itog_rub.value=itogo_rub;


 document.poisk.itog_usd.value=Math.round(document.poisk.itog_rub.value/kurs_dol);

// alert (komiss_jp);
}



function onload_page()
{prev=document.getElementById("onloadbox");
prev.style.visibility="visible";

prev=document.getElementById("loaderContainer");
prev.style.visibility="hidden";

//document.body.disabled = true;

}

function hideonload()
{
prev=document.getElementById("onloadbox");
prev.style.visibility="hidden";

prev=document.getElementById("loaderContainer");
prev.style.visibility="hidden";

}




