function ltrim(str) { 
	for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
	return str.substring(k, str.length);
}
function rtrim(str) {
	for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
	return str.substring(0,j+1);
}
function trim(str) {
	return ltrim(rtrim(str));
}
function isWhitespace(charToCheck) {
	var whitespaceChars = " \t\n\r\f";
	return (whitespaceChars.indexOf(charToCheck) != -1);
}

function LoginEnterKey() {
	if (window.event.keyCode == 13) {
		document.ApplyAccountForm3002.submit();
	}
}
function EditAddress(AddressKey) {
	document.ApplyAccountForm.AddressKey.value = AddressKey;
	alert(document.ApplyAccountForm.AddressKey.value);
}
function ModifyCart(OrderItemKey,CartActn) {
	var sFormName = 'cart';
	sFormName = sFormName + OrderItemKey;
	if (OrderItemKey!=0) {
		document.forms[sFormName].elements['CartAction'].value = CartActn;
		if (CartActn=="updateqty" || CartActn=="removeitem" || CartActn=="ship-discount" || CartActn=="item-discount" || CartActn=="manufactureweeks" || CartActn=="carrier-price") {
			document.forms[sFormName].elements['SubjectKey'].value = 2052;
		}
		document.forms[sFormName].submit();
	}
}

//Change Subject ID
function ChangeSubjectDD(SubjectKey,LOGOLINK) {
	if (SubjectKey.value==0) {
		//do nothing
	}
	else {
        if (LOGOLINK=='LL') {
            var newaction = 'wesco.asp?sk='+SubjectKey.value;
            if (document.getElementById) {
                document.getElementById('LOGOLINK').href = newaction;
                document.getElementById('LOGOLINK').click();
            }
            else {
                document.all['LOGOLINK'].href = newaction;
                document.all['LOGOLINK'].click();
            }
        }
        else {
            ChangeSubjectKey(SubjectKey.value);
        }
	}
}    
function ChangeSubjectKey(SubjectKey) {
	if (SubjectKey==-1) {
		//do nothing
	}
	else {
   	    document.PageActionForm.SubjectKey.value = SubjectKey;
	    document.PageActionForm.submit();
    }
}
function ChangeSubjectWarning(SubjectKey) {

	if (document.PageActionForm.Warning.value == "YES") {
		if (SubjectKey=="3041") {
			sWarningMsg = "WAIT!!! WESCO PROMOTION OFFER REMINDER!!!\r\rYour order qualifies for our current promotion offer.\r\rYou must click the APPLY TO THIS ORDER (green button)\rto activate it (and select a size when applicable)\r\rIf you really do not want this offer, simply click\rCHECK OUT again to continue."
			alert(sWarningMsg );
		}
		else {
			alert("Warning: ");
		}
		document.PageActionForm.Warning.value = "";
	}
	else {
		ChangeSubjectKey(SubjectKey);
	}
}

function ChangeSubjectKeyAdmin(SubjectKey,CustomerKey_Editing) {
    document.PageActionForm.CustomerKey_Editing.value = CustomerKey_Editing;
    ChangeSubjectKey(SubjectKey);
}

function AddBootsToCart() {
	//CartQuantity = document.CustomStepForm.buyqty.value;
	//document.AddToCartForm.CartQuantity.value = CartQuantity;
	//document.AddToCartForm.submit();
	ApplyChoice();
}
function AddFSToCart(fskey) {
	document.AddToCartForm.fskey.value = fskey;
	document.AddToCartForm.submit();

}
function ShowOrderHistory(OrderKey) {
	document.ApplyChoiceForm.OrderKey.value = OrderKey;
	document.ApplyChoiceForm.submit();

}
function CC(OrderKey,AC) {
	document.ApplyChoiceForm.SubjectKey.value = 5035;
	document.ApplyChoiceForm.ActionCode.value = AC;
	document.ApplyChoiceForm.OrderKey.value = OrderKey;
	document.ApplyChoiceForm.submit();
}

function OrderCatalog(eventtype) {
	document.OrderCatalogForm.EventType.value = eventtype;
	document.OrderCatalogForm.submit();
}


