﻿/*
 File Name:		enewsletter-subscribe.js
 Date Created:	24/04/2008
 Author:			Andrew Newnham/Mariam Saim
 Description:		This file is used only for displaying the enewsletter form in the website.
 Related files:	scripts/newsletter-validation.js
 Updates:	02.03.08: - created.
 			27.04.08: - made all tags lowercase
					  - changed html encompassing quotation marks to single quotes
					  - removed unrequired spacing
			11.08.08: - added arrays to hold various languages and changed the form to allow the language to be specified
					  - Added switch code to change folder names according to language
			02.03.09: - Added parameter to have the default elected dep city
					  - Added parameter to have a custom submit label.
			07/02/10 - Removed URI detecting code, as centralised code now being used in common.js - A. Newnham					
*/

//temp variable declaration
fileName=URI.substr(URI.lastIndexOf('/')+1,URI.length).toLowerCase();
//alert(fileName);
var japanesemsgemail=String.fromCharCode(69,45,12513,12540,12523,12539,12450,12489,12524,12473,12434,12372,20837,21147,12367,12384,12373,12356,12290);
var japanesemsgcity=String.fromCharCode(12424,12367,21033,29992,12377,12427,20986,30330,37117,24066,12434,25351,23450,12375,12390,12367,12384,12373,12356,12290);
var ClicktoAgreeTerms="Kindly Check the Terms and Agreements";
//Restricting relevant fields to numeric only
function numbersonly(myfield,e,dec){
	var key;
	var keychar;
	if(window.event)key=window.event.keyCode;
	else if(e)key=e.which;
	else return true;
	keychar=String.fromCharCode(key);
	//control keys
	if((key==null)||(key==0)||(key==8)||(key==9)||(key==13)||(key==27))return true;
	//numbers
	else if((("0123456789").indexOf(keychar)>-1))return true;
	//decimal point jump
	else if(dec&&(keychar==".")){myfield.form.elements[dec].focus();return false;}
	else return false;
}

//Creating a 3d array to hold all language data
function fieldDef(select,title,mr,mrs,ms,fName,lName,email,city,member,yes,privacy,source,flyer,newspaper,online,question,maha,ffp,qdfc,submit,mobile){
	this.select=select;
	this.title=title;
	this.mr=mr;
	this.mrs=mrs;
	this.ms=ms;
	this.fName=fName;
	this.lName=lName;
	this.email=email;
	this.city=city;
	this.member=member;
	this.yes=yes;
	this.privacy=privacy;
	this.source=source;
	this.flyer=flyer;
	this.newspaper=newspaper;
	this.online=online;
	this.question=question;
	this.maha=maha;
	this.ffp=ffp;
	this.qdfc=qdfc;
	this.submit=submit;
	this.mobile=mobile;
}

