
// Function's for item detail page

// variables are globaly decleared here 

var url = "";
var lItemId ;
var lShoeName ;
var lCategoryId ;
var lColorId ;
var lColorTitle ;
var lSizeId = "";
var lSizeHas = "0";
var lWidthId ;
var lWidthNameId = "" ;
var colorTitle = "";
var categoryID = "";
var salePrice ;
var colorCount ;
var sizeCount ;
var widthCount ;
var shoeColorId="";
var shoeAngle=6;
var shoeImageDownload=false;
var lUniquePINValue;
var verdorPIN;
var shoename;
var price = "";
var brandName;
var ItemTypeId; 
var ConstantsITEMTYPE_SHOEintValue ;
var ConstantsITEMTYPE_HANDBAGintValue ;
var ConstantsITEMTYPE_NEWSALEintValue ;
var lOnlyOneWidth;
var ItemOutOfStock = false;
var itemQty;
var freeGiftShoe;
var ImagePathForBrand;
var lFlagForSizeAvaialable = "0";

var shoeArray = new Array(colorCount);
var ShoecolorArray = new Array(colorCount);
var colorTextArray = new Array(colorCount);
var SaleArray = new Array(colorCount);
var ColorArrayForSize = new Array(colorCount);
//to check the colorarry


function setTheValueOfGlobalVariable(VariableName,VariableValue) {
   if (VariableName == "url") {
      url = VariableValue;
   } else if (VariableName == "lItemId") {
      lItemId = VariableValue;
   } else if (VariableName == "lColorId") {
      lColorId = VariableValue;
   } else if (VariableName == "lUniquePINValue") {
      lUniquePINValue = VariableValue;
   } else if (VariableName == "categoryID") {
       categoryID = VariableValue; 
   } else if (VariableName == "salePrice") {
      salePrice = VariableValue;
   } else if (VariableName == "ItemTypeId") {
      ItemTypeId = VariableValue;
   } else if (VariableName == "ConstantsITEMTYPE_SHOEintValue") {
      ConstantsITEMTYPE_SHOEintValue = VariableValue;
   } else if (VariableName == "ConstantsITEMTYPE_HANDBAGintValue") {
      ConstantsITEMTYPE_HANDBAGintValue = VariableValue;
   } else if (VariableName == "ConstantsITEMTYPE_NEWSALEintValue") {
      ConstantsITEMTYPE_NEWSALEintValue = VariableValue;
   } else if (VariableName == "shoeImageDownload") {
      shoeImageDownload = VariableValue;
   } else if (VariableName == "shoeColorId") {
      shoeColorId = VariableValue;
   } else if (VariableName == "colorTitle") {   
      lColorTitle = VariableValue;
   } else if (VariableName == "shoeAngle") {
      shoeAngle = VariableValue;
   } else if (VariableName == "verdorPIN") {
      verdorPIN = VariableValue;
   } else if (VariableName == "shoename") {
      shoename = VariableValue;
   } else if (VariableName == "price") {
      price = VariableValue;
   } else if (VariableName == "brandName") {
      brandName = VariableValue;
   } else if (VariableName == "lOnlyOneWidth") {
      lOnlyOneWidth = VariableValue;
   } else if (VariableName == "colorCount") {
      colorCount = VariableValue;
   } else if (VariableName == "sizeCount") {
      sizeCount = VariableValue;
   } else if (VariableName == "widthCount") {
      widthCount = VariableValue;
   } else if (VariableName == "shoeArray") {
      shoeArray = VariableValue;
   } else if (VariableName == "ItemOutOfStock") {
       ItemOutOfStock = VariableValue;
   } else if (VariableName == "colorArray") {
      ShoecolorArray = VariableValue;
   } else if (VariableName == "colorTextArray") {
      colorTextArray = VariableValue;
   } else if (VariableName == "saleArray") {
      SaleArray = VariableValue;
   } else if (VariableName == "itemQty") {
      itemQty = VariableValue;
   } else if (VariableName == "freeGiftShoe") {
      freeGiftShoe = VariableValue;
   } else if (VariableName == "ImagePathForBrand") {
      ImagePathForBrand = VariableValue;      
   } else if (VariableName == "lPreSize") {
      lSizeId = VariableValue;      
   } else if (VariableName == "lSizeHas") {
      lSizeHas = VariableValue;      
   } else if (VariableName == "ColorArrayForSize") {
      ColorArrayForSize = VariableValue;      
   } 
}