function BuyNow(ElementKey) {  
	var sFormName = 'Form';
	var Size_ElementKey = 0;
	var Color_ElementKey = 0;
	var CartQuantity = 0;
	var GCamount = '';
	var GCrecipient = '';
	var StockGC = '';
	var AlertMsg = '';
	var AddToStockOptions = 0;
	var UnitMeasure = '';

	sFormName = sFormName + ElementKey;
	Rebuild_SubjectKey = document.forms[sFormName].elements['Rebuild_SubjectKey'].value;
	Stock_ElementKey = document.forms[sFormName].elements['Stock_ElementKey'].value;
	Size_ElementKey = document.forms[sFormName].elements['Size_ElementKey'].value;
	Color_ElementKey = document.forms[sFormName].elements['Color_ElementKey'].value;
	CartQuantity = document.forms[sFormName].elements['buyqty'].value;
	GCamount = document.forms[sFormName].elements['GCamount'].value;
	GCrecipient = trim(document.forms[sFormName].elements['GCrecipient'].value);
	STOCKrecipient = trim(document.forms[sFormName].elements['STOCKrecipient'].value);
	StockGC = document.forms[sFormName].elements['StockGC'].value;
	
	if (Size_ElementKey=='' && StockGC=='NO') {
		alert("Please select a size.");
	}
	else {
        //GCamount = ''
        if (StockGC!='NO') {
    		if (GCamount=='') {
	    		GCamount = 0;
		    }
        }
		if (StockGC=='YES') {
		    if (GCamount<50) {
    			AlertMsg = "GC amount must be at least $50.00.";
    		}
	    	if (AlertMsg=='' && GCrecipient=='') {
			  	AlertMsg = "Please enter Name of Recipient.";
			}
        }
		if (StockGC=='MISC') {
	    	if (AlertMsg=='' && GCrecipient=='') {
			  	AlertMsg = "Please enter Description.";
			}
            else {
                if (document.forms[sFormName].elements['AddToStockOptions'].checked == true) {
                    AddToStockOptions = 1;
                    UnitMeasure = document.forms[sFormName].elements['UnitMeasure'].value;
                }
            }
        }
        if (AlertMsg=='') {       
		    document.AddToCartForm.Rebuild_SubjectKey.value = Rebuild_SubjectKey;
		    document.AddToCartForm.CartQuantity.value = CartQuantity;
		    document.AddToCartForm.Stock_ElementKey.value = Stock_ElementKey;
		    document.AddToCartForm.Size_ElementKey.value = Size_ElementKey;
		    document.AddToCartForm.Color_ElementKey.value = Color_ElementKey;
		    document.AddToCartForm.GCamount.value = GCamount;
		    document.AddToCartForm.GCrecipient.value = GCrecipient;
		    document.AddToCartForm.STOCKrecipient.value = STOCKrecipient;
		    document.AddToCartForm.AddToStockOptions.value = AddToStockOptions;
		    document.AddToCartForm.UnitMeasure.value = UnitMeasure;
		    document.AddToCartForm.submit();
		}
		else {
            alert(AlertMsg);
		}
	}
}    
function ApplyChoice(NextStep_SubjectKey) {
	if (document.ApplyChoiceForm.ChoiceElementKey.value=='') {
		alert("Please make a choice to continue to the next item.");
	}
	else {
	    document.ApplyChoiceForm.NextStep_SubjectKey.value = NextStep_SubjectKey;
	    document.ApplyChoiceForm.submit();
	}
}
function RetryChoice(NextStep_SubjectKey) {
    document.ApplyChoiceForm.NextStep_SubjectKey.value = NextStep_SubjectKey;
    document.ApplyChoiceForm.PriorChoice.value = 0;
    document.ApplyChoiceForm.submit();
}
function ApplyPriorChoice(NextStep_SubjectKey) {
    document.ApplyChoiceForm.NextStep_SubjectKey.value = NextStep_SubjectKey;
    document.ApplyChoiceForm.PriorChoice.value = 1;
    document.ApplyChoiceForm.submit();
}
function ApplyActiveChoice(NextStep_SubjectKey) {
    document.ApplyChoiceForm.NextStep_SubjectKey.value = NextStep_SubjectKey;
    document.ApplyChoiceForm.PriorChoice.value = 2;
    document.ApplyChoiceForm.submit();
}
function ApplyTempChoice(TempElementKey) {
    document.ApplyTempElementKey.TempElementKey.value = TempElementKey;
    document.ApplyTempElementKey.submit();
}
function ApplyCustomChoice(ChoiceElementKey) {
    document.ApplyChoiceForm.ChoiceElementKey.value = ChoiceElementKey;
}
function ApplyQty() {
    document.ApplyChoiceForm.ElementNameOverride.value = document.CustomStepForm.CustomChoice.value;
}
function ApplyTextInput(NextStep_SubjectKey) {	
	//same step - do nothing different
    document.ApplyChoiceForm.ElementNameOverride.value = document.CustomStepForm.TEXTINPUT.value;
    ApplyChoice(NextStep_SubjectKey);
}
function ApplyRecipientInput(NextStep_SubjectKey) {	
	//same step - do nothing different
	if (document.CustomStepForm.MEASURECODE.value == "#####" || document.CustomStepForm.MEASURECODE.value == "") {
	    document.ApplyChoiceForm.ElementNameOverride.value = document.CustomStepForm.TEXTINPUT.value;
	}
	else {
	    document.ApplyChoiceForm.ElementNameOverride.value = document.CustomStepForm.TEXTINPUT.value + " (" + document.CustomStepForm.MEASURECODE.value + ")";
	}

	ApplyChoice(NextStep_SubjectKey);
}
function UpdateCheckboxArray(TriKey1,TriKey2) {
	var strKeys = '';
	var priceMultiplier = 0;

	for (var i = 0; i<document.CustomStepForm.elements.length; i++) {
	    if (document.CustomStepForm.elements[i].type == 'checkbox') {
	        strName = document.CustomStepForm.elements[i].name;
		    strParse = document.CustomStepForm.elements[i].name.substring(0,12);
	        if (strParse == "CustomChoice" && document.CustomStepForm.elements[i].checked) {
			if (strKeys != '') {
				strKeys = strKeys + "-";
			}
			strKeys = strKeys + document.CustomStepForm.elements[i].name.substring(12,document.CustomStepForm.elements[i].length);
			priceMultiplier = priceMultiplier + 1;
		}
	    }
	}
	document.ApplyChoiceForm.ElementNameOverride.value = strKeys;
	document.ApplyChoiceForm.PriceMultiplier.value = priceMultiplier;
	if (strKeys != '') {
	    document.ApplyChoiceForm.ChoiceElementKey.value = TriKey2;
	}
	else {	
	    document.ApplyChoiceForm.ChoiceElementKey.value = TriKey1;
	}
}
function SingleToneReset(SubjectKey) {

	var sChangeColor = '0';
	var iChangeColor = '0';
	var iCurrentColor = '0';
	var valStrapsBypass = '2686';
	var valFlapsBypass = '3219';
	var valBypassReset = 0;

	for (var i = 0; i<document.CustomStepForm.elements.length; i++) {
		if (document.CustomStepForm.elements[i].type == 'select-one') {
			if (document.CustomStepForm.elements[i].name == SubjectKey) {
				iChangeColor = document.CustomStepForm.elements[i].value;
				sChangeColor = iChangeColor
				if (iChangeColor != parseInt(iChangeColor)) { iChangeColor = iChangeColor.substring(1,iChangeColor.length) }
				if (iChangeColor == valStrapsBypass || iChangeColor == valFlapsBypass) { valBypassReset = 1 }
			}
		}
	}
	if (valBypassReset == 0) {
		for (var i = 0; i<document.CustomStepForm.elements.length; i++) {
			if (document.CustomStepForm.elements[i].type == 'select-one') {
				if (document.CustomStepForm.elements[i].name != SubjectKey) {
					iCurrentColor = document.CustomStepForm.elements[i].value;
					if (iCurrentColor != valStrapsBypass && iCurrentColor != valFlapsBypass) {
						if (iCurrentColor != iChangeColor && iCurrentColor != sChangeColor) {
							if (iCurrentColor != parseInt(iCurrentColor)) {
								iCurrentColor = 'R'+iChangeColor;
							}
							else {
								iCurrentColor = iChangeColor;
							}
							document.CustomStepForm.elements[i].value = iCurrentColor;
						}
					}
				}
			}
//			if (i > 3) {
//				alert(i);
//			}
		}
	}

}
function ApplyStitchingColor(NextStep_SubjectKey) {
    var sCurrentColors = '|';

	for (var i = 0; i<document.CustomStepForm.elements.length; i++) {
	    if (document.CustomStepForm.elements[i].type == 'select-one') {
			sCurrentColors = sCurrentColors + document.CustomStepForm.elements[i].value + '|';
        }
    }
	document.ApplyChoiceForm.ElementNameOverride.value = sCurrentColors;
	ApplyChoice(NextStep_SubjectKey);
}

