/* Start News */

var ids_News=new Array('News1','News2','News3');

function switchid_News(id){	
	hideallids_News();
	showdiv(id);
}

function hideallids_News(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids_News.length;i++){
		hidediv(ids_News[i]);
	}		  
}

/* 
End News 

Start Inside Dimensions
*/

var ids_Inside_Dimensions=new Array('Inside_Dimensions1','Inside_Dimensions2','Inside_Dimensions3','Inside_Dimensions4');

function switchid_Inside_Dimensions(id){	
	hideallids_Inside_Dimensions();
	showdiv(id);
}

function hideallids_Inside_Dimensions(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids_Inside_Dimensions.length;i++){
		hidediv(ids_Inside_Dimensions[i]);
	}		  
}

/* 
End Inside Dimensions

Start Top 5
*/

var ids_Top5=new Array('Top5_1','Top5_2');

function switchid_Top5(id){	
	hideallids_Top5();
	showdiv(id);
}

function hideallids_Top5(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids_Top5.length;i++){
		hidediv(ids_Top5[i]);
	}		  
}




function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}



//////Dropdown menu///////

var TimeOut         = 300;
var currentLayer    = null;
var currentitem     = null;
var currentLayerNum = 0;
var noClose         = 0;
var closeTimer      = null;

function mopen(n) {
  var l  = document.getElementById("menu"+n);
  var mm = document.getElementById("mmenu"+n);
	
  if(l) {
    mcancelclosetime();
    l.style.visibility='visible';
    if(currentLayer && (currentLayerNum != n))
      currentLayer.style.visibility='hidden';
    currentLayer = l;
    currentitem = mm;
    currentLayerNum = n;			
  } else if(currentLayer) {
    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;
    currentitem = null;
    currentLayer = null;
 	}
}

function mclosetime() {
  closeTimer = window.setTimeout(mclose, TimeOut);
}

function mcancelclosetime() {
  if(closeTimer) {
    window.clearTimeout(closeTimer);
    closeTimer = null;
  }
}

function mclose() {
  if(currentLayer && noClose!=1)   {
    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;
    currentLayer = null;
    currentitem = null;
  } else {
    noClose = 0;
  }
  currentLayer = null;
  currentitem = null;
}

document.onclick = mclose; 

//////End dropdown menu///////