	var headerIsLoaded=false;
		var clicked=false;
	var syntrack_call=false;
	var syntrack_caller;
	var syntrack_caller2=false;
	var syntrack_data;
	function openWindow(url){
			var rand=Math.round(Math.random()*10000); 
			window.open(url,"synergyWindow" + rand);
	}
	var scid=0;
	
	function trackLink(link,type,newwindow,newwindowoptions,forceand){
		if(clicked==false && syntrack_call==false){
			syntrack_call=true;

			if(type=="Redirect"){
				headerIsLoaded=true;
			}
			if(newwindow!=1 && zDown==0){
				clicked=true;
			}
			//curent page
			var from="/synergy/v_1_/home/index.php";

			//heading where
			var to=link;

			//by text link, button, or image link and its label
			//in this format link_http://blah.com/test.php
			var by=type;

			var end = to.substring(to.length-4,to.length);
			if(end==".php"){
				if(forceand!=1){
					to = to + "?";
				}else{
					to = to + "&";
				}
			}else{
				to = to + "&";
			}

			to = to + "ccc=0_0_0&";

			var temp=to.split("export");
			if(temp.length > 1){
				syntrack_call=false;

				to = to + "skipTrack=1&ccc=0_0_0";
				if(scid!=0){
					to = to + "&scid=" + scid;
				}
				if(newwindow!=1 && zDown==0){
					window.top.location.href=to;
				}else{
					var rand=Math.round(Math.random()*10000); 
					if(newwindowoptions==2){
						window.open(to,"synergyWindow" + rand,"resizable=1,toolbar=0,scrollbars=1,scrolling=1,menubar=1");
					}else if(newwindowoptions!=0){
						window.open(to,"synergyWindow" + rand);
					}else{
						window.open(to,"synergyWindow" + rand,"resizable=1,toolbar=0,scrollbars=1,scrolling=1,menubar=0");
					}
					zDown=0;
				}
			}else{
				
				syntrack_data=new Array();
				syntrack_data["to"]=to;
				syntrack_data["newwindow"]=parseInt(newwindow,10);
				syntrack_data["zDown"]=zDown;
				syntrack_data["scid"]=scid;
				syntrack_data["newwindowoptions"]=parseInt(newwindowoptions,10);
				
				if(syntrack_caller2==false){
					syntrack_caller=createRequestObject_admin();
					syntrack_caller2=true;
				}else{
					
				}
				
				var string="trackKind=link&trackFrom=";
				string+= escape(from);
				string+= "&trackTo=" + escape(to);
				string+= "&trackType=" + by;
				var code=base64_encode( string );

				syntrack_caller.open('get', 'http://registration.sitesolutionsworldwide.com/synergy/v_1_/libs/syntrack_load.php?ccc=0_0_0&skipTrack=1&ccc=".getCCC()."&code=' + code);
				syntrack_caller.onreadystatechange = handleResponse_loadSyntrackResult;
				syntrack_caller.send(null);
			}
		}else{
			alert("Please do not double click buttons and/or links.");
		}
	}

	
	function trackSubmit(formname,type){
		if(clicked==false){
			clicked=true;
			syntrack_call=true;

			syntrack_data=new Array();

			//curent page
			var from="/synergy/v_1_/home/index.php";
			//heading where
			var to=document[formname].action;
			//by text link, button, or image link and its label
			var by=type;
			var end = to.substring(to.length-4,to.length);
			if(end==".php"){
				to = to + "?";
			}else{
				to = to + "&";
			}

			var code=base64_encode( "trackKind=submit&trackFrom=" + from + "&trackTo=" + to + "&trackType=" + by);

			to = to + "ccc=0_0_0&syntrack=";

			syntrack_data["to"]=to;
			syntrack_data["formname"]=formname;
			
			if(syntrack_caller2==false){
				syntrack_caller=createRequestObject_admin();
				syntrack_caller2=true;
			}

			syntrack_caller.open('get', 'http://registration.sitesolutionsworldwide.com/synergy/v_1_/libs/syntrack_load.php?ccc=0_0_0&skipTrack=1&ccc=".getCCC()."&code=' + code);
			syntrack_caller.onreadystatechange = handleResponse_loadSyntrackResult2;
			syntrack_caller.send(null);

		}else{
			alert("Please do not double click buttons and/or links.");
		}
	}

	function handleResponse_loadSyntrackResult2(){
		if(syntrack_caller.readyState == 4){

			var to=syntrack_data["to"];
			var formname=syntrack_data["formname"];
			var code_key = syntrack_caller.responseText;

			document[formname].action=to + code_key;
			document[formname].submit();
			
			try{
				document.getElementById("everything_table_wrapper").style.display="none";
			}catch(e){

			}

			//setTimeout('document[\'' + formname + '\'].submit();',100);
			
		}
	}

	function handleResponse_loadSyntrackResult(){
		if(syntrack_caller.readyState == 4){
			

			var to=syntrack_data["to"];
			var scid=syntrack_data["scid"];
			var zDown=syntrack_data["zDown"];
			var newwindow=syntrack_data["newwindow"];
			var newwindowoptions=syntrack_data["newwindowoptions"];
			var code_key = syntrack_caller.responseText;

			to = to + "syntrack=" + code_key;
			if(scid!=0){
				to = to + "&scid=" + scid;
			}

			

			if(newwindow!=1 && zDown==0){
				//setTimeout('window.top.location.href=\"' + to + '\";',100);
				window.top.location.href=to;
				try{
					document.getElementById("everything_table_wrapper").style.display="none";
				}catch(e){

				}
			}else{
				var rand=Math.round(Math.random()*10000); 
				if(newwindowoptions==2){
					window.open(to,"synergyWindow" + rand,"resizable=1,toolbar=0,scrollbars=1,scrolling=1,menubar=1");
				}else if(newwindowoptions!=0){
					window.open(to,"synergyWindow" + rand);
				}else{
					window.open(to,"synergyWindow" + rand,"resizable=1,toolbar=0,scrollbars=1,scrolling=1,menubar=0");
				}
				zDown=0;
	
				syntrack_call=false;
			}
		}
	}

	function createRequestObject_admin(){
		var ro;
		var browser = navigator.appName;
		if(browser == "Microsoft Internet Explorer"){
			ro = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
			ro = new XMLHttpRequest();
		}
		return ro;
	}

	function isHex(which){
			var checkOK = "ABCDEFabcdef0123456789";
			var checkStr = document.form1[which].value;
			var allValid = true;
			for (i = 0;  i < checkStr.length;  i++)
			{
				ch = checkStr.charAt(i);
				for (j = 0;  j < checkOK.length;  j++)
					if (ch == checkOK.charAt(j))
						break;
				if (j == checkOK.length)
				{
					allValid = false;
					break;
				}
			}
			if (!allValid)
			{
				alert("Hex codes may only contain numbers and the letters A through F." );
				document.form1[which].value=document.form1[which + "_default"].value;
				document.getElementById(which + "Row").style.backgroundColor=document.form1[which + "_default"].value;
			}
			
			// require at least 5 characters in the password field
			if (checkStr.length != 6)
			{
				alert("Hex codes must be 6 characters in length." );
				document.form1[which].value=document.form1[which + "_default"].value;
				document.getElementById(which + "Row").style.backgroundColor=document.form1[which + "_default"].value;
			}

			document.getElementById(which + "Row").style.backgroundColor=checkStr;
			document.form1[which + "_default"].value=checkStr;
		}
		function keyDown(e) {
			if(navigator.appName=="Microsoft Internet Explorer"){
				
				var e = window.event;
				
				
				if(e.keyCode==90){
					zDown=1;
				}
			}else{
				//var test="";
				//for(x in e){
				//	test += "######" + x + " : " + e[x];
				//}
				//alert(e['which']);
				if(e.which==90){
					zDown=1;
				}
			}
			return true;
		  }
		 function keyUp(e) {
			 if(navigator.appName=="Microsoft Internet Explorer"){
				var e = window.event;
				if(e.keyCode==90){
					zDown=0;
				}
			}else{
				if(e.which==90){
					zDown=0;
				}
			}
			return true;
		  }
		  document.onkeydown = keyDown
		  document.onkeyup = keyUp

	
	
		var zDown=0;

