// v 13/12/2010 : u/dCount, fix scroll
function FixAX(strSRC, w, h, fid) {
    var obid;
    if (fid != null && fid != '')
        obid = fid;
    else
        obid = "detectme"
    document.write("<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=\"" + w + "\" HEIGHT=\"" + h + "\" id=\"" + obid + "\">")
    document.write("<PARAM NAME=\"movie\" VALUE=\"" + strSRC)
    document.write("\"><PARAM NAME\"=quality\" VALUE=\"high\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"menu\" value=\"false\" />")
    document.write("<EMBED src=\"" + strSRC + "\" wmode=\"transparent\" WIDTH=\"" + w + "\" HEIGHT=\"" + h + "\" NAME=\"" + obid + "\" ID=\"" + obid + "\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\" transparent=\"true\"></EMBED>")
    document.write("</OBJECT>")
}
function showPic(pic)
{
    document.getElementById("ShowPic").src = "images/" + pic;
}
function ScroolObj(obj)
{
    var scroolTo;
    scroolTo = document.documentElement.scrollTop;
    if(scroolTo == null || scroolTo == 0 || scroolTo == '')
        scroolTo = document.body.scrollTop;
    document.getElementById(obj).style.marginTop = scroolTo;
    document.getElementById(obj).setAttribute("style", "margin-top:" + scroolTo + "px");
}
function showHide(obj)
{
    //  if(document.getElementById(obj) == 'undefind' || document.getElementById(obj) == null)
    //      return;
    if(document.getElementById(obj).style.display == 'none')
        document.getElementById(obj).style.display = 'block'
    else
        document.getElementById(obj).style.display = 'none'
}
function track(page, action, restaurant) {
    if (typeof (pageTracker) != "undefined")
        pageTracker._trackEvent(page, action, restaurant);
}
// fade efect 09/08/2010 by Barak / 2eat.co.il // checked on ie 6/7/8, FF 3.5, opera, chrome
var elm; var FdCnt; var ival; var onId; var elmName;
function startFade(ElmName) {
    elmName = ElmName;
    elm = document.getElementsByName(ElmName);
    if (elm.length == 0)
        return;
    if (FdCnt == null) {
        FdCnt = 0; onId = 0;
    }
    if (FdCnt < 100) {
        ival = setTimeout(upGo, 35);
    }
    else {
        ival = setTimeout(dnGo, 5);
    }
}
function upGo() {
    FdCnt = FdCnt + 1;
    elm[onId].style.zIndex = 100;
    if (FdCnt > 100) {
        startFade(elmName);
    }
    else {
        elm[onId].style.filter = 'alpha(opacity = ' + FdCnt + ')';
        elm[onId].style.opacity = (FdCnt / 100);
        ival = setTimeout(upGo, 35);
    }
}
function dnGo() {
    FdCnt = FdCnt - 1;
    if (FdCnt < 1) {
        if (onId < (elm.length - 1)) {
            onId = onId + 1;
            elm[onId].style.zIndex = -10;
            //elm[onId].style.display = 'none';
        }
        else
            onId = 0;
        startFade(elmName);
    }
    else {
        elm[onId].style.filter = 'alpha(opacity = ' + FdCnt + ')';
        elm[onId].style.opacity = (FdCnt / 100);
        if (elm.length > 1)
            ival = setTimeout(dnGo, 5);
    }
}
function stopFade() {
    clearInterval(ival);
    onRun = false;
}
/* updown counter */
function UpCount(obj) {
    //alert(document.getElementById(obj).value);
    var num = (document.getElementById(obj).value);
    document.getElementById(obj).value = Number(num) + 1;
}
function DownCount(obj) {
    //alert("down");
    var num = (document.getElementById(obj).value);
    if (Number(num) > 0)
        document.getElementById(obj).value = Number(num) - 1;
}
function IsNumber(obj) {
    var num = (obj.value);
    if (!Number(num) || num.indexOf(".") > -1) {
        alert("אנא הכנס מספר שלם בלבד");
        num = obj.value.substring(0, num.indexOf("."));
        obj.value = num;
    }
}
