<!-- 

function stateChange(formobject){
document.ContactForm.State.value = document.ContactForm.lclState.value;
}

function provinceChange(formobject){
document.ContactForm.State.value = document.ContactForm.lclProvince.value;
}

if(!ErrorColor)var ErrorColor="#45657F";
if(!OkColor)var OkColor="#FFFFFF";
if(!ErrorFontColor)var ErrorFontColor="#FFFFFF";
if(!OkFontColor)var OkFontColor="#606060";

function setCountryParams(formobject){	
	
var selCountry = formobject.value;

	$("#stateLine1:visible").hide("fast");
	$("#stateLine2:visible").hide("fast");
	$("#provinceLine1:visible").hide("fast");
	$("#provinceLine2:visible").hide("fast");
	
	document.ContactForm.lclState.style.backgroundColor = OkColor;
	document.ContactForm.lclProvince.style.backgroundColor = OkColor;
	document.ContactForm.lclState.style.color = ErrorColor;
	document.ContactForm.lclProvince.style.color = ErrorColor;
	
	if(selCountry == "USA"){
		$("#stateLine1:hidden").fadeIn("fast");
		$("#stateLine2:hidden").fadeIn("fast");
		document.ContactForm.State.value = document.ContactForm.lclState.value;
	}
	
	if(selCountry == "Canada"){
		$("#provinceLine1:hidden").fadeIn("fast");
		$("#provinceLine2:hidden").fadeIn("fast");
		document.ContactForm.State.value = document.ContactForm.lclProvince.value;
	}
	
	if(selCountry != "Canada" ){
		document.ContactForm.lclProvince.value = "";
	}
	if(selCountry != "USA"){
		document.ContactForm.lclState.value = "";
	}	
}