function WorkTicketLeatherOverride(oik) {

    wWidth = 480;
    wHeight = 250;
	xPos = screen.width / 2 - 225;
	yPos = screen.height / 2 - 125;
	
	windowOptions = "Width=" + wWidth + ",Height=" + wHeight + ",left=" + xPos + ",top=" + yPos +",directories=no,menubar=no,toolbar=no,scrollbars=yes,status=no";
	editWindow = window.open("A_COMMON_DETAILS.asp?type=LEATHER&oik="+oik,"getParm",windowOptions);
}

function ApplyLeatherColor(NextStep_SubjectKey, TempElementKey, BypassToneRule) {
	var strKeys = '';
	var bIncomplete = false;
//	var bOneColor = true;
	var iControlColorST = 0;
	var iControlColorTT = 0;
	var sCurrentColor = 0;
	var iCurrentColor = 0;
	var cntColors = 0;
	var reqColors = 1;
	var valStrapsBypass = 2686;
	var valFlapsBypass = 3219;
	var sRoughout = "";

	if (TempElementKey==2665) { reqColors = 1 }
	if (TempElementKey==2666) { reqColors = 2 }
	if (TempElementKey==2667) { reqColors = 3 }

	for (var i = 0; i<document.CustomStepForm.elements.length; i++) {

	    if (document.CustomStepForm.elements[i].type == 'select-one') {
			sCurrentColor = document.CustomStepForm.elements[i].value;
			iCurrentColor = sCurrentColor
			if (iCurrentColor != parseInt(iCurrentColor)) {
				iCurrentColor = iCurrentColor.substring(1,iCurrentColor.length) 
				sRoughout = 'R';
			}
			else {
				sRoughout = '';
			}

			if (iCurrentColor == '0000') {
				//bIncomplete = true;
				strKey = document.CustomStepForm.elements[i].name + "-" + sRoughout + iControlColorST;
				if (strKeys == '') {
					strKeys = strKeys + "| ";
				}
				strKeys = strKeys + strKey + " | ";
			}
			else {
				if (iCurrentColor != valStrapsBypass && iCurrentColor != valFlapsBypass) {
					if (iCurrentColor != iControlColorST && iCurrentColor != iControlColorTT && cntColors < 3) {
						cntColors = cntColors +1;
						if (iControlColorST == 0) {
							iControlColorST = iCurrentColor;
						}
						else {
							if (iControlColorTT == 0) {
								iControlColorTT = iCurrentColor;
							}
						}
					}
				}				
				strKey = document.CustomStepForm.elements[i].name + "-" + sCurrentColor;
				if (strKeys == '') {
					strKeys = strKeys + "| ";
				}
				strKeys = strKeys + strKey + " | ";
			}
	    }
	}
	if (bIncomplete==true) {
		alert("You must select a color for each part of boot.");
	}
	else {
		if (cntColors != reqColors && BypassToneRule == 0) {
			if (reqColors == 1) {alert("1 Leather Color is required for Single-Tone boots.");}
			if (reqColors == 2) {alert("2 Leather Colors are required for Two-Tone boots.");}
			if (reqColors == 3) {alert("At least 3 Leather Colors are required for Multi-Tone boots.");}
		}
		else {
			document.ApplyChoiceForm.ElementNameOverride.value = strKeys;
			document.ApplyChoiceForm.ChoiceElementKey.value = TempElementKey;
			ApplyChoice(NextStep_SubjectKey);
//			alert(strKeys);
		}
	}
}
function nbrValidate(e,typ) {

    var c = ('charCode' in e) ? e.charCode : e.keyCode;
    if (typ == 'd') {return ((c > 47 && c < 58) || c==46 || c==0);}
    if (typ == 'neg') {return ((c > 47 && c < 58) || c==45 || c==46 || c==0);}
    if (typ == '')  {return ((c > 47 && c < 58) || c==0);}
    
}

