function getElementByID(el){
	if(document.all)
		return document.all(el);
	else
		return document.getElementById(el);
}

function addListener(element,event,funct){
	if(typeof(element) != "string"){
		if(document.all)
			element.attachEvent(event,eval(funct));
		else
			element.addEventListener(event.substring(2,event.length),eval(funct),null);
		return true;
	}
	if(document.all)
		getElementByID(element).attachEvent(event,eval(funct));
	else
		getElementByID(element).addEventListener(event.substring(2,event.length),eval(funct),null);
	return true;
}

function xmlreq(url,post,statefunction,async){
	req = false;
	if(window.XMLHttpRequest){
		try{
			req = new XMLHttpRequest();
		}
		catch(e){
			req = false;
		}
	}
	else if(window.ActiveXObject){
		try{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		}
        catch(e){
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch(e){
					req = false;
				}
		}
	}
	if(req){
		req.onreadystatechange = eval(statefunction);
		req.open("POST", url, async);
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(post);
	}
}

function trackClick(){
	if(window.event){
		me = window.event.srcElement;
	}
	else{
		me = this;
	}
	if(me.className.indexOf("error") != -1)
 		me.className = me.className.replace(/\s?error/g,"");
	me.setAttribute("clicked","1");
}

function validate(){
		if(!document.forms[0].getAttribute("submitted") || document.forms[0].getAttribute("submitted") == 0){
			document.forms[0].setAttribute("submitted","1");
			if(getElementByID("country"))
				getCC = getElementByID("country").value;
				
			for(var i=1; i < 4; i++){
				if(getElementByID("phone"+i) && getElementByID("phone"+i).value == ""){
					if(getElementByID("areacode"+i))
						getElementByID("phone"+i).value += getElementByID("areacode"+i).value.toString();
					if(getElementByID("pre"+i))
						getElementByID("phone"+i).value += getElementByID("pre"+i).value.toString();
					if(getElementByID("suffix"+i))
						getElementByID("phone"+i).value += getElementByID("suffix"+i).value.toString();
				}
				if(getElementByID("confirm_phone"+i) && getElementByID("confirm_phone"+i).value == ""){
					if(getElementByID("confirm_areacode"+i))
						getElementByID("confirm_phone"+i).value += getElementByID("confirm_areacode"+i).value.toString();
					if(getElementByID("confirm_pre"+i))
						getElementByID("confirm_phone"+i).value += getElementByID("confirm_pre"+i).value.toString();
					if(getElementByID("confirm_suffix"+i))
						getElementByID("confirm_phone"+i).value += getElementByID("confirm_suffix"+i).value.toString();
				}
			}
			postdata = "";
			for(var total_elements=0; total_elements<document.forms[0].elements.length; total_elements++){
				if(postdata != "")
					postdata += "&";
				if(document.forms[0].elements[total_elements].type == "checkbox" || document.forms[0].elements[total_elements].type == "radio"){
					if(document.forms[0].elements[total_elements].checked){
						if(document.forms[0].elements[total_elements].value){
							postdata += document.forms[0].elements[total_elements].getAttribute("name")+"="+document.forms[0].elements[total_elements].value;
						}
						else{
							postdata += document.forms[0].elements[total_elements].getAttribute("name")+"=true";
						}
					}
				}
				else{
					postdata += document.forms[0].elements[total_elements].getAttribute("name")+"="+document.forms[0].elements[total_elements].value;
				}
			}
			xmlreq("request.php",postdata+"&action=validate","finishValidation",true);
			monitorValidation(0);
		}
		return false;
}

