function SetSelect(HTMLName, Name,Row,Column,Select)
{
   document.LANSA._SELECT.value=Select;
   SetNameLocation(Name,Row,Column);
   document.LANSA._CALFLD.value=HTMLName;
}

function SetNameLocation(Name,Row,Column)
{
   document.LANSA._NAME.value=Name;
   document.LANSA._ROW.value=Row;
   document.LANSA._COLUMN.value=Column;
   document.LANSA._CALFLD.value=Name;
}

function SetFocus()
{
   var NumElements=document.LANSA.elements.length;

   for (i=0; i<NumElements;i++)
   {
      if (document.LANSA.elements[i].type=="checkbox" ||
          document.LANSA.elements[i].type=="textarea" ||
          document.LANSA.elements[i].type=='text')
      {
         if (document.LANSA.elements[i].value!="")
            document.LANSA.elements[i].select();
         document.LANSA.elements[i].focus();
         break;
      }
   }
}

function preload(imgObj,imgSrc)
{
   if (document.images)
   {
      eval(imgObj+' = new Image()');
      eval(imgObj+'.src = "'+imgSrc+'"');
   }
}

function changeImage(layer,imgObj, imgName)
{
   if (document.images)
   {
      if (document.layers && layer!=null)
         eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src');
      else
         document.images[imgName].src = eval(imgObj+".src");
   }
}

function CheckNUpdate(Fld, Value)
{
   var NumElements=document.LANSA.elements.length;

   for (i=0; i<NumElements;i++)
   {
      if (document.LANSA.elements[i].name==Fld)
      {
         document.LANSA.elements[i].value=Value;
         break;
      }
   }
}

function FieldExists(Fld)
{
   var NumElements=document.LANSA.elements.length;

   for (i=0; i<NumElements;i++)
   {
      if (document.LANSA.elements[i].name==Fld)
         return true;
   }
  return false;
}

function SetState(obj, RFld, chkValue, unchkValue)
{
  var NumElements=document.LANSA.elements.length;

  for (i=0; i<NumElements;i++)
  {
    if (document.LANSA.elements[i].name==RFld)
    {
      if (obj.checked)
         document.LANSA.elements[i].value=chkValue;
      else
         document.LANSA.elements[i].value=unchkValue;
      break;
    }
  }
}

function GetFieldValue(RFld)
{
  var NumElements=document.LANSA.elements.length;

  for (i=0; i<NumElements;i++)
  {
    if (document.LANSA.elements[i].name==RFld)
         return document.LANSA.elements[i].value;
  }
  return null;
}

function SetCBState(obj, RFld, CY, CN)
{
   var NumElements=document.LANSA.elements.length;

   for (i=0; i<NumElements;i++)
   {
      if (document.LANSA.elements[i].name==RFld)
      {
         if (obj.checked)
            document.LANSA.elements[i].value=CY;
         else
            document.LANSA.elements[i].value=CN;
         break;
      }
   }
}

function StartFunction(URL)
{
  var win;
  win=window.open("","TESTFNC");
  if (win != null)
    win.location=URL;
  win.focus();
}

function ECSelect(proc,fun,ECparm)
{
  document.LANSA.action += '+FUNCPARMS+ECPARM(A0500):' + ECparm;
  HandleEvent(proc, fun);
}

// ELITE BUILD Scripts

var sealWin;
var nextImg;
var zoomImg;
var indexImg;
var prevImg;
var liveChat;
var catalogOpen;

function setDistributor(distributorCode)
{
	document.LANSA.ASTDRENTRY.value = 'V';
	document.LANSA.elements['ADSTCD    '].value = distributorCode;
	HandleEvent('ELT_BUILD', 'DISTRIB');
}

function setDistributorProductLine(countryCode, distributorCode, productLine)
{
		document.LANSA.elements['ACRYCD_E  '].value = countryCode;
		document.LANSA.elements['ADSTCD_E  '].value = distributorCode;
		document.LANSA.elements['APRDLN_E  '].value = productLine;
		document.LANSA.elements['ALW3PRVFUN'].value = 'HOMPGE1';
		HandleEvent('ELT_BUILD', 'CATALOG');
}

function setOptionCounter(OptionCounter)
{	OptionCounterField.value = OptionCounter;
	return;
}

function isARadioButtonSelected(RadioButtonGroup)
{  if (RadioButtonGroup.length) {
	for (i=0; i<RadioButtonGroup.length; i++)
	{
	if (RadioButtonGroup[i].checked) return(true);
	}
	return(false);
	}
     else
	return(RadioButtonGroup.checked);
}

function buildActionPath(Url)  {


	strCGI = "/CGI"

       if (browserName == "Netscape")
        {
	actionUrl = document.LANSA.action;
	position = actionUrl.indexOf(strCGI);
 	acUrl =  actionUrl.substring(position, actionUrl.length);
            document.LANSA.action =  Url + acUrl;
        }
	else{
	document.LANSA.action = Url + tempAction;
	}
    }

//end https script

