
	///var _lang="<? echo LANG; ?>";
	function display(texte1,texte2)
	{
		if(_lang=="fr")
			return texte1;
		else
			return texte2;
	
	}
	
	
	// retourne un objet xmlHttpRequest.
	// méthode compatible entre tous les navigateurs (IE/Firefox/Opera)
	function getXMLHTTPFonction(){
	  var xhr=null;
	  if(window.XMLHttpRequest) // Firefox et autres
	  xhr = new XMLHttpRequest();
	  else if(window.ActiveXObject){ // Internet Explorer
		try {
		  xhr = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
		  try {
			xhr = new ActiveXObject("Microsoft.XMLHTTP");
		  } catch (e1) {
			xhr = null;
		  }
		}
	  }
	  else { // XMLHttpRequest non supporté par le navigateur
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
	  }
	  return xhr;
	}
	
	
	
	function get_mouse(e)
	{
		var x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;
		var y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop;
		skn.left = x - 60;
		skn.top = y+20;
	}
	
	function setCookie(name,value,expires,path,domain) { 
		expires = expires * 60*60*24*1000;
		var today = new Date();
		var expires_date = new Date( today.getTime() + (expires) );
		var cookieString = name + "=" +escape(value) + 
		   ( (expires) ? ";expires=" + expires_date.toGMTString() : "") + 
		   ( (path) ? ";path=" + path : "") + 
		   ( (domain) ? ";domain=" + domain : "");
		document.cookie = cookieString; 
	}
	
	function getCookieVal(offset) {
		var endstr=document.cookie.indexOf (";", offset);
		if (endstr==-1)
				endstr=document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr));
	}
	
	function GetCookie(name) {
		var arg=name+"=";
		var alen=arg.length;
		var clen=document.cookie.length;
		var i=0;
		while (i<clen) {
			var j=i+alen;
			if (document.cookie.substring(i, j)==arg)
							return getCookieVal (j);
					i=document.cookie.indexOf(" ",i)+1;
							if (i==0) break;}
		return null;
	}
	
	function setStyleSheet(theme) {
		
		setCookie('style',theme,31,'/');
		
        for ( i = 0; i < document.styleSheets.length; i++ ) {
          if ( document.styleSheets[i].title ) {
            document.styleSheets[i].disabled = true;
            if ( document.styleSheets[i].title == theme )
              document.styleSheets[i].disabled = false;
          }
        }
        
     }
	 
	 function iPhoneAlert() {
		var question = confirm("<? echo $common['GoIphone']; ?>")
		if (question){
			window.location = "<? echo SITE_URL."/m/"; ?>";
		}
		else
			setCookie('NoIphoneVersion',1,1,'/',null)
	}
	
	var windows = {};
    //CommonWindowOpener.unNamedWindows = 0;
    //var timeToCheck = 3000;

    // static
    //CommonWindowOpener.openWindow = CommonWindowOpener_openWindow;
    //CommonWindowOpener.checkForNewWindow = CommonWindowOpener_checkForNewWindow;
    //CommonWindowOpener.redirectWindow = CommonWindowOpener_redirectWindow;

    function popup( url, windowName, windowFeatures )
    {
	    // try to open the window
	    var targetWindow = window.open(url, windowName, windowFeatures);
    	
	    // set timeout
	    if (targetWindow)
	    {
	    
    		
		    windows[windowName] = targetWindow;
		    var timeoutID = setTimeout("checkForNewWindow('" + windowName + "')", 3000);
	    }
	    else
	    {
		    redirectWindow('http://www.spirit-of-metal.com/popupkiller.php');
	    }
    }
     
    function checkForNewWindow( windowName )
    {
	    if (windows[windowName])
	    {
		    var targetWindow = windows[windowName];
		    if (targetWindow.closed)
		    {
			    redirectWindow('http://www.spirit-of-metal.com/popupkiller.php');
		    }
		   
	    }
    }

    function redirectWindow( url )
    {
	    window.top.location.replace(url);
    }
	

(function(){
  var bsa = document.createElement('script');
     bsa.type = 'text/javascript';
     bsa.async = true;
     bsa.src = '//s3.buysellads.com/ac/bsa.js';
  (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);
})();