function finishValidation(){
	if(req.readyState == 4){
		if(req.status == 200){
			var errors = document.createElement("ul");
			rtext = req.responseText;
			if(rtext != 1){
				var ms = document.getElementsByTagName("p");
				for(var i=ms.length-1; i >=0; i--)
					if(ms[i].className.indexOf("error") == 0)
						ms[i].parentNode.removeChild(ms[i])
				var ms = document.getElementsByTagName("div");
				for(var i=ms.length-1; i >=0; i--)
					if(ms[i].className.indexOf(" error") != -1)
						ms[i].className = ms[i].className.replace(" error","");
				var mf = document.forms[0];
				mf.className += " submitted";
				rtext = rtext.split("\n");
				for(i=0; i < rtext.length; i++){
					if(rtext[i].indexOf("|") !=-1){
						badval = rtext[i].split("|");
						var emsg = document.createElement("li");
						emsg.innerHTML = badval[2];
						errors.appendChild(emsg);
						badval[0] = document.forms[0].elements[badval[1]].parentNode.id;
						if(document.getElementById(badval[0]).className && document.getElementById(badval[0]).className.indexOf("form_row") == -1){
							while(document.getElementById(badval[0]) && document.getElementById(badval[0]).className.indexOf("form_row") == -1){
								badval[0] = document.getElementById(badval[0]).parentNode.id;
							}
						}
						if(document.getElementById(badval[0])){
							if(document.getElementById(badval[0]).className.indexOf(" error") == -1)
								document.getElementById(badval[0]).className += " error";
							if(document.forms[0].elements[badval[1]].className.indexOf(" error") == -1)
								document.forms[0].elements[badval[1]].className += " error";
							var mys = document.getElementById("er_"+badval[0]);
							if(!mys){
								mys = document.createElement("p");
								mys.id = "er_"+badval[0];
								mys.className = "error";
							}
							mys.innerHTML += " "+badval[2];
							document.getElementById(badval[0]).parentNode.insertBefore(mys,document.getElementById(badval[0]));
						}
					}
					else{
						if(rtext[i] != "")
							alert(rtext[i]);
					}
				}
				mf.id="retry";
				
				if(!document.getElementById("form_error_message_javascript")){
					msg = document.createElement("div");
					msg.id="form_error_message_javascript";
					msg.innerHTML = "<p>We are unable to process your request for information at this time due to the following error(s). Please make corrections below.</p>";
					mf.insertBefore(msg,mf.firstChild);
				}
				
				document.forms[0].setAttribute("submitted","0");
				location.href="#retry";
				window.scrollTo(0,0);
			
				return false;
			}
			else{
				document.forms[0].submit();
				return true;
			}
		}
		else{
			document.forms[0].submit();
			return true;
		}
	}
}

function monitorValidation(counter){
	if(counter > 5)
		if(document.forms[0].getAttribute("submitted") == 1)
			document.forms[0].submit();
	else
		setTimeout("monitorValidation("+(counter+1)+")",100);
}

function body_onload(){
	ff = document.forms[0];
	if(document.forms[0]){
		for(var total_elements=0; total_elements<document.forms[0].elements.length; total_elements++){
			document.forms[0].elements[total_elements].setAttribute("clicked","0");
			addListener(document.forms[0].elements[total_elements],"onclick","trackClick");
			addListener(document.forms[0].elements[total_elements],"onkeypress","trackClick");
		}
		document.forms[0].setAttribute("submitted","0");
	}
	else{
		return false;
	}
	
	if(getElementByID("zip")){
		addListener("zip","onkeyup","zipCheck");
		addListener("zip","onblur","zipDeduce");
		addListener("zip","onblur","limitState");
		zipCheck();
		zipDeduce();
		limitState();
	}
	if(getElementByID("location_id")){
		addListener("location_id","onchange","switchDrop");
	}
	if(getElementByID("country")){
		addListener("country","onchange","limitState");
		addListener("country","onchange","switchCC");
	}	
	if(getElementByID("state")){
		addListener("state","onchange","switchState");
	}
	
	for(var i=1; i < 4; i++){
		if(getElementByID("areacode"+i)){
			addListener("areacode"+i,"onfocus","monitor");
			addListener("areacode"+i,"onblur","update_phone");
		}
		if(getElementByID("pre"+i)){
			addListener("pre"+i,"onfocus","monitor");
			addListener("pre"+i,"onblur","update_phone");
		}
		if(getElementByID("suffix"+i)){
			addListener("suffix"+i,"onblur","update_phone");
		}
		if(getElementByID("confirm_areacode"+i)){
			addListener("confirm_areacode"+i,"onfocus","monitor");
			addListener("confirm_areacode"+i,"onblur","update_phone");
		}
		if(getElementByID("confirm_pre"+i)){
			addListener("confirm_pre"+i,"onfocus","monitor");
			addListener("confirm_pre"+i,"onblur","update_phone");
		}
		if(getElementByID("confirm_suffix"+i)){
			addListener("confirm_suffix"+i,"onblur","update_phone");
		}
	}
	if(getElementByID("location_id") && getElementByID("course_id")){
		switchDrop();
	}
	fixPhone();
	
	if(window.body_onload_custom)
		body_onload_custom();
	
	return true;
}