function checkRequiredDataFields(lang, formobject) {

	var pass=true;
	var i = 0;	

	if(document.getElementById('Required'))
	{
		var anz = formobject.elements.length;
		
		for(i=0;i<anz;i++){
			var f = formobject.elements[i];			
			var idname = f.id;
			var idvalue = f.value;
			var fieldname = f.name;
			var fieldtype = f.type;

			if((idname == "Required") && (idvalue == "") && (fieldname != "lclState")&& (fieldname != "lclProvince")){
				f.style.backgroundColor = ErrorColor;
				f.style.color = ErrorFontColor;
				pass = false;
			}else{
				
				if((document.ContactForm.Country.value == "USA") && (fieldname == "lclState") && (idvalue == "")){
					f.style.backgroundColor = ErrorColor;
					f.style.color = ErrorFontColor;
					pass = false;
				}
				if((document.ContactForm.Country.value == "Canada") && (fieldname == "lclProvince") && (idvalue == "")){
					f.style.backgroundColor = ErrorColor;
					f.style.color = ErrorFontColor;
					pass = false;
				}	
			}

			
			if((fieldname=="Email") && (idvalue != "") && (!isEmailAddr(idvalue))){
				f.style.backgroundColor = ErrorColor;
				f.style.color = ErrorFontColor;
				pass = false;				
			}
			
			if((idname == "Required") && (fieldtype == "checkbox") && (f.checked!=true)){
				f.style.backgroundColor = ErrorColor;
				f.style.borderColor = ErrorColor;
				f.style.border = '5px';
				f.style.width = '25px';
				f.style.height = '25px';
				f.style.color = ErrorFontColor;
				pass = false;
			}

		}
	}	

	if (lang=="en")var alertText = "One or more required fields have been left blank or are not correct. Please fill in the information and press submit again."
			if (lang=="de")var alertText = unescape("Eine oder mehrere Angaben sind nicht korrekt oder fehlen. Bitte %FCberpr%FCfen Sie die markierten Felder.")
			if (lang=="fr")var alertText = unescape("Un ou plusieurs champs n%27ont pas %E9t%E9 remplis correctement. Merci de bien vouloir v%E9rifier vos donn%E9es.");
			if (lang=="es")var alertText = "Por favor rellene todos los campos marcados con *"
			if (lang=="it")var alertText = "Per favore compili tutti i campi segnalati con *"
			if (lang=="nl")var alertText = "Een of meerdere verplichte velden zijn niet ingevuld of fout.  Gelieve de informatie in te geven en nogmaals te verzenden."
			if (lang=="pl")var alertText = unescape("Jedna albo wi%u0119cej podanych s%u0105 niew%u0142a%u015Bciwe lub brakuje danych. Prosz%u0119 sprawdzi%u0107 zaznaczone pola");
			if (lang=="pt")var alertText = unescape("Um ou mais campos foram deixados em branco ou preenchidos incorretamente. Por favor%2C inclua a informa%E7%E3o e clique em enviar novamente.");
			if (lang=="jp")var alertText = unescape("%u5FC5%u9808%u9805%u76EE%u304C%u3059%u3079%u3066%u8A18%u5165%u3055%u308C%u3066%u3044%u307E%u305B%u3093%u3002%u3059%u3079%u3066%u3054%u8A18%u5165%u306E%u3046%u3048%u9001%u4FE1%u30DC%u30BF%u30F3%u3092%u30AF%u30EA%u30C3%u30AF%u3057%u3066%u304F%u3060%u3055%u3044%u3002");
			if (lang=="cn")var alertText = alert(unescape("%u8868%u683C%u5F53%u4E2D%u6709%u7A7A%u7F3A%u6216%u672A%u6B63%u786E%u586B%u59A5%u7684%u8D44%u6599%u3002%u70E6%u8BF7%u60A8%u5C06%u8D44%u6599%u586B%u4E0A%u518D%u91CD%u65B0%u63D0%u4EA4%u3002"));	
			
	if (!pass) {		
		alert(alertText);
		return false;
	}else{	
	
		if(document.ContactForm["Country"] != undefined) var region = document.ContactForm["Region"].value = getRegion();
		if(document.ContactForm["Distribution"] != undefined)document.ContactForm["Distribution"].value = getDistribution();
		var doRanking = getRanking(region);
		if(document.ContactForm["MailHeader"] != undefined)document.ContactForm["MailHeader"].value = getMailHeader();
		if(document.ContactForm["Greeting"] != undefined)document.ContactForm["Greeting"].value = doGreeting();		
		//if(document.ContactForm["RS_History"] != undefined)document.ContactForm["RS_History"].value = getRS_String();
		if(document.ContactForm["CampaignName"] != undefined)var doCampaign = doSFDC(holecookie('farocp'));
		
		if(testalert){
			alert(" Greeting: " + document.ContactForm["Greeting"].value + "\n Ranking: " + document.ContactForm["Ranking"].value + "\n Region: " + document.ContactForm["Region"].value + "\n MailHeader: " + document.ContactForm["MailHeader"].value + "\ncampaign-name: " + document.ContactForm["CampaignName"].value + "\nfarocp: " + holecookie('farocp') + "\n");			
			return false;
		}
	
	}
}


function getRegion(){
	var country = document.ContactForm["Country"].value;
	var region = "EUROPE";
	
	if(country == "Australia" || country == "Brunei" || country == "China" || country == "Hong Kong" || country == "India" || country == "Indonesia" || country == "Japan" || country == "Korea" || country == "Malaysia" || country == "Myanmar" || country == "New Zealand" || country == "Philippines" || country == "Singapore" || country == "South Korea" || country == "Sri Lanka" || country == "Taiwan" || country == "Thailand" || country == "Vietnam"){ 
		region = "ASIA";
	}
	if(country == "USA" || country == "United States" || country == "Canada" || country == "Mexico" || country == "Brazil" || country == "Costa Rica" || country == "Guatemala" || country == "Honduras" || country == "Puerto Rico" || country == "Chile" || country == "Argentina" || country == "Panama" || country == "Peru" || country == "Bolivia" || country == "Ecuador" || country == "Colombia" || country == "Venezuela"){ 
		region = "AMERICAS";
	}
	
		return region;

//switch (country){
//case "Australia": return "ASIA"; break;
//default : return "EUROPE"
}		