function copy_clip(meintext)
{

 if (window.clipboardData) 
   {
   
   // the IE-manier
   window.clipboardData.setData("Text", meintext);
   
   // waarschijnlijk niet de beste manier om Moz/NS te detecteren;
   // het is mij echter onbekend vanaf welke versie dit precies werkt:
   }
   else if (window.netscape) 
   { 
   
   // dit is belangrijk maar staat nergens duidelijk vermeld:
   netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
   
   // maak een interface naar het clipboard
   var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
   if (!clip) return;
   
   // maak een transferable
   var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
   if (!trans) return;
   
   // specificeer wat voor soort data we op willen halen; text in dit geval
   trans.addDataFlavor('text/unicode');
   
   // om de data uit de transferable te halen hebben we 2 nieuwe objecten nodig   om het in op te slaan
   var str = new Object();
   var len = new Object();
   
   var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
   
   var copytext=meintext;
   
   str.data=copytext;
   
   trans.setTransferData("text/unicode",str,copytext.length*2);
   
   var clipid=Components.interfaces.nsIClipboard;
   
   if (!clip) return false;
   
   clip.setData(trans,null,clipid.kGlobalClipboard);
   
   }
   alert("Following info was copied to your clipboard:\n\n" + meintext);
   return false;
}

function newSynergyWindow(path){
	var rand=Math.round(Math.random()*10000); 
	window.open(path,"synergyWindow" + rand);
}