function monitor(){
	if(document.all)
		myel = event.srcElement;
	else
		myel = this;
	if(myel.value == "" && myel.getAttribute("maxlength"))
		mon_watch(myel.id,myel.getAttribute("maxlength"));
}

function mon_watch(myel,length){
	if(typeof(myel) == "string")
		myel = getElementByID(myel);
	if(myel.value.length == length && length != 0 && length != ""){
		p1 = myel.id.substring(0,myel.id.length-1);
		p2 = myel.id.substring(myel.id.length-1,myel.id.length);
		switch(p1){
			case "areacode":
				getElementByID("pre"+p2).focus();
				break;
			case "pre":
				getElementByID("suffix"+p2).focus();
				break;
		}
	}
	else{
		setTimeout("mon_watch('"+myel.id+"',"+length+")",1);
	}
}

function update_phone(){
	if(document.all)
		myel = event.srcElement;
	else
		myel = this;
	fieldset = myel.id.substring(myel.id.length-1,myel.id.length);
	if(myel.id.indexOf("confirm") != "-1"){
		phonefield = getElementByID("confirm_phone"+fieldset);
		phonefield.value = getElementByID("confirm_areacode"+fieldset).value+""+getElementByID("confirm_pre"+fieldset).value+""+getElementByID("confirm_suffix"+fieldset).value;
	}
	else{
		phonefield = getElementByID("phone"+fieldset);
		phonefield.value = getElementByID("areacode"+fieldset).value+""+getElementByID("pre"+fieldset).value+""+getElementByID("suffix"+fieldset).value;
	}
}

function switchDrop(){
	if(window.opera)
		return false;
	campus = getElementByID("location_id");
	courses = getElementByID("course_id");
	current_value = getElementByID("course_id").value;
	if(courses.getAttribute("type") == "hidden") return false;
	for(courses_counter = courses.childNodes.length-1; courses_counter >= 0; courses_counter--){
		if(courses.childNodes[courses_counter].nodeType == 3)
			courses.removeChild(courses.childNodes[courses_counter]);
	}
	for(courses_counter = courses.childNodes.length-1; courses_counter > 0; courses_counter--){
		courses.removeChild(courses.childNodes[courses_counter]);
	}
	if(course_options[campus.value] != undefined){
		courses.childNodes[0].innerHTML = "-- Select --"
		current = course_options[campus.value];
		for(current_counter=0; current_counter<current.length; current_counter++){
			courses.appendChild(current[current_counter]);
		}
	}
	else{
		courses.childNodes[0].innerHTML = "-- Select A Location --"
	}
	getElementByID("course_id").value = current_value;
	return true;
} 