function getDistribution(){
	var country = document.ContactForm["Country"].value;
	var distribution = "yes";
	
	if(country == "Australia" || country == "Brunei" || country == "China" || country == "Hong Kong" || country == "India" || country == "Indonesia" || country == "Japan" || country == "Korea" || country == "Malaysia" || country == "Myanmar" || country == "New Zealand" || country == "Philippines" || country == "Singapore" || country == "South Korea" || country == "Sri Lanka" || country == "Taiwan" || country == "Thailand" || country == "Vietnam"){ 
		distribution = "no";
	}
	if(country == "USA" || country == "United States" || country == "Canada" || country == "Mexico" || country == "Brazil" || country == "Costa Rica" || country == "Guatemala" || country == "Honduras" || country == "Puerto Rico" || country == "Chile" || country == "Argentina" || country == "Panama" || country == "Peru" || country == "Bolivia" || country == "Ecuador" || country == "Colombia" || country == "Venezuela"){ 
		distribution = "no";
	}
	if(country == "UK" || country == "United Kingdom" || country == "Germany" || country == "Turkey" || country == "Spain" || country == "Italy" || country == "France" || country == "Austria" || country == "Belgium" || country == "Netherlands" || country == "Luxembourg" || country == "Ireland" || country == "Switzerland" || country == "Poland" || country == "Portugal"){ 
		distribution = "no";
	}
	return distribution;

//switch (country){
//case "Australia": return "no"; break;
//case "Russia": return "yes"; break;
//default : return "yes"
}


function getRanking(){
	
	var ranked = document.ContactForm["Ranking"].value;
	var RequestedService = getRequestedService();
	var region = getRegion();
		
	if (RequestedService=="Demo Request"){
			ranked = unescape("2 Demo Request");
	}
	if (RequestedService=="Quote Request"){
			ranked = unescape("1 Quote Request or Callback");
	}
	if (RequestedService=="Callback"){
			ranked = unescape("1 Quote Request or Callback");
	}
	if (RequestedService=="Callback - Sales"){
			ranked = unescape("1 Quote Request or Callback");
	}
	if (RequestedService=="Callback - Customer Service"){
			ranked = unescape("4 General Request");
	}
	if (RequestedService=="Customer Service"){
			ranked = unescape("4 General Request");
	}
	if (RequestedService=="Product Info"){
			ranked = unescape("4 General Request");
	}
	if (RequestedService=="General Contact"){
			ranked = unescape("4 General Request");
	}
	
	document.ContactForm["Ranking"].value = ranked;	
	return "";
}


function getMailHeader(){
	var RequestedService = getRequestedService();
	var defaultMailHeader = document.ContactForm["MailHeader"].value;
	var Header = defaultMailHeader;
	
	if (RequestedService=="Customer Service")Header = unescape(defaultMailHeader + "- Please forward to Customer Service");
	if (RequestedService=="Callback - Customer Service")Header = unescape(defaultMailHeader + "- Callback CS: Please forward to Customer Service");
	if (RequestedService=="Callback")Header = unescape(defaultMailHeader + "- Callback Request!");
	if (RequestedService=="Callback - Sales")Header = unescape(defaultMailHeader + "- Callback Request!");
	if (RequestedService=="Product Info")Header = unescape(defaultMailHeader + "- Requested Service: Product Info");
	if (RequestedService=="Demo Request")Header = unescape(defaultMailHeader + "- Demo Request!");
	if (RequestedService=="Quote Request")Header = unescape(defaultMailHeader + "- Quote Request!");

	return Header;
}

function getRequestedService(){
	var RequestedService ="";
	if (document.ContactForm["Subject"])var SubjectObject = document.ContactForm["Subject"];
	if (document.ContactForm["RequestedService"])var SubjectObject = document.ContactForm["RequestedService"];	
	if(SubjectObject){
	if (SubjectObject.type=="hidden") {
		RequestedService = SubjectObject.value;
	}else{		
		var anz2 = SubjectObject.length;
		for(var j=0;j<anz2;j++){
			var f2 = SubjectObject[j];
			if (f2.checked || f2.selected)	RequestedService = SubjectObject[j].value;			
		}
	}	
	}
	return RequestedService;
}

