function pngfix(){
}
/********************************************************
*  EXTERNAL LINK
********************************************************/
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
	 		anchor.target = "_blank";
	 }
} 

Event.observe(window, 'load', externalLinks, false);

/********************************************************
*  NAVHOVER
********************************************************/

navHover = function() {
	var lis = document.getElementById("navigation").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}

if(navigator.userAgent.indexOf("MSIE 6") != -1)
	Event.observe(window, 'load', navHover, false);
	


/********************************************************
*  AJAX CONN
********************************************************/
function createAC(url_, target_, pars_, method_, onCompl_){
	
	var url 	= url_.unescapeHTML();
	var pars 	= pars_;
	var target 	= target_;
	var meth 	= method_;
	var onCompl = onCompl_;
		
	var myAjax = new Ajax.Updater(
		target, 
		url, 
		{
			method: meth, 
			parameters: pars,
			evalScripts: true,
			onComplete: onCompl
		});
		
}

/********************************************************
*  LOADCONTENT
********************************************************/

function loadContent(link, divv, cibleId){	
	createAC(link, divv, '', 'get');
}


/********************************************************
*  SELECTACTION
********************************************************/

function selectAction(list, url){
	
	val = list.options[list.options.selectedIndex].value;
	$('selalldestination').style.display='none';
	
	if(val=='od')
		$('selalldestination').style.display='';
	else
		document.location.href=url+val;
		
}


/********************************************************
*  Affichage des Publicités
* 
* showPubTrek([codeFormat], [codePromo], [codeTrek])
* [codeFormat] :
* 0 = carre colonne droite
* 1 = rectangle haut de page
* [codePromo] :
* 0 = vide
* 1 = promotion
* 2 = déstockage
* 3 = nouveaute
* [codeTrek] :
* ne pas modifier
********************************************************/

var uriBase = $('urlIdentifier').content;

function showPubTrek(pos_, cp_, id_){
	
	// init vars
	var url 	= 	uriBase+'/index.php?action=Pub';
	var divId	=	'pub' + Math.floor(Math.random()*100);
	var pars 	= 	'ido=' + id_ + '&pos=' + pos_ + '&cp=' + cp_;
	
	// ecriture du div contener
	document.write('<div id="' + divId + '"></div>');
	
	// ajax request
	new Ajax.Request(
		url,
		{
			method:'get',
			parameters:pars,
			onSuccess:function(xhr){
				if(xhr.status==200){
					$(divId).innerHTML = xhr.responseText;
				}
			}
		});
		
}