function switchCC(){
	getCC = getElementByID("country").value;
	
	for(var i=1; i < 4; i++){
		if(getElementByID("cc"+i)){
			getElementByID("cc"+i).value = PhoneFormatTable[getCC];
		}
		if(getElementByID("confirm_cc"+i)){
			getElementByID("confirm_cc"+i).value = PhoneFormatTable[getCC];
		}
	}

	if(PhoneFormatTable[getCC] == 1){
		for(var i=1; i < 4; i++){
			if(getElementByID("phone_row_"+i)){
				if(getElementByID("phone_row_"+i).className.indexOf(" script") == -1){
					getElementByID("phone_row_"+i).className += " script";
					if(getElementByID("phone"+i).value != "")
						eval("phone"+i+"_value = getElementByID(\"phone"+i+"\").value.replace(/[^0-9x]/g,\"\");");
					getElementByID("phone"+i).value = "";
					eval("getElementByID(\"areacode"+i+"\").value = phone1_value.substring(0,3);");
					eval("getElementByID(\"pre"+i+"\").value = phone1_value.substring(3,6);");
					eval("getElementByID(\"suffix"+i+"\").value = phone1_value.substring(6,phone1_value.length);");
				}
			}
			if(getElementByID("phone_row_"+i+"_confirm")){
				if(getElementByID("phone_row_"+i+"_confirm").className.indexOf(" script") == -1){
					getElementByID("phone_row_"+i+"_confirm").className += " script";
					if(getElementByID("confirm_phone"+i).value != "")
						eval("confirm_phone"+i+"_value = getElementByID(\"confirm_phone"+i+"\").value.replace(/[^0-9x]/g,\"\");");
					getElementByID("confirm_phone"+i).value = "";
					eval("getElementByID(\"confirm_areacode"+i+"\").value = confirm_phone1_value.substring(0,3);");
					eval("getElementByID(\"confirm_pre"+i+"\").value = confirm_phone1_value.substring(3,6);");
					eval("getElementByID(\"confirm_suffix"+i+"\").value = confirm_phone1_value.substring(6,confirm_phone1_value.length);");
				}
			}
		}
	}
	else{
		for(var i=1; i < 4; i++){
			if(getElementByID("phone_row_"+i)){
				getElementByID("phone_row_"+i).className = getElementByID("phone_row_"+i).className.replace(/ script/g,"");
				if(getElementByID("areacode"+i).value != "" && getElementByID("pre"+i).value != "" && getElementByID("suffix"+i).value != "")
					eval("phone"+i+"_value = getElementByID(\"areacode"+i+"\").value+\"\"+getElementByID(\"pre"+i+"\").value+\"\"+getElementByID(\"suffix"+i+"\").value;");
				eval("getElementByID(\"phone"+i+"\").value = phone1_value;");
				getElementByID("areacode"+i).value = "";
				getElementByID("pre"+i).value = "";
				getElementByID("suffix"+i).value = "";
			}
			if(getElementByID("phone_row_"+i+"_confirm")){
				getElementByID("phone_row_"+i+"_confirm").className = getElementByID("phone_row_"+i+"_confirm").className.replace(/ script/g,"");
				if(getElementByID("confirm_areacode"+i).value != "" && getElementByID("confirm_pre"+i).value != "" && getElementByID("confirm_suffix"+i).value != "")
					eval("confirm_phone"+i+"_value = getElementByID(\"confirm_areacode"+i+"\").value+\"\"+getElementByID(\"confirm_pre"+i+"\").value+\"\"+getElementByID(\"confirm_suffix"+i+"\").value;");
				eval("getElementByID(\"confirm_phone"+i+"\").value = confirm_phone1_value;");
				getElementByID("confirm_areacode"+i).value = "";
				getElementByID("confirm_pre"+i).value = "";
				getElementByID("confirm_suffix"+i).value = "";
			}
		}	
	}
	//fixPhone();
}

function zipCheck(){
	zipcode = getElementByID("zip").value;
	us_zip = /[\d]{5}/;
	ca_zip = /[a-z]\d[a-z][ ]?\d[a-z]\d/i;
	if(us_zip.test(zipcode)){
		zipDeduce();
	}
	else if(ca_zip.test(zipcode)){
		zipDeduce();
	}
}

function zipDeduce(){
	zipcode = getElementByID("zip").value;
	us_zip = /[\d]{5}/;
	ca_zip = /[a-z]\d[a-z][ ]?\d[a-z]\d/i;
	if(getElementByID("country")){
		if(us_zip.test(zipcode)){
			getElementByID("country").value="US";
		}
		else if(ca_zip.test(zipcode)){
			getElementByID("country").value="CA";
		}
		else{
			if(zipcode != "")
				getElementByID("country").selectedIndex="0";
		}
		switchCC();
	}
	else{
		return false;
	}
	if(zipcode != "" && (getElementByID("country").value == "CA" || getElementByID("country").value == "US"))
		xmlreq("request.php","action=ziplookup&brand_id="+(getElementByID("brand_id")?getElementByID("brand_id").value:0)+"&dcu_id="+(getElementByID("dcu_id")?getElementByID("dcu_id").value:0)+"&zip="+zipcode,"zipDeduceAjax",true);
	else
		if(getElementByID("city") && getElementByID("city").getAttribute("clicked") == 0)
			getElementByID("city").value="";
		if(getElementByID("state") && getElementByID("state").getAttribute("clicked") == 0)
			getElementByID("state").selectedIndex=0;
}

