//   ___________________________________________
//   >)))¡> Shouting Fish Script
//   Laurent FABRE - lfabre@shoutingfish.com
//   ___________________________________________


// ------------------------ NAV DETECT -------------------------

agt = navigator.userAgent.toLowerCase()
isIE4 = (agt.indexOf('msie 4') != -1)? 1:0
isIE5 = (agt.indexOf('msie 5') != -1)? 1:0
isMAC = (navigator.userAgent.indexOf('Mac') != -1)?  1:0
isNS4 = (navigator.appName=="Netscape" && agt.indexOf('mozilla/4') != -1)? 1:0
isW3C = (document.getElementById && !document.all)? 1:0

function gob(n) {
	if (isIE4 || isIE5) ob=eval(n);
	if (isNS4) ob=eval("document."+n);
	if (isW3C) ob = document.getElementById(n);
	return ob
}


// -------------------- ROLLOVER --------------------

function swap(c,qui,oo) {
	d = "document";
	eval(d+"."+c+qui+".src = "+c+"i["+(qui*2-oo)+"].src")
}
function swapmenu(c,qui,oo) {
	d = (isNS4)? "document."+c+".document" : "document";
	eval(d+"."+c+qui+".src = "+c+"i["+(qui*2-oo)+"].src")
}

function roll(nom, suf)
{
    	eval("document."+ nom +".src = " + nom + "_" + suf + ".src")			
}

// ------------------------ PRELOAD ------------------------

function preload(c,n,u,eon,eoff) {
	eval(c+"i = new Array()")
	j = 1
	for (i=1 ; i<=n*2 ; i+=2) {
		eval(c+"i["+i+"] = new Image()")
		eval(c+"i["+i+"].src = '"+u+j+eon+"'")
		eval(c+"i["+(i+1)+"] = new Image()")
		eval(c+"i["+(i+1)+"].src = '"+u+j+eoff+"'")
		j++;
	}
}

function loadimage(nom,path)
{
       eval(nom + "_on = new Image()");
//       eval(nom + "_on.src = '" + nom + "_on.gif'");
       eval(nom + "_on.src ='" + path + nom + "_on.gif'");
	  eval(nom + "_off = new Image()");
       eval(nom + "_off.src ='" + path + nom + "_off.gif'");
}

// ------------------------ PRELOAD ------------------------

var preloadDivFlag = false;
function newDivButton(div, path, arg, num) {
	if (document.images) {
		eval(arg + num + "1 = new Image()")
       eval(arg + num + "1.src = '" + path +  arg + "_on.gif'")
		eval(arg + num + "0 = new Image()")
       eval(arg + num + "0.src = '" + path + arg + "_off.gif'")
	}
}

function swapDivButton(div, name, num, suf) 
{
  if (document.images && (preloadDivFlag == true)) 
  {
 	d = (isNS4)? "document."+div+".document" : "document";
       eval(d+"."+ name + num +".src = " + name + num + suf + ".src")			
     //  status = d+"."+ name + num +".src = " + name + num + suf + ".src";
  }
}



//---------------------------open window--------------------
function ow(name,url,dimx,dimy) {
	featur = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+ dimx + ",height="+dimy;
    zow = window.open(url,name,featur)
	if (isNS4) zow.focus();
}

