function QTvalidOrdID(el){
	
	var elStr = el.value;
	
	var validChars = "0123456789.- ";
	if (elStr.length==0){return false;}
	var allValid = true;
	
	for (var i=0;  i < elStr.length;  i++){
		
		ch = elStr.charAt(i);
		
		for (j = 0;  j < validChars.length;  j++)
			if (ch == validChars.charAt(j))
				break;
		
		if (j == validChars.length){
			allValid = false;
			break;
		}
	}
	if (!allValid){
		alert("Please enter only valid characters in the \"Quick-Track\" field.\n[ex. 1554.010106]");
		el.focus();
		return false;
	}
	else{
		return true;
	}
}



//BEGIN CLOCK SCRIPTS
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

var adjust=0
var zone=" London" //This is the text that first appears denoting time zone
gmtOffset=0 //setting this to your offset will start with your current time
var a=-120
var b=420
var c=180
var d=-120
var e=-480
var f=-600
var g=-180
var h=-180
var ny=240
var j=240
var k=-270
var l=-330
var m=-600
var n=-120
var o=-120
var p=240
var q=-300
var r=-180
var s=-480
var t=-480
var u=-60
var v=-120
var w=420
var x=300
var y=-180
var z=-540
var aa=-600
var bb=0
var cc=-240
var dd=-120

function checkgermany(){

clearTimeout(checkDateTime)

gmtOffset=eval(a+adjust)

zone=" Germany"

checkDateTime()

}

function checkla(){

clearTimeout(checkDateTime)

gmtOffset=b+adjust

zone=" Los Angeles"

checkDateTime()

}

function checkbrazil(){

clearTimeout(checkDateTime)

gmtOffset=c+adjust

zone=" Brazil"

checkDateTime()

}

function checkdubai(){

clearTimeout(checkDateTime)

gmtOffset=d+adjust

zone=" Dubai"

checkDateTime()

}

function checkchina(){

clearTimeout(checkDateTime)

gmtOffset=e+adjust

zone=" China"

checkDateTime()

}

function checkbrisbane(){

clearTimeout(checkDateTime)

gmtOffset=f+adjust

zone=" Brisbane"

checkDateTime()

}

function checkkenya(){

clearTimeout(checkDateTime)

gmtOffset=g+adjust

zone=" Kenya"

checkDateTime()

}

function checkgreece(){

clearTimeout(checkDateTime)

gmtOffset=h+adjust

zone=" Greece"

checkDateTime()

}

function checknewyork(){

clearTimeout(checkDateTime)

gmtOffset=ny+adjust

zone=" New York"

checkDateTime()

}

function checkchile(){

clearTimeout(checkDateTime)

gmtOffset=j+adjust

zone=" Chile"

checkDateTime()

}

function checkiran(){

clearTimeout(checkDateTime)

gmtOffset=k+adjust

zone=" Iran"

checkDateTime()

}

function checkindia(){

clearTimeout(checkDateTime)

gmtOffset=l+adjust

zone=" India"

checkDateTime()

}

function checkmelbourne(){

clearTimeout(checkDateTime)

gmtOffset=m+adjust

zone=" Melbourne"

checkDateTime()

}

function checklibya(){

clearTimeout(checkDateTime)

gmtOffset=n+adjust

zone=" Libya"

checkDateTime()

}

function checkfrance(){

clearTimeout(checkDateTime)

gmtOffset=o+adjust

zone=" France"

checkDateTime()

}

function checktoronto(){

clearTimeout(checkDateTime)

gmtOffset=p+adjust

zone=" Toronto"

checkDateTime()

}

function checkmexico(){

clearTimeout(checkDateTime)

gmtOffset=q+adjust

zone=" Mexico"

checkDateTime()

}

function checksyria(){

clearTimeout(checkDateTime)

gmtOffset=r+adjust

zone=" Syria"

checkDateTime()

}

function checkhongkong(){

clearTimeout(checkDateTime)

gmtOffset=s+adjust

zone=" Hong Kong"

checkDateTime()

}

function checkperth(){

clearTimeout(checkDateTime)

gmtOffset=t+adjust

zone=" Perth"

checkDateTime()

}

function checknigeria(){

clearTimeout(checkDateTime)

gmtOffset=u+adjust

zone=" Nigeria"

checkDateTime()

}

