function popuptopicwh(title,topic,w,h,scrollbars) {
	window.open('popup.aspx?title=' + title + '&topic=' + topic,'Popup441','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=no,copyhistory=no,width=' + w + ',height=' + h + ',left=0,top=0');
	return (true);
}
	
function goToUrl(url) {
    if (url != "0") {
        location.href = "/" + url;
    }
}

function confirmTC(){
	var chk1 = document.getElementById("chkTC1"); 
	var chk2 = document.getElementById("chkTC2"); 

	if(!chk1.checked && !chk2.checked){
		alert("Please accept the Terms and Conditions in the checkbox before placing your order.");
		return false;
	}

	return true;
}

function setAvailability(nVariantID,opt) {
    var sColor = opt.value;
    sColor = opt.value.replace(/,/, "");
    if (sColor != "Color" && sColor != "-,-" && sColor != "--") {
        var sSpnName = "spnAvailability" + nVariantID;
        var spn = document.getElementById(sSpnName);
        var sInvName = "spnInv" + nVariantID + sColor;
        var spnA = document.getElementById(sInvName);
        
        if (spnA != null) {
            spn.innerHTML = spnA.innerHTML;
        }
    }
}

function showHideRegistrySettings() {
    var div = document.getElementById("divRegistrySettings");
    var div2 = document.getElementById("divGiftRegSettingsBox");
    
    var spn = document.getElementById("spnShowHide");
    if (div.style.display == "none") {
        div.style.display="";
        div2.style.display="";
        spn.innerHTML = "Hide Gift Registry Settings";
    }
    else {
        div.style.display="none";
        div2.style.display="none";        
        spn.innerHTML = "Create/Edit your Gift Registry Settings";                
    }
}