function ShowPDFPage(pdfFileName)
{
	newURL = location.protocol+'//'+location.host+pdfFileName;
	PDFWindow=window.open(newURL,'PDFs', 'Height=480,Width=640,Top=100,Left=150,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
}

function popUp(url,Width, Height) {

var Width;
var Height;
if (Width == 0) Width = 500;
if (Height == 0) Height = 450;
var windowParms = 'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width='+Width+',height='+Height;
sealWin=window.open(url,"win",windowParms);
self.name = "mainWin";
}

function ShowPrivacyPolicy()
{		
	newURL = location.protocol+'//'+location.host+'/images/'+gdstcd+'_Privacy_'+glang+'.htm'
	PrvWindow=window.open(newURL,'Policy', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	PrvInterval = setInterval("if (PrvWindow.closed) {PrvWindow = null; clearInterval(PrvInterval);}", 250);
}

var PromptField;
var PromptDescription;

function setPromptFieldValue(FieldValue, FieldDescription)
{
	PromptField.value=FieldValue;
	try {  if (FieldDescription != '')
		PromptDescription.value=FieldDescription;
		}
	catch(theError)
		{ };
	PromptField.focus();
}

/* Display an image in a pop-up window */
function showPic(PicImg, WindowWidth, WindowHeight)
{
            newURL = location.protocol+'//'+location.host+'/images/'+PicImg;
        	PictureWindow=window.open(newURL,'Picture', 'Height=WindowHeight,Width=WindowWidth,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	PictureWindow.resizeTo(WindowHeight,WindowWidth);
	PictureWindow.focus();
	PictureInterval = setInterval("if (PictureWindow != null) {if (PictureWindow.closed) {PictureWindow = null; clearInterval(PictureInterval);}}", 200);
}

function CheckOut()
{
// if catalogshopper is open, close added 3/30/2007 eltklf #133
try { if (!sealWin.closed) {
	          sealWin.close();  
           	}
	                           }
	  catch(theError) {

}

// are we in https mode?
currentUrl = new String(window.location);
if (currentUrl.indexOf('https') == 0)
	HandleEvent('ELT_BUILD','CHKOUT1');
else
{
	document.LANSA.ALW3SECURE.value='Y';
	document.LANSA.ALW3PRVFUN.value=document.LANSA._FUNCTION.value;
	HandleEvent2('ELT_BUILD','CHKOUT1');
	}
}

function SetCBState(obj, RFld, CY, CN)
{
var NumElements=document.LANSA.elements.length;
for (i=0; i<NumElements;i++)
	{
	if (document.LANSA.elements[i].name==RFld)
		{if (obj.checked) document.LANSA.elements[i].value=CY
		else document.LANSA.elements[i].value=CN;
		break;
		}
	}
}

function HandleTest(Option)
{
  if (Option == "")
	 	   alert('No option selected!');
			 else
			 {if (validOptionAngle(Option))
				HandleEvent('ELT_BUILD2', 'JWLOPT2');
				else alert('Please select the appropriate angle.')};
}

function TestContent(Option)
   {
       var x = Option.length;
       var y = true;
        if (x)
	    {
                 y = false;
	     for (i=0; i<x; i++)
	              {
	                 if (document.LANSA.CONTENT[i].checked) y = true;
	              }
	     }
        if (y == true)
	    {
           	  document.LANSA.ASTDPRVFUN.value='JWLOPT3';
	HandleEvent('ELT_BUILD2', 'JWLOPT3');
           	}
	else alert('No content selected!');	 			
}

function sendSubmitForm(FormName, Width, Height) {

   var Width;
   var Height;
   if (Width == 0) Width = 500;
   if (Height == 0) Height = 450;
   window.name = "main";
   var a = window.setTimeout("document.FormName.submit();",500);
  // var dCatalogWindow = window.open("","myNewWin","width=Width,height=Height,toolbar=0");
}

function orderItem(item, page, catalogId) {

     try { if (!spcordWindow.closed)
		sealWin.sendMessage();
	//	alert('Please finish the garment configuration before ordering another item');
		spcordWindow.focus();

		}
	  catch(theError) {
origItem = item.substr(1, 8);
configuredGarment = item.substr(0, 1)
catalog = catalogId.substr(0, 2);
catalogRel = catalogId.substr(2, 3);
document.LANSA.elements['ACAT_E    '].value = catalog;
document.LANSA.elements['ACATRL_E  '].value = catalogRel;
document.LANSA.elements['AITMNO    '].value = origItem;
document.LANSA.elements['ALW3PRVFUN'].value = "ITMSRCH";


var NumElements=document.LANSA.elements.length;
for (i=0; i<NumElements;i++)
	{

	if (document.LANSA.elements[i].name=="AITMNO    ")
		{document.LANSA.elements[i].value=origItem;

		}
	}


if(configuredGarment != 'Y') {

HandleEvent('ELT_BUILD', 'PRDDET1');
}

else {

// SpecOrder('<RDML MERGE="CAT">', '<RDML MERGE="CATRL">', '<RDML MERGE="ITMNO">')
SpecOrder(catalog, catalogRel, origItem) ;};

}

}

function appletPopUpOld(url,Width, Height) {
alert(document.LANSA.elements['AW_GOSHOP '].value);
if(document.LANSA.elements['AW_GOSHOP '].value == "Y")
return;
var Width;
var Height;
if (Width == 0) Width = 500;
if (Height == 0) Height = 450;
if(nextImg) {
   url1 = url.substr(0, url.indexOf("nextButtonImageName") + 20);
   url2 = url.substr(url.indexOf("nextButtonImageName") + 20, 1000);
   url = url1;
   url = url.concat(nextImg + url2);
   }
if(zoomImg) {
   url1 = url.substr(0, url.indexOf("zoomButtonImageName") + 20);
   url2 = url.substr(url.indexOf("zoomButtonImageName") + 20, 1000);
   url = url1;
   url = url.concat(zoomImg + url2);
   }
if(indexImg) {
   url1 = url.substr(0, url.indexOf("indexButtonImageName") + 21);
   url2 = url.substr(url.indexOf("indexButtonImageName") + 21, 1000);
   url = url1;
   url = url.concat(indexImg + url2);
   }
if(prevImg) {
   url1 = url.substr(0, url.indexOf("previousButtonImageName") + 24);
   url2 = url.substr(url.indexOf("previousButtonImageName") + 24, 1000);
   url = url1;
   url = url.concat(prevImg + url2);
   }
if(liveChat) {
   url1 = url.substr(0, url.indexOf("liveChat") + 9);
   url2 = url.substr(url.indexOf("liveChat") + 9, 1000);
   url = url1;
   url = url.concat(liveChat + url2);
   }
var windowParms = 'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width='+Width+',height='+Height;
sealWin=window.open(url,"sealWin",windowParms);
//optionWindowInterval = setInterval("if (sealWin.document.jspform.itemToOrder.value != null) {sealWin = null; clearInterval(optionWindowInterval);focus();HandleEvent('ELT_BUILD', 'CURORD1');showModelessDialog(closeWindowURL);}", 250);

self.name = "mainWin";
if (!sealWin.opener)
   sealWin.opener = self;

sealWin.focus();
}

function cycleCatItem() {

if (sealWin == null) {

   }
else {

    if (sealWin.document.jspform) {

      if (sealWin.document.jspform.itemToOrder.value != " " ) {
      orderItem(sealWin.document.jspform.itemToOrder.value, sealWin.document.jspform.pageNbr.value, sealWin.document.jspform.itemCatalog.value)
         }
      }
  }

}

function loadAppletParmsOld(nextVar,zoomVar,indexVar,prevVar,liveHlpVar) {
//var browserName = navigator.appName;
//var tempAction =  document.LANSA.action;
//pos2 = 4;
//strCGI = "/CGI"
//port = ":"
secureHttp = "https";
defaultHttp = "http";

//Is the page currently in HTTP or HTTPS mode
currentUrl = new String(window.location);
Mode =  currentUrl.substring(0, 5).toUpperCase();
if (Mode == secureHttp.toUpperCase()) {
document.LANSA.elements['AW_GOSHOP '].value = "Y";
alert('going to call ' + gfunc);
HandleEvent(gproc, gfunc);
return;
}

nextImg = "";
zoomImg = "";
indexImg = "";
prevImg = "";
liveChat = "";

if(liveHlpVar == 'N') {
   liveChat = "none";
}

if(nextVar.match(".gif")||nextVar.match(".jpg")||nextVar.match(".JPG")||nextVar.match(".GIF")) {

   nextImg = nextVar;
   document.LANSA.elements['AW_JCATNX '].value=nextImg;
   }
if(zoomVar.match(".gif")||zoomVar.match(".jpg")||zoomVar.match(".JPG")||zoomVar.match(".GIF")) {
  zoomImg = zoomVar;
   }
if(indexVar.match(".gif")||indexVar.match(".jpg")||indexVar.match(".JPG")||indexVar.match(".GIF")) {
   indexImg = indexVar;
   }
if(prevVar.match(".gif")||prevVar.match(".jpg")||prevVar.match(".JPG")||prevVar.match(".GIF")) {
   prevImg = prevVar;
   }
}

function doViewCart() {
HandleEvent('ELT_BUILD', 'CURORD1');
}

function continueShopping(process, func) {
Process = process;
Func = func;
try { if (!sealWin.closed)
		sealWin.focus();
}
	  catch(theError) {
 HandleEvent(Process, Func);
 }
}

function emailsignup()
   {
      var head= document.getElementsByTagName('head')[0];
      var script= document.createElement('script');
      script.type= 'text/javascript';
      script.src= 'http://forms.aweber.com/form/92/split_440550292.htm';
      head.appendChild(script);
   }

function setItem(Prodlin, Cat, Catrls, ItemCls, Item, Level)
{
	var Prev = 'ITMSRCH';
	document.LANSA.elements['APRDLN_E  '].value = Prodlin;
	document.LANSA.elements['ACAT_E    '].value = Cat;
	document.LANSA.elements['ACATRL_E  '].value = Catrls;
	document.LANSA.elements['AITMCL_E  '].value = ItemCls;
	document.LANSA.elements['AITMNO    '].value = Item;

	if (Level == 5) {
		SpecOrder(Cat, Catrls, Item);
	}
	if (Level == 4) {
		document.LANSA.elements['ALW3PRVFUN'].value = Prev;
		HandleEvent('ELT_BUILD', 'PRDDET1');
	}
	if (Level == 3) {
		HandleEvent('ELT_BUILD', 'PRDCAT1');
	}
	if (Level == 2) {
		HandleEvent('ELT_BUILD', 'ITEMCLS');
	}
	if (Level == 1) {
		HandleEvent('ELT_BUILD', 'CATALOG');
	}
}


function ASPSpecOrder(Catalog, CatalogRelease, ItemNumber, SessionID, ConfigCounter)
{
 
        newURL_Old = location.protocol+'//'+location.host+ '/gy/Default.aspx' + '?cat=' + Catalog + '&catrl=' + CatalogRelease + '&itmno=' + ItemNumber + '&sessionid=' + SessionID;
        newURL = 'http://gkdev/gy/Default.aspx' + '?cat=' + Catalog + '&catrl=' + CatalogRelease + '&itmno=' + ItemNumber + '&sessionid=' + SessionID + '&cfgctr=' + ConfigCounter;
                
	spcordWindow=window.open(newURL,'SpecialOrderWindow', 'Height=768,Width=1024,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	optionWindowInterval = setInterval("if (spcordWindow.closed) {spcordWindow = null; clearInterval(optionWindowInterval);focus();HandleEvent('ELT_BUILD', 'CURORD1');showModelessDialog(closeWindowURL);}", 250);
	           

}

function RmvODBCMsg()
{
	Chk = 'texttest';
	var NumElements = document.LANSA.elements.length;

	for (i = 0; i < NumElements; i++) {
	  if (document.LANSA.elements[i].name == Chk) {
	    testStr = document.LANSA.elements[i].value;
	    testStr = testStr.replace(/^The error details have been recorded into x_err.+\n.+$/m, " ");
	    document.LANSA.elements[i].value = testStr;
	    regexp = /A|E|I|O|U|Y|a|e|i|o|y/;
	    matchPos1 = testStr.search(regexp);
	    if(matchPos1 == -1)
	      document.getElementById('lansamsg').style.visibility = 'hidden';
	    return;
	  }
	}
        return;
}

function setLanguage(languageCode)
{
	sessionPartition = gpart;
	partLang = glang;
	procFuncPart ="?PROCFUN+" + gproc + "+" + gfunc + "+" + sessionPartition ;
	debugPart = "+BDEBUG+";
	setLanguageFlag = "+SETLANG(A0010):Y";
	procFuncPart = procFuncPart.toUpperCase();
	hrefUpper = location.href.toUpperCase();

// Do we have a language-specific static page?
		if (document.LANSA.LLW3DOCNAM.value != '')
		{
		 	posLangCode = document.LANSA.LLW3DOCNAM.value.toUpperCase().indexOf('_'+partLang);
			if (posLangCode >= 0)			
				document.LANSA.LLW3DOCNAM.value =
					document.LANSA.LLW3DOCNAM.value.substring(0,posLangCode + 1)+languageCode+document.LANSA.LLW3DOCNAM.value.substring(posLangCode + languageCode.length + 1);
		}
// Was the function invoked via a URL or a submit()?

	positionSPL = hrefUpper.indexOf(procFuncPart);
	if (positionSPL >= 0)
	{	
		positionSPL = positionSPL + procFuncPart.length;
		// Was a language specified?
		if (hrefUpper.substring(positionSPL + 1, positionSPL + 1 + partLang.length) == partLang)
			{
			temphref = location.href.substring(0, positionSPL) + "+" + languageCode + location.href.substring(positionSPL + 1 + languageCode.length);
			posLangFlag = temphref.indexOf(setLanguageFlag);
				if (posLangFlag >= 0)
					location.href = temphref.substring(0, posLangFlag) + temphref.substring(posLangFlag + setLanguageFlag.length);
				else
					location.href = temphref;
			}
		else if (location.href.substring(positionSPL + 1).length == 0)
				location.href = location.href.substring(0, positionSPL) + "+" + languageCode;
			else
			{
				location.href = location.href.substring(0, positionSPL) + "+" + languageCode + "+" + location.href.substring(positionSPL + 1);
			}
	}
	else
	{	posDebug = document.LANSA.action.toUpperCase().indexOf('+BDEBUG');	
		if (posDebug >= 0)
			document.LANSA.action = document.LANSA.action.substring(0, posDebug - partLang.length ) + languageCode + document.LANSA.action.substring(posDebug);			
		else
		 	document.LANSA.action = document.LANSA.action.substring(0, document.LANSA.action.length - partLang.length) + languageCode;
		document.LANSA.submit();
	}
}
function selectDistributor(productLine)
{
	sessionPartition = gpart;
	partLang = glang;
	procFuncPart ="?PROCFUN+" + gproc + "+" + gfunc + "+" + sessionPartition;
	webeventPart =  "?WEBEVENT+"
	procFuncPart = procFuncPart.toUpperCase();
	hrefUpper = location.href.toUpperCase();
	var undefinedValue;

	positionSPL = hrefUpper.indexOf(procFuncPart);
	if (positionSPL >= 0)
	{
		newURL = hrefUpper.substring(0, positionSPL)+ "?PROCFUN+ELT_BUILD+DISTRIB+" + sessionPartition ;
		positionSPL = positionSPL +  procFuncPart.length;
		if (positionSPL != hrefUpper.length)
			newURL= newURL + "+" + location.href.substring(positionSPL + 1);
		newURL= newURL + "+FUNCPARMS+PRDLN_E(A0030):" + productLine;
	}
	else
	{ 	
		positionSPL = hrefUpper.indexOf(webeventPart);
		newURL = hrefUpper.substring(0, positionSPL)+ "?PROCFUN+ELT_BUILD+DISTRIB+" + sessionPartition ;
		positionSPL = hrefUpper.indexOf("+" + sessionPartition) + 1 + sessionPartition.length;
		if (positionSPL != hrefUpper.length)
			newURL= newURL + "+" + location.href.substring(positionSPL + 1);
		newURL= newURL + "+FUNCPARMS+PRDLN_E(A0030):" + productLine;
	}

	document.LANSA.elements['ACRYCD_E  '].value = '';
	document.LANSA.elements['ADSTCD_E  '].value = '';
	myArray = new Array (document.LANSA.elements['ACRYCD_E  '].value, document.LANSA.elements['ADSTCD_E  '].value);
	showModalDialog(newURL,myArray, 'dialogHeight:390px;dialogWidth:350px;status:no;help:no;resizable:no;titlebar:no;');
	if (myArray[0] != '' ) {
		document.LANSA.elements['ACRYCD_E  '].value = myArray[0];
		document.LANSA.elements['ADSTCD_E  '].value = myArray[1];
		document.LANSA.elements['APRDLN_E  '].value = productLine;
		HandleEvent('ELT_BUILD', 'PRODLIN');
	}
	myArray = null;
}
function selectCatalog(ProductLine)
{
	document.LANSA.elements['APRDLN_E  '].value = ProductLine;
	HandleEvent('ELT_BUILD', 'CATALOG');
}
function setSeasonalCatalog(Catalog, CatalogRelease, SalePrice)
{
	document.LANSA.elements['ACAT_E    '].value=Catalog;
	document.LANSA.elements['ACATRL_E  '].value=CatalogRelease;
	if (SalePrice > 0)
	{
		document.LANSA.ALW3PRVFUN.value = 'CATALOG';
		document.LANSA.elements['ASALEYN   '].value='Y';
		HandleEvent('ELT_BUILD', 'PRDCAT1');
	}
	else
	{
		document.LANSA.elements['ASALEYN   '].value='N';
		HandleEvent('ELT_BUILD', 'ITEMCLS');
	}
}
function setItemClass(ItemClass, SalePrice)
{
	document.LANSA.elements['AITMCL_E  '].value=ItemClass;
	document.LANSA.elements['ASALEYN   '].value=SalePrice;
	if (document.LANSA.elements['ACAT_E    '].value.toUpperCase() !='CAT')
		HandleEvent('ELT_BUILD', 'PRDCAT1');
	else
		HandleEvent('ELT_BUILD', 'CATCAT1');
}
function JewelOptions(Catalog, CatalogRelease, ItemNumber, FabricType, ColorCode, LineNumber, OptionCounter, JewelButtonObject)
{		
	OptionCounterField = OptionCounter;
	JewelOptionButton = JewelButtonObject;
	newURL = location.protocol+'//'+location.host+location.pathname
		+'?PROCFUN+ELT_BUILD2+JWLOPT1+'+gpart+'+'+ glang
		+ '+FUNCPARMS+ITMNO(A0080):' + ItemNumber + '+FABTY(A0050):' + FabricType + '+CLRCD(A0050):' + ColorCode
		+ '+STDSESSID(S0150):'+gsesid+'+LW3ORDNUM(A0060):'+gordnum+'+OPTCTR(S0070):'+OptionCounter.value
		+ '+DSTCD_E(A0070):'+gdstcd+'+CUSTY_E(A0030):'+gcusty+'+CAT_E(A0020):'+Catalog
		+ '+CATRL_E(A0030):'+CatalogRelease;

	optionWindow=window.open(newURL,'JewelOptionWindow', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	if (gfunc == 'CURORD1') 

	{

	  JewelInterval = setInterval("if (optionWindow.closed) {optionWindow = null; clearInterval(JewelInterval);HandleEvent(gproc,gfunc)}", 250);
	}

	if (gfunc == 'CHKOUT1') 
	{
	  JewelInterval = setInterval("if (optionWindow.closed) {optionWindow = null; clearInterval(JewelInterval);HandleEvent(gproc,gfunc)}", 250);
        }
	if (gfunc == 'PRDDET1') 
	{
	  JewelInterval = setInterval("if (optionWindow.closed) {optionWindow = null; clearInterval(JewelInterval);self.focus();SetJewelButtonLabel(OptionCounterField, JewelOptionButton);}", 250);
        }
}
function JewelOptInqry(ItemNumber, FabricType, ColorCode, DistCode, OrderNumber, OrderSuffix, LineNumber, OptionCounter)
{		
	OptionCounterField = OptionCounter;
	newURL = location.protocol+'//'+location.host+location.pathname
		+'?PROCFUN+ELT_BUILD2+JWLOPT5+'+gpart+'+'+glang
		+ '+FUNCPARMS+ITMNO(A0080):' + ItemNumber + '+FABTY(A0050):' + FabricType + '+CLRCD(A0050):' + ColorCode
		+ '+STDSESSID(S0150):'+gsesid+'+DSTCD(A0070):' + DistCode + '+ORDNO(A0080):' + OrderNumber + '+ORDSFX(A0010):' + OrderSuffix + '+LINNO(S0030):' + LineNumber + '+OPTCTR(S0070):'+OptionCounter.value;
	optionWindow=window.open(newURL,'JewelOptionWindow', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
}
function SelectJewelOptions(Catalog, CatalogRelease, ItemNumber, FabricType, ColorCode, LineNumber, OptionCounter, JewelButtonObject)
{		
	OptionCounterField = OptionCounter;
	JewelOptionButton = JewelButtonObject;
	newURL = location.protocol+'//'+location.host+location.pathname
		+'?PROCFUN+ELT_BUILD2+OPTCTR2+'+gpart+'+'+glang
		+ '+FUNCPARMS+ITMNO(A0080):' + ItemNumber + '+FABTY(A0050):' + FabricType + '+CLRCD(A0050):' + ColorCode
		+ '+STDSESSID(S0150):'+gsesid+'+LW3ORDNUM(A0060):'+gordnum+'+OPTCTR(S0070):'+OptionCounter.value
		+ '+DSTCD_E(A0070):'+gdstcd+'+CUSTY_E(A0030):'+gcusty+'+CAT_E(A0020):'+Catalog
		+ '+CATRL_E(A0030):'+CatalogRelease;
	SelectOptionWindow=window.open(newURL,'SelectOptionWindow', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	JewelInterval = setInterval("if (SelectOptionWindow.closed) {SelectOptionWindow = null; clearInterval(JewelInterval); SetJewelButtonLabel(OptionCounterField, JewelOptionButton);}", 250);
}
function SetJewelButtonLabel(OptionCounter, ButtonObject)
{
	if (OptionCounter.value > 0)
		ButtonObject.value = gmtelt0020;
	else
		ButtonObject.value = gmtelt0001;
            ButtonObject.focus();ButtonObject.setActive();
}
function SetJewelButtonLabe2(OptionCounter, ButtonObject)
{
	if (OptionCounter.value > 0)
		ButtonObject.value = gmtelt0020;
	else
		ButtonObject.value = gmtelt0001;
        //    ButtonObject.focus();ButtonObject.setActive();
}
function ELT_SetFocus()
{
   var NumElements=document.LANSA.elements.length;

   for (i=0; i<NumElements;i++)
   {
      if (((document.LANSA.elements[i].type=="checkbox" ||
          document.LANSA.elements[i].type=='text')
	&& !(document.LANSA.elements[i].readOnly
	|| document.LANSA.elements[i].disabled))
            || (document.LANSA.elements[i].type=="textarea" && !document.LANSA.elements[i].disabled))
      {	
         if ((document.LANSA.elements[i].value!="") && (document.LANSA.elements[i].type!="textarea"))
            document.LANSA.elements[i].select();
	try { document.LANSA.elements[i].focus()
		break
		}
	catch(theError)
		{
		break
		}
      }
   }
if ((gcat != '') & (gproc != 'ELT_BUILD2'))
{
// Should a catalog banner display and is it a valid image?
    if (document.LANSA.elements['ACAT_E    '].value != '')
	{if (document.getElementById["CatalogBanner"] != null)
		{if (!CatalogBanner.complete)
		 CatalogBanner.src = '/images/BNR_CAT_GENERIC.gif'
		}
	}
}
}
function HandleEvent2(Proc,Func){
	if (document.LANSA.ALW3SECURE.value == 'Y'){
		if (document.LANSA.ALW3SECMOD.value != 'Y'){
			strCGI = "/CGI";
			port = ":";
			secureHttp = "https";
			defaultHttp = "http";
			// Secure Https call
			currentUrl = new String(window.location);
			pos2 = currentUrl.indexOf(port);
			position = currentUrl.indexOf(strCGI);
			pathUrl =  currentUrl.substring(pos2, position);
			originalUrl = pathUrl;
			portPosition = pathUrl.indexOf(port, 4);
			if (portPosition != -1)  {
				pathUrl = pathUrl.substring(0, portPosition);
			}
			if (gsslport != '')  {
			newUrl = secureHttp + pathUrl  + ':'+gsslport;
			}
			else {
			newUrl = secureHttp + pathUrl;
			}			
			buildActionPath(newUrl);
			//setting up orginal Http to be saved
			originalUrl = defaultHttp + originalUrl;
			if (document.LANSA.ALW3IPADDR.value == ""){
				document.LANSA.ALW3IPADDR.value = (originalUrl);
			}
		}
	}
	HandleEvent(Proc, Func);
}
//end https script
function SalesTermsAndConditions()
{		
	newURL = location.protocol+'//'+location.host+location.pathname
		+'?PROCFUN+ELT_BUILD2+SALTERM+'+gpart+'+'+glang
		+'+FUNCPARMS+DSTCD_E(A0070):'+gdstcd+'+STDSESSID(S0150):'+gsesid+'+STDWEBUSR(L0100):"'+gwebusr+'"';
	SalesTermWindow=window.open(newURL,'SalesTerms', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	SalesTermInterval = setInterval("if (SalesTermWindow.closed) {SalesTermWindow = null; clearInterval(SalesTermInterval);}", 250);
}
function validOptionAngle(optionNumber)
{
	try { if (document.LANSA.elements[OptionAngles[optionNumber].name].value != '')
		return true
		else
		return false
		}
//	No angle choices
	catch(theError)
		{
		return true
		}		
}
function showPrompt(PromptFieldName, PromptProcess, PromptFunction, PromptDescriptionField, PromptKeyParms)
{	var PromptDescriptionField;	
	var PromptKeyParms;	
	PromptField=PromptFieldName;
	PromptDescription=PromptDescriptionField;
	newURL = location.protocol+'//'+location.host+location.pathname
		+'?PROCFUN+'+PromptProcess+'+'+PromptFunction+'+'+gpart+'+'+glang;
	try {if (PromptKeyParms)
		newURL = newURL+'+FUNCPARMS+'+PromptKeyParms;}
	catch(theError) { };
	PromptWindow=window.open(newURL,'Prompt', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	PromptInterval = setInterval("if (PromptWindow.closed) {PromptWindow = null; clearInterval(PromptInterval);}", 250);
}
function largerImage(PhotoLocation, WindowWidth, WindowHeight)
{
var imageToDsp = "/images/" + PhotoLocation;
var linkColor = "#000295b"
OpenWindow=window.open("", "newwin", "height="+WindowHeight+", width="+WindowWidth+",toolbar=no,scrollbars=yes,menubar=no,resizable=yes");
OpenWindow.document.write("<TITLE>"+gitmno+" Larger Image </TITLE>")
OpenWindow.document.write("<BODY BGCOLOR=white LINK="+linkColor+" VLINK="+linkColor+" TEXT="+linkColor+" ALINK="+linkColor+">")
OpenWindow.document.write("<IMG SRC=" + imageToDsp + "><BR>")
OpenWindow.document.write("<A HREF=JavaScript:window.close()>"+gmtelt0009+"</A>")
OpenWindow.document.write("</BODY>")
OpenWindow.document.write("</HTML>")
OpenWindow.document.close()
self.name="main"
}
function isBrowserSupp() {
// Get the version of the browser
version = parseFloat( navigator.appVersion );
if ( ( version >= 2.0 ) && ( version < 2.1 ) && ( navigator.appName.indexOf( "Netscape" ) != -1 ) ) {
return false;
}
else {
return true;
}
}
function getDaysInMonth(mthIdx, YrStr)
{
  // all the rest have 31
  var maxDays=31
  // expect FEB. (of course)
  if (mthIdx==2)
    {
  if (isLeapYear(YrStr))
{ maxDays=29; }
    else  { maxDays=28; } }
  // thirty days hath...
  if (mthIdx==4 || mthIdx==6 || mthIdx==9 || mthIdx==11)
    {   maxDays=30; }
  return maxDays;
}
function isLeapYear(yrStr)
{
  var leapYear=false;
  // every fourth year is a leap year
  if ((parseInt(yrStr, 10)%4) == 0)
  { leapYear=true; } return leapYear;
}
//Calendar Section
//calculation functions
function nextMonth(month)
{
  if (month==12)
{ return 1;}else{ return (month+1);}
}
function prevMonth(month)
{
  var prevMonth = (month-1)
  if (month==1) { prevMonth = 12;}return prevMonth
}
//increments or decrements month when it goes past JAN or DEC
function changeYear(direction,month,year)
{
  var theYear = year
  if (direction=="next")
  {if (month == 12) {
      theYear = (year+1)
    }
  }
  if (direction=="prev")
  {
    if (month == 1)
    {   theYear = (year-1) }
}return theYear
}
//opens a new window for the calendar
function createCalendar(Wwidth, Wheight, Wtop, Wleft,format, fieldname)
{
// Sets the global DateFormat and Fieldname here
DateFormat = format;
FieldName = fieldname;

// Build the Calendar Windows HTML
var opt = "width=" + Wwidth + ",height=" + Wheight + ",top=" + Wtop + ",left=" + Wleft + ",resizable=no,scrollbars=no";
  if (!isBrowserSupp())
  {
    alert("Your browser is outdated and does not support this feature")
   return;
  }
  if (navigator.appVersion.indexOf("Mac",0) != -1)
  {
 calendarWindow = window.open("","Calendar", opt);
 }
  else
  {
    calendarWindow = window.open("","Calendar", opt);
 }
var today = new Date();
var mthIdx = today.getMonth();
var mthVal = today.getMonth() + 1;
var yearVal = today.getYear();

// If year returned is 100 (in Netscape Version 4.0x and below)
// Subtract 100 to give you just 00
if (yearVal == 100) yearVal = yearVal - 100;

// If year is between 00 and 50, assume that the year is in the 2000 era.
// otheriwse assume year is in the 1900 era
if ((yearVal >= 00) && (yearVal <= 50))
{
// if year is 00, add 2000 to give you a 4 digit year
yearVal = yearVal + 2000;
}
else
{
if (yearVal.length <= 2)
{
// If year is NOT between 00 and 50, ad 1900 to assume its in the 1900 era.
  yearVal = yearVal + 1900;
}
}
//call the function to populate the window
generateCalendar(calendarWindow,mthVal,yearVal)
}
//generates the meat of the calendar
function generateCalendar(target,month,year)
{
 if (!isBrowserSupp())
  {
   return;
  }
  var monthName = new Array ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
  //begin table for calendar
  target.document.open();
  calendar = "<html><head><title>Calendar</title></head><body bgcolor='white' topmargin=2 leftmargin=2><div align='center'>"
  calendar +="<table border=0 cellspacing=3 cellpadding=0>"
  calendar +="<tr valign=top>"
  var mthIdx = parseInt(month, 10);
  var endday = getDaysInMonth(mthIdx, year)

  //next month and previous month buttons
  var goPrevMonth = prevMonth(mthIdx)
  var goNextMonth = nextMonth(mthIdx)
  var nextYear = changeYear("next",parseInt(month, 10),parseInt(year, 10))
  var prevYear = changeYear("prev",parseInt(month, 10),parseInt(year, 10))
  var index = (mthIdx-1)

  //month header
  {
    calendar +="<form><td align=left colspan=7 bgcolor=#A7CCDC><table width='100%' border=0 cellpadding=0 cellspacing=0><tr><td><a href='javascript:void(0)' onClick='document.clear();opener.generateCalendar(opener.calendarWindow,"+goPrevMonth+","+
prevYear+")'><img border=0 src='"+gSETCALPREV+"'></B></a></font></td>"
    calendar +="<td align=center colspan=3 bgcolor=#A7CCDC><b><font size='-2' face='Arial' color='darkblue'>" + monthName[index] + " "
+ year + "</font></b></td>"
    calendar +="<td align=right colspan=2 bgcolor=#A7CCDC><a href='javascript:void(0)'onClick='document.clear();opener.generateCalendar(opener.calendarWindow,"+goNextMonth+","+
nextYear+")'><img border=0 src='"+gSETCALNEXT+"'></td></tr></table></td></tr>"
  }
  //writes in the day of the week labels
  calendar +="<tr align=center>"
  calendar +="<td align='center' bgcolor='#FFFFC0'><b><img src='"+gSETSCAL+"' border=0></b></font></td>"
  calendar +="<td align='center' bgcolor='#FFFFC0'><b><img src='"+gSETMCAL+"' border=0></b></font></td>"
  calendar +="<td align='center' bgcolor='#FFFFC0'><b><img src='"+gSETTCAL+"' border=0></b></font></td>"
  calendar +="<td align='center' bgcolor='#FFFFC0'><b><img src='"+gSETWCAL+"' border=0></b></font></td>"
  calendar +="<td align='center' bgcolor='#FFFFC0'><b><img src='"+gSETTCAL+"' border=0></b></font></td>"
  calendar +="<td align='center' bgcolor='#FFFFC0'><b><img src='"+gSETFCAL+"' border=0></b></font></td>"
  calendar +="<td align='center' bgcolor='#FFFFC0'><font color='#FF0000'><b><img src='"+gSETSCAL+"' border=0></b></font></td>"
  calendar +="</tr>"
  wholeDate = month + "/01/" + year
  thedate = new Date(wholeDate)
  firstDay = thedate.getDay()
  selectedmonth = mthIdx;
  var today = new Date();
  var thisyear = today.getYear() + 1900;
  selectedyear = year;

  var lastDay = (endday + firstDay+1)
  calendar +="<tr>"

  var daycounter = 0;
  for (var i = 1; i < lastDay; i++)
  {
    daycounter=i;
    if (i <= firstDay)
    {
      // 'empty' boxes prior to first day
      calendar +="<td><img border=0 src='"+gSETCALBLANK+"'></td>"
    }
    else
    {
      // enter date number
      if (i % 7 == 0 || i % 7 == 1)
      {
      if ((i-firstDay)==(today.getDate())&&(month == parseInt(today.getMonth() + 1)) &&(year == today.getYear()))
      {
       calendar +="<td bgcolor='lightgreen' align=center><a href='JavaScript:self.close();opener.closeCalendar"+"("+(i-firstDay)+ "," + selectedyear + ")'>"+(i-firstDay)+"</a></td>"
}
      else
      {
       calendar +="<td bgcolor='pink' align=center><a href='JavaScript:self.close();opener.closeCalendar"+"("+(i-firstDay)+ "," + selectedyear + ")'>"+(i-firstDay)+"</a></td>"
}
      }
      else
      {
        if ((i-firstDay)==(today.getDate())&&(month == parseInt(today.getMonth() + 1)) && (year == today.getYear()))
        {
       calendar +="<td bgcolor='lightgreen' align=center><a href='JavaScript:self.close();opener.closeCalendar"+"("+(i-firstDay)+ "," + selectedyear + ")'>"+(i-firstDay)+"</a></td>"
        }
        else
        {
       calendar +="<td align=center><a href='JavaScript:self.close();opener.closeCalendar"+"("+(i-firstDay)+ "," + selectedyear + ")'>"+(i-firstDay)+"</a></td>"
        }
      }
    }
    //must start new row after each week
    if (i % 7 == 0 && i != lastDay)
      {
      calendar +="</tr><tr>"
      }
    }
  calendar +="</tr>"

  //separator line

  //calendar +="<tr><td colspan=7 align=center width=200><hr noshade></td></tr></table></form></body></html>"
calendar +="</table></div></form></body></html>"

  target.document.write(calendar);
target.focus();
  target.document.close()
}
function SetDateField(FieldName, DateFormat, day, year)
{
// Get the total number of input elements on the page
var NumElements=document.LANSA.elements.length;

// Loop thorugh each input element
for (i=0; i<NumElements;i++)
{
// Find the matching fieldname and type
if (document.LANSA.elements[i].name==FieldName && document.LANSA.elements[i].type =="text")
{
// Set the Date to the selected date using the required format
if (DateFormat == 6)
{
document.LANSA.elements[i].value=year + "/" + selectedmonth + "/" + parseInt(day, 10);
}
else if (DateFormat == 5)
{
document.LANSA.elements[i].value=selectedmonth + "/" + day + "/" + year;
}
else if (DateFormat == 4)
{
document.LANSA.elements[i].value=parseInt(day,10) + "/" + selectedmonth + "/" + year;
}
else if (DateFormat == 3 || DateFormat == null)
{
document.LANSA.elements[i].value=parseInt(day,10) + "/" + selectedmonth + "/" + year;
break;
}
else if (DateFormat == 2)
{
document.LANSA.elements[i].value=selectedmonth + "/" + day + "/" + year;
break;
}
else if (DateFormat == 1)
{
document.LANSA.elements[i].value=year + "/" + selectedmonth + "/" + parseInt(day, 10);
break;
}
}
}
}
function closeCalendar(day, year)
{
// If no FieldName is passed in return. you could put an alert in here to inform the user that no FieldName was passed.

if (FieldName == null || FieldName == "")
{ return; }

// Set Default DateFOrmat to 1
if (DateFormat == null || DateFormat == "")
{ DateFormat = 1; }

// Add leading 0 if Month is less than 10
if (selectedmonth < 10)
{ selectedmonth = "0" + selectedmonth; }

if (day < 10 && day.length != 2) {day = "0" + day;}

// Make year 2 digit format only if DateFormat is 4, 5 or 6
if (DateFormat >= 4 && DateFormat <= 6)
{
if ((year >= 2000) && (year <= 2050))
{ year = parseInt(year, 10) - 2000; }
else
{ year = parseInt(year, 10) - 1900;}
if (year < 10) year = "0" + year;
}
// Call SetDateField to set the value of the Field to the Selected Date.
SetDateField(FieldName, DateFormat, day, year);
}
//---------------------------------------------------------------
//opens a new window for the calendar and sets the start month and year
function createCalendarSetBegin(Wwidth, Wheight, Wtop, Wleft,format, fieldname, begindate)
{
// Sets the global DateFormat and Fieldname here
DateFormat = format;
FieldName = fieldname;
Stryr = begindate.lastIndexOf("/");
fixYear = begindate.substring(Stryr + 1);
endMo = begindate.indexOf("/");
fixMonth = begindate.substring(0,endMo)
// Build the Calendar Windows HTML
var opt = "width=" + Wwidth + ",height=" + Wheight + ",top=" + Wtop + ",left=" + Wleft + ",resizable=no,scrollbars=no";
  if (!isBrowserSupp())
  {
    alert("Your browser is outdated and does not support this feature")
   return;
  }
  if (navigator.appVersion.indexOf("Mac",0) != -1)
  {
 calendarWindow = window.open("","Calendar", opt);
 }
  else
  {
    calendarWindow = window.open("","Calendar", opt);
 }
var today = new Date();
var mthIdx = today.getMonth();
var mthVal = today.getMonth() + 1;
var yearVal = today.getYear();
if (fixMonth < 13 && fixMonth > 0)
{
yearVal = fixYear;
mthVal = fixMonth;
}
// If year returned is 100 (in Netscape Version 4.0x and below)
// Subtract 100 to give you just 00
if (yearVal == 100) yearVal = yearVal - 100;

// If year is between 00 and 50, assume that the year is in the 2000 era.
// otheriwse assume year is in the 1900 era
if ((yearVal >= 00) && (yearVal <= 50))
{
// if year is 00, add 2000 to give you a 4 digit year
yearVal = yearVal + 2000;
}
else
{
if (yearVal.length <= 2)
{
// If year is NOT between 00 and 50, ad 1900 to assume its in the 1900 era.
  yearVal = yearVal + 1900;
}
}
//call the function to populate the window
generateCalendar(calendarWindow,mthVal,yearVal)
}
function PrintSilhouette(Distributor, OrderNumber, OrderSuffix, SilhouetteNumber, Catalog, CatalogRelease, ItemNumber, Configuration, LineNumber)
{		
	newURL = location.protocol+'//'+location.host+location.pathname
		+'?PROCFUN+ELT_BUILD2+CFGPRT1+'+gpart+'+'+glang
		+ '+FUNCPARMS+ITMNO(A0080):' + ItemNumber + '+SILNO(A0050):'+SilhouetteNumber
		+ '+STDSESSID(S0150):'+gsesid+'+ORDNO(A0080):'+OrderNumber+'+ORDSFX(A0010):'+OrderSuffix+'+CFGCTR(S0150):'+Configuration
		+ '+DSTCD(A0070):'+gdstcd+'+CUSTY_E(A0030):'+gcusty+'+CAT(A0020):'+Catalog
		+ '+CATRL(A0030):'+CatalogRelease
		+ '+LINNO(S0030):'+LineNumber;
	SilhouetteWindow=window.open(newURL,'SilhouetteWindow', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	SilhouetteInterval = setInterval("if (SilhouetteWindow.closed) {optionWindow = null; clearInterval(SilhouetteInterval)}", 250);
}
function continueShopping(process, func) {
Process = process;
Func = func;
try { if (!sealWin.closed)
		sealWin.focus();
                           }
	  catch(theError) {
 HandleEvent(Process, Func);}
}
function appletPopUp(url,Width, Height) {
if(document.LANSA.elements['AW_GOSHOP '].value == "Y")
return;
var Width;
var Height;
if (Width == 0) Width = 500;
if (Height == 0) Height = 450;
if(nextImg) {
   url1 = url.substr(0, url.indexOf("nextButtonImageName") + 20);
   url2 = url.substr(url.indexOf("nextButtonImageName") + 20, 1000);
   url = url1;
   url = url.concat(nextImg + url2);
   }
if(zoomImg) {
   url1 = url.substr(0, url.indexOf("zoomButtonImageName") + 20);
   url2 = url.substr(url.indexOf("zoomButtonImageName") + 20, 1000);
   url = url1;
   url = url.concat(zoomImg + url2);
   }
if(indexImg) {
   url1 = url.substr(0, url.indexOf("indexButtonImageName") + 21);
   url2 = url.substr(url.indexOf("indexButtonImageName") + 21, 1000);
   url = url1;
   url = url.concat(indexImg + url2);
   }
if(prevImg) {
   url1 = url.substr(0, url.indexOf("previousButtonImageName") + 24);
   url2 = url.substr(url.indexOf("previousButtonImageName") + 24, 1000);
   url = url1;
   url = url.concat(prevImg + url2);
   }
if(liveChat) {
   url1 = url.substr(0, url.indexOf("liveChat") + 9);
   url2 = url.substr(url.indexOf("liveChat") + 9, 1000);
   url = url1;
   url = url.concat(liveChat + url2);
   }
var windowParms = 'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width='+Width+',height='+Height;
sealWin=window.open(url,"sealWin",windowParms);
//optionWindowInterval = setInterval("if (sealWin.document.jspform.itemToOrder.value != null) {sealWin = null; clearInterval(optionWindowInterval);focus();HandleEvent('ELT_BUILD', 'CURORD1');showModelessDialog(closeWindowURL);}", 250);
self.name = "mainWin";
if (!sealWin.opener)
   sealWin.opener = self;
sealWin.focus();
}
function cycleCatItem() {
if (sealWin == null) {

   }
else {

    if (sealWin.document.jspform) {

      if (sealWin.document.jspform.itemToOrder.value != " " ) {
      orderItem(sealWin.document.jspform.itemToOrder.value, sealWin.document.jspform.pageNbr.value, sealWin.document.jspform.itemCatalog.value)
         }
      }
  }
}
function loadAppletParms(nextVar,zoomVar,indexVar,prevVar,liveHlpVar) {
//var browserName = navigator.appName;
//var tempAction =  document.LANSA.action;
//pos2 = 4;
//strCGI = "/CGI"
//port = ":"
secureHttp = "https";
defaultHttp = "http";

//Is the page currently in HTTP or HTTPS mode
currentUrl = new String(window.location);
Mode =  currentUrl.substring(0, 5).toUpperCase();
if (Mode == secureHttp.toUpperCase()) {
document.LANSA.elements['AW_GOSHOP '].value = "Y";
HandleEvent(gproc, gfunc);
return;
}
nextImg = "";
zoomImg = "";
indexImg = "";
prevImg = "";
liveChat = "";
if(liveHlpVar == 'N') {
   liveChat = "none";
}
if(nextVar.match(".gif")||nextVar.match(".jpg")||nextVar.match(".JPG")||nextVar.match(".GIF")) {
   nextImg = nextVar;
   document.LANSA.elements['AW_JCATNX '].value=nextImg;
   }
if(zoomVar.match(".gif")||zoomVar.match(".jpg")||zoomVar.match(".JPG")||zoomVar.match(".GIF")) {
  zoomImg = zoomVar;
   }
if(indexVar.match(".gif")||indexVar.match(".jpg")||indexVar.match(".JPG")||indexVar.match(".GIF")) {
   indexImg = indexVar;
   }
if(prevVar.match(".gif")||prevVar.match(".jpg")||prevVar.match(".JPG")||prevVar.match(".GIF")) {
   prevImg = prevVar;
   }
}
function SpecOrderOld(Catalog, CatalogRelease, ItemNumber)
{
            alert("SpecOrder original");
	if (location.protocol.toUpperCase() == 'HTTPS:')
			newURL = document.LANSA.ALW3IPADDR.value+location.pathname;
	else
			newURL = location.protocol+'//'+location.host+location.pathname;
	if (document.LANSA.elements['LSTDWEBUSR'].value == ''){
	//	ww3msg = "\n<RDML MERGE="*MTXTCFG0012">\n \n <RDML MERGE="*MTXTCFG0013">"
		if (confirm(ww3msg)){
			newURL = newURL
				+'?PROCFUN+ELT_BUILD2+CFGSTY0+<RDML MERGE="*PARTITION">+<RDML MERGE="*LANGUAGE">'
				+ '+FUNCPARMS+ITMNO(A0080):' + ItemNumber + '+STDSESSID(S0150):<RDML MERGE="STDSESSID">'
				+ '+DSTCD_E(A0070):<RDML MERGE="DSTCD_E">+CUSTY_E(A0030):<RDML MERGE="CUSTY_E">+CAT_E(A0020):'+Catalog + '+CATRL_E(A0030):'+CatalogRelease
				+ '+STDWEBUSR(L0100):<RDML MERGE="STDWEBUSR">'+ '+LW3IPADDR(A0350):<RDML MERGE="LW3IPADDR">';
			spcordWindow=window.open(newURL,'SpecialOrderWindow', 'Height=500,Width=750,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
			optionWindowInterval = setInterval("if (spcordWindow.closed) {spcordWindow = null; clearInterval(optionWindowInterval);focus();HandleEvent('ELT_BUILD', 'CURORD1');showModelessDialog(closeWindowURL);}", 250);
		}
		else{
			return;
		}
	}
	else{
		newURL = newURL
			+'?PROCFUN+ELT_BUILD2+CFGSTY0+<RDML MERGE="*PARTITION">+<RDML MERGE="*LANGUAGE">'
			+ '+FUNCPARMS+ITMNO(A0080):' + ItemNumber + '+STDSESSID(S0150):<RDML MERGE="STDSESSID">'
			+ '+DSTCD_E(A0070):<RDML MERGE="DSTCD_E">+CUSTY_E(A0030):<RDML MERGE="CUSTY_E">+CAT_E(A0020):'+Catalog + '+CATRL_E(A0030):'+CatalogRelease
			+ '+STDWEBUSR(L0100):<RDML MERGE="STDWEBUSR">'+ '+LW3IPADDR(A0350):<RDML MERGE="LW3IPADDR">';
		spcordWindow=window.open(newURL,'SpecialOrderWindow', 'Height=500,Width=750,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		optionWindowInterval = setInterval("if (spcordWindow.closed) {spcordWindow = null; clearInterval(optionWindowInterval);focus();HandleEvent('ELT_BUILD', 'CURORD1');showModelessDialog(closeWindowURL);}", 250);
	}
}
function SpecOrder(Catalog, CatalogRelease, ItemNumber)
{
	var nAgt = navigator.userAgent;
	var browserName  = '';
        if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
	  browserName  = 'IE';
	}
	if (location.protocol.toUpperCase() == 'HTTPS:')
			newURL = document.LANSA.ALW3IPADDR.value+location.pathname;
	else
			newURL = location.protocol+'//'+location.host+location.pathname;

            newURL = newURL
			+'?PROCFUN+ELT_BUILD2+CFGSTY0+'+gpart+'+'+glang
			+ '+FUNCPARMS+ITMNO(A0080):' + ItemNumber + '+STDSESSID(S0150):'+gsesid
			+ '+DSTCD_E(A0070):'+gdstcd+'+CUSTY_E(A0030):'+gcusty+'+CAT_E(A0020):'+Catalog + '+CATRL_E(A0030):'+CatalogRelease
			+ '+STDWEBUSR(L0100):'+gwebusr+'+LW3IPADDR(A0350):'+gIPADDR+'+BROWSER(A0100):'+browserName;
		spcordWindow=window.open(newURL,'SpecialOrderWindow', 'Height=768,Width=1024,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		optionWindowInterval = setInterval("testWindow();", 250);
}
function testWindow() {
try {
		if (spcordWindow != null && spcordWindow.closed){
		 clearInterval(optionWindowInterval);
		 focus();
		 HandleEvent('ELT_BUILD', 'CURORD1');
		 showModelessDialog(closeWindowURL);
		 }
   }
catch(e)
   {
	 clearInterval(optionWindowInterval);
	 focus();
	 HandleEvent('ELT_BUILD', 'CURORD1');
	 showModelessDialog(closeWindowURL);
   }
}
function configureOptions(Catalog, CatalogRelease, ItemNumber, ConfigurationNumber, ConfigurationStatus)
{
	var nAgt = navigator.userAgent;
	var browserName  = '';
        if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
	  browserName  = 'IE';
	}
	if (ConfigurationStatus.toUpperCase() == 'ERR')
		functionName = 'CFGSTY1';
	else
		functionName = 'CFGSTY1';
	newURL = location.protocol+'//'+location.host+location.pathname
			+'?PROCFUN+ELT_BUILD2+' + functionName + '+'+gpart+'+'+glang
			+ '+FUNCPARMS+ITMNO(A0080):' + ItemNumber + '+STDSESSID(S0150):'+gsesid
			+ '+DSTCD_E(A0070):'+gdstcd+'+CUSTY_E(A0030):'+gcusty+'+CAT_E(A0020):'+Catalog + '+CATRL_E(A0030):'+CatalogRelease
			+ '+STDWEBUSR(L0100):'+gwebusr+'+LW3IPADDR(A0350):'+gIPADDR
			+ '+CFGCTR(S0150):'+ConfigurationNumber+'+BROWSER(A0100):'+browserName;
	if (gfunc == 'CHKOUT1') {
		spcordWindow=window.open(newURL,'SpecialOrderWindow', 'Height=768,Width=1024,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		optionWindowInterval = setInterval("if (spcordWindow.closed) {spcordWindow = null; clearInterval(optionWindowInterval);focus();CheckOut();}", 250);
	}
	else {
		spcordWindow=window.open(newURL,'SpecialOrderWindow', 'Height=768,Width=1024,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		optionWindowInterval = setInterval("if (spcordWindow.closed) {spcordWindow = null; clearInterval(optionWindowInterval);focus();HandleEvent('ELT_BUILD', 'CURORD1');showModelessDialog(closeWindowURL);}", 250);
	}
}
function reviewConfiguration(Distributor, OrderNumber, OrderSuffix, Catalog, CatalogRelease, ItemNumber, ConfigurationNumber)
{
		newURL = location.protocol+'//'+location.host+location.pathname
			+'?PROCFUN+ELT_BUILD2+CFGSTY7+'+gpart+'+'+glang
			+ '+FUNCPARMS+ITMNO(A0080):' + ItemNumber + '+DSTCD_E(A0070):'+Distributor
			+ '+ORDNO(A0080):'+OrderNumber+'+ORDSFX(A0010):'+OrderSuffix+'+CUSTY_E(A0030):'+gcusty+'+CAT_E(A0020):'+Catalog
			+ '+CATRL_E(A0030):'+CatalogRelease
			+ '+STDWEBUSR(L0100):'+gwebusr+'+LW3IPADDR(A0350):'+gIPADDR
			+ '+CFGCTR(S0150):'+ConfigurationNumber;
		spcordWindow=window.open(newURL,'SpecialOrderWindow', 'Height=500,Width=750,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		optionWindowInterval = setInterval("if (spcordWindow.closed) {spcordWindow = null; focus();clearInterval(optionWindowInterval);}", 250);
}
function getFlashMovieObject(configCounter)
{
  if (window.document['CChanger'+configCounter])
  {
      return window.document['CChanger'+configCounter];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds['CChanger'+configCounter])
      return document.embeds['CChanger'+configCounter];
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById('CChanger'+configCounter);
  }
}
function callChange(varName, flashVar, configCounter)
{
 var flashMovie=getFlashMovieObject(configCounter);
 flashMovie.SetVariable("/:" + varName, flashVar);
}
function ShowPriceList()
{
	if (document.LANSA.elements['ACAT_E    '].value==''){
		alert(gmtWW3PRCCAT);
		return
	}
	if (glang == 'ENG'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'SPN' && gdstcd == 'ELITE'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'FRA' && gdstcd == 'ENG01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'FRA' && gdstcd == 'IRE01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'FRA' && gdstcd == 'BEL01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'FRA' && gdstcd == 'AUS01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'FRA' && gdstcd == 'FRA01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'DEU' && gdstcd == 'GER01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'DEU' && gdstcd == 'SWI01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'FIN' && gdstcd == 'FIN01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'FIN' && gdstcd == 'ICE01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'FIN' && gdstcd == 'NOR01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'FIN' && gdstcd == 'SWE01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	if (glang == 'DUT' && gdstcd == 'NET01'){
		newURL = location.protocol+'//'+location.host+'/PriceList/'+gcat+gcatrl+gdstcd+gcusty+glang+'Y.HTM'
		PrcWindow=window.open(newURL,'PriceList', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
		return
	}
	alert(gmtWW3PRCALT)
}
function open_sizechart()
{
var wourl='/images/sizecharts/'+gszchurl;
window.open(wourl,"sizechart",
		"toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=600, height=600");
}
function ShowPrivacyPolicy()
{
	newURL = location.protocol+'//'+location.host+'/images/'+gdstcd+'_Privacy_'+glang+'.htm'
	PrvWindow=window.open(newURL,'Policy', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	PrvInterval = setInterval("if (PrvWindow.closed) {PrvWindow = null; clearInterval(PrvInterval);}", 250);
}
function HandleEvent5(Proc,Func){
try { if (!sealWin.closed) {
            document.LANSA.elements['ACATSHOP  '].value = "Y";
            var catVar = document.LANSA.elements['ACATSHOP  '].value;
	}
                           }
	  catch(theError) {
document.LANSA.elements['ACATSHOP  '].value = "N";
var catVar = document.LANSA.elements['ACATSHOP  '].value;
}
   var pos2 = 4;
   tempAction =  document.LANSA.action;
   strCGI = "/CGI";
   if (document.LANSA.ALW3SECMOD.value == 'Y') {
      document.LANSA.action = window.location;
   } else {	
      port = ":";
      secureHttp = "https";
      defaultHttp = "http";
      // Secure Https call
      currentUrl = new String(window.location);	
      currentUrl = currentUrl.toUpperCase();
      position = currentUrl.indexOf(strCGI);
      if (currentUrl.indexOf('HTTPS') == 0)
         pos2 = 5;
      pathUrl =  currentUrl.substring(pos2, position);
      originalUrl = pathUrl;
      portPosition = pathUrl.indexOf(port, 4);
      if (portPosition != -1){
         pathUrl = pathUrl.substring(0, portPosition);
      }
      if (gsslport != ''){
      newUrl = secureHttp + pathUrl  + ':'+gsslport;
      }
      if (gsslport == ''){
      newUrl = secureHttp + pathUrl;
      }
      buildActionPath(newUrl);
      //setting up orginal Http to be saved
      originalUrl = defaultHttp + originalUrl;
      document.LANSA.ALW3SECMOD.value = 'Y';
      if (document.LANSA.ALW3IPADDR.value == "")  {
         document.LANSA.ALW3IPADDR.value = (originalUrl);
      }
   }
   HandleEvent(Proc, Func);
}
function switchEm(){
var browserName = navigator.appName;
var tempAction
tempAction =  document.LANSA.action;
strCGI = "/CGI";
secureHttp = "https";
currentUrl = new String(window.location);
pos2 = currentUrl.indexOf(secureHttp);
//Switch back to http mode if coming from https mode
 if (pos2 != -1 && document.LANSA.ALW3IPADDR.value != "" )   {
	actionUrlR = document.LANSA.action;
	positionR = actionUrlR.indexOf(strCGI);
	if (positionR != 0)
	 	actionUrlR =  actionUrlR.substring(positionR, actionUrlR.length);
	document.LANSA.action = document.LANSA.ALW3IPADDR.value + actionUrlR;
   }
if (gSETLANG == "Y")  {
setLanguage(glang);
}
}
function showPrompt(PromptFieldName, PromptProcess, PromptFunction, PromptDescriptionField, PromptKeyParms)
{	var PromptDescriptionField;	
	var PromptKeyParms;	
	PromptField=PromptFieldName;
	PromptDescription=PromptDescriptionField;
	newURL = location.protocol+'//'+location.host+location.pathname
		+'?PROCFUN+'+PromptProcess+'+'+PromptFunction+'+'+gpart+'+'+glang;
	try {if (PromptKeyParms)
		newURL = newURL+'+FUNCPARMS+'+PromptKeyParms;}
	catch(theError) { };
	PromptWindow=window.open(newURL,'Prompt', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	PromptInterval = setInterval("if (PromptWindow.closed) {PromptWindow = null; clearInterval(PromptInterval);}", 250);
}
function ShowImage(image)
{		
	newURL=location.protocol+'//'+location.host+'/images/'+image;
	ImgWin=window.open(newURL,'ItemImg','Height=200,Width=200,help=no,scrollbars=yes,resizeable=yes,menubar=no,toolbar=no');
	ImgWin.focus();
}
function OpenCFGSTY9()
{
	newURL = location.protocol+'//'+location.host+location.pathname
		+'?PROCFUN+ELT_BUILD2+CFGSTY9+'+gpart+'+'+glang
		+ '+FUNCPARMS+ITMNO(A0080):'+gitmno+'+STDSESSID(S0150):'+gsesid
		+ '+DSTCD_E(A0070):'+gdstcd+'+CUSTY_E(A0030):'+gcusty+'+CAT_E(A0020):'+gcat
		+ '+CATRL_E(A0030):'+gcatrl+'+CFGCTR(S0070):'+gcfgctr;
	optionDetailWindow=window.open(newURL,'OptionDetailWindow', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	OptDetailInterval = setInterval("if (optionDetailWindow.closed) {optionDetailWindow = null; clearInterval(OptDetailInterval);focus();}");
}
function configureJewels(Catalog, CatalogRelease, ItemNumber, JewelButtonObject, OptionCounter, ConfigurationCounter)
{
	OptionCounterField = OptionCounter;
	JewelOptionButton = JewelButtonObject;
	newURL = location.protocol+'//'+location.host+location.pathname
		+'?PROCFUN+ELT_BUILD2+JWLOPT1+'+gpart+'+'+glang
		+ '+FUNCPARMS+ITMNO(A0080):' + ItemNumber + '+STDSESSID(S0150):'+gsesid+'+LW3ORDNUM(A0060):'
		+ '+DSTCD_E(A0070):'+gdstcd+'+CUSTY_E(A0030):'+gcusty+'+CAT_E(A0020):'+Catalog
		+ '+CATRL_E(A0030):'+CatalogRelease + '+OPTCTR(S0070):'+goptctr+'+CFGCTR(S0070):'+ConfigurationCounter;
	optionWindow=window.open(newURL,'JewelOptionWindow', 'Height=480,Width=640,status=yes,help=no,resizable=yes,menubar=no,scrollbars=yes, toolbar=no,');
	JewelInterval = setInterval("if (optionWindow.closed) {optionWindow = null; clearInterval(JewelInterval);focus();document.LANSA.elements['ASTDRENTRY'].value='J';HandleEvent(gproc,gfunc)}", 250);
}
function goBackToLevel(LevelNumber, SearchValue)
{
	document.LANSA.elements['SOPTLVL   '].value=LevelNumber;
	document.LANSA.ASTDRENTRY.value='S';
	if (LevelNumber == 0)
	{
		document.LANSA.elements['ASILTY_S  '].value=SearchValue;
		HandleEvent('CFG_MAINT', 'ICF100');
		}
	else
	{
		HandleEvent(gproc, gfunc);
		}
}
function optionClicked(objectName, myRowNumber, divisionName)
{
	SetCBState(objectName, '__W_SLCTD   -'+myRowNumber+' A', 'Y', 'N');
	if (objectName.checked)
		document.LANSA.all['DIV', divisionName].disabled=false;
	else
		document.LANSA.all['DIV', divisionName].disabled=true;

}

function radioOptionClicked(myOption, parentOption, myRowNumber)
{
	currentDivision = 'CURRDIV'+parentOption;
	myOptionName = 'OP'+myOption;
	currentSelection = 'CURR_W_SLCTD'+parentOption;
	if (document.LANSA.elements[currentDivision].value !='' && document.LANSA.elements[currentDivision].value != myOption)
		{
			document.LANSA.all['DIV', document.LANSA.elements[currentDivision].value].disabled=true;
			document.LANSA.elements[document.LANSA.elements[currentSelection].value].value='N';
			}
	document.LANSA.elements[currentSelection].value='__W_SLCTD   -'+myRowNumber+' A';
	document.LANSA.elements[currentDivision].value=myOption;
}
function colorChange(colorList, myRowNumber, parentRowNumber)
{
	document.LANSA.elements['__W_CLRCD   -'+myRowNumber+' D'].value=colorList[colorList.selectedIndex].value.substr(0,5);
	if (colorList[colorList.selectedIndex].value.substr(0,5) != ' ')
		document.LANSA.elements['__W_SLCTD   -'+myRowNumber+' A'].value='N';
	else
		document.LANSA.elements['__W_SLCTD   -'+myRowNumber+' A'].value='N';
}
function showColorPic(parentRowNumber)
{  	colorList = document.LANSA.elements['SCLRCD    -'+parentRowNumber];
	pictureName=colorList[colorList.selectedIndex].value.substr(5,25);

	if(pictureName == '')
		alert(gmtcfg0039);
	else
		showPic(pictureName, 150, 150)
}
function countit(TextEntered)
{
var length;
var thisString;
thisString = TextEntered;
length = thisString.length;
  if (length > (maxlength - 1))
  {
    alert ("You have reached the limit of " + maxlength + " characters you can type.");
    return false;
  }
    return true;
  }
function Continue(Flag)
{
 if ((length2  <=  maxlength) || (length2 == 0))
  {
    document.LANSA.ASTDRENTRY.value=Flag;
    if ((Flag == 'E') || (Flag == 'N'))
        { HandleEvent2('ELT_BUILD', 'CHKOUT1'); }
    else
       {    HandleEvent('ELT_BUILD', 'CHKOUT1'); }
  }
  else
  {
    alert ("You have reached the limit of "+ maxlength +"  characters you can type");
  }
}
function setChar(textEntered)
{
  moChars = textEntered;
  length2 = moChars.length;
}