function nbrValidation(keycode,chkFld) {
	if (keycode < 48 || keycode > 57) {
		event.returnValue = false;
	}
}
function decimalValidation(keycode,chkFld) {
	if (keycode==46) {
	}
	else {
		if (keycode < 48 || keycode > 57) {
			event.returnValue = false;
		}
	}
}
function decimalValidationNegOK(keycode,chkFld) {
	if (keycode==45 || keycode==46) {
	}
	else {
		if (keycode < 48 || keycode > 57) {
			event.returnValue = false;
		}
	}
}
var wescoWindow = null
function ShowFactorySecondBoot(OrderItemKey,imgWidth,imgHeight) {

	if (!wescoWindow || wescoWindow.closed) {
	}
	else {
		wescoWindow.window.close();
		wescoWindow = null;
	}

	var xPos, yPos;
	var windowOptions;
	var imagename = OrderItemKey + ".jpg"
	var imgWidthPop = imgWidth+40;
	var imgHeightPop = imgHeight+50;
	xPos = screen.width - imgWidthPop;
	yPos = screen.height - imgHeightPop;
	windowOptions = "Width="+imgWidthPop+",Height="+imgHeightPop+",left=" + xPos + ",top=" + yPos +",alwaysRaised=yes,scrollbars=1";
	wescoWindow = window.open("fs_bootimage.asp?i="+imagename,"getParm",windowOptions);
}