function zipDeduceAjax(){
	if(req.readyState == 4){
		if(req.status == 200){
			parts = req.responseText.split("|");
			if(parts[0] != ""){
				for(var i=1; i < 4; i++){
					if(getElementByID("areacode"+i) && getElementByID("areacode"+i).getAttribute("clicked") == 0)
						getElementByID("areacode"+i).value = parts[0];
					if(getElementByID("phone"+i) && getElementByID("phone"+i).getAttribute("clicked") == 0)
						getElementByID("phone"+i).value = parts[0];
					if(getElementByID("confirm_areacode"+i) && getElementByID("confirm_areacode"+i).getAttribute("clicked") == 0)
						getElementByID("confirm_areacode"+i).value = parts[0];
					if(getElementByID("confirm_phone"+i) && getElementByID("confirm_phone"+i).getAttribute("clicked") == 0)
						getElementByID("confirm_phone"+i).value = parts[0];
				}
			}
			if(parts[1] != ""){
				if(getElementByID("location_id")){
					if(getElementByID("location_id").getAttribute("clicked") == 0){
						getElementByID("location_id").value=parts[1];
						switchDrop();
					}
				}
			}
			if(parts[2] != ""){
				if(getElementByID("city")){
					if(getElementByID("city").getAttribute("clicked") == 0){
						getElementByID("city").value=parts[2];
					}
				}
			}
			if(parts[3] != ""){
				if(getElementByID("state")){
					getElementByID("state").value=parts[3];
				}
			}
		}
	}
}

function limitState(){
	if(window.opera)
		return false;
	if(!getElementByID("country"))
		return false;
	country = getElementByID("country").value;
	grab = false;
	if(country=="CA" || country=="US"){
		if(country=="CA")
			grab = "Canada";
		else
			grab = "United States of America";
	}
	else if(country != "" && country != "-- Select --"){
		grab = "Other";
	}
	else{
		grab = "*";
	}

	if(getElementByID("state") && grab != false){
		state = getElementByID("state");
		state_parts;
		for(var state_count=state.childNodes.length-1; state_count > 0; state_count--){
			if(state.childNodes[state_count].nodeType != 3){
				curlabel = state.childNodes[state_count].getAttribute("label");
				if(!state_parts[curlabel])
					state_parts[curlabel] = state.childNodes[state_count];
			}
			state.removeChild(state.childNodes[state_count]);
		}
		if(grab != "*"){
			state.appendChild(state_parts[grab]);
		}
		else{
			for(grab in state_parts){
				state.appendChild(state_parts[grab]);
			}
		}
	}
}



function switchState(){
	cstate = getElementByID("state").options[getElementByID("state").selectedIndex].parentNode.getAttribute("label");
	country = getElementByID("country");
	if(cstate == "United States of America"){
		if(country){
			country.value = "US";
		}
	}
	else if(cstate == "Canada"){
		if(country){
			country.value = "CA";
		}
	}
	switchCC();
}

function fixPhone(){
	for(var i=1; i < 4; i++){
		if(getElementByID("phone_row_"+i)){
			if(getElementByID("phone_row_"+i).className.indexOf(" script") ==- 1)
				getElementByID("phone_row_"+i).className += " script";
		}
		if(getElementByID("phone_row_"+i+"_confirm")){
			if(getElementByID("phone_row_"+i+"_confirm").className.indexOf(" script") ==- 1)
				getElementByID("phone_row_"+i+"_confirm").className += " script";
		}
	}
	if(getElementByID("country")){
		for(var i=1; i < 4; i++){
			if(getElementByID("phone_row_"+i)){
				if(getElementByID("phone_row_"+i).className.indexOf(" country") ==- 1)
					getElementByID("phone_row_"+i).className += " country";
			}
			if(getElementByID("phone_row_"+i+"_confirm")){
				if(getElementByID("phone_row_"+i+"_confirm").className.indexOf(" country") ==- 1)
					getElementByID("phone_row_"+i+"_confirm").className += " country";
			}
		}
	}
}

