
     function new_win(adrese, w, h)
{
        width=screen.width;
        height=screen.height;
        l=(width-w)/2;
        t=(height-h)/2-50;

  window.open(adrese, "_blank", "toolbar=no, location=no, left="+l+", top="+t+", directories=no, status=no, menubar=no, scrollbars=yes, resizable=1, fullscreen=no, width="+w+", height="+h);
}


/*function screenwidth() {

	var height, width;

      if (document.all)
    height = document.body.offsetHeight;
	width =document.body.offsetWidth;
   else if (document.layers)
   height = window.innerHeight; width = window.innerWidth;

   load=document.getElementById("bodytable");
   load.style.width=width;
}*/


  function add_amount(cat,i) {

  	var amount = document.getElementsByName("amount[]");
  	var prices = document.getElementsByName("prices[]");
  	var pricesall = document.getElementsByName("pricesall[]");

  	var t = document.getElementById("totalprice");
	var c = document.getElementById("pricebusket");
	var r = document.getElementById("radiolizing");

    var amountcount = amount.length;
    var decimals = 2;
     var mytotal = 0;
     var countprice = 0;

    	 if(cat==1) {
 amount[i].value = (eval(amount[i].value)+1);
  } else if(cat==2) {
  	if(amount[i].value>1)
 amount[i].value = (eval(amount[i].value)-1);
  } else {
  	amount[i].value = eval(amount[i].value);
  }

   	var total = (pricesall[i].value * amount[i].value) * Math.pow(10, decimals);
    prices[i].innerText = Math.round(total) / Math.pow(10, decimals);

    for(n=0; n<amountcount; n++) {

    var totalall = (pricesall[n].value * amount[n].value) * Math.pow(10, decimals);
    mytotal = mytotal+totalall;
    countprice = countprice+eval(amount[n].value);
    }

     if((Math.round(mytotal) / Math.pow(10, decimals))>50) {
    	r.disabled = false;

    } else {
    	r.disabled = true;
    }

   c.innerHTML = countprice;
t.innerHTML = Math.round(mytotal) / Math.pow(10, decimals);
document.order.totalpr.value = Math.round(mytotal) / Math.pow(10, decimals);

  }

/*
  function count_total() {
  	var amount = document.getElementsByName("amount[]");
  	var prices = document.getElementsByName("prices[]");
  	var pricesall = document.getElementsByName("pricesall[]");

  	var t = document.getElementById("totalprice");
  	var t2 = document.getElementById("totalpr");
    var amountcount = amount.length;
    var decimals = 2;
     var mytotal = 0;

	 for(n=0; n<amountcount; n++) {

    var totalall = (pricesall[n].value * amount[n].value) * Math.pow(10, decimals);
    prices[n].innerText = Math.round(totalall) / Math.pow(10, decimals);
    mytotal = mytotal+totalall;
    }

t.innerHTML = Math.round(mytotal) / Math.pow(10, decimals);
//t2.innerHTML = Math.round(mytotal) / Math.pow(10, decimals);

  }*/


    function close_block (id)
{
e=document.getElementById (id);

if (e.style.display == 'table')
e.style.display="none";
}

    function opener(id,count)
{
	for(n=0; n<count; n++) {
			var name = eval("photo"+n);

		//n=document.getElementById (name);
		// alert(n);
		if (name.style.display == 'inline')
			name.style.display="none";

	}

e=document.getElementById (id);

if (e.style.display == 'none')
e.style.display="inline";
}



	<!--
var company = new Array();

	//GEMONEY
company[4] = new Array();
    company[4]['rate']      = 1.12;
    company[4]['comission'] = 0;
    company[4]['type'] = 1;
    company[4]['service']   = 0;

    //HANSA
company[1] = new Array();
    company[1]['rate']      = 0.28;
    company[1]['comission'] = 0;
    company[1]['type'] = 0;
    company[1]['service']   = 0;

    //INSERVISS
company[2] = new Array();
    company[2]['rate']      = 1.18;
    company[2]['comission'] = 0;
    company[2]['type'] = 2;
    company[2]['service']   = 0;

    //LATEKO
company[3] = new Array();
    company[3]['rate']      = 0.255;
    company[3]['comission'] = 0;
    company[3]['type'] = 1;
    company[3]['service']   = 0.90;

        //NELSS
company[4] = new Array();
    company[4]['rate']      = 0.255;
    company[4]['comission'] = 0;
    company[4]['type'] = 1;
    company[4]['service']   = 0.90;



function calcLeasing(){

	var lizing = document.getElementById("kompany");
	var price = document.getElementById("totalpr");
	var first = document.getElementById("first");
	var menesi = document.getElementById("term");

if (company[lizing.value]['type']==0)
{

	pirmaiemaksa.innerText=Math.round((price.value*first.value/100 + price.value*company[lizing.value]['service']*1.21)*100)/100;

 /*menesamaksa.innerText=Math.round(( (price.value-price.value*first.value/100)* + price.value*company[lizing.value]['service']*1.18))/12 +((1-(1/Math.pow((1+(company[lizing.value]['rate']/12)),menesi.value)))))*100)/100;*/

  menesamaksa.innerText=Math.round(( (price.value-price.value*first.value/100)*(company[lizing.value]['rate']/12)/(1-(1/Math.pow((1+(company[lizing.value]['rate']/12)),menesi.value))) )*100)/100;


}
else
if (company[lizing.value]['type']==1)
{
 pirmaiemaksa.innerText=Math.round(price.value*first.value/100*100)/100;

 menesamaksa.innerText=Math.round(( (price.value-(price.value/100*first.value))/100*company[lizing.value]['rate']+price.value/100*company[lizing.value]['service']+((price.value-(price.value/100*first.value))/menesi.value) )*100)/100;


}
else
{
 pirmaiemaksa.innerText=Math.round(((price.value/100)*(parseInt(company[lizing.value]['comission'])+parseInt(first.value)))*100)/100;

menesamaksa.innerText=Math.round((((price.value-((price.value/100)*(first.value)))/100)*(company[lizing.value]['rate'])+((price.value-((price.value/100)*(first.value)))/(menesi.value))+(company[lizing.value]['service']))*100)/100;


};

};
//-->


