function gotoForgotPwd() {
    window.location = '/Forgot-Password.aspx';
}

function gotoReg() {
    window.location = '/Register.aspx';
}

function gotoMyRecipes() {
    window.location = '/MyRecipes';
}

function gotoMyRecipesTab(tab) {
    window.location = '/MyRecipes/Default.aspx?tab=' + tab;
}

function gotoMyRecipesNew() {
    window.location = '/MyRecipes/Default.aspx?new=yes';
}

function closeBox() {
    $.facebox.close();
}

function openWindow(url) {
    window.open(url, "recipe", "resizable=yes,menubar=no,titlebar=no,location=no,status=no,scrollbars=no,width=650,height=500");
}

function openSTF(url) {
    window.open(url, "recipe", "resizable=yes,menubar=no,titlebar=no,location=no,status=no,scrollbars=no,width=600,height=500");
}

function openPrint(url) {
    window.open(url, "recipe", "resizable=yes,menubar=no,titlebar=no,location=no,status=no,scrollbars=yes,width=630,height=600");
}

function showFaq(id){	
    document.getElementById(id+'-small').style.visibility = "hidden";
	document.getElementById(id+'-small').style.display = "none";
	document.getElementById(id).style.visibility = "visible";
	document.getElementById(id).style.display = "block";
}

function hideFaq() {
    for (i = 1; i < 4; i++) {
        document.getElementById('ways-to-spray-' + i).style.visibility = "hidden";
        document.getElementById('ways-to-spray-' + i).style.display = "none";
    }
}

function openButtertons() {
    window.open('/Buttertons.aspx', 'buttertonsvideos', 'scrollbars=no,status=no,width=800,height=497')
}
function openTurnTheTub() {
    window.open('/TurnTheTubAroundCommercial.aspx', 'buttertonsvideos', 'scrollbars=no,status=no,width=800,height=497')
}
function showTip(id) {
    document.getElementById(id + '-small').style.visibility = "hidden";
    document.getElementById(id + '-small').style.display = "none";
    document.getElementById(id).style.visibility = "visible";
    document.getElementById(id).style.display = "block";
}

function hideTips() {
    for (i = 1; i < 15; i++) {
        document.getElementById('tip' + i).style.visibility = "hidden";
        document.getElementById('tip' + i).style.display = "none";
        document.getElementById('tip' + i + '-small').style.visibility = "visible";
        document.getElementById('tip' + i + '-small').style.display = "block";
    }
}
function hideTip(id) {
    document.getElementById(id).style.visibility = "hidden";
    document.getElementById(id).style.display = "none";
    document.getElementById(id + '-small').style.visibility = "visible";
    document.getElementById(id + '-small').style.display = "block";
}


function resetToggle() {
    if (getQueryString()["tip"] != null) {
        var item = getQueryString()["tip"];
        //$("input[id*='hidToggle" + item + "']").val('true');
        hideTips();
        showTip('tip' + item);
        document.location.hash = 'tip' + item;
        
    }

}

function getQueryString() {
    var assoc = new Array();
    var queryString = unescape(location.search.substring(1));
    var keyValues = queryString.split('&');
    for (var i in keyValues) {
        var key = keyValues[i].split('=');
        assoc[key[0]] = key[1];
    }
    return assoc;
}



function showTub() {
    $("#home-tub-wrapper").show();    
}

function showPostTub() {
    $("#home-tub-wrapper").addClass("tub-post-transition").removeClass("tub-transition");
    $("#header-wrapper").hide();
    $("#content-wrapper").hide();
    $("#bigfatbar").hide();
    $("#footer-home-wrapper").css("top", "615px");
    $("#hometubfooter").hide();
    $("#tubfooter-share").show();
}

function openTerms() {
    window.open("{contentURL}{mediaURL}/{doorId}/misc/terms.html", 'icbinb_terms', 'width=500,height=240');
}
function openRules() {
    window.open("/TurnTheTubAround/Official-Rules.aspx", "rules", "resizable=yes,menubar=no,titlebar=no,location=no,status=no,scrollbars=yes,width=957,height=700");
}


function openPrivacy() {
    window.open("http://unileverus.com/privacy/policy.html?site=www.tasteyoulove.com", "privacy", "resizable=yes,menubar=no,titlebar=no,location=no,status=no,scrollbars=yes,width=700,height=600");
}


function openToastReg() {
    window.open("/Own-the-Toast-Registration.aspx", "ownthetoastreg", "resizable=yes,menubar=no,titlebar=no,location=no,status=no,scrollbars=yes,width=955,height=760");
}
function openToastRules() {
    window.open("/Toast-Rules.html", "ownthetoastrules", "resizable=yes,menubar=no,titlebar=no,location=no,status=no,scrollbars=yes,width=600,height=400");
}
function openToastGame() {
    window.open("/Own-the-Toast-Game.aspx", "toastgame", "resizable=yes,menubar=no,titlebar=no,location=no,status=no,scrollbars=no,width=518,height=270");
}
function openOvenGame() {
    window.open("/Oven-Game.aspx", "toastgame", "resizable=yes,menubar=no,titlebar=no,location=no,status=no,scrollbars=no,width=518,height=270");
}

function openGrillGame() {
    window.open("/Spray-and-Grill-Game.aspx", "sprayandgrillgame", "resizable=yes,menubar=no,titlebar=no,location=no,status=no,scrollbars=no,width=675,height=360");
}
function goToRecipes() {
    window.close();
    window.opener.location.href = "http://www.icantbelieveitsnotbutter.com/Recipes/Default.aspx";
}

function goToGrilling() {
    window.close();
    window.opener.location.href = "http://www.icantbelieveitsnotbutter.com/Spray/Default.aspx";
}


function closePopup() {
    window.close();
}
