﻿function CreateBookmarkLink() {
    title = "BHOL"
    url = "http://www.bhol.co.il"
    if (window.sidebar) {
        window.sidebar.addPanel(title, url, "")
    } else if (window.external) {
        window.external.AddFavorite(url, title)
    }
    else if (window.opera && window.print) {
        return true
    } 
}
function setHomepage() {
    if (document.all) {
        document.body.style.behavior = 'url(#default#homepage)'
        document.body.setHomePage('http://www.bhol.co.il')
    }
    else if (window.sidebar) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
            }
            catch (e) {
                alert("this action was aviod by your browser，if you want to enable，please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true")
            } 
        }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch)
        prefs.setCharPref('browser.startup.homepage', 'http://www.bhol.co.il')
    } 
}
function hide_login() {
//    if (subcookiejar.fetch('HydeUser_Ver01', 'Member_ID')) {
//        $('#menu1_nLogin').css("display", "none")
//        $('#menu1_yLogin').css("display", "inline")
//        var mname = subcookiejar.fetch('HydeUser_Ver01', 'Name') + " !"
//        $('#menu1_uname').text(mname)
    //} 
}
function getURL(uri) {
    uri.dir = location.href.substring(0, location.href.lastIndexOf('\/'))
    uri.dom = uri.dir; if (uri.dom.substr(0, 7) == 'http:\/\/') uri.dom = uri.dom.substr(7)
    uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) { uri.path = uri.dom.substr(pos + 1); uri.dom = uri.dom.substr(0, pos); }
    uri.page = location.href.substring(uri.dir.length + 1, location.href.length + 1)
    pos = uri.page.indexOf('?'); if (pos > -1) { uri.page = uri.page.substring(0, pos); }
    pos = uri.page.indexOf('#'); if (pos > -1) { uri.page = uri.page.substring(0, pos); }
    uri.ext = ''; pos = uri.page.indexOf('.'); if (pos > -1) { uri.ext = uri.page.substring(pos + 1); uri.page = uri.page.substr(0, pos); }
    uri.file = uri.page
    if (uri.ext != '') uri.file += '.' + uri.ext
    if (uri.file == '') uri.page = 'index'
    uri.args = location.search.substr(1).split("?")
    return uri
}
function cahngeDivClassCss(divId,allDivId)
{
    $("div[id^='"+allDivId+"']").removeClass("selected");
    $("#"+divId).addClass("selected");
} 
var uri = new Object()
getURL(uri)
function cancelOncontextmenu()
{
//   var selectors = $("img");

//    $.each(selectors, function(i) {
//     $(selectors[i]).attr("onContextMenu", "javascript:return false;");
//        return true;    
//      });

}
function KuponsClick(sKid,sBid,iClickPlaceKupon) {
   
	//var params = String.prototype.format('{ sKid:"{0}", sBid:"{1}", iClickPlaceKupon:"{2}" }', sKid, sBid, 1)
        $.ajax({
            type: "POST",
            url: "KuponsClick.ashx?sKid="+sKid+"&sBid="+sBid+"&iClickPlaceKupon="+iClickPlaceKupon,
            //data: params,
            dataType: "json",
            success: function(msg, status) {
               
            },
            error: function(xhr, msg, e) {
                //alert(msg)
            }
        })
    }
   var reloadTimer = null;
 var sURL = unescape(window.location.pathname);
 
 function setReloadTime(secs) 
 { //this function is used to refresh the broswer
    if (arguments.length == 1) 
    { //if some seconds are passed in then create and set the timer and 
      //have it call this function again with no seconds passed in
        if (reloadTimer) clearTimeout(reloadTimer);
        reloadTimer = setTimeout("setReloadTime()", 
                         Math.ceil(parseFloat(secs) * 1000));
    }
    else 
    { //No seconds were passed in the timer must be up clear the timer 
     //and refresh the browser
        reloadTimer = null;
        //passing true causes the request to go back to the web server
        // false refreshs the page from history
        //This is javascript 1.2
        location.reload(true);
        //This is javascript 1.1
        window.location.replace( sURL );
    }
 }

    