var langList=new Array();
//English
langList[0]=new fieldDef('select','Title','Mr','Mrs','Ms','First Name','Family Name','Email Address','Preferred City of Departure','Privilege Club Member','Yes','I have read, understood and accepted the <a href="/global/en/privacy-policy.html#Newsletter">Privacy Policy</a>','','','','','Q: Our passengers enjoy a range<br/>of exclusive privileges and benefits at: ','Al Maha Services','Privilege Club','Qatar Duty Free','Submit','Mobile/Cell Number');
//French
langList[1]=new fieldDef('select','Titre','Mr','Mme','Mlle','Pr&#233;nom','Nom','Adresse Email','A&#233;roport de d&#233;part habituel','Membre Privilege Club','Oui','J\'ai pris connaissance de la <a href="charte-de-confidentialite.html" title="view the Privacy Policy">charte de confidentialit&#233;</a>. Je la comprends et j\'en accepte les conditions.','Flyer','Journaux','Internet','','','','','','Envoyer','Num&#233;ro de t&#233;l&#233;phone portable');
//German
langList[2]=new fieldDef('ausw&#228;hlen','Titel','','Frau','Herr','Vorname','Nachname','E-Mail-Adresse','Bevorzugter Abflughafen','Privilege Club Mitglied','Ja','Ich habe die Nutzungsbedingungen gelesen,<a href="privacy-policy.html"> datenschutzrichtlinie</a>','','','','','','','','','Absenden','Handynummer');
//Japanese
langList[3]=new fieldDef('&#12362;&#36984;&#12403;&#12367;&#12384;&#12373;&#12356;','&#31216;&#21495;','Mr','Mrs','Ms','&#12362;&#21517;&#21069;&#65288;&#21517;&#65289;','&#12362;&#21517;&#21069;&#65288;&#22995;&#65289;','E&#12513;&#12540;&#12523;&#12539;&#12450;&#12489;&#12524;&#12473;','&#12424;&#12367;&#21033;&#29992;&#12377;&#12427;&#20986;&#30330;&#37117;&#24066;','&#12503;&#12522;&#12499;&#12524;&#12483;&#12472;&#12463;&#12521;&#12502;&#20250;&#21729;&#12391;&#12377;&#12363;','&#12399;&#12356;','<a href="/global/en/privacy-policy.html#Newsletter">&#35215;&#32004;</a>&#12434;&#35501;&#12415;&#12289;&#21516;&#24847;&#12375;&#12414;&#12377;&#12290;','','','','','','','','','&#36865;&#20449;','Mobile/Cell Number');
//Arabic
langList[4]=new fieldDef('select','&#1575;&#1604;&#1604;&#1602;&#1576;','&#1575;&#1604;&#1587;&#1610;&#1583;','&#1575;&#1604;&#1587;&#1610;&#1583;&#1577;','&#1575;&#1604;&#1570;&#1606;&#1587;&#1577;','&#1575;&#1604;&#1575;&#1587;&#1605;&#32;&#1575;&#1604;&#1571;&#1608;&#1604;','&#1575;&#1587;&#1605;&#32;&#1575;&#1604;&#1593;&#1575;&#1574;&#1604;&#1577;','&#1575;&#1604;&#1576;&#1585;&#1610;&#1583;&#32;&#1575;&#1604;&#1573;&#1604;&#1603;&#1578;&#1585;&#1608;&#1606;&#1610;','&#1575;&#1604;&#1605;&#1583;&#1610;&#1606;&#1577;&#32;&#1575;&#1604;&#1605;&#1601;&#1590;&#1604;&#1577;&#32;&#1604;&#1604;&#1605;&#1594;&#1575;&#1583;&#1585;&#1577;','&#1607;&#1604;&#32;&#1571;&#1606;&#1578;&#32;&#1593;&#1590;&#1608;&#32;&#1601;&#1610;&#32;&#1606;&#1575;&#1583;&#1610;&#32;&#1575;&#1604;&#1575;&#1605;&#1578;&#1610;&#1575;&#1586;','&#1606;&#1593;&#1605;','&#1602;&#1585;&#1571;&#1578;&#1548;&#32;&#1601;&#1607;&#1605;&#1578;&#32;&#1608;&#1602;&#1576;&#1604;&#1578;&#32;&#1588;&#1585;&#1608;&#1591 <a href="/global/en/privacy-policy.html#Newsletter">&#1575;&#1604;&#1582;&#1589;&#1608;&#1589;&#1610;&#1577;</a>','','','','','','','','','&#1575;&#1606;&#1578;&#1607;&#1609;','&#1585;&#1602;&#1605;&#32;&#1575;&#1604;&#1607;&#1575;&#1578;&#1601;&#32;&#1575;&#1604;&#1580;&#1608;&#1575;&#1604;');
//Italian
langList[5]=new fieldDef('select','Titolo','Sig.','Sig.na','Sig.ra','Nome','Cognome','Indirizzo e-mail','Citt&#224; di partenza preferita','Numero di Privilege Club','Si','Ho letto, compreso e accettato i termini in materia di legge della <a href="/global/en/privacy-policy.html#Newsletter">Privacy</a>','','','','','','','','','Iscrizione','Mobile/Cellulare');
//Spanish
langList[6]=new fieldDef('seleccionar','Tratamiento','Sr','Sra','Srta','Nombre','Apellido','Direcci&#243;n de e-mail','Ciudad de salida','Es socio de \'Privilege Club\'','Si','He le&#237;do y acepto la  <a href="/global/en/privacy-policy.html#Newsletter">pol&#237;tica de privacidad</a>','D&oacute;nde ha visto esta promoci&oacute;n?','Folleto','Peri&#243;dico','Online','','','','','Enviar','Tel&#233;fono m&#243;vil');
//Chinese
langList[7]=new fieldDef('&#36873;&#25321;','&#31216;&#35859;','&#20808;&#29983;','&#22827;&#20154;','&#23567;&#22992;','&#21517;&#23383;','&#22995;&#27663;','&#37038;&#31665;&#22320;&#22336;','&#39318;&#36873;&#22987;&#21457;&#22478;&#24066;','&#24120;&#26053;&#23458;&#20465;&#20048;&#37096;&#20250;&#21592;&#65311;','&#26159;','&#25105;&#24050;&#38405;&#35835;&#12289;&#29702;&#35299;&#24182;&#25509;&#21463;&#35813;<a href="/global/en/privacy_policy.html#Newsletter">&#38544;&#31169;&#25919;&#31574;</a>&#12290;','','','','','','','','','&#25552;&#20132;','&#25163;&#26426;&#21495;');
//Russian
langList[8]=new fieldDef('&#1042;&#1099;&#1073;&#1088;&#1072;&#1090;&#1100;','&#1054;&#1073;&#1088;&#1072;&#1097;&#1077;&#1085;&#1080;&#1077;','&#1043;&#45;&#1085;','&#1043;&#45;&#1078;&#1072;','','&#1048;&#1084;&#1103;','&#1060;&#1072;&#1084;&#1080;&#1083;&#1080;&#1103;','&#1040;&#1076;&#1088;&#1077;&#1089;&#32;&#1101;&#1083;&#1077;&#1082;&#1090;&#1088;&#1086;&#1085;&#1085;&#1086;&#1081;&#32;&#1087;&#1086;&#1095;&#1090;&#1099;','&#1055;&#1088;&#1077;&#1076;&#1087;&#1086;&#1095;&#1090;&#1080;&#1090;&#1077;&#1083;&#1100;&#1085;&#1099;&#1081;&#32;&#1075;&#1086;&#1088;&#1086;&#1076;&#32;&#1086;&#1090;&#1087;&#1088;&#1072;&#1074;&#1083;&#1077;&#1085;&#1080;&#1103;','&#1042;&#1099; &#1091;&#1095;&#1072;&#1089;&#1090;&#1085;&#1080;&#1082; Privilege Club','&#1044;&#1072;','&#1071;&#32;&#1086;&#1079;&#1085;&#1072;&#1082;&#1086;&#1084;&#1083;&#1077;&#1085;&#32;&#1080;&#32;&#1089;&#1086;&#1075;&#1083;&#1072;&#1089;&#1077;&#1085;&#32;&#1089; <a href="/global/en/privacy-policy.html#Newsletter">&#1091;&#1089;&#1083;&#1086;&#1074;&#1080;&#1103;&#32;&#1080;&#32;&#1087;&#1088;&#1072;&#1074;&#1080;&#1083;&#1072;</a>','','','','','','','','','&#1055;&#1077;&#1088;&#1077;&#1076;&#1072;&#1090;&#1100;','&#1053;&#1086;&#1084;&#1077;&#1088;&#32;&#1084;&#1086;&#1073;&#1080;&#1083;&#1100;&#1085;&#1086;&#1075;&#1086;&#32;&#1090;&#1077;&#1083;&#1077;&#1092;&#1086;&#1085;&#1072;');
//Korean
langList[9]=new fieldDef('&#49440;&#53469;','&#53440;&#51060;&#53952;','Mr','Mrs','Ms','&#51060;&#47492;','&#49457;','&#51060;&#47700;&#51068;&#32;&#51452;&#49548;','&#49440;&#54840;&#54616;&#45716;&#32;&#52636;&#48156;&#51648;','&#54532;&#47532;&#48716;&#47532;&#51648; &#53364;&#47101; &#54924;&#50896;&#51060;&#49901;&#45768;&#44620;','&#45348;','&#51060;&#32;&#50557;&#44288;&#51012;&#32;&#51069;&#50632;&#51004;&#47728;&#32;&#51060;&#32;&#45236;&#50857;&#50640; <a href="/global/en/privacy_policy.html#Newsletter">&#46041;&#51032;&#32;&#54633;&#45768;&#45796;</a>','','','','','','','','','&#48372;&#45236;&#44592;','&#55092;&#45824;&#54256;&#32;&#48264;&#54840;');
//Turkish
langList[10]=new fieldDef('se&#231;iniz','&#220;nvan','Bay','Bayan','','Ad','Soyad','E–posta adresi','Kalk&#305;&#351; i&#231;in tercih edilen &#351;ehir','Privilege Club üyeli&#287;iniz var m&#305;','Evet','Gizlilik Politikas&#305;n&#305; okudum, anlad&#305;m ve kabul <a href="/tr/tr/privacy-policy.html#Newsletter">ediyorum</a>','','','','','','','','','Gönder','Cep Telefonu Numaras&#305;');
//Portuguese
langList[11]=new fieldDef('seleccione','T&iacute;tulo','Sr.','Sra.','Srta.','Nome','Sobrenome','Endere&ccedil;o de email','Cidade Preferencial de partida','Membro do Privilege Club','Sim','Eu li, compreendi e aceito a <a href="/global/en/privacy-policy.html#Newsletter">Pol&iacute;tica de Privacidade</a>','','','','','Q: Our passengers enjoy a range<br/>of exclusive privileges and benefits at: ','Al Maha Services','Privilege Club','Qatar Duty Free','Enviar','Mobile/Cell Number');
//Greek
langList[12]=new fieldDef('select','Title','Mr','Mrs','Ms','First Name','Family Name','Email Address','Preferred City of Departure','Privilege Club Member','Yes','I have read, understood and accepted the <a href="/global/en/privacy-policy.html#Newsletter">Privacy Policy</a>','','','','','Q: Our passengers enjoy a range<br/>of exclusive privileges and benefits at: ','Al Maha Services','Privilege Club','Qatar Duty Free','Submit','Mobile/Cell Number');
//Swedish
langList[13]=new fieldDef('V&auml;lj','Titel','Herr','Fru','Fr&ouml;ken','F&ouml;rnamn','Efternamn','E-postadress','Din avreseort','Medlem i Privilege Club','Ja','Jag har l&auml;st, f&ouml;rst&aring;tt och godk&auml;nt <a href="/global/en/privacy-policy.html#Newsletter">sekretesspolicyn</a>','','','','','Q: Our passengers enjoy a range<br/>of exclusive privileges and benefits at: ','Al Maha Services','Privilege Club','Qatar Duty Free','Skicka','Mobilnummer');