function parseMe(something,parse,min,max){
	var temp;
	if(parse=='int'){
		something.value=parseInt(something.value);
	}else if(parse=='float'){
		something.value=parseFloat(something.value);
		//alert(something.value);
		something.value *= 100;
		//alert(something.value);
		something.value=parseInt(something.value);
		//alert(something.value);
		something.value = something.value/100;
		//alert(something.value);
	}else{
		something.value=parseInt(something.value);
	}	
	if(something.value=="NaN" || something.value=="Na" || something.value=="N"){
		something.value=0;
	}
	if(min == temp){
		min=0;
	}
	if(max == temp){
		max=99999999999;
	}
	//alert(something.value + " " + min + " " + max);
	if(something.value < parseFloat(min)){
		//alert(something.value + " < " + min);
		something.value=min;
	}
	if(something.value > parseFloat(max)){
		//alert(something.value + " > " + max);
		something.value=max;
	}
	if(parse=='float'){
		something.value=currency(something.value);
	}


}
//-->
function getFormGroup(name) {
		return document.getElementsByName(name);
}

function getRadio(name) {
	elements = getFormGroup(name);
	if (elements)/* loop over all the radio buttons */
		for (i = 0; i < elements.length; i++)
			if (elements[i].checked)
				return elements[i];/* either no group by that name was foundor none were selected */
	return null;
}

function getRadioValue(name) {
	element = getRadio(name);
		if (element)
			return element.value;/* there must not have been a radio buttonselected */
	return null;
}

function clearRadio(name) {
	elements = getFormGroup(name);
	if (elements)
		for (i = 0; i < elements.length; i++)
			if (elements[i].checked)
				elements[i].checked=false;
}
function selectRadio(name,val){
	elements = getFormGroup(name);
	if (elements){
		for (i = 0; i < elements.length; i++){
			if (elements[i].value==val){
				elements[i].checked=true;
				break;
			}
		}
	}
}

function currency(something2){
	
	newstring="";
	flagStarted=0;
	flagDecimal=0;
	postDecimal=0;
	var something="" + something2;
	for(i=0;i<something.length;i++){
		if((flagStarted!=0 || something.charAt(i)!="0") && postDecimal < 2){
			if(flagDecimal==1){
				postDecimal++;
			}
			if(something.charAt(i)=="."){
				if(flagStarted==0){
					newstring += "0";
				}
				flagDecimal=1;
			}
			flagStarted=1;
			newstring += something.charAt(i);
		}
	}
	if(flagDecimal==0){
		newstring += ".00";
	}else{
		if(postDecimal==0){
			newstring += "00";
		}else if(postDecimal==1){
			newstring += "0";
		}
	}
	
	
	return newstring;
}