// My form's parent.
var mfp;

var phone1_value = "";
var phone2_value = "";
var phone3_value = "";
var confirm_phone1_value = "";
var confirm_phone2_value = "";
var confirm_phone3_value = "";

var state_parts = new Array();
var req;

var PhoneFormatTable = new Array();
PhoneFormatTable["AF"] = "93";PhoneFormatTable["AL"] = "355";PhoneFormatTable["DZ"] = "213";PhoneFormatTable["AS"] = "684";PhoneFormatTable["AD"] = "376";PhoneFormatTable["AO"] = "244";PhoneFormatTable["AI"] = "264";PhoneFormatTable["AQ"] = "672";PhoneFormatTable["AG"] = "268";PhoneFormatTable["AR"] = "54";PhoneFormatTable["AM"] = "374";PhoneFormatTable["AW"] = "297";PhoneFormatTable["AU"] = "61";PhoneFormatTable["AT"] = "43";PhoneFormatTable["AZ"] = "994";PhoneFormatTable["BS"] = "242";PhoneFormatTable["BH"] = "973";PhoneFormatTable["BD"] = "880";PhoneFormatTable["BB"] = "246";PhoneFormatTable["BY"] = "375";PhoneFormatTable["BE"] = "32";PhoneFormatTable["BZ"] = "501";PhoneFormatTable["BJ"] = "229";PhoneFormatTable["BM"] = "441";PhoneFormatTable["BT"] = "975";PhoneFormatTable["BO"] = "591";PhoneFormatTable["BA"] = "387";PhoneFormatTable["BW"] = "267";PhoneFormatTable["BV"] = "000";PhoneFormatTable["BR"] = "55";PhoneFormatTable["IO"] = "000";PhoneFormatTable["BN"] = "673";PhoneFormatTable["BG"] = "359";PhoneFormatTable["BF"] = "226";PhoneFormatTable["BI"] = "257";PhoneFormatTable["KH"] = "855";PhoneFormatTable["CM"] = "237";PhoneFormatTable["CA"] = "1";PhoneFormatTable["CV"] = "238";PhoneFormatTable["KY"] = "345";PhoneFormatTable["CF"] = "236";PhoneFormatTable["TD"] = "235";PhoneFormatTable["CL"] = "56";PhoneFormatTable["CN"] = "86";PhoneFormatTable["CX"] = "672";PhoneFormatTable["CC"] = "672";PhoneFormatTable["CO"] = "57";PhoneFormatTable["KM"] = "269";PhoneFormatTable["CG"] = "242";PhoneFormatTable["CD"] = "242";PhoneFormatTable["CK"] = "682";PhoneFormatTable["CR"] = "506";PhoneFormatTable["CI"] = "225";PhoneFormatTable["HR"] = "385";PhoneFormatTable["CU"] = "53";PhoneFormatTable["CY"] = "357";PhoneFormatTable["CZ"] = "420";PhoneFormatTable["DK"] = "45";PhoneFormatTable["DJ"] = "253";PhoneFormatTable["DM"] = "767";PhoneFormatTable["DO"] = "809";PhoneFormatTable["EC"] = "593";PhoneFormatTable["EG"] = "20";PhoneFormatTable["SV"] = "503";PhoneFormatTable["GQ"] = "245";PhoneFormatTable["ER"] = "291";PhoneFormatTable["EE"] = "372";PhoneFormatTable["ET"] = "251";PhoneFormatTable["FK"] = "500";PhoneFormatTable["FO"] = "298";PhoneFormatTable["FM"] = "691";PhoneFormatTable["FJ"] = "679";PhoneFormatTable["FI"] = "358";PhoneFormatTable["FR"] = "33";PhoneFormatTable["GF"] = "594";PhoneFormatTable["PF"] = "689";PhoneFormatTable["TF"] = "596";PhoneFormatTable["GA"] = "241";PhoneFormatTable["GM"] = "220";PhoneFormatTable["GE"] = "995";PhoneFormatTable["DE"] = "49";PhoneFormatTable["GH"] = "233";PhoneFormatTable["GI"] = "350";PhoneFormatTable["GR"] = "30";PhoneFormatTable["GL"] = "299";PhoneFormatTable["GD"] = "473";PhoneFormatTable["GP"] = "590";PhoneFormatTable["GU"] = "671";PhoneFormatTable["GT"] = "502";PhoneFormatTable["GN"] = "224";PhoneFormatTable["GW"] = "245";PhoneFormatTable["GY"] = "592";PhoneFormatTable["HT"] = "509";PhoneFormatTable["HM"] = "000";PhoneFormatTable["VA"] = "39";PhoneFormatTable["HN"] = "504";PhoneFormatTable["HK"] = "852";PhoneFormatTable["HU"] = "36";PhoneFormatTable["IS"] = "354";PhoneFormatTable["IN"] = "91";PhoneFormatTable["ID"] = "62";PhoneFormatTable["IR"] = "98";PhoneFormatTable["IQ"] = "964";PhoneFormatTable["IE"] = "353";PhoneFormatTable["IL"] = "972";PhoneFormatTable["IT"] = "39";PhoneFormatTable["JM"] = "876";PhoneFormatTable["JP"] = "81";PhoneFormatTable["JO"] = "962";PhoneFormatTable["KZ"] = "7";PhoneFormatTable["KE"] = "254";PhoneFormatTable["KI"] = "686";PhoneFormatTable["KP"] = "82";PhoneFormatTable["KR"] = "850";PhoneFormatTable["KW"] = "965";PhoneFormatTable["KG"] = "7";PhoneFormatTable["LA"] = "856";PhoneFormatTable["LV"] = "371";PhoneFormatTable["LB"] = "961";PhoneFormatTable["LS"] = "266";PhoneFormatTable["LR"] = "231";PhoneFormatTable["LY"] = "218";PhoneFormatTable["LI"] = "423";PhoneFormatTable["LT"] = "370";PhoneFormatTable["LU"] = "352";PhoneFormatTable["MO"] = "853";PhoneFormatTable["MK"] = "389";PhoneFormatTable["MG"] = "261";PhoneFormatTable["MW"] = "265";PhoneFormatTable["MY"] = "60";PhoneFormatTable["MV"] = "90";PhoneFormatTable["ML"] = "223";PhoneFormatTable["MT"] = "356";PhoneFormatTable["MH"] = "692";PhoneFormatTable["MQ"] = "596";PhoneFormatTable["MR"] = "222";PhoneFormatTable["MU"] = "230";PhoneFormatTable["YT"] = "269";PhoneFormatTable["MX"] = "52";PhoneFormatTable["MD"] = "373";PhoneFormatTable["MC"] = "33";PhoneFormatTable["MN"] = "976";PhoneFormatTable["MS"] = "473";PhoneFormatTable["MA"] = "212";PhoneFormatTable["MZ"] = "258";PhoneFormatTable["MM"] = "95";PhoneFormatTable["NA"] = "264";PhoneFormatTable["NR"] = "674";PhoneFormatTable["NP"] = "977";PhoneFormatTable["NL"] = "31";PhoneFormatTable["AN"] = "599";PhoneFormatTable["NC"] = "687";PhoneFormatTable["NZ"] = "64";PhoneFormatTable["NI"] = "505";PhoneFormatTable["NE"] = "227";PhoneFormatTable["NG"] = "234";PhoneFormatTable["NU"] = "683";PhoneFormatTable["NF"] = "672";PhoneFormatTable["MP"] = "670";PhoneFormatTable["NO"] = "47";PhoneFormatTable["OM"] = "968";PhoneFormatTable["PK"] = "92";PhoneFormatTable["PW"] = "680";PhoneFormatTable["PA"] = "507";PhoneFormatTable["PG"] = "675";PhoneFormatTable["PY"] = "595";PhoneFormatTable["PE"] = "51";PhoneFormatTable["PH"] = "63";PhoneFormatTable["PN"] = "649";PhoneFormatTable["PL"] = "48";PhoneFormatTable["PT"] = "351";PhoneFormatTable["PR"] = "787";PhoneFormatTable["QA"] = "974";PhoneFormatTable["RE"] = "262";PhoneFormatTable["RO"] = "40";PhoneFormatTable["RU"] = "7";PhoneFormatTable["RW"] = "250";PhoneFormatTable["GS"] = "500";PhoneFormatTable["KN"] = "869";PhoneFormatTable["LC"] = "758";PhoneFormatTable["VC"] = "809";PhoneFormatTable["SM"] = "378";PhoneFormatTable["ST"] = "239";PhoneFormatTable["SA"] = "966";PhoneFormatTable["SN"] = "221";PhoneFormatTable["SC"] = "248";PhoneFormatTable["SL"] = "232";PhoneFormatTable["SG"] = "65";PhoneFormatTable["SK"] = "421";PhoneFormatTable["SI"] = "386";PhoneFormatTable["SB"] = "677";PhoneFormatTable["SO"] = "252";PhoneFormatTable["ZA"] = "27";PhoneFormatTable["ES"] = "34";PhoneFormatTable["LK"] = "94";PhoneFormatTable["SH"] = "290";PhoneFormatTable["PM"] = "508";PhoneFormatTable["SD"] = "249";PhoneFormatTable["SR"] = "597";PhoneFormatTable["SJ"] = "79";PhoneFormatTable["SZ"] = "268";PhoneFormatTable["SE"] = "46";PhoneFormatTable["CH"] = "41";PhoneFormatTable["SY"] = "963";PhoneFormatTable["TW"] = "886";PhoneFormatTable["TJ"] = "992";PhoneFormatTable["TZ"] = "255";PhoneFormatTable["TH"] = "66";PhoneFormatTable["TG"] = "228";PhoneFormatTable["TK"] = "690";PhoneFormatTable["TO"] = "676";PhoneFormatTable["TT"] = "868";PhoneFormatTable["TN"] = "216";PhoneFormatTable["TR"] = "90";PhoneFormatTable["TM"] = "993";PhoneFormatTable["TC"] = "649";PhoneFormatTable["TV"] = "688";PhoneFormatTable["UG"] = "256";PhoneFormatTable["UA"] = "380";PhoneFormatTable["AE"] = "971";PhoneFormatTable["GB"] = "44";PhoneFormatTable["US"] = "1";PhoneFormatTable["UM"] = "808";PhoneFormatTable["UY"] = "598";PhoneFormatTable["UZ"] = "998";PhoneFormatTable["VU"] = "678";PhoneFormatTable["VE"] = "58";PhoneFormatTable["VN"] = "84";PhoneFormatTable["VG"] = "284";PhoneFormatTable["VI"] = "340";PhoneFormatTable["WF"] = "681";PhoneFormatTable["EH"] = "212";PhoneFormatTable["WS"] = "685";PhoneFormatTable["YE"] = "967";PhoneFormatTable["YU"] = "381";PhoneFormatTable["ZM"] = "260";PhoneFormatTable["ZW"] = "263";PhoneFormatTable["OT"] = "0";

/* OVERTURE TAG STUFF */
if(location.href.indexOf('action=show_thankyou') != -1){
	var pm_tagname = "conversionTag.txt";
	var pm_tagversion = "1.4";
	window.pm_customData = new Object();
	window.pm_customData.segment = "name=conversion, transId=, amount=";
}
var pm_tagname = "universalTag.txt";
var pm_tagversion = "1.4";
var pm_accountid = "79U4K59D1QJOSM2B78CVG78KJ4";
var pm_scripthost = "srv.perf.overture.com";
var pm_customargs = "";
var pm_querystr = "?" + "ver=" + pm_tagversion + "&aid=" + pm_accountid + pm_customargs;
var pm_tag = "<SCR" + "IPT LANGUAGE='JavaScript' " + "SR" + "C=//" + pm_scripthost + "/collweb/ScriptServlet" + pm_querystr + "></SCR" + "IPT>";
document.write(pm_tag);

