<!--
 
function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}  




function Get_Cookie( name ) {
	
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}


  function openURL(form){
  
  	var URL = form.goURL.options[form.goURL.selectedIndex].value;
          top.location.href = URL;
  
  }
  
  function submitForm(myform)
  {
     myform.submit();
  }  
    
  /* 
     this function is used on the cart page to autoselect the giftnote when 
     a user selects the gift wrap option
   */
  function autoSelectGiftNote() {
  /*  
    if (document.cartform.wrap.checked &&
        !document.cartform.giftnote.checked) {
       
      document.cartform.giftnote.click();
    }  
	*/
  }  
  
 /**
  * <p>This function is used to limit the number of characters entered into a form
  * field.  Created for the gift note textarea
  **/
  function textLimit(field, maxlen) {
     if (field.value.length > maxlen) {
       field.value = field.value.substring(0, maxlen);
     }
  }  
    
  /**
  * The email campaign popup.  First check the form fields to 
  * make sure we can submit.
  */ 
  function emailSignup(URL, theForm) {  
    // need to make sure the required fields are not null
    openWindow = true;
    
    // check to see if we have an email address at all
    addressEntered = theForm.emailAddress.value;
    if (trim(addressEntered) == "") {
      openWindow = false;
    }
    
    // check to see if we have an email address with an @ symbol
    if (addressEntered.indexOf("@") == -1 ) {
      openWindow = false;
    }
  
    // don't open window if we had a form error
    if (openWindow) {
      newwindow=open(URL,"","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=480,height=500");
    }
  }

   /* Cindi mini_site */
  function miniSitePopup(URL) {
       width = 812;
       height = 426;

        if(navigator.appName == "Microsoft Internet Explorer")
        {
                screenY = (window.screen.availHeight - height) / 2;
                screenX = (window.screen.availWidth - width ) / 2;
        }
        else
        {
                screenY = (document.body.offsetHeight - height) / 2 - pageXOffset;
                screenX = (window.screen.availWidth - width ) / 2 - pageYOffset;
        };

    newwindow=open(URL,"","scrollbars=no,toolbar=no,directories=no,menubar=no,resizable=no,status=no,width=" + width + ",height=" + height + ",top=" + screenY + ",left="+ screenX);
  }

  /* The product details popup */
  function detailsPopup(URL) {
  
	width = 450;
	height = 525;
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		screenY = (window.screen.availHeight - height) / 2;
		screenX = (window.screen.availWidth - width ) / 2;
	}
	else
	{
		screenY = (document.body.offsetHeight - height) / 2 - pageXOffset;
		screenX = (window.screen.availWidth - width ) / 2 - pageYOffset;
	};

    newwindow=open(URL,"","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=" + width + ",height=" + height + ",top=" + screenY + ",left="+ screenX);  
  }
  
  /* The notify me when in-stock popup */
  function notifyMePopup(URL) {
  
	width = 480;
	height = 500;
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		screenY = (window.screen.availHeight - height) / 2;
		screenX = (window.screen.availWidth - width ) / 2;
	}
	else
	{
		screenY = (document.body.offsetHeight - height) / 2 - pageXOffset;
		screenX = (window.screen.availWidth - width ) / 2 - pageYOffset;
	};

    newwindow=open(URL,"","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=" + width + ",height=" + height + ",top=" + screenY + ",left="+ screenX);  
  }
  function notifyMeLargePopup(URL) {
	width = 650;
	height = 1000;
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		screenY = (window.screen.availHeight - height) / 2;
		screenX = (window.screen.availWidth - width ) / 2;
	}
	else
	{
		screenY = (document.body.offsetHeight - height) / 2 - pageXOffset;
		screenX = (window.screen.availWidth - width ) / 2 - pageYOffset;
	};

    newwindow=open(URL,"","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=" + width + ",height=" + height + ",top=" + screenY + ",left="+ screenX);  
  }
  function notifyMeEmailPopup(URL, email) {
	width = 1024;
	height = 750;
	
	if (!email || email.length == 0 || email == " Enter email")
	{
		email = "";
	} else {
		email = email;
	}
	
	URL = URL + email;
	
	//alert(URL);
	
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		screenY = (window.screen.availHeight - height) / 2;
		screenX = (window.screen.availWidth - width ) / 2;
	}
	else
	{
		screenY = (document.body.offsetHeight - height) / 2 - pageXOffset;
		screenX = (window.screen.availWidth - width ) / 2 - pageYOffset;
	};

    newwindow=open(URL,"","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=" + width + ",height=" + height + ",top=" + screenY + ",left="+ screenX);  
  }
    function notifyMePassportPopup(URL) {
	width = 760;
	height = 1000;
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		screenY = (window.screen.availHeight - height) / 2;
		screenX = (window.screen.availWidth - width ) / 2;
	}
	else
	{
		screenY = (document.body.offsetHeight - height) / 2 - pageXOffset;
		screenX = (window.screen.availWidth - width ) / 2 - pageYOffset;
	};

    newwindow=open(URL,"","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=" + width + ",height=" + height + ",top=" + screenY + ",left="+ screenX);  
  }
  
  function notifyMeForgotPopup(URL) {
	width = 650;
	height = 600;
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		screenY = (window.screen.availHeight - height) / 2;
		screenX = (window.screen.availWidth - width ) / 2;
	}
	else
	{
		screenY = (document.body.offsetHeight - height) / 2 - pageXOffset;
		screenX = (window.screen.availWidth - width ) / 2 - pageYOffset;
	};

    newwindow=open(URL,"","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=" + width + ",height=" + height + ",top=" + screenY + ",left="+ screenX);  
  }
  function notifyMePopupCustomWidth(URL,nWidth) {
  
	width = nWidth;
	height = 500;
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		screenY = (window.screen.availHeight - height) / 2;
		screenX = (window.screen.availWidth - width ) / 2;
	}
	else
	{
		screenY = (document.body.offsetHeight - height) / 2 - pageXOffset;
		screenX = (window.screen.availWidth - width ) / 2 - pageYOffset;
	};

    newwindow=open(URL,"","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=" + width + ",height=" + height + ",top=" + screenY + ",left="+ screenX);  
  }
  
    
  
  
  
  
  function trim(inputString) {
     // Removes leading and trailing spaces from the passed string. Also removes
     // consecutive spaces and replaces it with one space. If something besides
     // a string is passed in (null, custom object, etc.) then return the input.
     if (typeof inputString != "string") { return inputString; }
     var retValue = inputString;
     var ch = retValue.substring(0, 1);
     while (ch == " ") { // Check for spaces at the beginning of the string
        retValue = retValue.substring(1, retValue.length);
        ch = retValue.substring(0, 1);
     }
     ch = retValue.substring(retValue.length-1, retValue.length);
     while (ch == " ") { // Check for spaces at the end of the string
        retValue = retValue.substring(0, retValue.length-1);
        ch = retValue.substring(retValue.length-1, retValue.length);
     }
     while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
        retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
     }
     return retValue; // Return the trimmed string back to the user
  } // Ends the "trim" function


  
  function viewerPopup(classStyle, colorList, prodDescription)
  {
  	// takes "curSwatch" as a global variable set when each swatch is set
  
    // http://s7ondemand1.scene7.com/s7ondemand/zoom/flasht_zoom.jsp?
	// 		company=NewYorkCompany&
	//		config=default_config&
	//		sku=01404528&
	//		vc=selItem=NewYorkCompany/01404528,136&singleImageSwatch=True&
	//		itemdesc=TEST PRODUCT NAME&
	//		initialFrame=0&
	//		zoomheight=500&
	//		zoomwidth=640
  
  
//  	baseUrl="http://s7ondemand1.scene7.com/s7ondemand/zoom/flasht_zoom.jsp?";
	baseUrl="http://s7d2.scene7.com/s7ondemand/zoom/flasht_zoom.jsp?";
	accountCompany="NewYorkCompany";
	viewerConfiguration="default_config";
	skuNumber="";
	//width="640";
	//height="500";
	width="590";
	height="740";
	customer="";
	
	initialFrame=0;
	initialFrame += curSwatch; // 0,1,2,n-1 of swatches
	
	selItem="NewYorkCompany/"+classStyle;
	if (colorList != "")
		selItem= selItem + "," + colorList;
	if (colorList.indexOf(",") != -1)
	{
		singleSwatch="false";
		singleSwatch="true";
	} else {
		singleSwatch="true";
	}
	
	var ua = navigator.userAgent.toLowerCase();
	
	URL = baseUrl + "company=" + escape(accountCompany) + "&config=" + escape(viewerConfiguration) + "&sku=" + escape(classStyle) + "&vc=" + "selItem%3D" + escape(selItem) + "%26singleImageSwatch%3D" + singleSwatch + "%26itemdesc%3D" + escape(prodDescription) + "%26initialFrame%3D" + escape(initialFrame) + "%26codeRoot%3D%2Fis-viewers%2Fflash%2F&viewer=%2Fskins%2FNewYorkCompany%2FSWFs%2Fnycogenericzoom.swf" + "&zoomheight=" + escape(height) + "&zoomwidth=" + escape(width)
//	alert(URL);

	if (ua.indexOf("msie"))
	{
    	newwindow=open(URL,"","location=yes,resizable=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,width="+width+",height="+height);
	} else {
	    newwindow=open(URL,"","location=no,scrollbars=no,toolbar=no,directories=no,menubar=no,resizable=no,status=yes,width="+width+",height="+height);
	}

	return;
  }
  
  curSwatch = 0;
  
  function setSwatch(nSwatch)
  {

  	if (nSwatch < 0)
	{
		strSwatch = strLarge;
		curSwatch = -1;
	} else {

	  	curSwatch = nSwatch;
		strSwatch = arUrls[nSwatch];
	}

	//strSwatch = "/nyco/images/products/M17-Crew-neck_red_w60.jpg";

	if (strSwatch != "null")
	{
		document.images['fullThumb'].src = strSwatch;
	}
//    alert(nSwatch + " / " + strSwatch);
	
	return true;


	
  }

  function autotab(current,to){
        if (current.getAttribute && 
            current.value.length==current.getAttribute("maxlength")) {
            to.focus()
        }
  }   
  
  function disable(button){
        var positionX = 0;
        var positionY = 0;
        
        while(button != null){
            positionX += button.offsetLeft;
            positionY += button.offsetTop;
            button = button.offsetParent;
        }
	 if (document.getElementById("coveringButton")!=null){
        	document.getElementById("coveringButton").style.left = "" + positionX + "px";
        	document.getElementById("coveringButton").style.top = "" + positionY + "px";
        	document.getElementById("coveringButton").style.visibility = "visible";
        	document.getElementById("coveringButton").style.display = "block";
	 }
        document.forms[0].submit;        
  } 


-->