function doGreeting(){
	var Greeting ="";
	var Salut = "";
	if (document.ContactForm["Salutation"]){
		var SubjectObject = document.ContactForm["Salutation"];
		for(var s=0;s<2;s++){
			var s2 = SubjectObject[s];
			if (s2.checked || s2.selected)	Salut = SubjectObject[s].value;			
		}
	}
	
	var SiteSource = document.ContactForm["Language"].value;
	var FirstN = document.ContactForm["FirstName"].value;
	var LastN = document.ContactForm["LastName"].value;
	
	if (SiteSource == "DE" || SiteSource == "CH_DE"){
		if (Salut == "Mr.") Greeting = "Guten Tag Herr";
		if (Salut == "Mrs.") Greeting = "Guten Tag Frau";
		if (LastN == "") Greeting = "Guten Tag";
	}if (SiteSource == "UK" || SiteSource == "DISTRI" || SiteSource == "USA"){
		if (Salut == "Mr.") Greeting = "Dear Mr.";
		if (Salut == "Mrs.") Greeting = "Dear Ms.";
		if (LastN == "") Greeting = "Dear Sir or Madam";
	}if (SiteSource == "FR"){
		if (Salut == "Mr.") Greeting = "Bonjour Monsieur";
		if (Salut == "Mrs.") Greeting = "Bonjour Madame";
		if (LastN == "") Greeting = "Madame, Monsieur";
	}if (SiteSource == "NL" || SiteSource == "BEN"){
		if (Salut == "Mr.") Greeting = "Geachte heer";
		if (Salut == "Mrs.") Greeting = "Geachte mevrouw";
		if (LastN == "") Greeting = "Geachte";
	}if (SiteSource == "IT"){
		if (Salut == "Mr.") Greeting = "Gentile Signor";
		if (Salut == "Mrs.") Greeting = "Gentile Signora";
		if (LastN == "") Greeting = "Gentili Signore e Signori";
	}if (SiteSource == "ES"){
		if (Salut == "Mr.") Greeting = unescape("Estimado Se%F1or");
		if (Salut == "Mrs.") Greeting = unescape("Estimada Se%F1ora");
		if (LastN == "") Greeting = unescape("Estimado Se%F1orres nuestros");
	}if (SiteSource == "PL"){
		Greeting = "Szanowni Panstwo";
	}if (SiteSource == "TR"){
		if (Salut == "Mr.") Greeting = "Sayin Baylar";
		if (Salut == "Mrs.") Greeting = "Sayin Bayanlar";
		if (LastN == "") Greeting = "Sayin Bayanlar ve Baylar";
	}
	
	return Greeting;
}

function clearBox(lclObj,message){
	if(lclObj.value==message){
		lclObj.value = "";
	}
}

function bgWhite(object){
	object.style.backgroundColor = OkColor;
	object.style.color = OkFontColor;
}

function bgGrey(object){
	object.style.backgroundColor = OkColor;	
	object.style.color = OkFontColor;
}


function isEmailAddr(str) 
{
	return str.match(/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/);
}	
	
	
function openPr(popName,popUrl,w,h){
	var windowPrefs="width="+w+",height="+h+",left=100,top=100,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no";
	popWindow=window.open(popUrl,popName, windowPrefs);
	popWindow.focus();
}

function getCookie(CookieName)
{
  var dc = "" + document.cookie;
  var Muster = 'dc.match(/' + CookieName + '=(.+)/)';
  eval(Muster);
  var Wert = unescape(RegExp.$1);
  return Wert;
}


function holecookie(labelName){

	var labelLaenge = labelName.length;
	var cookieDaten = document.cookie;
	var cLaenge = cookieDaten.length;
	var i = 0;
	var cEnde;
	while ( i < cLaenge){	
		var j = i + labelLaenge;
		if (cookieDaten.substring(i,j) == labelName) {
			cEnde = cookieDaten.indexOf(";",j);
			if (cEnde == -1) {
				cEnde = cookieDaten.length;
				}
				return unescape(cookieDaten.substring(j+1, cEnde));
		}
		i++;
	} 
	return "";
}

function doSFDC(cpath){
		if (cpath.search(/awda.+/)!= -1) document.ContactForm["CampaignName"].value = "EU_2009 SEM DACH";
		if (cpath.search(/icda.+/)!= -1) document.ContactForm["CampaignName"].value = "EU_2009 SEM DACH";
		if (cpath.search(/awuk.+/)!= -1) document.ContactForm["CampaignName"].value = "EU_2009 SEM UK";
		if (cpath.search(/awfr.+/)!= -1) document.ContactForm["CampaignName"].value = "EU_2009 SEM FR";
		//alert ("cpath: " +cpath);
}


-->