function AccountSubmit(AccountFormName) {
	document.forms[AccountFormName].submit();
}
function FSedit(bootkey) {
	document.adminshell.itemkey.value = bootkey;
	document.adminshell.submit();
}
function FSsearch() {
	if (document.fs.CancelSubmit.value == 'NO') {
		document.fs.CancelSubmit.value = 'YES';
		document.fs.submit();
	}
}

var infoWindow = null
var editWindow = null;
var editWindow2 = null;
var xPos, yPos, wWidth, wHeight;
var windowOptions;

function RunAsScanner(BC, asm, asa, asc, byps, pos) {

    var confirmit = true;
    if (byps==0) {
        confirmit = confirm("This will print a box label, do you wish continue?");
    }
    else {
        confirmit = confirm("This will NOT print a box label, do you wish continue?");    
    }
	if (confirmit==true) {
	    if (!editWindow || editWindow.closed) {
	    }
	    else {
		    editWindow.window.close();
		    editWindow = null;
	    }

        wWidth = 200;
        wHeight = 300;
		
	    xPos = screen.width / 2 - 225;
	    yPos = screen.height / 2 - 125;
	
	    windowOptions = "Width=" + wWidth + ",Height=" + wHeight + ",left=" + xPos + ",top=" + yPos +",alwaysRaised=yes";
	    editWindow = window.open("A_SCANNER.aspx?bc="+BC+"&asm="+asm+"&asa="+asa+"&asc="+asc+"&bypass="+byps+"&pos="+pos,"getParm",windowOptions);
    }
}

function UpdateImage(imgstr) {

	if (!editWindow || editWindow.closed) {
	}
	else {
		editWindow.window.close();
		editWindow = null;
	}

    wWidth = 500;
    wHeight = 125;
	
	xPos = screen.width / 2 - 225;
	yPos = screen.height / 2 - 125;
	
	windowOptions = "Width=" + wWidth + ",Height=" + wHeight + ",left=" + xPos + ",top=" + yPos +",alwaysRaised=yes";
	editWindow = window.open("A_UPLOAD_GETFILE.asp?file="+imgstr,"getParm",windowOptions);
}

function ShowDetails(sType,bek,sek) {

	if (!editWindow || editWindow.closed) {
	}
	else {
		editWindow.window.close();
		editWindow = null;
	}

    if (sType == 'STOCK_PROD' || sType == 'STOCK_REQ' || sType == 'STOCK_REQ_ACC') { //STOCK MGMT 
        wWidth = 600;
        wHeight = 500;
	}
    else {
        if (sType == 'INV_DETAIL' || sType == 'ITEM_STATUS_HISTORY' || sType == 'CUST_NOTES' || sType == 'CUST_NOTES_COMMON') {
            wWidth = 600;
            wHeight = 500;
        }
    	else { //DEFAULT DISPLAY
            if (sType == 'INV_SHIPPING' || sType == 'INV_SHIPPING_NEW' || sType == 'CUST_XFER') {
                wWidth = 300;
                wHeight = 350;
                if (sType == 'CUST_XFER') {wHeight = 220;}
    	    }	
        	else { //DEFAULT DISPLAY
                wWidth = 500;
                wHeight = 125;
      	    }	
        }
    }
	xPos = screen.width / 2 - 225;
	yPos = screen.height / 2 - 125;
	
	windowOptions = "Width=" + wWidth + ",Height=" + wHeight + ",left=" + xPos + ",top=" + yPos +",directories=no,menubar=no,toolbar=no,scrollbars=yes,status=no";
	editWindow = window.open("A_COMMON_DETAILS.asp?type="+sType+"&bek="+bek+"&sek="+sek,"getParm",windowOptions);
}