function isCreditCard(card) {
	len = card.length - 1;

	if ((len > 19) || (len < 0))
		return (false);

	weight = 2;
	card_sum = 0;

	for (i = len - 1;i >= 0 ;i = i - 1)
	{
		digit = card.substr(i,1) - 0;
		digit_sum = digit * weight;
		tens = Math.floor(digit_sum / 10);
		card_sum += tens + (digit_sum % 10);
		if(weight > 1) 
			weight = 1;
		else 
			weight = 2;		
	}
	result = (10 - card_sum % 10) % 10;

	if (result == card.substr(len,1))
		return true;
	else 
		return false;
}

//0 is numbers, 1 is letters, 2 is alpha numeric, 3 is alpha numeric with spaces
function parseFix(something,type){

	curval=something.value;
	type=parseInt(type);
	if(type!=0 && type!=1 && type!=2 && type!=3){
		type=0;
	}		
	if(type==0){
		check="0123456789";
	}else if(type==1){
		check="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	}else if(type==2){
		check="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	}else{
		check="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	}

	newstring="";

	for(i=0;i<curval.length;i++){
		flag=0;
		for(j=0;j<check.length;j++){
			cur=curval.charAt(i);
			if(cur==check.substr(j,1)){
				flag=1;
			}
		}
		if(flag==1){
			newstring += "" + curval.charAt(i);
		}
	}

	something.value=newstring;
}

 var focused_fields=new Array();
 function mouseOver(field,type){
  try{
   if(focused_fields[field.name]!=1){
    field.className=type + '-hover';
   }
  }catch(err){
   field.className=type + '-hover';
  }
 }
 function mouseOut(field,type){
  try{
   if(focused_fields[field.name]!=1){
    field.className=type;
   }
  }catch(err){
   field.className=type;
  }
  
  
 }
 function mouseFocus(field,type){
  
  focused_fields[field.name]=1;
  field.className=type + '-active';
  
 }
 function mouseBlur(field,type){
  focused_fields[field.name]=0;
  field.className=type;
 }


	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;
	}

	function check(e) {
		var key = window.event ? e.keyCode : e.which;
		var keychar = String.fromCharCode(key);
		
		if(key =="8" || key=="0"){ //allow delete key and arrows to pass through
		return true;
		}
		
		reg = /\d/;
		return reg.test(keychar);
	}

	function uberReplace(from,to,string){
		var strReplaceAll = string;
		var intIndexOfMatch = strReplaceAll.indexOf( from);
		while (intIndexOfMatch != -1){
			strReplaceAll = strReplaceAll.replace( from, to )
			intIndexOfMatch = strReplaceAll.indexOf( from );
		}
		return strReplaceAll;
	}

	function uberReplace3(from,to,string){
		var temp=string.split(from);
		var ret="";
		for(x in temp){
			if(ret!=""){
				ret+=to;
			}
			ret+=temp[x];
		}
		return ret;
	}

	function uberReplace2(from,to,string){
		var endline = "\n";
		var temp=string.split(endline);
		var ret="";
		for(x in temp){
			if(ret!=""){
				ret+=endline;
			}
			ret+=uberReplace3(from,to,temp[x]);
		}
		return ret;
	}

	function scrubFile(field){
		var temp=field.value;
		temp=uberReplace('"','',temp);
		temp=uberReplace('|','',temp);
		temp=uberReplace('?','',temp);
		temp=uberReplace('/','',temp);
		temp=uberReplace('\\','',temp);
		temp=uberReplace('*','',temp);
		temp=uberReplace(':','',temp);
		temp=uberReplace('<','',temp);
		temp=uberReplace('>','',temp);
		field.value=temp;
	}

	
	function base64_encode( data ) {
		// http://kevin.vanzonneveld.net
		// +   original by: Tyler Akins (http://rumkin.com)
		// +   improved by: Bayron Guevara
		// +   improved by: Thunder.m
		// +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)        
		// -    depends on: utf8_encode
		// *     example 1: base64_encode('Kevin van Zonneveld');
		// *     returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='
	 
		// mozilla has this native
		// - but breaks in 2.0.0.12!
		//if (typeof window['atob'] == 'function') {
		//    return atob(data);
		//}
			
		var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
		var o1, o2, o3, h1, h2, h3, h4, bits, i = ac = 0, enc="", tmp_arr = [];
		data = utf8_encode(data);
		
		do { // pack three octets into four hexets
			o1 = data.charCodeAt(i++);
			o2 = data.charCodeAt(i++);
			o3 = data.charCodeAt(i++);
	 
			bits = o1<<16 | o2<<8 | o3;
	 
			h1 = bits>>18 & 0x3f;
			h2 = bits>>12 & 0x3f;
			h3 = bits>>6 & 0x3f;
			h4 = bits & 0x3f;
	 
			// use hexets to index into b64, and append result to encoded string
			tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
		} while (i < data.length);
		
		enc = tmp_arr.join('');
		
		switch( data.length % 3 ){
			case 1:
				enc = enc.slice(0, -2) + '==';
			break;
			case 2:
				enc = enc.slice(0, -1) + '=';
			break;
		}
	 
		return enc;
	}

	function utf8_encode ( string ) {
		// http://kevin.vanzonneveld.net
		// +   original by: Webtoolkit.info (http://www.webtoolkit.info/)
		// +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
		// +   improved by: sowberry
		// +    tweaked by: Jack
		// +   bugfixed by: Onno Marsman
		// +   improved by: Yves Sucaet
		// +   bugfixed by: Onno Marsman
		// *     example 1: utf8_encode('Kevin van Zonneveld');
		// *     returns 1: 'Kevin van Zonneveld'
	 
		string = (string+'').replace(/\r\n/g, "\n").replace(/\r/g, "\n");
	 
		var utftext = "";
		var start, end;
		var stringl = 0;
	 
		start = end = 0;
		stringl = string.length;
		for (var n = 0; n < stringl; n++) {
			var c1 = string.charCodeAt(n);
			var enc = null;
	 
			if (c1 < 128) {
				end++;
			} else if((c1 > 127) && (c1 < 2048)) {
				enc = String.fromCharCode((c1 >> 6) | 192) + String.fromCharCode((c1 & 63) | 128);
			} else {
				enc = String.fromCharCode((c1 >> 12) | 224) + String.fromCharCode(((c1 >> 6) & 63) | 128) + String.fromCharCode((c1 & 63) | 128);
			}
			if (enc != null) {
				if (end > start) {
					utftext += string.substring(start, end);
				}
				utftext += enc;
				start = end = n+1;
			}
		}
	 
		if (end > start) {
			utftext += string.substring(start, string.length);
		}
	 
		return utftext;
	}

	function base64_decode( data ) {
		// http://kevin.vanzonneveld.net
		// +   original by: Tyler Akins (http://rumkin.com)
		// +   improved by: Thunder.m
		// +      input by: Aman Gupta
		// +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
		// +   bugfixed by: Onno Marsman
		// -    depends on: utf8_decode
		// *     example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');
		// *     returns 1: 'Kevin van Zonneveld'
	 
		// mozilla has this native
		// - but breaks in 2.0.0.12!
		//if (typeof window['btoa'] == 'function') {
		//    return btoa(data);
		//}
	 
		var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
		var o1, o2, o3, h1, h2, h3, h4, bits, i = ac = 0, dec = "", tmp_arr = [];
	 
		data += '';
	 
		do {  // unpack four hexets into three octets using index points in b64
			h1 = b64.indexOf(data.charAt(i++));
			h2 = b64.indexOf(data.charAt(i++));
			h3 = b64.indexOf(data.charAt(i++));
			h4 = b64.indexOf(data.charAt(i++));
	 
			bits = h1<<18 | h2<<12 | h3<<6 | h4;
	 
			o1 = bits>>16 & 0xff;
			o2 = bits>>8 & 0xff;
			o3 = bits & 0xff;
	 
			if (h3 == 64) {
				tmp_arr[ac++] = String.fromCharCode(o1);
			} else if (h4 == 64) {
				tmp_arr[ac++] = String.fromCharCode(o1, o2);
			} else {
				tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
			}
		} while (i < data.length);
	 
		dec = tmp_arr.join('');
		dec = utf8_decode(dec);
	 
		return dec;
	}

	function utf8_decode ( str_data ) {
		// http://kevin.vanzonneveld.net
		// +   original by: Webtoolkit.info (http://www.webtoolkit.info/)
		// +      input by: Aman Gupta
		// +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
		// +   improved by: Norman "zEh" Fuchs
		// +   bugfixed by: hitwork
		// +   bugfixed by: Onno Marsman
		// *     example 1: utf8_decode('Kevin van Zonneveld');
		// *     returns 1: 'Kevin van Zonneveld'
	 
		var tmp_arr = [], i = ac = c1 = c2 = c3 = 0;
	 
		str_data += '';
	 
		while ( i < str_data.length ) {
			c1 = str_data.charCodeAt(i);
			if (c1 < 128) {
				tmp_arr[ac++] = String.fromCharCode(c1);
				i++;
			} else if ((c1 > 191) && (c1 < 224)) {
				c2 = str_data.charCodeAt(i+1);
				tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
				i += 2;
			} else {
				c2 = str_data.charCodeAt(i+1);
				c3 = str_data.charCodeAt(i+2);
				tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
		}
	 
		return tmp_arr.join('');
	}

	var current_year=2010;
	
	function validateDate(item,time){
		try{
			if(current_year==1){

			}
		}catch(e){
			current_year=2008;
		}
		if(time==1){
				var date=item.value;
				var temp=date.split("/");
				if(temp.length==1){
					temp=date.split("-");
				}
				if(date==""){
					
				}else if(temp.length < 3){
					alert("Invalid Date. Please use format mm/dd/yyyy - hh:mm PM");
					item.value="";
				}else{
					temp2=temp[2].split(" - ");
					if(temp2.length!=2){
						validateDate(item);
						item.value=item.value + " - 07:00 PM";
					}else{
						temp3=temp2[1].split(":");
						if(temp3.length!=2){
							validateDate(item);
							item.value=item.value + " - 07:00 PM";
						}else{
							temp4=temp3[1].split(" ");
							if(temp3.length!=2){
								validateDate(item);
								item.value=item.value + " - 07:00 PM";
							}else{
								temp[0]=parseInt(temp[0],10);
								temp[1]=parseInt(temp[1],10);
								temp[2]=parseInt(temp2[0],10);
								temp[3]=parseInt(temp3[0],10);
								temp[4]=parseInt(temp4[0],10);
								temp[5]=temp4[1];


								if(temp[0] < 1){
									temp[0]=1;
								}else if(temp[0] > 12){
									temp[0]=12;
								}
								if(temp[2].toString().length==2){
									if(temp[2] > 40){
										temp[2]="19" + temp[2];
									}else{
										temp[2]="20" + temp[2];
									}
								}else if(temp[2].toString().length==1){
									temp[2]="200" + temp[2];
								}
								
								if(temp[2] < 1900){
									temp[2]=current_year;
								}else if(temp[2] > 2050){
									temp[2]=current_year;
								}

								if(temp[1] < 1){
									temp[1]=1;
								}else if(temp[1] > 31){
									temp[1]=31;
								}
								if(temp[1] > 28){
									switch(temp[0]){
										case 1:
										case 3:
										case 5:
										case 7:
										case 8:
										case 10:
										case 12:
											
										break;
										case 4:
										case 6:
										case 9:
										case 11:
											if(temp[1] > 30){
												temp[1]=30;
											}
										break;
										case 2:
											if(temp[2]%4==0){
												if(temp[1] > 29){
													temp[1]=29;
												}
											}else{
												if(temp[1] > 28){
													temp[1]=28;
												}
											}
										break;
									}
								}
								if(temp[0] < 10){
									temp[0]="0" + temp[0];
								}
								if(temp[1] < 10){
									temp[1]="0" + temp[1];
								}

								if(temp[3] < 1){
									temp[3]=1;
								}else if(temp[3] > 12){
									temp[3]=12;
								}

								if(temp[3] < 10){
									temp[3]="0" + temp[3];
								}

								if(temp[4] < 0){
									temp[4]=0;
								}else if(temp[4] > 59){
									temp[4]=59;
								}

								if(temp[4] < 10){
									temp[4]="0" + temp[4];
								}

								if(temp[5]=="AM" || temp[5]=="am" || temp[5]=="A" || temp[5]=="a" || temp[5]=="Am" || temp[5]=="aM"){
									temp[5]="AM";
								}else{
									temp[5]="PM";
								}
								

								item.value=temp[0] + "/" + temp[1] + "/" + temp[2] + " - " + temp[3] + ":" + temp[4] + " " + temp[5];
							}
						}
					}
				}
		}else{

				var date=item.value;
				var temp=date.split("/");
				if(temp.length==1){
					temp=date.split("-");
				}
				if(date==""){
					
				}else if(temp.length < 3){
					alert("Invalid Date. Please use format mm/dd/yyyy");
					item.value="";
				}else{
					temp[0]=parseInt(temp[0],10);
					temp[1]=parseInt(temp[1],10);
					temp[2]=parseInt(temp[2],10);


					if(temp[0] < 1){
						temp[0]=1;
					}else if(temp[0] > 12){
						temp[0]=12;
					}
					if(temp[2].toString().length==2){
						if(temp[2] > 40){
							temp[2]="19" + temp[2];
						}else{
							temp[2]="20" + temp[2];
						}
					}else if(temp[2].toString().length==1){
						temp[2]="200" + temp[2];
					}
					
					if(temp[2] < 1900){
						temp[2]=current_year;
					}else if(temp[2] > 2050){
						temp[2]=current_year;
					}

					if(temp[1] < 1){
						temp[1]=1;
					}else if(temp[1] > 31){
						temp[1]=31;
					}
					if(temp[1] > 28){
						switch(temp[0]){
							case 1:
							case 3:
							case 5:
							case 7:
							case 8:
							case 10:
							case 12:
								
							break;
							case 4:
							case 6:
							case 9:
							case 11:
								if(temp[1] > 30){
									temp[1]=30;
								}
							break;
							case 2:
								if(temp[2]%4==0){
									if(temp[1] > 29){
										temp[1]=29;
									}
								}else{
									if(temp[1] > 28){
										temp[1]=28;
									}
								}
							break;
						}
					}
					if(temp[0] < 10){
						temp[0]="0" + temp[0];
					}
					if(temp[1] < 10){
						temp[1]="0" + temp[1];
					}
					item.value=temp[0] + "/" + temp[1] + "/" + temp[2];
				}
			}
	}

	
	function runAjaxJSAll(source){
		var last_match="";
		while(source.indexOf("<script") > -1 || source.indexOf("</script") > -1) {
			var s = source.indexOf("<script");
			var s_e = source.indexOf(">", s);
			var e = source.indexOf("</script", s);
			var e_e = source.indexOf(">", e);
			
			// Add to scripts array
			last_match=source.substring(s_e+1, e);
			// Strip from source
			source = source.substring(0, s) + source.substring(e_e+1);

			if(last_match!=""){
				//eval(last_match);
				/*var script = document.createElement('script');
				var text = document.createTextNode(last_match);
				script.type = 'text/javascript';
				script.appendChild(text);
				document.getElementsByTagName("head")[0].appendChild(script);*/

				var getheadTag = document.getElementsByTagName('head')[0];
				setjs = document.createElement('script'); 
				setjs.setAttribute('type', 'text/javascript');
				getheadTag.appendChild(setjs); 
				setjs.text = last_match;
			}

		}

	}

	function getPixelsFromTop(obj){
		objFromTop = obj.offsetTop;
		while(obj.offsetParent!=null) {
			objParent = obj.offsetParent;
			objFromTop += objParent.offsetTop;
			obj = objParent;
		}
		return objFromTop;
	}

	function getTDHeight(top,bottom){
		contentTopDiv = top;
		contentBotDiv = bottom;
		contentTop = getPixelsFromTop(contentTopDiv);
		contentBottom = getPixelsFromTop(contentBotDiv);
		contentHeight = contentBottom - contentTop;
		
		return contentHeight;
	}