﻿
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
var is_English = false;
var is_1024 = (window.screen.width == 1024);
var ClickToSortTxt = 'לחץ למיון';
var waitWin = null;
var is_IE6 = false;
//var IE6 = false/*@cc_on || @_jscript_version < 5.7@*/;
var carSearchResultsDiv = null;

//alert(is_IE6)
window.scrollTo(0,0)

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
    var ieversion = new Number(RegExp.$1) // capture x.x portion and store as a number
    if (ieversion >= 8) {
        //document.write("You're using IE8 or above")
    }
    else if (ieversion >= 7) {
        //document.write("You're using IE7.x")
    }
    else if (ieversion >= 6) {
        //document.write("You're using IE6.x")
        is_IE6 = true;
    }
    else if (ieversion >= 5) {
        //document.write("You're using IE5.x")
    }
}


function pageX(elem) {
    // See if we're at the root element, or not
    return elem.offsetParent ?
    // If we can still go up, add the current offset and recurse upwards
    elem.offsetLeft + pageX(elem.offsetParent) :
        // Otherwise, just get the current offset
    elem.offsetLeft;
}

// Find the Y (Vertical, Top) position of an element
function pageY(elem) {
    //debugger
    //alert(elem.offsetParent)
    //alert(elem.offsetTop)
    
    // See if we're at the root element, or not
    return elem.offsetParent ?
    // If we can still go up, add the current offset and recurse upwards
elem.offsetTop + pageY(elem.offsetParent) :
    // Otherwise, just get the current offset
elem.offsetTop;
}

function getEventObj(e) {
    return e || window.event;
}

function getEventTarget(e) {
    var e = getEventObj(e);
    return e.target || e.srcElement;
}

function getInternetExplorerVersion() {    
    var rv = -1;
    // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    
    return rv;
}

function trim(stringToTrim) {
    return stringToTrim.replace(/^\s+|\s+$/g, "");
}

//function ShowWaitingImage() {
//    $get('divWait').style.display = "block";
//    //waitWin = window.open('http://localhost/hertznew/pages/Wait.aspx', 'wait', 'left=450,top=450,width=70,height=160,toolbar=0,resizable=0,scrollbars=0');
//    //window.open("");
//}

function CloseWaitingImage() {
    if (waitWin) {
        waitWin.close();
    }
}