// for shoe chart popup
function showSizingChart() {
   window.open (url+"/pages/sizechartpop.jsp", 'SizeChart', 'height=380, width=585, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
}
// for sendAFriend popup
function sendToAFriend() {
   sendtofriendwindow = window.open(url+"/sendToFriend.do?method=input&itemID="+lItemId+"&colorID="+lColorId+"&ItemTypeId="+ItemTypeId,'sendafriend','height=538,width=573,scrollbars=1');
   sendtofriendwindow.focus();
}
//for url itemid value
function addReview() {
   window.open (url+"/pages/adduserreview.jsp?itemId="+lItemId+"&uniquepin="+lUniquePINValue, 'UserReview', 'height=400, width=600, top=100, left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
}

function showShoePopup(offset){
   if (ItemTypeId == ConstantsITEMTYPE_SHOEintValue || ItemTypeId == ConstantsITEMTYPE_NEWSALEintValue || ItemTypeId == ConstantsITEMTYPE_HANDBAGintValue) {
      if( false == shoeImageDownload || null == lColorId || "" == lColorId) return;
//      window.open(url+'popup_image.php?itemid='+ lItemId +'&shoename='+ shoename +'&price='+ price +'&shoeimage=' + eval("document.shoebigpics" + lColorId + "[" + (parseInt(shoeAngle) + parseInt(offset)) + "]"),'_blank','height=532, width=566, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');  //url+'itempopdetail.jsp?
	window.open(url+'popup_image.php?pID='+ lItemId +'&colorid=' + lColorId + '&verdorPIN='+ verdorPIN +'&shoename='+ shoename +'&brandname='+ brandName +'&price='+ price +'&shoeimage=' + eval("document.shoebigpics" + lColorId + "[" + (parseInt(shoeAngle) + parseInt(offset)) + "]"),'_blank','height=550, width=566, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');  //itempopdetail.php popup_image.php
   }
}

//to re set cursor.............
function resetCursor(Angle) {
     //document.body.style.cursor='normal';
   document.getElementById("ThumbNail_"+Angle+"0").style.display='block';
   document.getElementById("ThumbNail_"+Angle+"1").style.display='none';
}
 //changing the shoe angle
function changeShoeAngle(whichShot){
   if(false==shoeImageDownload) return;
   shoeAngle=whichShot;
   setTheValueOfGlobalVariable('shoeAngle',shoeAngle);
   swapShoePicColor();
}

// to bold product title
function changeThumb(Angle) {
    document.getElementById("ThumbNail_"+Angle+"0").style.display='none';
    document.getElementById("ThumbNail_"+Angle+"1").style.display='block';
}

//for shoe piccolor popup
function swapShoePicColor() {
   // new img src = images/shoes/${vendorPIN}/${shoePIN}/web/320x240/${whichShot}_320x240.jpg
   // or perhaps we will build some hash-tables at load time, and read from them. Yes, I like that idea- easier pre-loading................................
   if(document.images) {
      //if( null == shoeColorId || "" == shoeColorId ) return;
      if (null == lColorId || "" == lColorId) {
         return;
      }
      document.getElementById("showshoe").src = eval("document.shoebigpics" + lColorId + "[" + shoeAngle + "].src");
      document.getElementById("upper").src = eval("document.shoebigpics" + lColorId + "[7].src");
      document.getElementById("toe").src = eval("document.shoebigpics" + lColorId + "[8].src");
      document.getElementById("outstep").src = eval("document.shoebigpics" + lColorId + "[9].src");
      document.getElementById("instep").src = eval("document.shoebigpics" + lColorId + "[10].src");
      if (ItemTypeId == ConstantsITEMTYPE_SHOEintValue) {
         document.getElementById("sole").src = eval("document.shoebigpics" + lColorId + "[11].src");
         document.getElementById("heel").src = eval("document.shoebigpics" + lColorId + "[12].src");
           //document.getElementById("runWayShoes").style.display = 'block';
      }
   }
}

function changeThingsByColor(colorId){
   document.getElementById("thinTopmostBar_common").style.display= 'block';
   try{
      document.getElementById("runWayShoes_common").style.display= 'block';
   } catch(e){
    
   } 
   document.getElementById("thinTopmostBar_special").style.display= 'none';
   try{
      document.getElementById("runWayShoes_special").style.display= 'none';
   } catch(e){
    
   }
}

// this function is being written for the item out of stock 
function changeSizesByColorWhenOutOfStock(colorId) {
   document.getElementById("SizeWidthBagDiv_1").style.display='none'; 
   document.getElementById("SizeWidthBagDiv_2").style.display='block';
   shoeColorId = colorId;
   setTheValueOfGlobalVariable('shoeColorId',colorId);
}



//for preselected popup
function ifColorPreSelected(colorid) {
   setTheValueOfGlobalVariable('shoeColorId',colorid);
   alert("ifColorPreSelected");
   if (ItemOutOfStock == 'false') {
      changeSizesByColor(colorid);
   }
}


//for opening sizealert
function sizealert() {
   
   //sendtofriendwindow = window.open(url+"/notifyme.do?method=initialize&shoeId="+lItemId+"&colorId="+lColorId+"&widthId=1", 'NotifyMe', 'height=475, width=583, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
   //sendtofriendwindow.focus();

   window.open (url+'/notifyme.do?method=initialize&shoeId='+ lItemId +'&widthId=1&colorId=' + lColorId, 'NotifyMe', 'height=475, width=583, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
   document.getElementById('sizeDiv'+lColorId).style.display='none';
   document.getElementById("sizeval").innerHTML = "select";
   document.getElementById("leftArrowforSize").src = url + "/images/leftarrowred.gif";
}

// Function for putting sale price dyanamically corresponding to color title.
function setSalePriceRespectToColor() {
   price = SaleArray[lColorId];
   deleteSalePrice();
   
alert("Price = "+price);   

   if (price <= 0 || price == null) {
      document.getElementById('retailprice').className = "RetailPrice";
   } else {
      document.getElementById('retailprice').className = "RetailPriceStrikeThrough";
      document.getElementById('salepriceText').style.display='block';
      document.getElementById('saleprice').style.display='block';
      document.getElementById('salepriceText').innerHTML = "sale";
      document.getElementById('saleprice').innerHTML = "$"+price;
   }
}

function deleteSalePrice() {
   document.getElementById('salepriceText').innerHTML = "";
   document.getElementById('saleprice').innerHTML = "";
}

var flagForColor = 1;
function showColorList() {
   if (flagForColor == 1) {
      flagForColor = 2;
      document.getElementById('colorDiv').style.display='block';
      document.getElementById("shoecolor").style.color = "#000000";
      document.getElementById("shoecolorval").innerHTML = "select";
      document.getElementById("shoecolorval").style.color = "#CCCCCC";
      document.getElementById("leftarrow").src = url + "/images/downarrowred.gif";
   } else {
      flagForColor = 1;
      document.getElementById('colorDiv').style.display='none';
      document.getElementById("shoecolor").style.color = "#666666";
      if (colorTitle != "") {
         document.getElementById("shoecolorval").innerHTML = colorTitle;
      } else {
         document.getElementById("shoecolorval").innerHTML = lColorTitle;
      }
      //document.getElementById("shoecolorval").innerHTML = "select";
      document.getElementById("shoecolorval").style.color = "#000000";
      document.getElementById("leftarrow").src = url + "/images/leftarrowred.gif";

      document.getElementById('sizeDiv'+lColorId).style.display='none';
      document.getElementById("shoesize").style.color = "#666666";

      if(lSizeId != "" && lFlagForSizeAvaialable == "1") {
         document.getElementById("sizeval").innerHTML = lSizeId;
         document.getElementById("sizeval").style.color = "#000000";
      } else {
         document.getElementById("sizeval").innerHTML = "select";
         document.getElementById("sizeval").style.color = "#990000";
      }
      document.getElementById("leftArrowforSize").src = url + "/images/leftarrowred.gif";

     if(lOnlyOneWidth == "false"  && lSizeId != "") {
        document.getElementById('widthDiv'+lColorId+lSizeId).style.display='none';
        document.getElementById("shoewidth").style.color = "#666666";
        if(lWidthNameId != "") {
           document.getElementById("widthval").innerHTML = lWidthNameId;
           document.getElementById("widthval").style.color = "#000000";
        } else {
           document.getElementById("widthval").innerHTML = "select";
           document.getElementById("widthval").style.color = "#990000";
        }
        document.getElementById("leftArrowForWidth").src = url + "/images/leftarrowred.gif";
     }
   }
}

var flagForSize = 1;
function showSizeList() {
   if (flagForSize == 1) {
      flagForSize = 2;
      document.getElementById('sizeDiv'+lColorId).style.display='block';
      document.getElementById("shoesize").style.color = "#000000";
      document.getElementById("sizeval").innerHTML = "select";
      document.getElementById("sizeval").style.color = "#CCCCCC";
      document.getElementById("leftArrowforSize").src = url + "/images/downarrowred.gif";
   } else {
      flagForSize = 1;
      document.getElementById('sizeDiv'+lColorId).style.display='none';
      document.getElementById("shoesize").style.color = "#666666";
      //if(lSizeId != "" && lSizeHas == "1") {
         //document.getElementById("sizeval").innerHTML = lSizeId;
         //document.getElementById("sizeval").style.color = "#000000";
      //} else {
         document.getElementById("sizeval").innerHTML = "select";
         document.getElementById("sizeval").style.color = "#990000";
      //}
      Delete_Cookie('lastSize','/',url);
      document.getElementById("leftArrowforSize").src = url + "/images/leftarrowred.gif";
      document.getElementById('sizeSelect').value = "";
      lSizeId = "";

      if(lOnlyOneWidth == "false" && lSizeId != "") {
         document.getElementById("shoewidth").style.color = "#666666";
         if(lWidthNameId != "") {
            document.getElementById("widthval").innerHTML = lWidthNameId;
            document.getElementById("widthval").style.color = "#990000";
         } else {
            document.getElementById("widthval").innerHTML = "select";
            document.getElementById("widthval").style.color = "#000000";
         }
         document.getElementById("leftArrowForWidth").src = url + "/images/leftarrowred.gif";
         document.getElementById('widthSelect').value = "";
      }
   }
}

var flagForWidth = 1;
function showWidthList() {
   if (lSizeId == "") {
      return
   }
   if (flagForWidth == 1) {
      flagForWidth = 2;
      document.getElementById('widthDiv'+lColorId+lSizeId).style.display='block';
      document.getElementById("shoewidth").style.color = "#000000";
      document.getElementById("leftArrowForWidth").src = url + "/images/downarrowred.gif";
   } else {
      flagForWidth = 1;
      document.getElementById('widthDiv'+lColorId+lSizeId).style.display='none';
      document.getElementById("shoewidth").style.color = "#666666";
      document.getElementById("leftArrowForWidth").src = url + "/images/leftarrowred.gif";
      if(lWidthNameId != "") {
         document.getElementById("widthval").innerHTML = lWidthNameId;
         document.getElementById("widthval").style.color = "#000000";
      } else {
         document.getElementById("widthval").innerHTML = "select";
         document.getElementById("widthval").style.color = "#990000";
      }
   }
   //document.getElementById("widthval").innerHTML = "select";
   //document.getElementById("widthval").style.color = "#CCCCCC";
   
}


function changeFontColorToBlack(id) {
  document.getElementById(id).style.color = "#000000";
}

function changeFontColorToGrey(id) {
  document.getElementById(id).style.color = "#666666";
}

function changeSizesByColor(colorId,pColorTitle) {
   var lPreviousColor = lColorId;
   alert("test - I get to - changeSizesByColor"); 
   if (ShoecolorArray[colorId] <= 0) {
   alert("test - Item out of stock");  
      setTheValueOfGlobalVariable('ItemOutOfStock','true');
      changeSizesByColorWhenOutOfStock(colorId);
    } else {
      setTheValueOfGlobalVariable('salePrice',SaleArray[colorId]);
      setTheValueOfGlobalVariable('ItemOutOfStock','false');
      lColorId = colorId;
      colorTitle = pColorTitle;
      flagForColor = 1;
      alert("test - Calls - setSalePriceRespectToColor");  
      setSalePriceRespectToColor();

      document.getElementById("shoecolorval").innerHTML = colorTextArray[colorId];
      document.getElementById("shoecolorval").style.color = "#000000";
      document.getElementById("shoecolor").style.color = "#666666";
      document.getElementById("leftarrow").src = url + "/images/leftarrowred.gif";
      for (number=0; number < ColorArrayForSize[colorId].length; number++) {
         if(ColorArrayForSize[colorId][number] == lSizeId) {
            lFlagForSizeAvaialable = "1";
            break;
         } else {
            lFlagForSizeAvaialable = "0";
         }
      }
      document.getElementById("colorDiv").style.display='none';
      if (ItemTypeId == ConstantsITEMTYPE_SHOEintValue || ItemTypeId == ConstantsITEMTYPE_NEWSALEintValue) {
         document.getElementById("shoesize").style.color = "#666666";
         if(lSizeId != "" && lFlagForSizeAvaialable == "1") {
            document.getElementById("sizeval").innerHTML = lSizeId;
            document.getElementById("sizeval").style.color = "#000000";
            document.getElementById('sizeSelect').value = lSizeId;
         } else {
            document.getElementById("sizeval").innerHTML = "select";
            document.getElementById("sizeval").style.color = "#990000";
            document.getElementById('sizeSelect').value = "";
         }
         document.getElementById("leftArrowforSize").src = url + "/images/leftarrowred.gif";
         document.getElementById('sizeDiv'+lPreviousColor).style.display='none';
         flagForSize = 1;
      }

      if(lOnlyOneWidth == "false") {
         document.getElementById("widthval").innerHTML = "select";
         document.getElementById("widthval").style.color = "#990000";
         document.getElementById("leftArrowForWidth").src = url + "/images/leftarrowred.gif";
      }
      if(lOnlyOneWidth == "false" && lSizeId != "") {
         document.getElementById('widthDiv'+lColorId+lSizeId).style.display='none';
      }
      document.getElementById('colorSelect').value = colorId;

      swapShoePicColor();
      changeThingsByColor();
   }
}

function changeWidthBySize(sizeid) {
   lSizeId = sizeid;
   flagForSize = 1;
   document.getElementById('sizeDiv'+lColorId).style.display='none';
   document.getElementById("shoesize").style.color = "#666666";
   document.getElementById("sizeval").innerHTML = sizeid;
   document.getElementById("sizeval").style.color = "#000000";
   document.getElementById("leftArrowforSize").src = url + "/images/leftarrowred.gif";
   document.getElementById('sizeSelect').value = sizeid;

   if(lOnlyOneWidth == "false") {
      document.getElementById("widthval").innerHTML = "select";
      document.getElementById("widthval").style.color = "#990000";
      document.getElementById("leftArrowForWidth").src = url + "/images/leftarrowred.gif";
   }   
}


function selectWidth(pWidthId,pWidthName) {
   lWidthId = pWidthId;
   lWidthNameId = pWidthName;
   flagForWidth = 1;
   //document.getElementById('widthSelect').value = lWidthNameId;
   document.getElementById('widthSelect').value = pWidthName;

   document.getElementById("shoewidth").style.color = "#666666";
   document.getElementById("widthval").innerHTML = pWidthName;
   document.getElementById("widthval").style.color = "#000000";
   document.getElementById("leftArrowForWidth").src = url + "/images/leftarrowred.gif";
   document.getElementById('widthDiv'+lColorId+lSizeId).style.display='none';
}

function IncreaseHeight(UserReviewSize) {
   var height = 188 * UserReviewSize;
   document.getElementById("mainDiv").style.height = 610 + height;

   price = SaleArray[lColorId];
   if (price > 0 || price != "") {
      setSalePriceRespectToColor();
   }
   if (ShoecolorArray[lColorId] <= 0) {
      setTheValueOfGlobalVariable('ItemOutOfStock','true');
      changeSizesByColorWhenOutOfStock(lColorId);
   }
}

function ShowRunwayPrice(pItemID) {
   document.getElementById('runwayPrice'+pItemID).style.display='block';
   document.getElementById('runwayName'+pItemID).style.display='none';
}

function HideRunwayPrice(pItemID) {
   document.getElementById('runwayName'+pItemID).style.display='block';
   document.getElementById('runwayPrice'+pItemID).style.display='none';
}

function ShowSpecialRunwayPrice(pItemID) {
   document.getElementById('SpecialrunwayPrice'+pItemID).style.display='block';
   document.getElementById('SpecialrunwayName'+pItemID).style.display='none';
}

function HideSpecialRunwayPrice(pItemID) {
   document.getElementById('SpecialrunwayName'+pItemID).style.display='block';
   document.getElementById('SpecialrunwayPrice'+pItemID).style.display='none';
}

function ShowRecentlyViewedPrice(pItemID) {
   document.getElementById('recentlyViewedPrice'+pItemID).style.display='block';
   document.getElementById('recentlyViewedName'+pItemID).style.display='none';
}

function HideRecentlyViewedPrice(pItemID) {
   document.getElementById('recentlyViewedName'+pItemID).style.display='block';
   document.getElementById('recentlyViewedPrice'+pItemID).style.display='none';
}

function ShowLeftArrowForColor(pColorID) {
   document.getElementById('leftarrowForColor'+pColorID).style.display='block';
   document.getElementById("ColorTd"+pColorID).style.color = "#990000";
}

function HideLeftArrowForColor(pColorID) {
   document.getElementById('leftarrowForColor'+pColorID).style.display='none';
   document.getElementById("ColorTd"+pColorID).style.color = "#666666";
}

function ShowLeftArrowForSize(pColorid,pSizeID) {
   document.getElementById('leftarrowForSize'+pColorid+pSizeID).style.display='block';
   document.getElementById("SizeTd"+pColorid+pSizeID).style.color = "#990000";
}

function HideLeftArrowForSize(pColorid,pSizeID) {
   document.getElementById('leftarrowForSize'+pColorid+pSizeID).style.display='none';
   document.getElementById("SizeTd"+pColorid+pSizeID).style.color = "#666666";
}

function ShowLeftArrowForWidth(pColorid,pSizeid,pWidthID) {
   document.getElementById('leftArrowForWidth'+pColorid+pSizeid+pWidthID).style.display='block';
   document.getElementById("WidthTd"+pColorid+pSizeid+pWidthID).style.color = "#990000";
}

function HideLeftArrowForWidth(pColorid,pSizeid,pWidthID) {
   document.getElementById('leftArrowForWidth'+pColorid+pSizeid+pWidthID).style.display='none';
   document.getElementById("WidthTd"+pColorid+pSizeid+pWidthID).style.color = "#666666";
}

function CollapseAllDiv() {
   
   if (flagForColor == 2) {
      flagForColor = 1;
      document.getElementById('colorDiv').style.display='none';
      document.getElementById("shoecolor").style.color = "#666666";
      document.getElementById("shoecolorval").innerHTML = "select";
      document.getElementById("shoecolorval").style.color = "#990000";
      document.getElementById("leftarrow").src = url + "/images/leftarrowred.gif";
   }
   
   if (flagForSize == 2) {
      flagForSize = 1;
      document.getElementById('sizeDiv'+lColorId).style.display='none';
      document.getElementById("shoesize").style.color = "#666666";
      document.getElementById("sizeval").innerHTML = "select";
      document.getElementById("sizeval").style.color = "#990000";
      document.getElementById("leftArrowforSize").src = url + "/images/leftarrowred.gif";
   }
   
   if(flagForWidth == 2 && lOnlyOneWidth == "false"  && lSizeId != "") {
      flagForWidth = 1;
      document.getElementById('widthDiv'+lColorId+lSizeId).style.display='none';
      document.getElementById("shoewidth").style.color = "#666666";
      document.getElementById("widthval").innerHTML = "select";
      document.getElementById("widthval").style.color = "#990000";
      document.getElementById("leftArrowForWidth").src = url + "/images/leftarrowred.gif";
   }
}


// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
//alert(" name = "+name+" path ="+path+" domain = "+domain);
if ( createCookie(name,'',0) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


