        /*
                1st Element ---> Promotions title
                2nd Element ---> Promotions short text
                3rd Element ---> Promotions image path
                4th Element ---> Promotions href

                Qantas Box Office - http://qantasboxoffice.com.au/
                Red e-Mail -
                        AM - http://web.qantas.net.au/redemail/am/
                        SP - http://web.qantas.net.au/redemail/sp/
                        EU - http://web.qantas.net.au/redemail/eu/
                        AF - http://web.qantas.net.au/redemail/af/
                        AS - http://web.qantas.net.au/redemail/as/
                Flight Status - http://www.qantas.com.au/travel/airlines/flight-status/global/en
                Travel Classes - http://www.qantas.com.au/travel/airlines/travel-classes/global/en
        */

        var australiaDefaultPromotion1 = new Array();
        australiaDefaultPromotion1[0] = 'Show & Event Tickets booked online';
        australiaDefaultPromotion1[1] = 'Book tickets online';
        australiaDefaultPromotion1[2] = 'http://www.qantas.com.au/img/160x140/1_au_en.jpg';
        australiaDefaultPromotion1[3] = 'http://qantasboxoffice.com.au/';


        var australiaDefaultPromotion2 = new Array();
        australiaDefaultPromotion2[0] = 'Subscribe to Red e-Mail for the latest specials';
        australiaDefaultPromotion2[1] = 'Stay informed and be the first to know about our latest specials and travel reviews';
        australiaDefaultPromotion2[2] = 'http://www.qantas.com.au/img/160x140/2_au_en.jpg';
        australiaDefaultPromotion2[3] = 'http://web.qantas.net.au/redemail/au/';


        var australiaDefaultPromotion3 = new Array();
        australiaDefaultPromotion3[0] = 'Online Check-in now available';
        australiaDefaultPromotion3[1] = 'The quickest and easiest way to check in';
        australiaDefaultPromotion3[2] = 'http://www.qantas.com.au/img/160x140/informational/online-checkin.jpg';
        australiaDefaultPromotion3[3] = 'http://www.qantas.com.au/travel/airlines/online-checkin/global/en';


        var australiaDefaultPromotion4 = new Array();
        australiaDefaultPromotion4[0] = 'Not a Qantas Club member? Join now';
        australiaDefaultPromotion4[1] = 'Whenever you travel, make The Qantas Club your first destination';
        australiaDefaultPromotion4[2] = 'http://www.qantas.com.au/img/160x140/4_au_en.jpg';
        australiaDefaultPromotion4[3] = 'http://www.qantas.com.au/travel/airlines/qantas-club/global/en';


        var australiaDefaultPromotions = new Array();
        australiaDefaultPromotions[0] = australiaDefaultPromotion1;
        australiaDefaultPromotions[1] = australiaDefaultPromotion2;
        australiaDefaultPromotions[2] = australiaDefaultPromotion3;
        australiaDefaultPromotions[3] = australiaDefaultPromotion4;

        /***********************************Australia Default Promotion Ends********************************************************/
        /*
                1st Element ---> Promotions title
                2nd Element ---> Promotions short text
                3rd Element ---> Promotions image path
                4th Element ---> Promotions href

                Qantas Box Office - http://qantasboxoffice.com.au/
                Red e-Mail -
                        AM - http://web.qantas.net.au/redemail/am/
                        SP - http://web.qantas.net.au/redemail/sp/
                        EU - http://web.qantas.net.au/redemail/eu/
                        AF - http://web.qantas.net.au/redemail/af/
                        AS - http://web.qantas.net.au/redemail/as/
                Flight Status - http://www.qantas.com.au/travel/airlines/flight-status/global/en
                Travel Classes - http://www.qantas.com.au/travel/airlines/travel-classes/global/en
        */


        var nonAustraliaDefaultPromotion1 = new Array();
        nonAustraliaDefaultPromotion1[0] = 'Show & Event Tickets booked online';
        nonAustraliaDefaultPromotion1[1] = 'Book tickets online';
        nonAustraliaDefaultPromotion1[2] = 'http://www.qantas.com.au/img/160x140/1_REGION_CODE_en.jpg';
        nonAustraliaDefaultPromotion1[3] = 'http://qantasboxoffice.com.au/';


        var nonAustraliaDefaultPromotion2 = new Array();
        nonAustraliaDefaultPromotion2[0] = 'Subscribe to Red e-Mail for the latest specials';
        nonAustraliaDefaultPromotion2[1] = 'Stay informed and be the first to know about our latest specials and travel reviews';
        nonAustraliaDefaultPromotion2[2] = 'http://www.qantas.com.au/img/160x140/2_REGION_CODE_en.jpg';
        nonAustraliaDefaultPromotion2[3] = 'http://web.qantas.net.au/redemail/REGION_CODE/';


        var nonAustraliaDefaultPromotion3 = new Array();
        nonAustraliaDefaultPromotion3[0] = 'Online Check-in now available';
        nonAustraliaDefaultPromotion3[1] = 'The quickest and easiest way to check in';
        nonAustraliaDefaultPromotion3[2] = 'http://www.qantas.com.au/img/160x140/informational/online-checkin.jpg';
        nonAustraliaDefaultPromotion3[3] = 'http://www.qantas.com.au/travel/airlines/online-checkin/global/en';


        var nonAustraliaDefaultPromotion4 = new Array();
        nonAustraliaDefaultPromotion4[0] = 'Travel Classes';
        nonAustraliaDefaultPromotion4[1] = 'Find out where you could be sitting and what you could be eating';
        nonAustraliaDefaultPromotion4[2] = 'http://www.qantas.com.au/img/160x140/4_REGION_CODE_en.jpg';
        nonAustraliaDefaultPromotion4[3] = 'http://www.qantas.com.au/travel/airlines/travel-classes/global/en';

        var nonAustraliaDefaultPromotion = new Array();
        nonAustraliaDefaultPromotion[0] = nonAustraliaDefaultPromotion1;
        nonAustraliaDefaultPromotion[1] = nonAustraliaDefaultPromotion2;
        nonAustraliaDefaultPromotion[2] = nonAustraliaDefaultPromotion3;
        nonAustraliaDefaultPromotion[3] = nonAustraliaDefaultPromotion4;

        /***********************************Non-Australia English Default Promotion Ends********************************************************/


        /***********************************Non-English Default Promotion Starts********************************************************/
        /*
                1st Element ---> Promotions title
                2nd Element ---> Promotions short text
                3rd Element ---> Promotions image path
                4th Element ---> Promotions href

                Flight Status  - http://www.qantas.com.au/travel/airlines/flight-status/global/es
                Red e-Mail -
                        AM - http://web.qantas.net.au/redemail/am/
                        SP - http://web.qantas.net.au/redemail/sp/
                        EU - http://web.qantas.net.au/redemail/eu/
                        AF - http://web.qantas.net.au/redemail/af/
                        AS - http://web.qantas.net.au/redemail/as/
                Manage Your Booking - http://www.qantas.com.au/travel/airlines/your-booking/global/es
                Timetables - http://www.qantas.com.au/travel/airlines/timetable/global/es
        */


        var nonEnglishDefaultPromotion1 = new Array();
        nonEnglishDefaultPromotion1[0] = 'Flight Status';
        nonEnglishDefaultPromotion1[1] = 'Flight Status';
        nonEnglishDefaultPromotion1[2] = 'http://www.qantas.com.au/img/160x140/1_LANGUAGE_CODE.jpg';
        nonEnglishDefaultPromotion1[3] = 'http://www.qantas.com.au/travel/airlines/flight-status/global/LANGUAGE_CODE';
		var flightStatusTitleArray = new Array(7);
		flightStatusTitleArray['en'] = 'Flight Status';
		flightStatusTitleArray['es'] = 'Información de llegada y salida en tiempo real';
		flightStatusTitleArray['de'] = 'Echtzeit Ankunfts- und Abflugsinformationen';
		flightStatusTitleArray['fr'] = 'État du vol';
		flightStatusTitleArray['ja'] = 'リアルタイム発着案内';
		flightStatusTitleArray['zh_CN'] = '实时航班到港和离港信息';
		flightStatusTitleArray['zh_TW'] = '航班出發及抵達實際時間';

		var flightStatusShortTextArray = new Array(7);
		flightStatusShortTextArray['en'] = 'Flight Status';
		flightStatusShortTextArray['es'] = 'Obtenga la información más reciente con Estado de Vuelo';
		flightStatusShortTextArray['de'] = 'Erhalten Sie aktuelle Fluginformationen mit Flugstatus';
		flightStatusShortTextArray['fr'] = 'Obtenez la dernière information avec Flight Status';
		flightStatusShortTextArray['ja'] = '最新の出発・到着時刻を確認する';
		flightStatusShortTextArray['zh_CN'] = '在航班状态了解最新信息';
		flightStatusShortTextArray['zh_TW'] = '於航班狀況了解最新資訊';



        var nonEnglishDefaultPromotion2 = new Array();
        nonEnglishDefaultPromotion2[0] = 'Red e-Mail';
        nonEnglishDefaultPromotion2[1] = 'Red e-Mail';
        nonEnglishDefaultPromotion2[2] = 'http://www.qantas.com.au/img/160x140/2_LANGUAGE_CODE.jpg';
        nonEnglishDefaultPromotion2[3] = 'http://web.qantas.net.au/redemail/REGION_CODE/COUNTRY_CODE/REDEMAIL_LANGUAGE_CODE';
		var redEmailTitleArray = new Array(7);
		redEmailTitleArray['en'] = 'Red e-Mail';                                                    
		redEmailTitleArray['es'] = 'Suscríbase a Red e-Mail';
		redEmailTitleArray['de'] = 'Bestellen Sie unseren Newsletter';
		redEmailTitleArray['fr'] = 'Souscrivez à Red e-Mails';
		redEmailTitleArray['ja'] = 'Red e-Mail メール配信登録';
		redEmailTitleArray['zh_CN'] = '登记阅读最新优惠信息';
		redEmailTitleArray['zh_TW'] = '登記閱取最新優惠資訊';

		var redEmailShortTextArray = new Array(7);
		redEmailShortTextArray['en'] = 'Red e-Mail';
		redEmailShortTextArray['es'] = 'Mantengase informado y sea el primero en saber sobre nuestras últimas ofertas';
		redEmailShortTextArray['de'] = 'Bleiben Sie informiert und erfahren Sie als Erster von unseren aktuellen Angeboten und Reiseberichten';
		redEmailShortTextArray['fr'] = 'Informez-vous et soyez le premier à connaître nos dernières offres spéciales et informations touristiques. ';
		redEmailShortTextArray['ja'] = '最新の特別運賃、旅行情報を購読する';
		redEmailShortTextArray['zh_CN'] = '在第一时间收到澳航的最新优惠信息';
		redEmailShortTextArray['zh_TW'] = '在第一時間收到澳航的最新優惠資訊';

        var nonEnglishDefaultPromotion3 = new Array();
        nonEnglishDefaultPromotion3[0] = 'Manage Your Booking';
        nonEnglishDefaultPromotion3[1] = 'Manage Your Booking';
        nonEnglishDefaultPromotion3[2] = 'http://www.qantas.com.au/img/160x140/3_LANGUAGE_CODE.jpg';
        nonEnglishDefaultPromotion3[3] = 'http://www.qantas.com.au/travel/airlines/your-booking/global/LANGUAGE_CODE';
 		var mybTitleArray = new Array(7);
		mybTitleArray['en'] = 'Manage Your Booking';
		mybTitleArray['es'] = 'Administre su reserva on line';
		mybTitleArray['de'] = 'Ihre Buchungsdaten online verwalten';
		mybTitleArray['fr'] = 'Gérez vos réservations en ligne';
		mybTitleArray['ja'] = 'オンラインでのご予約の管理';
		mybTitleArray['zh_CN'] = '网上管理您的预订';
		mybTitleArray['zh_TW'] = '網上管理您的預訂';

 		var mybShortTextArray = new Array(7);
		mybShortTextArray['en'] = 'Manage Your Booking';
		mybShortTextArray['es'] = 'Vea las características puede manejar usted mismo';
		mybShortTextArray['de'] = 'Erhalten Sie einen Überblick über die Funktionen, die Sie online verwalten können';
		mybShortTextArray['fr'] = 'Aperçu des rubriques que vous pouvez gérer seuls';
		mybShortTextArray['ja'] = 'セルフサービスメニューを見る';
		mybShortTextArray['zh_CN'] = '查看自动化管理的功能';
		mybShortTextArray['zh_TW'] = '查看自助式管理的功能';


        var nonEnglishDefaultPromotion4 = new Array();
        nonEnglishDefaultPromotion4[0] = 'Travel Classes';
        nonEnglishDefaultPromotion4[1] = 'Travel Classes';
        nonEnglishDefaultPromotion4[2] = 'http://www.qantas.com.au/img/160x140/4_LANGUAGE_CODE.jpg';
        nonEnglishDefaultPromotion4[3] = 'http://www.qantas.com.au/travel/airlines/travel-classes/global/LANGUAGE_CODE';
 		var travelclassesTitleArray = new Array(7);
		travelclassesTitleArray['en'] = 'Travel Classes';
		travelclassesTitleArray['es'] = 'Clases de viaje';
		travelclassesTitleArray['de'] = 'Reiseklassen';
		travelclassesTitleArray['fr'] = 'Classes de voyage';
		travelclassesTitleArray['ja'] = '国際線・国内線のご利用クラス';
		travelclassesTitleArray['zh_CN'] = '客舱级别-国际及澳大利亚境内航班';
		travelclassesTitleArray['zh_TW'] = '客艙級別 - 國際及澳洲境內航班';

 		var travelclassesShortTextArray = new Array(7);
		travelclassesShortTextArray['en'] = 'Travel Classes';
		travelclassesShortTextArray['es'] = 'Descubra dónde podría sentarse y lo que podría comer';
		travelclassesShortTextArray['de'] = 'Informieren Sie sich über unsere Kabinenausstattung und unsere Bordmenüs';
		travelclassesShortTextArray['fr'] = 'Renseignez vous sur notre plan de cabine et nos repas ';
		travelclassesShortTextArray['ja'] = 'ご利用クラスのサービスについて調べる。';
		travelclassesShortTextArray['zh_CN'] = '查看机位及航班上提供的餐食';
		travelclassesShortTextArray['zh_TW'] = '查看機位及航班上提供的餐食';

        var nonEnglishDefaultPromotions = new Array();
        nonEnglishDefaultPromotions[0] = nonEnglishDefaultPromotion1;
        nonEnglishDefaultPromotions[1] = nonEnglishDefaultPromotion2;
        nonEnglishDefaultPromotions[2] = nonEnglishDefaultPromotion3;
        nonEnglishDefaultPromotions[3] = nonEnglishDefaultPromotion4;

 		var defaultPromosTitles = new Array();
		defaultPromosTitles[0] = flightStatusTitleArray;
		defaultPromosTitles[1] = redEmailTitleArray;
		defaultPromosTitles[2] = mybTitleArray;
		defaultPromosTitles[3] = travelclassesTitleArray;

 		var defaultPromosShortText = new Array();
		defaultPromosShortText[0] = flightStatusShortTextArray;
		defaultPromosShortText[1] = redEmailShortTextArray;
		defaultPromosShortText[2] = mybShortTextArray;
		defaultPromosShortText[3] = travelclassesShortTextArray;

        /***********************************Non-English Default Promotion Ends********************************************************/

        var newPromotionSnippet = '';

		try{
			var userContextInfo = new UserContextInfo();
			var usercontextRegion = userContextInfo.getLastRegion();
			var usercontextCountry = userContextInfo.getLastCountry();
			var usercontextLocale = userContextInfo.getLastLocale();

			var promotionSnippet = '<div class="promotion"><a target="" href="TARGET_URL"><span class="promoContent"><span class="title">PROMOTION_TITLE</span><span class="content">PROMOTION_SHORT_TEXT</span></span></a><img alt="PROMOTION_TITLE" src="PROMOTION_IMAGE_SRC"/></div>';
			var currentPromotion = '';


			if(usercontextLocale.toLowerCase() == 'en'){
					if(usercontextRegion.toLowerCase() == 'au'){
							for(i=0; i < 4; i++){
									currentPromotion = australiaDefaultPromotions[i];
									newPromotionSnippet = newPromotionSnippet + promotionSnippet;
									newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_TITLE/g, currentPromotion[0]);
									newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_SHORT_TEXT/g, currentPromotion[1]);
									newPromotionSnippet = newPromotionSnippet.replace(/TARGET_URL/g, currentPromotion[3]);
									newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_IMAGE_SRC/g, currentPromotion[2]);
							}
					} else{
							for(i=0; i < 4; i++){
									currentPromotion = nonAustraliaDefaultPromotion[i];
									newPromotionSnippet = newPromotionSnippet + promotionSnippet;
									newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_TITLE/g, currentPromotion[0]);
									newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_SHORT_TEXT/g, currentPromotion[1]);
									newPromotionSnippet = newPromotionSnippet.replace(/TARGET_URL/g, currentPromotion[3]);
									newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_IMAGE_SRC/g, currentPromotion[2]);
									newPromotionSnippet = newPromotionSnippet;
							}
					}
					newPromotionSnippet = newPromotionSnippet.replace(/REGION_CODE/g,usercontextRegion.toLowerCase());

			} else if(usercontextLocale.toLowerCase() == 'zh'){
					for(i = 0; i < 4; i++){
							currentPromotion = nonEnglishDefaultPromotions[i];
							promotionTitle = defaultPromosTitles[i];
							promotionShortText = defaultPromosShortText[i];
							newPromotionSnippet = newPromotionSnippet + promotionSnippet;
							if(usercontextCountry.toLowerCase() == 'cn'){
									newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_TITLE/g,promotionTitle['zh_CN']);
									newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_SHORT_TEXT/g, promotionShortText['zh_CN']);
							} else{
									newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_TITLE/g,promotionTitle['zh_TW']);
									newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_SHORT_TEXT/g, promotionShortText['zh_TW']);
							}
							newPromotionSnippet = newPromotionSnippet.replace(/TARGET_URL/g, currentPromotion[3]);
							newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_IMAGE_SRC/g, currentPromotion[2]);
					}
					newPromotionSnippet = newPromotionSnippet.replace(/REDEMAIL_LANGUAGE_CODE/g,'zh');
					newPromotionSnippet = newPromotionSnippet.replace(/REGION_CODE/g,usercontextRegion.toLowerCase());
					newPromotionSnippet = newPromotionSnippet.replace(/COUNTRY_CODE/g,usercontextCountry.toLowerCase());
					if(usercontextCountry.toLowerCase() == 'cn'){
							newPromotionSnippet = newPromotionSnippet.replace(/LANGUAGE_CODE/g,'zh_CN');
					} else{
							newPromotionSnippet = newPromotionSnippet.replace(/LANGUAGE_CODE/g,'zh_TW');
					}
					
					
			} else{
					for(i = 0; i < 4; i++){
							currentPromotion = nonEnglishDefaultPromotions[i];
							promotionTitle = defaultPromosTitles[i];
							promotionShortText = defaultPromosShortText[i];
							newPromotionSnippet = newPromotionSnippet + promotionSnippet;
							newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_TITLE/g,promotionTitle[usercontextLocale.toLowerCase()]);
							newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_SHORT_TEXT/g,promotionShortText[usercontextLocale.toLowerCase()]);
							newPromotionSnippet = newPromotionSnippet.replace(/TARGET_URL/g, currentPromotion[3]);
							newPromotionSnippet = newPromotionSnippet.replace(/PROMOTION_IMAGE_SRC/g, currentPromotion[2]);
					}
					newPromotionSnippet = newPromotionSnippet.replace(/REDEMAIL_LANGUAGE_CODE/g,usercontextLocale.toLowerCase());
					newPromotionSnippet = newPromotionSnippet.replace(/REGION_CODE/g,usercontextRegion.toLowerCase());
					newPromotionSnippet = newPromotionSnippet.replace(/COUNTRY_CODE/g,usercontextCountry.toLowerCase());
					newPromotionSnippet = newPromotionSnippet.replace(/LANGUAGE_CODE/g,usercontextLocale.toLowerCase());
			}
		}catch(e){
			/* We no need to ado anything here. This is fixed to prevent this issue in other legacy pages like
				FFlyer, Holidays, etc.,
			*/
		}
        var defaultContent = "";
        if(document.getElementById("homepagePromotionsDiv") != null){
                defaultContent = newPromotionSnippet;
        } 