//Danish

langList[14]=new fieldDef('select','Titel','Frk','Fru','Ms','Fornavn','Efternavn','E-mail adresse','Foretrukket by for afrejse','Privilege Club medlem','Ja','Jeg har l&#230;st, forst&#229;et og accepteret politiken for beskyttelse af <a href="/global/en/privacy-policy.html#Newsletter">Private oplysninger</a>','','','','','Q: Our passengers enjoy a range<br/>of exclusive privileges and benefits at: ','Al Maha Services','Privilege Club','Qatar Duty Free','Tilmeld','Mobile/Cell Number');
function writeform(lang,sourceCode,prefCityCode,submitLabel){
//If default city is not specified, first field is selected
if((prefCityCode==null)|| (prefCityCode=="")){prefCityCode="";}
if((submitLabel==null) || submitLabel==""){submitLabel=langList[lang].submit;}
//lang is to specify the language of the e-newsletter, 0=english, 1=french, 2=German
//sourceCode is the indicate where the signup is coming from, i.e. qr.com, msn arabia etc.
document.write('<div class="form" id="#newsletter">');
document.write('<form name="icpsignup" action="http://app.icontact.com/icp/signup.php" method="post">');
document.write('<input type="hidden" name="redirect" value="http://www.qatarairways.com/'+folder+'/confirm.html" />');
document.write('<input type="hidden" name="errorredirect" value="http://www.qatarairways.com/'+folder+'/sorry.html" />');
document.write('<input type="hidden" name="listid" value="3737" />');
document.write('<input type="hidden" name="specialid:3737" value="HUBS" />');	  
document.write('<input type="hidden" name="clientid" value="223895" />');
document.write('<input type="hidden" name="formid" value="188" />');
document.write('<input type="hidden" name="reallistid" value="1" />');
document.write('<input type="hidden" name="doubleopt" value="1" />');
//Default the source code to qr_com
document.write('<input type="hidden" name="fields_signup_location" value="'+sourceCode+'" />');
document.write('<fieldset>');
document.write('<div class="label"><label>'+langList[lang].title+'</label></div>');
document.write('<div><select name="fields_prefix">');
document.write('<option value="" selected>-- '+langList[lang].select+' --</option>');
if(langList[lang].mr!='')document.write('<option value="'+langList[lang].mr+'">'+langList[lang].mr+'</option>');
if(langList[lang].mrs!='')document.write('<option value="'+langList[lang].mrs+'">'+langList[lang].mrs+'</option>');
if(langList[lang].ms!='')document.write('<option value="'+langList[lang].ms+'">'+langList[lang].ms+'</option>');
document.write('</select></div>');
document.write('<div class="label"><label for="fields_fname">'+langList[lang].fName+'</label></div>');
document.write('<div><input type="text" name="fields_fname" maxlength="40" class="middle" /></div>');
document.write('<div class="label"><label for="fields_lname">'+langList[lang].lName+'</label></div>');
document.write('<div><input type="text" name="fields_lname"  maxlength="40" class="middle" /></div>');
document.write('<div class="label required"><label for="fields_email">'+langList[lang].email+'</label></div>');
document.write('<div><input type="text" name="fields_email" maxlength="40" class="middle" /></div>');
//Do not display the mobile field on the Japanese site

	if( (folder=='ae/en') && (fileName=='radio1.html') ){
	document.write('<div class="label required"><label for="fields_mobilenumber">'+langList[lang].mobile+'</label></div>');
	document.write('<div><input type="text" name="fields_mobilenumber" class="middle"/></div>');}
	else{
	document.write('<div class="label"><label for="fields_mobilenumber">'+langList[lang].mobile+'</label></div>');
	document.write('<div><input type="text" name="fields_mobilenumber" class="middle"/></div>');
}


//if(folder=='ae/en'){
//	document.write('<div class="label required"><label for="fields_mobilenumber">'+langList[lang].mobile+'</label></div>');
//	document.write('<div><input type="text" name="fields_mobilenumber" class="middle" onKeyPress="return numbersonly(this,event)" /></div>');
//}
//Philippines (Address1 , Address2 , City , Zip)
if(folder=='ph/en'){
	document.write('<div class="label required"><label for="fields_address1">Residential Address </label></div>');
	document.write('<div><input type="text" name="fields_address1" class="middle"/></div>');
	document.write('<div class="label"><label for="fields_address2">&nbsp;&nbsp; </label></div>');
	document.write('<div><input type="text" name="fields_address2" class="middle"/></div>');
	document.write('<div class="label required"><label for="fields_city">City </label></div>');
	document.write('<div><input type="text" name="fields_city" class="middle"/></div>');
	document.write('<div class="label required"><label for="fields_zip">Zip </label></div>');
	document.write('<div><input type="text" name="fields_zip" class="middle"/></div>');
}

//UK new competion page

if((folder=='uk/en') && (fileName=='northwest-insider.html') )
{
	document.write('<div class="label required"><label for="fields_business">Company</label></div>');
	document.write('<div><input type="text" name="fields_business" class="middle"/></div>');
	document.write('<div class="label required"><label for="fields_address1">Address Line 1</label></div>');
	document.write('<div><input type="text" name="fields_address1" class="middle"/></div>');
	document.write('<div class="label required"><label for="fields_address2">Address Line 2 </label></div>');
	document.write('<div><input type="text" name="fields_address2" class="middle"/></div>');
	document.write('<div class="label required"><label for="fields_zip">Postcode</label></div>');
	document.write('<div><input type="text" name="fields_zip" class="middle"/></div>');
	document.write('<div class="label required"><label for="fields_fields_longhaul">Number of long-haul trips taken per year</label></div>');
	document.write('<div><input type="text" name="fields_fields_longhaul" class="middle"/></div>');
}

if((folder=='se/en') && (fileName=='kul.html') )
{
	document.write('<div class="label required"><label for="fields_Thailand">What is Qatar Airways latest destination in Thailand?</label></div>');
	document.write('<div><select name="fields_thailand" id="fields_thailand">');
	document.write('<option value="" >--'+langList[lang].select+'--</option>');
	document.write('<option value="Bangkok">Bangkok</option>');
	document.write('<option value="Phuket">Phuket</option>');
	document.write('<option value="Chaing Mai">Chaing Mai</option>'); 
    document.write('<option value="Koh Samui">Koh Samui</option>');
	document.write('</select></div>');
	var browserName=navigator.appName; 

	//alert("Name of the browser " +browserName);
	if (browserName=="Netscape")
	{ 
     document.write('<br\><br\><br\><br\><br\><br\><br\><br\><br\><br\><br><div class="label required"><label for="fields_baggage">How many kilos checked baggage are you allowed to bring when you are travelling in Business Class?</label></div>');
	
	}
	else
	{
	document.write('<br></br><br><div class="label required"><label for="fields_baggage">How many kilos checked baggage are you allowed to bring when you are travelling in Business Class?</label></div>');
	}
	document.write('<div><select name="fields_baggage" id="fields_baggage">');
	document.write('<option value="" >-- '+langList[lang].select+' --</option>');
	document.write('<option value="20">20</option>');
	document.write('<option value="30">30</option>');
	document.write('<option value="40">40</option>');
    document.write('<option value="50" >50</option>');
	document.write('</select></div>');
	document.write('<br\><br\><br\><br\><div class="label required"><label for="fields_motivate">In max 200 words, please explain why you think you should win the tickets</label></div>');
    document.write('<div> <TEXTAREA id="fields_motivate" NAME="fields_motivate" COLS=29 ROWS=6></TEXTAREA></div>');
	//document.write('<div><input type="text" name="fields_fields_motivate" class="middle"/></div>');
}
if((folder=='se/se') && (fileName=='kul.html') )
{
	document.write('<div class="label required"><label for="fields_Thailand">Vilken &#228;r Qatar Airways senaste destination i Thailand?</label></div>');
	document.write('<div><select name="fields_thailand" id="fields_thailand">');
	document.write('<option value="" >-- '+langList[lang].select+' --</option>');
	document.write('<option value="Bangkok" >Bangkok</option>');
	document.write('<option value="Phuket" >Phuket</option>');
	document.write('<option value="Chaing Mai" >Chaing Mai</option>');
    document.write('<option value="Koh Samui" >Koh Samui</option>');
	document.write('</select></div>');
    var browserName=navigator.appName; 

	//alert("Name of the browser " +browserName);
	if (browserName=="Netscape")
	{ 
     document.write('<br\><br\><br\><br\><br\><br\><br\><br\><br\><br\><br><div class="label required"><label for="fields_baggage">Hur m&#229;nga kilo bagage f&#229;r du checka in n&#228;r du reser i Business Klass?</label></div>');
	
	}
	else
	{
	document.write('<br></br><br><div class="label required"><label for="fields_baggage">Hur m&#229;nga kilo bagage f&#229;r du checka in n&#228;r du reser i Business Klass?</label></div>');
	}

	//document.write('<br\><br\><br\><br\><br\><br\><br\><br\><br\><br\><br><div class="label required"><label for="fields_baggage">Hur m&#229;nga kilo bagage f&#229;r du checka in n&#228;r du reser i Business Klass?</label></div>');
	document.write('<div><select name="fields_baggage" id="fields_baggage">');
	document.write('<option value="" >-- '+langList[lang].select+' --</option>');
	document.write('<option value="20" >20</option>');
	document.write('<option value="30" >30</option>');
	document.write('<option value="40" >40</option>');
    document.write('<option value="50" >50</option>');
	document.write('</select></div>');
	document.write('<br\><br\><br\><div class="label required"><label for="fields_motivate">Motivera varf&#246;r just du ska vinna en resa med Qatar Airways.</label></div>');
    document.write('<div> <TEXTAREA id="fields_motivate" NAME="fields_motivate" COLS=29 ROWS=6></TEXTAREA></div>');
	//document.write('<div><input type="text" name="fields_fields_motivate" class="middle"/></div>');
}


document.write('<br\><br\><br\><div class="label required"><label for="fields_departure">'+langList[lang].city+'</label></div>');
document.write('<div><select name="fields_departure">');
document.write('<option value="" >-- '+langList[lang].select+' --</option>');
document.write('<option value="AUH">Abu Dhabi</option>');
document.write('<option value="ADL">Adelaide</option>');
document.write('<option value="AMD">Ahmedabad</option>');
document.write('<option value="ALY">Alexandria</option>');
document.write('<option value="ALG">Algiers</option>');
document.write('<option value="AMM">Amman</option>');
document.write('<option value="ATQ">Amritsar</option>');
document.write('<option value="ESB">Ankara</option>');
document.write('<option value="ATH">Athens</option>');
document.write('<option value="BAH">Bahrain</option>');
document.write('<option value="BKK">Bangkok</option>');
document.write('<option value="BCN">Barcelona</option>');
document.write('<option value="PEK">Beijing</option>');
document.write('<option value="BEY">Beirut</option>');
document.write('<option value="BLR">Bengaluru</option>');
document.write('<option value="TXL">Berlin</option>');
document.write('<option value="BNE">Brisbane</option>');
document.write('<option value="BRU">Brussels</option>');
document.write('<option value="OTP">Bucharest</option>');
document.write('<option value="BUD">Budapest</option>');
document.write('<option value="EZE">Buenos Aires</option>');
document.write('<option value="CAI">Cairo</option>');
document.write('<option value="CPT">Cape Town</option>');
document.write('<option value="CMN">Casablanca</option>');
document.write('<option value="CEB">Cebu</option>');
document.write('<option value="MAA">Chennai</option>');
document.write('<option value="CMB">Colombo</option>');
document.write('<option value="CPH">Copenhagen</option>');
document.write('<option value="DAM">Damascus</option>');
document.write('<option value="DMM">Dammam</option>');
document.write('<option value="DAR">Dar Es Salaam </option>');
document.write('<option value="DPS">Denpasar Bali</option>');
document.write('<option value="DAC">Dhaka</option>');
document.write('<option value="DOH">Doha</option>');
document.write('<option value="DXB">Dubai</option>');
document.write('<option value="FRA">Frankfurt</option>');
document.write('<option value="GVA">Geneva</option>');
document.write('<option value="GOI">Goa</option>');
document.write('<option value="CAN">Guangzhou</option>');
document.write('<option value="HAN">Hanoi</option>');
document.write('<option value="SGN">Ho Chi Minh City</option>');
document.write('<option value="HKG">Hong Kong</option>');
document.write('<option value="HOU">Houston</option>');
document.write('<option value="HYD">Hyderabad</option>');
document.write('<option value="ISB">Islamabad</option>');
document.write('<option value="IST">Istanbul</option>');
document.write('<option value="CGK">Jakarta</option>');
document.write('<option value="JED">Jeddah</option>');
document.write('<option value="JNB">Johannesburg</option>');
document.write('<option value="KHI">Karachi</option>');
document.write('<option value="KTM">Kathmandu</option>');
document.write('<option value="KRT">Khartoum</option>');
document.write('<option value="COK">Kochi</option>');
document.write('<option value="CCJ">Kozhikode</option>');
document.write('<option value="KUL">Kuala Lumpur</option>');
document.write('<option value="KWI">Kuwait</option>');
document.write('<option value="LOS">Lagos</option>');
document.write('<option value="LHE">Lahore</option>');
document.write('<option value="LON">London</option>');
document.write('<option value="LXR">Luxor</option>');
document.write('<option value="MAD">Madrid</option>');
document.write('<option value="MLE">Maldives</option>');
document.write('<option value="MAN">Manchester</option>');
document.write('<option value="MNL">Manila</option>');
document.write('<option value="MHD">Mashad</option>');
document.write('<option value="MEL">Melbourne</option>');
document.write('<option value="MXP">Milan</option>');
document.write('<option value="DME">Moscow</option>');
document.write('<option value="BOM">Mumbai</option>');
document.write('<option value="MUC">Munich</option>');
document.write('<option value="MCT">Muscat</option>');
document.write('<option value="NAG">Nagpur</option>');
document.write('<option value="NBO">Nairobi</option>');
document.write('<option value="DEL">New Delhi</option>');
document.write('<option value="EWR">New York</option>');
document.write('<option value="NCE">Nice</option>');
document.write('<option value="KIX">Osaka</option>');
document.write('<option value="CDG">Paris</option>');
document.write('<option value="PER">Perth</option>');
document.write('<option value="PEW">Peshawar</option>');
document.write('<option value="HKT">Phuket</option>');
document.write('<option value="PRG">Prague</option>');
document.write('<option value="RUH">Riyadh</option>');
document.write('<option value="FCO">Rome</option>');
document.write('<option value="SAH">Sanaa</option>');
document.write('<option value="GRU">Sao Paulo</option>');
document.write('<option value="ICN">Seoul</option>');
document.write('<option value="SEZ">Seychelles</option>');
document.write('<option value="PVG">Shanghai</option>');
document.write('<option value="SIN">Singapore</option>');
document.write('<option value="ARN">Stockholm</option>');
document.write('<option value="SYD">Sydney</option>');
document.write('<option value="IKA">Tehran</option>');
document.write('<option value="TRV">Thiruvananthapuram</option>');
document.write('<option value="TYO">Tokyo</option>');
document.write('<option value="TIP">Tripoli</option>');
document.write('<option value="TUN">Tunis</option>');
document.write('<option value="VIE">Vienna</option>');
document.write('<option value="IAD">Washington DC</option>');
document.write('<option value="ZRH">Zurich</option>');
document.write('</select></div>');
//Sweden Competition Fields
//if(folder=='se/en'){
//	document.write('<div class="fullWidth"><div class="label required"><label for="fields_se_quiz_1">How many departures per week from Stockholm will Qatar Airways have as of 28th of March 2010?</label></div>');
//	document.write('<div><select name="fields_se_quiz_1" id="fields_se_quiz_1">');
//	document.write('<option value="" selected="selected">select</option>');
//	document.write('<option value="1">1</option>');
//	document.write('<option value="2">2</option>');
//	document.write('<option value="3">3</option>');
//	document.write('<option value="4">4</option>');
//	document.write('<option value="5">5</option>');
//	document.write('<option value="6">6</option>');
//	document.write('<option value="7">7</option>');
//	document.write('<option value="8">8</option>');
//	document.write('<option value="9">9</option>');
//	document.write('<option value="10">10</option>');
//	document.write('</select>');
//	document.write('</div></div>');
//	document.write('<div class="fullWidth"><div class="label required"><label for="fields_se_quiz_2">What destination in Australia is Qatar Airways currently flying to?</label></div>');
//	document.write('<div><select name="fields_se_quiz_2" id="fields_se_quiz_2">');
//	document.write('<option value="" selected="selected">select</option>');
//	document.write('<option value="Brisbane">Brisbane</option>');
//	document.write('<option value="Canberra">Canberra</option>');
//	document.write('<option value="Darwin">Darwin</option>');
//	document.write('<option value="Melbourne">Melbourne</option>');
//	document.write('<option value="Newcastle">Newcastle</option>');
//	document.write('<option value="Perth">Perth</option>');
//	document.write('<option value="Sydney">Sydney</option>');
//	document.write('</select>');
//	document.write('</div></div>');
//	document.write('<div class="fullWidth"><div class="label required"><label for="fields_se_quiz_3">Please explain why you think you should win the quiz.</label></div>');
//	document.write('<div><textarea rows="6" name="fields_se_quiz_3" id="fields_se_quiz_3" class="textarea" style="width:185px;"></textarea></div></div>');
//}
document.write('<div class="label"><label>'+langList[lang].member+'?</label></div>');
document.write('<div class="radio"><input type="checkbox" id="fields_pc_member" name="fields_pc_member" />'+langList[lang].yes+'</div>');
//Malaysia Competition Fields
if(folder=='my/en'&&fileName=='my-newsletter.html'){
document.write('<div class="label required"><label for="fields_newdest">When is Qatar Airways launching</br>the new flight services to Sao Paulo and</br>Buenos Aires? (dd/mm/yy)</label></div>');
document.write('<div><input type="text" value="" name="fields_newdest" maxlength="8" class="middle" style="width:60px;" onfocus="this.value=\'\';"/></div>');}
if(fileName=='tatler.html'&&folder=='uk/en'){//Temp addition for Tatler competition on UK/EN site - 07/02/10
	document.write('<div class="fullWidth check"><input type="checkbox" id="fields_uk-tatler" name="fields_uk-tatler" />I would like to receive e-Newsletters from Qatar Airways.</div>');
	document.write('<div class="fullWidth check"><input type="checkbox" id="fields_tourismvic" name="fields_tourismvic" />I would like to receive e-Newsletters from Tourism Victoria.</div>');
}
document.write('<div class="fullWidth check"><input type="checkbox" name="termsagreement" value="termsagreement" />'+langList[lang].privacy+'.</div>');
if(folder=='us/en')
	{
	
//<div class="fullWidth"><div class="label required"><label for="fields_se_quiz_1">How many departures per week from Stockholm will Qatar Airways have as of 28th of March 2010?</label></div>
document.write('<div class="required" style="width:450px"><div class="fullWidth check"><input type="checkbox" name="agreeterms" value="agreeterms"/>By clicking here I agree to the Official Terms and Conditions.</div></div>');
	}
	if(folder=='us/en')
	{
document.write('</fieldset><br/><div class="label"></div><input type="submit" name="submit" value="'+submitLabel+'" onClick="return validate_term(agreeterms);" class="');
	}
	else
	{
		
		var str=langList[lang].submit;
	var start, end;
	start=str.indexOf("&#");
	while(start != -1){
		end=str.indexOf(";");
		var subStr = str.substring(start,end+1);
		var nSubStr = subStr.replace(/&#/,"");
		nSubStr = nSubStr.replace(/;/,"");
		nSubStr = String.fromCharCode(nSubStr);
		str = str.replace(subStr,nSubStr);	
		start=str.indexOf("&#");
	
	submitLabel=str;
	//alert("submitLabel: "+submitLabel);
	}
		
		//alert(submitLabel);
	document.write('</fieldset><br/><div class="label"></div><input type="submit" name="submit" value="'+submitLabel+'" onClick="return validate(termsagreement);" class="');
	}
if(folder=='ru/ru'){document.write('ButtonBig buttonLLBig" />');}else{document.write('button buttonLL" />');}
document.write('</form></div>');
document.write('<script type="text/javascript">');
document.write('var DepSelect = document.icpsignup.fields_departure;');
document.write('for(var i=0; i<DepSelect.length; i++){');
document.write('if(DepSelect.options[i].value == "'+prefCityCode+'"){DepSelect.selectedIndex=i;}');
document.write('}\n');
document.write('var frmvalidator=new Validator("icpsignup");');
document.write('frmvalidator.addValidation("termsagreement","req","Please check the Terms and Conditions.");');

if(folder=='jp/jp'){
	document.write('frmvalidator.addValidation("fields_email","req",japanesemsgemail);');
	document.write('frmvalidator.addValidation("fields_departure","req",japanesemsgcity);');
}else{
document.write('frmvalidator.addValidation("fields_departure","req","Please select preferred city of departure");');
document.write('frmvalidator.addValidation("fields_email","req","Please enter your Email Address");');

//document.write('frmvalidator.addValidation("agreeterms","req","Please check the Agree Terms and Conditions.");');
document.write('frmvalidator.addValidation("fields_mobilenumber","numeric","Please enter a valid Mobile/Cell Number.");');
}
document.write('frmvalidator.addValidation("fields_fname","alpha");');
document.write('frmvalidator.addValidation("fields_lname","alpha");');
document.write('frmvalidator.addValidation("fields_email","email");');

//Swedish competition validation fields
//if(folder=='se/en'){
//	document.write('frmvalidator.addValidation("fields_se_quiz_1","req","Please select an answer to competition question 1");');
//	document.write('frmvalidator.addValidation("fields_se_quiz_2","req","Please select an answer to competition question 2");');
//	document.write('frmvalidator.addValidation("fields_se_quiz_3","req","Please explain why you think you should win the quiz.");');
//}
if(folder=='es/es'){
	document.write('frmvalidator.addValidation("termsagreement","req","Por favor, lea y marque la casilla de términos y condiciones.");');
	document.write('frmvalidator.addValidation("fields_email","req","Por favor, introduzca su dirección de correo electrónico.");');
	document.write('frmvalidator.addValidation("fields_departure","req","Por favor, seleccione su ciudad preferida de salida.");');
}
if(folder=='my/en' && fileName=='my-newsletter.html'){
	document.write('frmvalidator.addValidation("fields_newdest","req","Please enter the launch date of Qatar Airways new flight services to Sao Paulo and Buenos Aires.");');
}
if(folder=='ph/en'){
	document.write('frmvalidator.addValidation("fields_address1","req","Please enter the residential address.");');
	document.write('frmvalidator.addValidation("fields_city","req","Please enter the city name.");');
	document.write('frmvalidator.addValidation("fields_zip","req","Please enter the Zip code.");');
}

if((folder=='uk/en') && (fileName=='northwest-insider.html')){
	document.write('frmvalidator.addValidation("fields_business","req","Please enter the Company.");');
	document.write('frmvalidator.addValidation("fields_address1","req","Please enter the Address 1.");');
	document.write('frmvalidator.addValidation("fields_address2","req","Please enter the Address 2.");');
	document.write('frmvalidator.addValidation("fields_zip","req","Please enter the Postal code");');
	document.write('frmvalidator.addValidation("fields_fields_longhaul","req","Please enter the Number of Long haul per year");');
	
}
if( (folder=='ae/en') && (fileName=='radio1.html') ){document.write('frmvalidator.addValidation("fields_mobilenumber","req","Please enter Mobile/Cell Number.");');}


//if(folder=='ae/en'){
//	document.write('frmvalidator.addValidation("fields_mobilenumber","req","Please enter Mobile/Cell Number.");');
//}


document.write('</script>');
}