try{
		var dcTempLocationString = ""+location;
		var dcSite="hdc";

		var dcAffiliate="ahdcmain";

		var dcSubAffiliate = "&safhdc=";
		var dcDomain = "haaretz.com";
		
		//set the stage 
		var dcStg = "";
	       if(dcTempLocationString.indexOf('pre.haaretz.com') != -1 )
	       {
	 	  //test
		  dcStg="2";
	       }
	       else if (dcTempLocationString.indexOf(":8080") != -1){
		  dcStg="1";
		}
		
		//set the page type
		var dcPage = "";
		if (typeof dclkArticleId != "undefined"){
			dcArticleId = dclkArticleId;
			if (typeof dclkPage != "undefined"){
				dcPage = dclkPage;
			}else{
				dcPage = "article";	
			}	
			if(dcPage != ""){
				dcPage = "&pg="+dcPage;
			}			
		}

		//initialize and populate section map 
		var sectionToSubAffiliateMap = new Array();
		sectionToSubAffiliateMap["haaretz_com"] = "sahdcmnhp";
		sectionToSubAffiliateMap["haaretzcom"] = "sahdcmnhp";
		sectionToSubAffiliateMap["news"] = "sahdcmnnws";  
		sectionToSubAffiliateMap["opinion"] = "sahdcmnopnn";  
		sectionToSubAffiliateMap["jewishworld"] = "sahdcmnjwshwrld";  
		sectionToSubAffiliateMap["business"] = "sahdcmnbsnss"; 
		sectionToSubAffiliateMap["culture"] = "sahdcmncltr"; 
		sectionToSubAffiliateMap["magazine"] = "sahdcmnmgzn"; 
		sectionToSubAffiliateMap["tv"] = "sahdcmntv"; 
		sectionToSubAffiliateMap["meta"] = "sahdcmntgs"; 
		sectionToSubAffiliateMap["all_todays_headlines"] = "sahdcmntdhdln"; 
		sectionToSubAffiliateMap["searchresults"] = "sahdcmnsrp"; 
		sectionToSubAffiliateMap["subscribetorssfeed"] = "sahdcmnrss"; 
		sectionToSubAffiliateMap["breaking_news"] = "sahdcmnbrkngnws"; 
		sectionToSubAffiliateMap["newsletters_page"] = "sahdcmnnwsltr"; 
		sectionToSubAffiliateMap["disclaimer_page"] = "sahdcmnndsclmr"; 
		sectionToSubAffiliateMap["weather_forecast_page"] = "sahdcmnnwtr"; 
		sectionToSubAffiliateMap["people_and_departments"] = "sahdcmnnpd"; 
		sectionToSubAffiliateMap["employment_opportunities"] = "sahdcmnemplmnt"; 
		sectionToSubAffiliateMap["contact_us"] = "sahdcmnncntctus"; 
		sectionToSubAffiliateMap["downloads_page"] = "sahdcmnndnlds"; 
		sectionToSubAffiliateMap["blogs"] = "sahdcmnblgs"; 
		sectionToSubAffiliateMap["subscription"] = "sahdcmnsubscription";
		sectionToSubAffiliateMap["ga"] = "sahdcmnga";
		sectionToSubAffiliateMap["gaplazma"] = "sahdcmngaplazma";
		sectionToSubAffiliateMap["gaplasma2011"] = "sahdcmngaplazma";
		sectionToSubAffiliateMap["themarker"] = "sahdcthemarker";
		sectionToSubAffiliateMap["weekend"] = "sahdcweekend";
		sectionToSubAffiliateMap["printedition"] = "sahdcmnprntdtn";
		sectionToSubAffiliateMap["shabattimes"] = "sahdcshabattimes";
		
		document.write("<scr"+"ipt charset='utf-8' src='http://www."+dcDomain+"/dclk/dclk_ads_top.js'></scr"+"ipt>");

		//add the call to hasut advertisement only when not article
		if (typeof dclkPage == "undefined")
		{
			document.write("<scr"+"ipt charset='utf-8' src='http://dclk."+dcDomain+"/js.ng/"+"site="+dcSite+"&affiliate="+dcAffiliate+(dcSubAffiliate+sectionToSubAffiliateMap[dclkSection])+dcPage+"&adsize=hasut'></scr"+"ipt>");
		}
}catch(err){
	var errorMsg = err.message;
}