function checkspain(){

clearTimeout(checkDateTime)

gmtOffset=v+adjust

zone=" Spain"

checkDateTime()

}

function checkvancouver(){

clearTimeout(checkDateTime)

gmtOffset=w+adjust

zone=" Vancouver"

checkDateTime()

}

function checkperu(){

clearTimeout(checkDateTime)

gmtOffset=x+adjust

zone=" Peru"

checkDateTime()

}

function checksaudi(){

clearTimeout(checkDateTime)

gmtOffset=y+adjust

zone=" Saudi"

checkDateTime()

}

function checkjapan(){

clearTimeout(checkDateTime)

gmtOffset=z+adjust

zone=" Japan"

checkDateTime()

}

function checksydney(){

clearTimeout(checkDateTime)

gmtOffset=aa+adjust

zone=" Sydney"

checkDateTime()

}

function checksenegal(){

clearTimeout(checkDateTime)

gmtOffset=bb+adjust

zone=" Senegal"

checkDateTime()

}

function checkrussia(){

clearTimeout(checkDateTime)

gmtOffset=cc+adjust

zone=" Russia"

checkDateTime()

}

function checksouthafrica(){

clearTimeout(checkDateTime)

gmtOffset=dd+adjust

zone=" South Africa"

checkDateTime()

}

function checkDateTime() {

adjust=0

var today = new Date();
var year = today.getFullYear();
var month = today.getMonth()+1;
var date = today.getDate();
var day = today.getDay();
var hour = today.getHours();
var minute = today.getMinutes();
var second = today.getSeconds();

yourOffset=(new Date()).getTimezoneOffset();

yourOffset = yourOffset+adjust

ourDifference=eval(gmtOffset-yourOffset);

var half=eval(ourDifference%60);

ourDifference=Math.round(ourDifference/60);

hour=eval(hour-ourDifference);

var m = new Array

("mm","Jan.","Feb.","Mar.","Apr.","May","Jun.","Jul.","Aug.","Sept.","Oct.", "Nov.","Dec.");

var leap=eval(year%4); 

if ((half==-30) || (half==30)) minute+=30;

if (minute>59) minute-=60, hour++;

if (minute<0) minute+=60, hour--;

if (hour>23) hour-=24, date+=1;

if (((month==4) || (month==6) || (month==9) || (month==11)) && (date==31))

date=1, month+=1;

if (((month==2) && (date>28)) && (leap!=0)) date=1, month+=1;

if ((month==2) && (date>29)) date=1, month+=1;

if (hour<0) hour+=24, date-=1;

if ((date==32) && (month==12)) month=m[1], date=1, year+=1

if (date==32) date=1, month+=1;

if ((date<1) && (month==1)) month=m[12], date=31, year-=1

if (date<1) date=31, month-=1;

if (((month==4) || (month==6) || (month==9) || (month==11)) && (date==31))

date=30;

if ((month==2) && (date>28)) date=29;

if (((month==2) && (date>28)) && (leap!=0)) date=28;

for (i=1;i<13;i++){

if (month==i) {month=m[i];

break;

}


}

var dateTime = hour;

dateTime = ((dateTime <10)? "0":"") + dateTime;

dateTime = " " + dateTime;

dateTime += ((minute < 10) ? ":0" : ":") + minute;

dateTime += ((second < 10) ? ":0" : ":") + second;

dateTime += "  -  " + date + " " + month + " " + year;

document.clock.face.value = dateTime;

document.clock.locationx.value = zone;

setTimeout("checkDateTime()",900);

}
//END CLOCK SCRIPTS



//OPEN CURRENCY CONVERTER
function open_CurrencyConverter(){
	window.open('Currency.aspx','OpenCurrencyWin','width=900,height=410,resizable=1,scrollbars=0,menubar=0,status=0');
}


//OPEN MAP GAME
function openMapGame(){
	window.open('MapGame.aspx','OpenMapGame','width=800,height=600,resizable=1,scrollbars=0,menubar=0,status=0');
}


//OPEN MAP_QUEST
function mapQuest(){
		if (document.MapForm.FromZip.value && document.MapForm.ToZip.value){
			window.open("http://www.mapquest.com/directions/main.adp?1z=" +document.MapForm.FromZip.value+ "&2z=" +document.MapForm.ToZip.value)
		}
		else {
			alert("From Zip and To Zip are required to use this tool!\nFill those form elements and try again.");
			return;
		}
}