function ShowPaymentDetails(OK, PK) {

    if (!editWindow || editWindow.closed) {
    }
    else {
	    editWindow.window.close();
	    editWindow = null;
    }

    wWidth = 400;
    wHeight = 300;

    xPos = screen.width / 2 - 225;
    yPos = screen.height / 2 - 125;
	
    windowOptions = "Width=" + wWidth + ",Height=" + wHeight + ",left=" + xPos + ",top=" + yPos +",directories=no,menubar=no,toolbar=no,scrollbars=yes,status=no";
    editWindow = window.open("A_ORDER_PAYMENT_HISTORY.asp?OK="+OK+"&PK="+PK,"getParm",windowOptions);
}

function EditCustomFeatures(editmode,iKey,sKey,eKey) {

	if (!editWindow || editWindow.closed) {
	}
	else {
		editWindow.window.close();
		editWindow = null;
	}

    if (editmode=='ADD') {
        wWidth = 800;
        wHeight = 800;
    }
    else {
        if (editmode=='EDIT') {
            wWidth = 800;
            wHeight = 800;
        }
        else {
            if (editmode=='STITCHING') {
                wWidth = 400;
                wHeight = 350;
            }
            else {
                wWidth = 400;
                wHeight = 325;
            }
        }        
    }

    xPos = (screen.width / 2) - (wWidth / 2);
    yPos = 250;
    
	windowOptions = "Width=" + wWidth + ",Height=" + wHeight + ",left=" + xPos + ",top=" + yPos +",directories=no,menubar=no,toolbar=no,scrollbars=yes,status=no";
	editWindow = window.open("cart_custom_edit.asp?editmode="+editmode+"&iKey="+iKey+"&sKey="+sKey+"&eKey="+eKey,"getParm",windowOptions);
}
function SubmitDocument(tt) {
    if (tt=='email') {
        document.SendDocument.targettype.value = tt;
    }
    if (tt=='fax') {
        document.SendDocument.targettype.value = tt;
    }
    if (tt=='print') {
    	var selObj = document.SendDocument[tt];
        document.SendDocument.targettype.value = selObj[selObj.selectedIndex].value;
    }
    document.SendDocument.submit();
}

function PlayVideo(VT, VK) {

    if (!infoWindow || infoWindow.closed) {
    }
    else {
	    infoWindow.window.close();
	    infoWindow = null;
    }

    wWidth = 630;
    wHeight = 400;

    xPos = screen.width / 2 - 225;
    yPos = screen.height / 2 - 125;
	
    windowOptions = "Width=" + wWidth + ",Height=" + wHeight + ",left=" + xPos + ",top=" + yPos +",directories=no,menubar=no,toolbar=no,scrollbars=no,status=no";
    infoWindow = window.open("http://www.westcoastshoe.com/wesco/video.asp?VT="+VT+"&VK="+VK,"getParm",windowOptions);
}

function ShowSwatch(imgstr) {

	if (!infoWindow || infoWindow.closed) {
	}
	else {
		infoWindow.window.close();
		infoWindow = null;
	}

	var xPos, yPos, wWidth, wHeight;
	var windowOptions;

    wWidth = 275;
    wHeight = 360;

	xPos = (screen.width / 2) - (wWidth / 2);
	yPos = 250;

	windowOptions = "Width=" + wWidth + ",Height=" + wHeight + ",left=" + xPos + ",top=" + yPos +",directories=no,menubar=no,toolbar=no,scrollbars=no,status=no";
	infoWindow = window.open("custom_swatch_popup.asp?file="+imgstr,"getParm",windowOptions);
}

function Track(sok,rtn) {

	if (!editWindow || editWindow.closed) {
	}
	else {
		editWindow.window.close();
		editWindow = null;
	}

    wWidth = 275;
    wHeight = 275;

    xPos = screen.width / 2 - 225;
	yPos = screen.height / 2 - 125;
	
	windowOptions = "Width=" + wWidth + ",Height=" + wHeight + ",left=" + xPos + ",top=" + yPos +",directories=no,menubar=no,toolbar=no,scrollbars=yes,status=no";
	editWindow = window.open("shipments.asp?sok="+sok+"&rtn="+rtn,"getParm",windowOptions);
}	
