
var formName="";

function FieldName(imageName) { 

	if (window.opener && !window.opener.closed) {
	
		eval("window.opener.document.form1."+objectName+".value='"+imageName+"'");

	}
}


function addSelection(listField,newText,newValue) { 

	if (window.opener && !window.opener.closed) {
		//var listField = window.opener.document.form1.departure;
		var len = listField.length++;
		listField.options[len].value = newValue;
		listField.options[len].text = newText;
		listField.selectedIndex = len;
		
		
		//eval("window.opener.document.form1."+objectName+".value='"+imageName+"'");

	}
}


function getArgs() {
	objectName = location.search.substr(location.search.indexOf('=')+1);
	if (objectName.indexOf("&") > -1) {
		objectName = objectName.substring(0,objectName.indexOf("&"));
	}
}


////////////////////////////////////////////////////////////////////////////////////
//
//                 BELOW IS THE SOURCE CODE THAT THE DEVELOPER WILL USE
//                 ----------------------------------------------------
//
//
//  This code will require two pages.  The first page (parent) is the page with the form that
//  will be populated.  The second page (child) is the page that allows the user to select a
//  value that will be placed in the parent's form
//
//
//  On the Parent page the following code must be placed...
//
//  This code allows the window to popup, this gets placed in the <HEAD></HEAD> tags
//  <script src="../include/popup_window.js"></script>
//
//  In order for this to work, your form needs to be named..
//  myForm
//
//  This is an example of a link...
//  The PAGENAME is your popped up window and the itemName is the forms field name
//  <a href="PAGENAME.asp?itemName=FORMFIELD" onclick="NewWindow(this.href);return false">TEST</a>
//
//  The Forms field looks like this
//  <input type="text" size="30" name="Icon" value="<%=myIcon%>" onFocus="blur();">
//
//
//
//  The following gets placed on the Child page
//
//  This gets placed in the <HEAD></HEAD> tags
//  <script src="../include/form_populate.js"></script>
//
//  The <BODY> tag must look similar to this...
//  This is where the script knows what field value is being replaced
//  <body onLoad='getArgs(); window.focus();'>
//
//  This is an example of a radio button
//  <input onClick='javascript:FieldName("VALUE OF FIELD");' type='radio' name='Image' value='"&i.name&"'>
//
// A link would look something like...
// <a href="#" onClick='javascript:FieldName("VALUE OF FIELD");'>LINK NAME</a>
//
//
//
////////////////////////////////////////////////////////////////////////////////////








