var t;
var src="show_cart.php";
var ver=0,pe=0.1,e;
var glng='lv';

//function lng(ln){glng=ln;}
function rek(glng){
window.open("rekins_"+glng+".php",null,"height=700,width=750,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
}


function e_ov(e){
ev=e || window.event;
t=ev.srcElement || ev.target;
//t=window.event.srcElement || evt.target;
}
function DoOver2(e){alert("gena");
ev=e || window.event;
evt=ev.srcElement || ev.target;
evt.style.backgroundColor="red";
}


function Ov(e)
{
	ev=e || window.event;
	evt=ev.srcElement || ev.target;
//	if(pe && (pe !=evt))
	{
		evt.style.color="red";
		evt.style.backgroundColor="springgreen";
	}
}
function e_on(a1,a2,a3,a4)
{ 
	msg="";
	if(a3==1)
	{//alert("ggg");
    	obj = document.getElementsByName("ck");
    	tb = document.getElementById("tbl");
		for(i=0; i<obj.length; i++)
		{
			if(obj[i].checked)
			{
				row = obj[i].parentNode.parentNode.rowIndex ;
				msg+=tb.rows[row].cells[0].innerHTML;
				msg+= ";";
			}
		}
		var strPar="new="+msg;
		src="exp/show_cart";
		getVote("exp/show_cart",strPar, "container");
	}
    if(t.className=="ns1")
	{
	    t.innerHTML=a1;
	    t.className ="ns2";
    }else if(t.className=="ns2")
    {
    	t.innerHTML=a2;
    	t.className="ns1";
    }
/*	function t.onmouseup()
	{
		if(a4)
		{
			t.innerText=a2;
			t.className ="ns1";
		}
	}*/
}

function ce()
{
    if(t.className=="ns1"){
		document.getElementById("cont").contentEditable=false;
    }else if(t.className=="ns2"){
		document.getElementById("cont").contentEditable=true;}
}


function createQuery()
{
    var elements = document.getElementById("contact").elements;
    var pairs = new Array();

    for (var i = 0; i < elements.length; i++) {

//        if ((name = elements[i].name) && (value = elements[i].value))
//            pairs.push(name + "=" + encodeURIComponent(value));
	value = elements[i].value;	
	if (!value){value = 0;}
	name = elements[i].name;
        pairs.push(name + "=" + encodeURIComponent(value));
    }
    var txt = pairs.join("&");
    return txt;
}

function sendLog3()
{
src="checkout.php";
getVote("checkout.php","", "container");
}
function sendLog33()
{
src="process.php";
getVote("process.php","", "container");
}

function sendLog10()
{
	var tt = document.getElementById("fiz");
	if(tt.className=="ns1")
	{
	   fizu = "new=1";
    }else 
    {
    	fizu = "new=2";
    }src="checkout.php";
	getVote("checkout.php",fizu, "container");
}

function sendLog15()
{
src="show_cart.php";
	getVote("show_cart.php","aj=1", "container");
}

function sendLog20(){
var strName=document.frm5.name.value;
var strAddress=document.frm5.address.value;
var strCity=document.frm5.city.value;
var strZip=document.frm5.zip.value;
var strCountry=document.frm5.country.value;

var strPar="name="+strName+"&address="+strAddress+"&city="+strCity+"&zip="+strZip+"&country="+strCountry;
src="purchase.php";
getVote("purchase.php",strPar, "container");
}

function fiz(){
var sName=document.frmf.name.value;
var sPcode=document.frmf.pcode.value;
var sEmail=document.frmf.email.value;
var sAddress=document.frmf.address.value;
var sTel=document.frmf.tel.value;
var sFax=document.frmf.fax.value;
var sCom=document.frmf.comment.value;
var strPar="name="+sName+"&pcode="+sPcode+"&email="+sEmail+"&address="+sAddress+ "&tel="+sTel+"&fax="+sFax+"&comment="+sCom;
src="purchase.php";
getVote("purchase.php",strPar, "container");
}

function jur(){
var sFirm=document.frmf.firma.value;
var sTel=document.frmf.tel.value;
var sFax=document.frmf.fax.value;
var sAddr=document.frmf.address.value;
var sJura=document.frmf.juraddr.value;
var sRegnom=document.frmf.regnom.value;
var sName=document.frmf.name.value;
var sEmail=document.frmf.email.value;
var sCom=document.frmf.comment.value;
var strPar="firma="+sFirm+"&tel="+sTel+"&fax="+sFax+"&address="+sAddr+"&juraddr="+sJura+"&regnom="+sRegnom+"&name="+sName+"&email="+sEmail+"&comment="+sCom;
src="purchase.php";
getVote("purchase.php",strPar, "container");
}


function sel(el)
{
	for(var i=0;i<el.options.length;i++)
	{
		if(el.options[i].selected)
		{
			strPar="aj=1&val="+el.options[i].value;
			getVote(src,strPar, "container");
		}
	}
}
function sendLog2()
{
var msg = createQuery();
var strPar="aj=1&save=true&"+msg;
src="show_cart.php";
getVote("show_cart.php",strPar, "container");

}

function flsh(){if(!document.getElementById('d9'))return null;
var d=document.getElementById('d9');
if(d.style.color=='blue')
{d.style.color='red';
}else{d.style.color='blue';}
}
window.setInterval("flsh()",700);
function ow( url ){
var width=screen.width * 0.7;
var height=screen.height * 0.5;
var l=(screen.width - width )/2;
var t=(screen.height - height )/2-50;
window.open( url,"_blank","toolbar=0,menubar=1,scrollbars=yes,resizable=1,left="+l+",top="+t+",width="+width+",height="+height );
}




