<!-- Begin
function popUp(URL) {
day = new Date();
	id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=0, scrollbars=0, location=0, statusbars=0, menubars=0, resizable=0, width=650, height=490');");
}

function retImageid(value) 
{      
		top.opener.document.imagesearch.imagelink.value='<img src="'+value+'"/>';
		top.opener.focus();
		top.close();
}
function submitform(){
frm.submit();
}

function chatbox(URL) {
day = new Date();
	id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=0, scrollbars=0, location=0, statusbars=0, menubars=0, resizable=0, width=400, height=300');");
}

// Cursor on 1st input box Script
function placeFocus() {
if (document.forms.length > 0) {
var field = document.forms[0];
for (i = 0; i < field.length; i++) {
if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
document.forms[0].elements[i].focus();
break;
         }
      }
   }
}

function checkCheckBox(f){
if (f.agree.checked == false )
{
alert('Please note this product is out of stock and will delay your order, click OK box to accept');
return false;
}else
return true;
}

function checkProgram(f){
alert('PROGRAM CONFIRMATION\n\nYou have selected to join the program and agree to the terms & conditions.\nWe will deliver this order each month. You can cancel at anytime.\nFor further information click the more details link.');
return true;
}

// Autotab Script
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}

// This part grows the textfield box
function growBox(t) {
a = t.value.split('\n');
b=1;
for (x=0;x < a.length; x++) {
 if (a[x].length >= t.cols) b+= Math.floor(a[x].length/t.cols);
 }
b+= a.length;
if (b > t.rows) t.rows = b;
}

//  End -->


