
//Header
OAS_rn = new String (Math.random()); 
OAS_rns = OAS_rn.substring (2, 11);

function phpads_deliverActiveX(content)
{
	document.write(content);	
}

if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

//Script de redirection
if (gi_pub.indexOf("105") >-1 || gi_pub.indexOf("103") >-1 || gi_pub.indexOf("108") >-1) gi_pub = "gi-2103";
if (gi_pub.indexOf("114") >-1) gi_pub = "gi-2115";

//Script de détection automatique
//=========================================================================================
if (gi_pub.indexOf("auto_") > -1){
	var btype=1;
	if (gi_pub.replace("auto_","")=="LB") btype=1;
	if (gi_pub.replace("auto_","")=="BB") btype=2;
	if (gi_pub.replace("auto_","")=="SK") btype=3;

	var ft = new Array(19);
	var b=0;
	
	ft[b] = new Array('abitibi','2117','2180','2218','2142','2161','2199');b++;
	ft[b] = new Array('baiejames','2138','2195','2233','2157','2176','2214');b++;
	ft[b] = new Array('basstlaurent','2119','2181','2219','2143','2162','2200');b++;
	ft[b] = new Array('centrequebec','2126','2183','2221','2145','2164','2202');b++;
	ft[b] = new Array('charlevoix','2127','2184','2222','2146','2165','2203');b++;
	ft[b] = new Array('chaudapp','2128','2185','2223','2147','2166','2204');b++;
	ft[b] = new Array('cotenord','2129','2186','2224','2148','2167','2205');b++;
	ft[b] = new Array('estrie','2125','2182','2220','2144','2163','2201');b++;
	ft[b] = new Array('gaspesie','2130','2187','2225','2149','2168','2206');b++;
	ft[b] = new Array('ilemadeleine','2131','2188','2226','2150','2169','2207');b++;
	ft[b] = new Array('lacstjean','2141','2198','2236','2160','2179','2217');b++;
	ft[b] = new Array('lanaudiere','2132','2189','2227','2151','2170','2208');b++;
	ft[b] = new Array('laurentides','2133','2190','2228','2152','2171','2209');b++;
	ft[b] = new Array('laval','2134','2191','2229','2153','2172','2210');b++;
	ft[b] = new Array('mauricie','2135','2192','2230','2154','2173','2211');b++;
	ft[b] = new Array('monteregie','2136','2193','2231','2155','2174','2212');b++;
	ft[b] = new Array('montreal','2137','2194','2232','2156','2175','2213');b++;
	ft[b] = new Array('outaouais','2139','2196','2234','2158','2177','2215');b++;
	ft[b] = new Array('quebec','2140','2197','2235','2159','2178','2216');b++;

	
	var tdoc = "" + document.location;
	
	//On detecte le mode anglophone
	if (tdoc.indexOf("ang.")>-1) btype+=3;

	for (i=0;i<ft.length;i++){
		if (tdoc.indexOf("/"+ft[i][0]+"/")>-1){
			ShowPub(ft[i][btype],phpAds_random,"zone");
			b=100;
		}
	}

	if (b<100){
		if (btype==1 || btype==4) ShowPub("2114",phpAds_random,"zone");
		if (btype==2 || btype==5) ShowPub("2113",phpAds_random,"zone");
		if (btype==3 || btype==6) ShowPub("2115",phpAds_random,"zone");
	}
}
//Pub Direct sur un bandeau (Non Zoné)
else if (gi_pub.indexOf("gidirect-client")>-1){
	ShowPub(gi_pub.replace("gidirect-client-",""),phpAds_random,"clientid");
}
else{
	ShowPub(gi_pub.replace("gidirect-","").replace("gi-",""),phpAds_random,"zone");
}
//document.write ("&amp;referer=" + escape(document.referrer));
//Affichage de la pub
function ShowPub(idpub,rdnm,pubtype){
	document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
	document.write ("http://ads.globalinternet.ca/adjs.php?n=" + rdnm);
	document.write ("&amp;what="+pubtype+":"+idpub);
	document.write ("&amp;exclude=" + document.phpAds_used);
	if (document.referrer)
		document.write ("&amp;referer=" + document.referrer);
	document.write ("'><" + "/script>");
}
