window.addEvent('domready', function() {
 
    /**
     * That CSS selector will find all <a> elements with the
     * attribute rel="boxed"      * and href starting with a #.
     *
     * The second argument sets additional options
     */
   
    SqueezeBox.assign($$('a[rel=boxed][href^=#]'), {
        size: {x: 600, y: 600}
    });
});
function changePicOn(cnt)
{
    x=document.getElementById("menu_pic"+cnt);
    x.src="/images/li-on-"+cnt+".gif";
}
function changePicOff(cnt)
{
    x=document.getElementById("menu_pic"+cnt);
    x.src="/images/li-off-"+cnt+".gif";
}
function changeMidOn(id)
{
    for (i=1; i<4; i++)
    {
     document.getElementById("mid"+i).className="not_cur";
     document.getElementById("mid"+i+"1").style.display="none";
    }
    x=document.getElementById(id);
    y=document.getElementById(id+"1");
    x.className="current"
	y.style.display="block"
	var myEffect = new Fx.Morph(y, {duration: '1000'});
	myEffect.start({
	'opacity': [0, 1]
		});
}
function cleanField(id)
{
    document.getElementById(id).value="";
}
function changeField(id)
{
    document.getElementById(id).value="";
    document.getElementById(id).type="password";
}
function changeField2(id)
{
    if (document.getElementById(id).type!="password")
        document.getElementById(id).type="password";     
}
function changeTd(name1, name2, name3, val1, val2, val3, date)
{
 
    document.getElementById("td1").innerHTML="<font color='#c5242c'>"+name1+":&nbsp;&nbsp;</font>";
    document.getElementById("td3").innerHTML="<font color='#406b3d'>"+name2+":&nbsp;&nbsp; ";
    document.getElementById("td5").innerHTML="<font color='#de862e'>"+name3+":&nbsp;&nbsp; ";
    document.getElementById("td2").innerHTML="<font color='#c5242c'>"+val1+"</font>";
    document.getElementById("td4").innerHTML="<font color='#406b3d'>"+val2+"</font>";
    document.getElementById("td6").innerHTML="<font color='#de862e'>"+val3+"</font>";
    document.getElementById("dateTd").innerHTML=date;
}
function checkDate()
{
    from=document.getElementById("from");
    to=document.getElementById("to");
  
    if (to.value<=from.value)
    {
        alert ('אי אפשר לבחור "עד" יותר מאוחר או זהה ל- "מ"');
    }
    else
    {
        flag=true;
        file='uploads/xml/kupot'+to.value+".xml";
      //  alert (file);
        var myRequest = new Request({url: file,
            async:false,
            onFailure:function(){
                alert("עדיין אין דיווח על תתאריכים האלו");
                flag=false;
            }
        });
        addEvent('error' , function(){
            alert("404");
        });
        myRequest.send();
        if (flag)
        {
            url="/index.php?page=compr&from="+from.value+"&to="+to.value;
            document.getElementById("no_bord").href=url;
         }
    }
}

