
function doLoad(req,parm) {
 var xhr;
 if (!(window.XMLHttpRequest||window.ActiveXObject)) {return}
 if (window.ActiveXObject) {
  try {xhr = new ActiveXObject("Msxml2.XMLHTTP")} catch(e) {xhr = new ActiveXObject("Microsoft.XMLHTTP")}
 } else {
  xhr = new XMLHttpRequest(); 
 }
 xhr.onreadystatechange = function() {if (xhr.readyState==4) {eval(xhr.responseText)}};
 xhr.open("GET",req+"?"+parm,true);
 xhr.send(null);
}

function addEvent(nom,i,type,func) {
 if (!window.document.getElementById(nom)) {return}
 var elt = window.document.getElementById(nom);
 if (i>0) {elt = elt.childNodes[i-1]}
if (elt.addEventListener) { 
 elt.addEventListener(type,func,false);
} else if (elt.attachEvent) {
 elt.attachEvent("on"+type,func);
}
 if (type=='click') {try {elt.onclick = function() {return false}} catch(e) {}}
}

function removeEvent(nom,i,type,func) {
 if (!window.document.getElementById(nom)) {return}
 var elt = window.document.getElementById(nom);
 if (i>0) {elt = elt.childNodes[i-1]}
if (elt.removeEventListener) { 
 elt.removeEventListener(type,func,false);
} else if (elt.detachEvent) {
 elt.detachEvent("on"+type,func);
}
}

/*----- init -----*/

var Ttempo = [];

function doImage(nom0,nom) {
 if (!window.document.getElementById(nom)) {return}
 window.document.getElementById(nom).style.display = 'none';
if (typeof(Ttempo[nom0])=="undefined") {
 Ttempo[nom0] = new Image(); Ttempo[nom0].src = '../../transline/common/'+nom0+'.png';
}
if (Ttempo[nom0].complete) {
if ((nom!='topTabletempo')||((window.document.getElementById('topTabletempo').innerHTML!="")&&(!window.document.getElementById('topTabletempo').innerHTML.match(/^<ul>/i)))) {
 window.document.getElementById(nom).style.display = '';
 return;
}}
 setTimeout('doImage(\''+nom0+'\',\''+nom+'\')',100);
}

function doTopM(nom) {
 if (!window.document.getElementById(nom)) {return}
 var elt0,elt;
if (window.document.getElementById(nom).childNodes.length!=0) {
 elt0 = window.document.getElementById(nom).childNodes[0];
 elt = window.document.createElement("li");
 elt.innerHTML = ('<div class="bL ItopM"></div><div class="bC ItopM"></div><div class="bR ItopM"></div>');
 elt0.insertBefore(elt,elt0.childNodes[0]);
}
 doImage('topM',nom);
}

function Initer() {
 if (!window.document.getElementById) {return}
 if (!window.document.getElementById('footer')) {setTimeout('Initer()',100); return}
 doTopM('topTabletempo');
 doTopM('topM1tempo');
 doTopM('topM2tempo');
 doInit();
}
Initer();

/*----- window -----*/

function doWindow(target,name) {
 var x = window.document.getElementById(target).className;
 window.document.getElementById(target).className = ((x=='window '+name)?'window '+'wOff':'window '+name);
}

/*----- cookie -----*/

function getCookie(nom) {
 if (!window.document.cookie) {return ""}
 if (!("; "+window.document.cookie).match(new RegExp("; "+nom+"=([^;]*)"))) {return ""}
 return unescape(RegExp.$1);
}

function setCookie(nom,val) {
 var x1 = nom+"="+escape(val)+"; path=/"+((val!="")?"":"; expires=Thu, 01-Jan-2000 00:00:01 GMT");
 window.document.cookie = x1;
}

function getWidth() {
 if (window.innerWidth) {return window.innerWidth}
 if (window.document&&window.document.body&&window.document.body.clientWidth) {return window.document.body.clientWidth}
 if (window.document&&window.document.documentElement&&window.document.documentElement.clientWidth) {return window.document.documentElement.clientWidth}
 return 0;
}

var Thome;

function doInit() {
if (window.document.getElementById('home')) {
 Thome = {'flashM':'w2','actuM':'w2'};
 window.document.cookie = "red=true; path=/; expires=Thu, 01-Jan-2000 00:00:01 GMT";
 window.document.cookie = "tags=; path=/; expires=Thu, 01-Jan-2000 00:00:01 GMT";
 window.document.cookie = "r=; path=/; expires=Thu, 01-Jan-2000 00:00:01 GMT";
 window.document.cookie = "v=; path=/; expires=Thu, 01-Jan-2000 00:00:01 GMT";
} else {
 var val;
 val = (getWidth()>=1030);
if (getCookie("red")!="") {
 if (getCookie("red")!=val.toString()) {setTimeout('doReduce(true)',1000)}
}
}
}

function doReduce(flag) {
 var x,val;
 val = (getWidth()>=1030);
 x = window.document.body.className;
 x = " "+x; x = x.replace(/ red\w*/g,""); x += (flag?(val?' red':' red_small'):''); x = x.substr(1);
 window.document.body.className = x;
if (flag) {
 if (getCookie("red")!=val.toString()) {setCookie("red",val.toString())}
} else {
 setCookie("red","");
}
}

function doTags() {
 var x,flag;
 x = window.document.body.className;
 flag = !(" "+x).match(/ tags\w*/);
 x = " "+x; x = x.replace(/ tags\w*/g,""); x += (flag?' tags':''); x = x.substr(1);
 window.document.body.className = x;
if (flag) {
 if (getCookie("tags")!="true") {setCookie("tags","true")}
} else {
 setCookie("tags","");
}
}

function doSearch() {
 if (window.document.getElementById('r').value=="tags") {window.document.body.className += ' tagOn'; return false}
 return true;
}

function doSearchOff() {
 setCookie("v","");
 x = window.document.body.className;
 x = " "+x; x = x.replace(/ Rech\w*/g,""); x = x.substr(1);
 window.document.body.className = x;
 window.document.getElementById('Rech').style.display = 'none';
}

