//javascript document
function addLoadEvent(func){ 
	var oldonload = window.onload; 
	if(typeof window.onload != 'function'){ 
		window.onload = func; 
	}else{ 
		window.onload = function(){ 
		if(oldonload){ 
			oldonload(); 
		} 
		func(); 
		} 
	} 
} 

function goToURL(url) { window.open(url,'_blank');}

//confirms deletion of things
function confirmSubmit()
{
	var agree=confirm("Delete item?");
	if (agree)
		return true ;
	else
		return false ;
}

//make sure of save
function confirmSave()
{
	var agree=confirm("Please make sure you have saved any updates on this current page before continuing.");
	if (agree)
		return true ;
	else
		return false ;
}

//get all class names and swap them
function swapclass(findClass,swap,opt,val) 
{
	var aElm = document.body.getElementsByTagName('*');
	for(var i=0; i<aElm.length; i++) 
	{
		if(aElm[i].className==findClass) 
		{
			aElm[i].className = swap;
		}
		try{
			document.getElementById(opt).style.width = val;	
		}
		catch(e){
		}
	} 
}

function swapid(showid,hideid){
	document.getElementById(hideid).className = "hide";
	document.getElementById(showid).className = "show2";
}