
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var nn4 = false;   // Netscape Navigator or Communicator
var ie4 = false;
var ie5 = false;
var ie6 = false;
var moz = false;   // Mozilla, NS 6+, Konqueror, etc
var dom1 = false;   // fully supports DOM1
var dom2 = false;   // fully supports (important bits of) DOM2
var old = false;   // very old browser + opera cause there is some stuff it just dont do!

function browser_detect() {
// do it the official W3C way
	if ( window.document.implementation != null) {
		dom1 = window.document.implementation.hasFeature("HTML","1.0");
		dom2 = window.document.implementation.hasFeature("HTML","2.0") &&
        	window.document.implementation.hasFeature("Events","2.0") &&
       		window.document.implementation.hasFeature("Core","2.0") &&
		window.document.implementation.hasFeature("CSS2","2.0");
       }
 // Mozilla based browsers contain the Gecko rendering engine
	moz = (window.navigator != null ? ( window.navigator.userAgent.indexOf("ecko") != -1 ) : 

false);
	nn4 = (window.document.layers != null && !moz);
 // IE has incremental support for the Document Object Model
	ie6 = (window.document.all && dom1);
	ie5 = (window.document.all && window.document.getElementsByTagName && !ie6);
	ie4 = (window.document.all && !ie6 && !ie5);
// something horrible and old - sorry Opera.
	old = (!ie4 && !ie5 && !ie6 && !dom1 && !nn4 && !moz);
}
browser_detect();


function findObj(n, d) { //one of a million ways of hunting down an object from its ID cross browser!
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function showHideLayers() { // turn on or off the visibilty of (a) layer(s) cross browser 
//iterates arguments cunningly
  var i,p,v,obj,objid,args=showHideLayers.arguments;
  for (i=0; i<(args.length-1); i+=2) {
	  objid=args[i] ;
	  if ((obj=findObj(objid))!=null) {
		v=args[i+1];
		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
	}
}
function showcamel(camelnumber) {
objid=((nn4)?'nn':'') + 'camel' + camelnumber ;
showHideLayers(objid,"show");
}

function hidecamel(camelnumber) {
objid=((nn4)?'nn':'') + 'camel' + camelnumber ;
showHideLayers(objid,"hide");
}
