﻿var IE = false;
var cookie_set = false;

    if (navigator.appName.substring(0, 1) == "M") {
        IE = true;
    }
    else {
        Net = true;
    }

    function ChkCookie() {

        SetCookie("ctest", "test")
        // if Get_Cookie succeeds, cookies are enabled, since
        //the cookie was successfully created.
        if (GetCookie("ctest")) {
            cookie_set = true;
            DeleteCookie('ctest');
        }
        // if the Get_Cookie test fails, cookies
        //are not enabled for this session.
        else {

            cookie_set = false;
        }
        return cookie_set
;
    }     

function getElementByIdEx(tagName, elType) {

    elements = document.getElementsByTagName(elType);

    for (y = 0; y < elements.length; y++) {
        if (elements[y].id.indexOf(tagName) > -1) {
            return elements[y];

        }

    }

}

function mouseOver(obin) {
    cur = obin.src
    
    //alert(curPage)
    obin.src = cur.replace("/off", "/on")
}

function mouseOut(obin) {


    cur = obin.src

    
    obin.src = cur.replace("/on", "/off")


}

String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g, "");
}

function SetCookie(cook, val) {
    
    document.cookie = cook + "=" + val + " ;expires=Fri, 17 Dec 2020 10:00:00 GMT";
}

function GetCookie(cookieName) {
    cookAr = document.cookie.split(";");
    for (y = 0; y < cookAr.length; y++) {
        curCook = cookAr[y].split("=");
        if (curCook[0].toString().trim() == cookieName.toString().trim()) {
            return (curCook[1])
        }
    }
}

function DeleteCookie(cookieName) {
    document.cookie = cookieName + "='';expires=Fri, 17 Dec 2000 10:00:00 GMT";
}



function ShowPremium(controlIn) {

    
    if (controlIn.checked != true) {

        var test = window.confirm("Maintaining a private recipe store requires Premium Membership.\n Continue to Premium section?")

        if (test) {
            window.location = "premiummembers.aspx"

        }
        else {
            controlIn.checked = true
        }
        
        
    }

}