function piegade() {

	var p = document.getElementById("dropsel");
	var f = document.getElementById("padress");
	var r = document.getElementById("radiolizing");
	var t = document.getElementById("totalpr");

	if(p.value=="-1") {
		f.disabled = false;
		f.value = "";
	} else if(p.value=="-2") {
		f.disabled = false;
		f.value = "Riga, Vagonu 17";

	} else {
		f.value = "";
		f.disabled = true;
	}

	 if(t.value>34) {
    	r.disabled = false;

    } else {
    	r.disabled = true;
    }

}




function swith_pay(type)
{
s=document.getElementById("skaidra");
p=document.getElementById("parskaitijums");
l=document.getElementById("lizings");

ffs1=document.getElementById("skaidr1");
ffs2=document.getElementById("skaidr2");

ffp1=document.getElementById("parsk1");
ffp2=document.getElementById("parsk2");

ffl1=document.getElementById("lizing1");
ffl2=document.getElementById("lizing2");

if(type==2) {

	p.style.display="inline";
	s.style.display="none";
	l.style.display="none";
	ffp1.disabled = false;
	ffp2.disabled = false;

	ffs1.disabled = true;
	ffs2.disabled = true;

	ffl1.disabled = true;
	ffl2.disabled = true;

} else if(type==3) {
	p.style.display="none";
	s.style.display="none";
	l.style.display="inline";

	ffl1.disabled = false;
	ffl2.disabled = false;

	ffp1.disabled = true;
	ffp2.disabled = true;

	ffs1.disabled = true;
	ffs2.disabled = true;

} else {
	p.style.display="none";
	s.style.display="inline";
	l.style.display="none";

	ffs1.disabled = false;
	ffs2.disabled = false;

	ffl1.disabled = true;
	ffl2.disabled = true;

	ffp1.disabled = true;
	ffp2.disabled = true;
	}

}

/*
function open_block(pay,persona)
{

	if(persona[0].checked) {

	f=document.getElementById("fizich");
	if (f.style.display == "none")
	f.style.display="inline";

	g=document.getElementById("jurid");
	if (g.style.display == "inline")
	g.style.display="none";

	if(pay==2) {

	e=document.getElementById("show");
	a=document.getElementById("show1");
	if (e.style.display == "none")
e.style.display="inline";

if (a.style.display == "inline")
a.style.display="none";

	} else if(pay==3) {

	e=document.getElementById("show1");
	a=document.getElementById("show");
	if (e.style.display == "none")
e.style.display="inline";

if (a.style.display == "inline")
a.style.display="none";

	} else {
	k=document.getElementById("show1");
	c=document.getElementById("show");
	k.style.display="none";
	c.style.display="none";
	}
	} else if(order.persona[1].checked)  {
	g=document.getElementById("jurid");
	if (g.style.display == "none")
	g.style.display="inline";

	k=document.getElementById("fizich");
	if (g.style.display == "inline")
	k.style.display="none";

		k=document.getElementById("show1");
	c=document.getElementById("show");
	k.style.display="none";
	c.style.display="none";

	}


}*/


function ImageOver(url) {

document.prodphoto.src=url;

}



/*function LizCount(summa, menesi, first) {


var summa;
var menesi;
var first;
var iemaksa;
var menesinauda;

			var perc = eval(1.042);
			var perc2 = eval(1.052);


iemaksa = ((summa*first)/100);
menesinauda = (((summa-iemaksa)/menesi)*perc)*Math.pow(10, 2);

menesinauda2 = (((summa-iemaksa)/menesi)*perc2)*Math.pow(10, 2);

pirmaiemaksa1.innerText = iemaksa;
pirmaiemaksa2.innerText = iemaksa;
menesamaksa1.innerText = Math.round(menesinauda,2)/Math.pow(10, 2);
menesamaksa2.innerText = Math.round(menesinauda2,2)/Math.pow(10, 2);
    }   */


 function show(key,name) {

		var menu = eval(name+key);

if (menu.style.display == "none")
	menu.style.display="inline";

 }

  function hide(key,name) {

		var menu = eval(name+key);


if (menu.style.display == "inline")
	menu.style.display="none";

 }

      function openWinCentered(loc, winname, widthh, heightt, params)
                   {
                        tp = Math.ceil((screen.height-heightt) / 2);
                        lf = Math.ceil((screen.width-widthh) / 2);
                        if (params.length > 0)
                             params = "," + params;

                        var win = window.open(loc, winname, "width=" + widthh + ", height=" + heightt + ", top=" + tp + ", left=" + lf + params);
                        win.focus();

                        return win;
                   }
