<!--
// alert ( "\nHello World #1!\n" );
//
// 1) Query Availability function
//
function QueryAvailability ( sku, name ) {
var myname = name.replace ( RegExp(" ", "g"), "+" );
var dest = "http://www.cybercucina.com/cgi-php/CheckAvailability.php3?sku=" + sku + "&name=" + myname;
Child = window.open ( dest, "availability", "resizable=no,toolbar=no,locationbar=no,location=no,menubar=no,scrollbars=yes,width=475,height=550" );
if (Child.opener == null) Child.opener = window;
if (Child.parent == null) Child.parent = window;
Child.opener.name = "creator";
}
//
// 2) Refocus function
//
function refocus() {
focus();
}
//
// 3) Simple Jump To Page function
//
function jumpto ( url ) {
focus();
var myurl = url;
window.location = myurl;
return;
}
//
// 4) Soft Cart Jump To deprecated now to just call Jump To
//
function sc_jumpto ( url ) {
jumpto ( url );
return;
}
//
// 5) SYAS download function
//
function syas() {
var dest='http://www.cybercucina.com/syas/default.htm';
void(window.open(dest,'Shortcut','alwaysRaised=yes,resizable=yes,scrollbars=yes,width=350,height=350,left=100,top=100,screenX=100,screenY=100'));
}
//
// 6) Feature Product Pop Up Windown function
//
function DisplayFeatureProduct ( Aisle ) {
var allcookies = document.cookie;
var pos = allcookies.indexOf ( "featurepopup" );
if  ( pos == -1 ) {
    document.cookie = "featurepopup=" + Aisle + "; path=" + "/";
    var url = "http://www.cybercucina.com/cgi-php/FeatureProduct.php4?Aisle=" + Aisle;
    faceVar = window.open ( url, "feature", "resizable=no,toolbar=no,scrollbars=yes,width=550,height=350" );
    if (faceVar.opener == null) faceVar.opener = window;
    faceVar.opener.name = "creator";
} 
}
//
// 7) GI Sub Pop Up Window function
//
function DisplayGISub () {
var allcookies = document.cookie;
var pos = allcookies.indexOf ( "gisubpopup" );
if  ( pos == -1 ) {
    document.cookie = "gisubpopup=" + "yes" + "; path=" + "/";
    var url = "http://www.cybercucina.com/cgi-php/SolicitGISub.php4";
    faceVar = window.open ( url, "gisub", "resizable=yes,toolbar=no,scrollbars=yes,width=550,height=350" );
    if (faceVar.opener == null) faceVar.opener = window;
    faceVar.opener.name = "creator";
}
}

//
// 8) Common entry function parametrized for aisle name
//
function EnterPage ( myaisle ) {
if ( document.referrer.indexOf("cybercucina.com") == -1 && document.referrer.indexOf("cybersitesearch") == -1) {
   var nextyear = new Date();
   nextyear.setFullYear(nextyear.getFullYear() + 1);
   document.cookie = "referrer=" + document.referrer + "->" + document.URL + ";path=/;expires=" + nextyear.toGMTString();
}
// if  ( location.search.indexOf ( "source=overture" ) >= 0 ) {
//     DisplayFeatureProduct ( myaisle );
// } else if ( location.search.indexOf ( "source=gaws" ) < 0 ) {
//    DisplayGISub ();
//    refocus();
//    DisplayFeatureProduct ( myaisle );
// }
}

//
// 9) Function to emit the mailto: link for the cusomerservice email address
//
function EmitMailtoCS () {

var username = "customerservice";
var hostname = "cybercucina.com";
var linktext = username + "@" + hostname;

// document.write("<A HREF=mail" + "to:" + username + "@" + hostname + ">" + linktext + "</A>");
document.write("<A HREF=\"http://www.cybercucina.com/ccdocs/general/feedback.htm\">Use Our Feedback Form</A>");
}

//
// 10) function emits the drop down list for aisles
//
function EmitAisleList () {

document.write("<SELECT ONCHANGE=\"self.location.pathname = this.options[this.selectedIndex].value;\" SIZE=\"1\" NAME=\"JumpTop\">");
document.write("<OPTION VALUE=\"\">Select Aisle</OPTION>");
document.write("<OPTION VALUE=\"/ccdocs/aisles/Index_Antipasti.htm\">Appetizers</OPTION>");
document.write("<OPTION VALUE=\"/ccdocs/aisles/Index_Aromatherapy.htm\">Aromatherapy/Bath</OPTION>");
document.write("</SELECT>");

}

//
// 11) function URL encodes a multi word product name and writes it into the document

function EmitCrossSellLink ( sku, aisle, name, linktext ) {

var myname = name.replace ( RegExp(" ", "g"), "+" );
var myaisle = aisle.replace ( RegExp(" ", "g"), "+" );

document.write("<A HREF=/cgi-php/CrossSellDisplaySKUs.php?ProductSKU=" + sku + "&Aisle=" + myaisle + "&ProductName=" + myname + ">" + linktext + "</A>");

}

// -->

