
function isLayerDisplay(layerName) //Public function
{
	if (obj=MM_findObj(layerName))
	{
		if (obj.style.visibility =='' || obj.style.visibility == 'hidden')
			return false;
		else
			return true;
	}
	else
		return false;
}

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_showHideLayers() { 
//Public function
//alert("hai");
	var v,r,a,ps,cp,blnPageExisted,obj,args=MM_showHideLayers.arguments;
	if (args[0] != null){
		arrLayer = args[0].split(",");
		v=args[1]; // get value 'show' or 'hide'
		r=args[2]; // a list of remove class name
		a=args[3]; // a list of add class name
		col=args[4]; // boolean value to specify if other layers should keep opened or not (true/false)
		ps=args[5]; // a list of page display the menu, separated by comma
		cp=args[6]; // current page which include the menu



		
		for (var i=0; i< arrLayer.length;i++){
			if ((obj=MM_findObj(arrLayer[i]))!=null)
			{
				objStyle = obj.style
				if (objStyle) {
					if (v=='show' || blnPageExisted)
					{
						objStyle.visibility = 'visible';
						objStyle.display = 'block';
					}
					else if (v=='hide' || blnPageExisted)
					{
						objStyle.visibility = 'hidden';
						objStyle.display = 'none';
					}
					obj_b = document.getElementById(obj.id + "_button"); // get button object e.g. Layer_a_button
					
				

				}
			}
		}
   }
}



