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_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

	// layer show and hide
	
	var timer = null;
	var last_menu = null;
	var delay = 0;
	var layer_name = null;
	db = 0;

	function flipBox(who) {
		var tmp;
		if (document.images['b_' + who].src.indexOf('_on') == -1) {
			tmp = document.images['b_' + who].src.replace('_off', '_on');
			document.getElementById('box_' + who).style.display = 'none';
			document.images['b_' + who].src = tmp;
		} else {
			tmp = document.images['b_' + who].src.replace('_on', '_off');
			document.getElementById('box_' + who).style.display = 'block';
			document.images['b_' + who].src = tmp;
		}
	}

	function loadframe(id,page) {
	if (ns4) { eval("document."+id+"_frame.src = page"); }
	else if (ie4) eval(id+"_frame.document.location = page");
	}

	function find_obj(id){
		if (this.document.all) return this.document.all[''+id+''];
		else if (this.document.getElementById) return this.document.getElementById(''+id+'');
	}
	
	function showlayer(id){
		if (db==2) alert('show '+id);
		if (id==null){
			if (layer_name!=null){
				id=layer_name;
				alert("Default ["+layer_name+"]");
			}else{
				alert("No layer specified to show");
			}
		}
		if (this.document.layers) this.document.layers[''+id+''].visibility = "show"
		else if (this.document.all) this.document.all[''+id+''].style.visibility = "visible"
		else if (this.document.getElementById) this.document.getElementById(''+id+'').style.visibility = "visible"
		if (delay>0) timer = setTimeout("hidelayer()", delay);
		last_menu=id;
	}

	function initlayer(id){
		if (db==2) alert('show '+id);
		if (id==null){
			if (layer_name!=null){
				id=layer_name;
				alert("Default ["+layer_name+"]");
			}else{
				alert("No layer specified to show");
			}
		}
		if (this.document.layers) this.document.layers[''+id+''].visibility = "show"
		else if (this.document.all) this.document.all[''+id+''].style.visibility = "visible"
		else if (this.document.getElementById) this.document.getElementById(''+id+'').style.visibility = "visible"
	}

	function hidelayer(id){
		if (db==2) alert('hide '+id);
		if (timer!=null){
			clearTimeout(timer);
		}
		if (id!=null){
			if (this.document.layers)
				this.document.layers[''+id+''].visibility = "hide"
				else if (this.document.all) this.document.all[''+id+''].style.visibility = "hidden"
				else if (this.document.getElementById) this.document.getElementById(''+id+'').style.visibility = "hidden"
		}else{
			if (last_menu!=null){
				hidelayer(last_menu);
				last_menu=null;
			}
		}
	}
	
	function movelayer(id,y,x){
		if (db==2) alert('move '+id+' '+x+','+y);
		if (this.document.all){
			o = this.document.all[id];
		} else if (this.document.getElementById){
			o = this.document.getElementById(''+id+'');
		}
		o.style.top = x;
		o.style.left = y;
	}
	
	function showmouse(){
		window.status = "xMousePos=" + xMousePos + ", yMousePos=" + yMousePos + ", xMousePosMax=" + xMousePosMax + ", yMousePosMax=" + yMousePosMax;
	}

	function writelayer(ID,parentID,sText) { 
		if (document.layers) { 
	   		var oLayer; 
	   		if(parentID){ 
		 		oLayer = eval('document.' + parentID + '.document.' + ID + '.document'); 
	   		}else{ 
		 		oLayer = document.layers[ID].document; 
	   		} 
	   		oLayer.open(); 
	   		oLayer.write(sText); 
	   		oLayer.close(); 
		} 
		else if (parseInt(navigator.appVersion)>=5&&navigator. 
			appName=="Netscape") { 
			document.getElementById(ID).innerHTML = sText; 
		} 
	 	else if (document.all) document.all[ID].innerHTML = sText 
	} 