<!--
// Ensure that all popup windows are opened in a consistent manner

function LE_popup(theURL) { 
    LE_popup_large(theURL); 
}

function LE_popup_kdsbig(theURL) { 
    if (theURL != "")
    {
        var win =  window.open(theURL, "LE_PopupLarge",
                       "scrollbars=yes,width=605,height=680,top=0,left=210,resizable=yes");
        win.focus();
    }
}

function LE_popup_kds(theURL) { 
    if (theURL != "")
    {
        var win =  window.open(theURL, "LE_PopupLarge",
                       "scrollbars=yes,width=605,height=410,top=0,left=210,resizable=yes");
        win.focus();
    }
}

function LE_popup_lar(theURL) { 
    if (theURL != "")
    {
        var win =  window.open(theURL, "LE_PopupLarge",
                       "scrollbars=yes,width=650,height=840,top=0,left=210,resizable=yes");
        win.focus();
    }
}

function LE_popup_lar2(theURL) { 
    if (theURL != "")
    {
        var win =  window.open(theURL, "LE_PopupLarge",
                       "scrollbars=yes,width=650,height=400,top=0,left=210,resizable=yes");
        win.focus();
    }
}

function LE_popup_large(theURL) { 
    if (theURL != "")
    {
        var win =  window.open(theURL, "LE_PopupLarge",
                       "scrollbars=yes,width=550,height=540,top=0,left=210,resizable=yes");
        win.focus();
    }
}

function LE_popup_small(theURL) { 
    if (theURL != "")
    {
        var win =  window.open(theURL, "LE_PopupSmall",
                       "scrollbars=yes,width=400,height=320,top=50,left=332,resizable=yes");
        win.focus();
    }
}


// Insure that all popup windows are opened in a consistent manner
function swim_popup_internal(theURL,SID,REFER) {
                sid = "?sid=" + SID;
                refer = "&refer=" + REFER;
                ppURL = theURL+sid+refer;
    return window.open(ppURL, "Window2",
                       "scrollbars=yes,width=550,height=370,top=75,left=125");
}

// Lands' End popup window script -RW
function swim_popup(theURL,SID,REFER) {
  swim_popup_internal(theURL,SID,REFER).focus();
}


// popup window that generates content to view an expanded swatch or
// product image
function LE_popup2(akamaiString,ImgPath,ImgAlt,Height,Width) {
    var win =  window.open('', "LE_PopupLarge",
               "scrollbars=yes,width=550,height=540,top=0,left=210,resizable=yes");

    if (typeof akamaiString == "undefined")
       akamaiString = "";

    var headerhtml = "\n<HTML><HEAD>\n<TITLE>Lands' End Image Viewer</TITLE><META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></HEAD>\n<BODY bgcolor=\"#D6E1EB\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"100%\">\n  <tr valign=\"top\" bgcolor=\"#FFFFFF\"> \n    <td height=\"1\"> \n      <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n        <tr bgcolor=\"#D6E1EB\"> \n          <td width=\"50%\" align=\"left\" valign=\"bottom\"><img src=\""+akamaiString+"/IMAGES/OTHER/ledotcom.gif\" width=\"127\" height=\"19\"><br>\n            <img src=\""+akamaiString+"/IMAGES/OTHER/10x10.gif\" width=\"15\" height=\"2\"></td>\n          <td width=\"50%\" align=\"right\" valign=\"top\">\n                 <a href=\"javascript:window.close()\"><img src=\""+akamaiString+"/IMAGES/OTHER/close.gif\" width=\"89\" height=\"23\" border=\"0\"></a>\n               </td>\n        </tr>\n        <tr bgcolor=\"#336699\"> \n          <td align=\"left\" valign=\"top\" height=\"2\" colspan=\"2\"><img src=\""+akamaiString+"/IMAGES/OTHER/10x10.gif\" width=\"5\" height=\"2\"></td>\n        </tr>\n      </table>\n    </td>\n</tr>\n <tr align=\"center\" valign=\"middle\" bgcolor=\"#FFFFFF\"> \n    <td>\n";

    var imagehtml = "";
    if (ImgPath.length > 0) {
        if (typeof ImgAlt == "undefined")
            ImgAlt = "";
        else
            ImgAlt = ' alt="' + ImgAlt + '"';

        if (typeof Width == "undefined")
            Width = "";
        else
            Width = ' width="' + Width + '"';

        if (typeof Height == "undefined")
            Height = "";
        else
            Height = ' height="' + Height + '"';

        imagehtml = '<img src="' + akamaiString + ImgPath + '"' + Width + Height +
                     ImgAlt + '>';
    }

    var footerhtml = '\n    </td>\n  </tr>\n  <tr valign=\"bottom\" bgcolor=\"#FFFFFF\"> \n    <td height=\"1\"> \n      <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n        <tr bgcolor=\"#336699\"> \n          <td colspan=\"2\" align=\"left\" valign=\"top\" height=\"2\"><img src=\"'+akamaiString+'/IMAGES/OTHER/10x10.gif\" width=\"10\" height=\"2\"></td>\n        </tr>\n        <tr bgcolor=\"#D6E1EB\"> \n          <td width=\"50%\" align=\"left\" valign=\"bottom\"><img src="'+akamaiString+'/images/2001.gif" width=\"86\" height=\"11\"></td>\n          <td width=\"50%\" align=\"right\" valign=\"top\" bgcolor=\"#D6E1EB\">\n               <a href=\"javascript:window.close()\"><img src=\"'+akamaiString+'/IMAGES/OTHER/close.gif\" width=\"89\" height=\"23\" border=\"0\"></a><br>\n            <img src=\"'+akamaiString+'/IMAGES/OTHER/10x10.gif\" width=\"7\" height=\"2\"></td>\n        </tr>\n      </table>\n    </td>\n </tr>\n</table>\n</BODY></HTML>\n   ';

    with (win.document) {
        open("text/html", "replace");
        write(headerhtml);
        write(imagehtml);
        write(footerhtml);
        
        close();
        win.focus();
    }
}
function getQSVar(name) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == name) { 
      return pair[1];
    }    
  }
  return ''; 
}


// Lands' End Swap Image

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// Lands' End preloadImages

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//-->


