<!--

function CheckLength(TargetObject){
        LenString = TargetObject.value.length;
        if (LenString > 700){
            TargetObject.value = TargetObject.value.substring(0,700);
        }
    }

function CalculatePaymentR(){
    var price = document.getElementById("PriceR").value;
	price=price.replace(",",".");
	
	var vuu = document.getElementById("vuu").value;
	vuu=vuu.replace(",",".");
	if (vuu=="") vuu=0;
	
	var pn = document.getElementById("pn").value;
	pn=pn.replace(",",".");
	if (pn=="") pn=0;
	
	var psm = document.getElementById("psm").value;
	psm=psm.replace(",",".");
	if (psm=="") psm=0;
	
	var ocen = document.getElementById("ocen").value;
	ocen=ocen.replace(",",".");
	if (ocen=="") ocen=0;
	
	var vkz = document.getElementById("vkz").value;
	vkz=vkz.replace(",",".");
	if (vkz=="") vkz=0;
	
	var pu = document.getElementById("pu").value;
	pu=pu.replace(",",".");
	if (pu=="") pu=0;
	
	var kat_vp = document.getElementById("kat_vp").value;
	kat_vp=kat_vp.replace(",",".");
	if (kat_vp=="") kat_vp=0;
	
	var kat_zp = document.getElementById("kat_zp").value;
	kat_zp=kat_zp.replace(",",".");
	if (kat_zp=="") kat_zp=0;
	
	var ine = document.getElementById("ine").value;
	if (ine==""){ ine=0;}
	else{ine=ine.replace(",",".");}

	if (price==0 || price==""){ 
	alert("Zadajte výku úveru, prosím!");
	document.getElementById("PriceR").focus();
	return false;}
    var dnpmt = document.getElementById("DownPaymentR").value;
	if (dnpmt=="") {  dnpmt=0;}
    var prin = price - dnpmt;
    var intRate = document.getElementById("InterestRateR").value;
	intRate=intRate.replace(",",".");
	intRate = (intRate/100) / 12;
	if (intRate==0 || intRate==""){ 
	alert("Zadajte úrok, prosím!");
	document.getElementById("InterestRateR").focus();
	return false;}
    var term = document.getElementById("Term5R").value * 12;
	if (term==0 || term==""){ 
	alert("Zadajte počet rokov splatnosti, prosím!");
	document.getElementById("Term5R").focus();
	return false;}
	var pmt = 0;
	pmt = Math.floor((prin*intRate)/(1-Math.pow((1+intRate),(-1*term)))*100)/100;
	
	//pmt=Math.ceil(pmt)+ parseInt(vuu)+ parseInt(pn)+ parseInt(psm)+parseInt(ocen)+ parseInt(vkz)+ parseInt(pu)+ parseInt(kat_vp) +parseInt(kat_zp) + parseInt(ine);
	pmt=Math.ceil(pmt*term)+ parseInt(vuu*term)+ parseInt(pn*term)+ parseInt(psm*term)+parseInt(ocen)+ parseInt(vkz)+ parseInt(pu)+ parseInt(kat_vp) +parseInt(kat_zp) + parseInt(ine);
	document.getElementById("Payment1R").value = pmt  ;

}

function CalculatePayment(){
    var price = document.getElementById("Price").value;
	price=price.replace(",",".");
	if (price==0 || price==""){ 
	alert("Zadajte výku úveru, prosím!");
	document.getElementById("Price").focus();
	return false;}
    var dnpmt = document.getElementById("DownPayment").value;
	if (dnpmt=="") {  dnpmt=0;}
    var prin = price - dnpmt;
    var intRate = document.getElementById("InterestRate").value;
	intRate=intRate.replace(",",".");
	intRate = (intRate/100) / 12;
	if (intRate==0 || intRate==""){ 
	alert("Zadajte úrok, prosím!");
	document.getElementById("InterestRate").focus();
	return false;}
    var term = document.getElementById("Term5").value * 12;
	if (term==0 || term==""){ 
	alert("Zadajte počet rokov splatnosti, prosím!");
	document.getElementById("Term5").focus();
	return false;}
	var pmt =Math.floor((prin*intRate)/(1-Math.pow((1+intRate),(-1*term)))*100)/100;
	document.getElementById("Principle1").value = prin;
	document.getElementById("TotalPayments1").value = term ;
	document.getElementById("Payment1").value = Math.ceil(pmt);
	
}
function displayHTML() {
if(navigator.userAgent.indexOf("MSIE") != -1){
    var inf = document.getElementById("printArea").innerHTML;
    win = window.open("this", 'popup', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=0,width=800,height=400,left = 112,top = 84');
    win.document.write("<html><body onload='window.print();'><div id='printA' >");
    win.document.write(inf);
    win.document.write("</div></body></html>");
    win.history.go(0);
}
else
    {
    var price = document.getElementById("Price").value;
    var dnpmt = document.getElementById("DownPayment").value;
    var intRate = document.getElementById("InterestRate").value;
    var term = document.getElementById("Term5").value;
    var url = "calc_popP.asp?loan="+price+"&dp="+dnpmt+"&ir="+intRate+"&yr="+term;
    window.open(url, 'popup', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=500,height=420');
}    
}

function displayHTMLr() {
//if(navigator.userAgent.indexOf("MSIE") != -1){
    var inf = document.getElementById("printArear").innerHTML;
    win = window.open("this", 'popup', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=0,width=800,height=600,left = 112,top = 84');
    win.document.write("<html><body onload='window.print();'><div id='printA' >");
    win.document.write(inf);
    win.document.write("</div></body></html>");
    win.history.go(0);
//}
//else
//    {var url = "cal_popP.aspx?loan="+x;
//    window.open(url, 'popup', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=600');
//}    
}		

function displayHTMLd(x) {
if(navigator.userAgent.indexOf("MSIE") != -1){
    var inf = document.getElementById("printAreaD").innerHTML;
    win = window.open("this", 'popup', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=600');
    win.document.write("<html><head><link href='css/web.css' rel='stylesheet' type='text/css' /></head><body onload='window.print();'><div id='printAreaD' style='font-size:10px;'>");
    win.document.write(inf);
    win.document.write("</div></body></html>");
    win.history.go(0);
    }
else
{var url = "detailzP.aspx?idZ="+x;
window.open(url, 'popup', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=600');

}    


}	

function Kalkulator(x){
	var URL = 'calc_pop.asp?loan='+x;
	day = new Date();
	id = day.getTime();
	window.open(URL, 'hk', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=290,height=320,left = 632,top = 164');
}

function Kalkulator_en(x){
	var URL = 'calc_pop_en.asp?loan='+x;
	day = new Date();
	id = day.getTime();
	window.open(URL, 'hk', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=290,height=320,left = 632,top = 164');
}	

// -->

