
//timer that closes menu
function TimedClose(name,toggle,seconds)
{
if (!onLayer)
{
	var Call = "SetMenuVisible('" +name+ "','" +toggle+ "')";
	theID = setTimeout(Call,1000*seconds);
}
else {alert('error with onLayer status');}

}


function goto()
{
	var theObj = event.srcElement
	theObj.style.backgroundColor = '#80BFFF';
	window.location.href = theObj.href;

}
function onLayerColor(menu,layerName){
	if(window.event.srcElement.info != null){setTheWinStatus(window.event.srcElement.info)}
	var theLayer = eval("document.all."+layerName+".style");
	setBGColor(theLayer,'#DFEFFF', '1px SOLID #003366')
}


//Function to turn layer off
function offLayerColor(menu,layerName){

var theLayer = eval("document.all."+layerName+".style");
setBGColor(theLayer,'white','')
}

function setTDRollover(obj, theClassName)
{
	var theObj = getObject(obj);
	
	theObj.className = 'tdOver';
	
}

function setTDRollOff (obj, theClassName)
{
	var theObj = getObject(obj);
	
	theObj.className = 'tdOut';
	
}





//Function for background color
function setBGColor(obj,bgcolor,theborder, thefont){
     var theObj = getObject(obj);
    

     theObj.bgColor = bgcolor;
     theObj.border=theborder;
        
}
function getObject(obj){
     var theObj;
     if(typeof obj == "string"){
          theObj = eval("document." + coll + obj + styleObj);
     }else{
          theObj = obj;
     }
     return theObj;
}     

//timer that closes menu
function TimedClose(name,toggle,seconds)
{
if (!onLayer)
{
	var Call = "SetMenuVisible('" +name+ "','" +toggle+ "')";
	theID = setTimeout(Call,1000*seconds);
}
else {alert('error with onLayer status');}

}

function SetMenuVisible(mName,state)
{

	ieObj = document.all[mName].style;
	
if (state == 'on')
{
	ieObj.visibility = "visible";
	ieObj.cursor= 'hand';
	//eval("document.all."+layerName+".style")
	if (window.event.srcElement.id.substring(0,2) == 'td')
	{
		setBGColor(window.event.srcElement.style, '#DFEFFF', '1px SOLID #003366')
	}
	if(window.event.srcElement.info != null){setTheWinStatus(window.event.srcElement.info);}

}
else
{
	ieObj.visibility = "hidden";
	ieObj.cursor= 'auto';
	

}

}
function setTheWinStatus(thestatus)
{
window.status = thestatus;
}
//timer that closes menu
function TimedClose(name,toggle,seconds)
{
	
	setTheWinStatus('')
	var theEventID = window.event.srcElement.id;
if (theEventID.substring(0,2) == 'td')
	{setBGColor(window.event.srcElement.style, 'white', '')}
if (!onLayer)
{
	var Call = "SetMenuVisible('" +name+ "','" +toggle+ "')";
	theID = setTimeout(Call,1000*seconds);
}
else {alert('error with onLayer status');}

}








function buttonDo(theTask, ArticleID)
{

	switch(theTask)
	{
	
		case "delete":
			var delItem = confirm('Are you sure you wish to delete this item?')
			if (delItem)
			{
			
				window.location.href('../admin/articles.asp?action=deletearticle&articleid=' + ArticleID)
			
			}
		break;
		case "edit":
				window.location.href('../admin/addarticle.asp?action=editarticle&articleid=' + ArticleID)
		break;
		case "approval":
		
				window.location.href('../admin/articles.asp?action=approvearticle&articleid=' + ArticleID)
		
		break;
	}

}






