function getMyElementById(id) 	{
	var elts = null;
	if (document.getElementById) {
		elts = document.getElementsByTagName(id);
	} 
	else {
		if (document.all) {
			elts = document.all[id]
		} 
		else if (document.layers) {
			elts = document.layers[id]
		} 
	}
	return elts;
}

function getMyAttributeHref(elt) 	{
	var val = null;
	if (document.getElementById) {
		val = elt.getAttribute('href');
	} 
	else {
		if (document.all) {
			val = elt.href;
		} 
		else if (document.layers) {
			val = elt.href;
		} 
	}
	return val;
}


function getMyAttributeRel(elt) 	{
	var val = null;
	if (document.getElementById) {
		val = elt.getAttribute('rel');
	} 
	else {
		if (document.all) {
			val = elt.rel;
		} 
		else if (document.layers) {
			val = elt.rel;
		} 
	}
	return val;
}

function overflowHidden() {
	if (document.getElementsByTagName) {
		document.getElementsByTagName("html")[0].style.overflow = "hidden";
	} else {
		if (document.all) {
	 		document.all.tags("html")[0].style.overflow = "hidden";
		} 
	}
	
} 

function flashFullScreen() {
	var idflash = "flashcontent";
	if (document.getElementById) {
		document.getElementById(idflash).style.height = "100%";
	} else {
		if (document.all) {
			document.all[idflash].style.height = "100%";
		} 
		else if (document.layers) {
			document.layers[idflash].height = "100%";
		} 
	}

} 

function charge() {
	flashFullScreen();	
	overflowHidden();	
	var html = getMyElementById("link");
	
	var links = getMyElementById("link");
	var fichier = "";
	var p = new Array();
	p[0] = "6D292C";
	p[1] = "";
	p[2] = "";
	p[3] = "";
	var href = null;
	if (links && links.length >0) {
		for (var i = 0; i < links.length; i++) {
			var relUrbilog = getMyAttributeRel(links[i]);
			if (relUrbilog && relUrbilog == "urbilog") {
				href = getMyAttributeHref(links[i]);
				break;
			}
		}
	}
	while (href) {
		var point = href.indexOf("?");
		if (point >= 0) {
			fichier = href.substring(0,point);
			href = href.substring(point+1, href.length);
			continue;
		}
   		var et = href.indexOf("&");
   		var param = "";
		if (et >= 0) {
				param = href.substring(0, et);
				href = href.substring(et+1, href.length);
		} else {
				param = href;
				href = null;
		}
   		var eg = param.indexOf("=");
		if (eg >= 0) {
				var i = param.substring(1, 2);
				p[i] = param.substring(eg+1, param.length);
		} else {
				href = null;
		}
	}
	//alert("fichier = " + fichier);
	//alert("p[0] = " + p[0]);
	//alert("p[1] = " + p[1]);
	//alert("p[2] = " + p[2]);
	if (fichier != "") {
		var fo = new FlashObject(fichier + ".swf", "fotester", "100%", "100%", "7", p[0]);
		if (p[1] != "")
			fo.addVariable("flashVarText", p[1]);
		if (p[2] != "")
			fo.addVariable("flashVarText2", p[2]);
		if (p[3] != "")
			fo.addVariable("flashVarText3", p[3]);
		fo.write("flashcontent");
	}
	
}
oldOnLoad = window.onload;
window.onload = function() {
	if (oldOnLoad != null)
		oldOnLoad();
	//charge();
};