function detectBrowser()
{
	var browser=navigator.appName;
	return browser;
}

function rollImage(holder,image,level)
{
	var str = "";
	
	for(var i=0; i<level; i++)
	{
		str = str + "../";
	}
	
	var property = "url("+str+"images/"+image+") no-repeat";
	
	if(detectBrowser() == "Microsoft Internet Explorer")
	{
		holder.style.background = property;
	}
	else
	{
		holder.style.setProperty("background",property,"");
	}
}

function addLoadEvent(func)
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function')
	{
		window.onload = func;
	}
	else
	{
		window.onload = function()
		{
			oldonload();
			func();
		}
	}
}

//Switches the page to the desired page selected in the page input field.s
function switchPage(goPage,args)
{
	window.location = "?page=" + goPage + "&" + args;
}

//Changes the background color for the referenced element.
//elementID: the element we want to change the bg color of
//color: the new color
function changeBG(element,color)
{
	
	if(typeof(element) != "object")
		element = document.getElementById(element);
	
	if(detectBrowser() == "Microsoft Internet Explorer")
	{
		element.style.backgroundColor = color;
	}
	else
	{
		element.style.setProperty("background-color",color,"");
	}
}

function changeBorder(element,border)
{
	if(typeof(element) != "object")
		element = document.getElementById(element);
	
	if(detectBrowser() == "Microsoft Internet Explorer")
	{
		element.style.border = border;
	}
	else
	{
		element.style.setProperty("border",border,"");
	}
}
//Will display a confirmation box about an action and if
//approved will redirect to the locatiom which needs to 
//be executed
function confirmAction(action,script)
{
	var doAction = confirm(action);
	if (doAction == true)
	{
		window.target = "_blank";
		window.location=script;
 	}
}

/* 
function fixSubPageColumnsHeights()
{
	return;
	
	var content = document.getElementById("contentArea");
	var menu = document.getElementById("menu_inner");
	
	var highest = 0;

	var nums = new Array()
	nums[0] = content.scrollHeight;
	nums[1] = menu.scrollHeight;
	
	for(var i=0;i<nums.length;i++)
	{
		alert(nums[i]);
		if(nums[i] > highest) highest = nums[i];
	}
	
	if(detectBrowser() == "Microsoft Internet Explorer")
	{
		content.style.height = highest+"px";
		menu.style.height = highest+"px";
	}
	else
	{
		content.style.setProperty("height",highest+"px","");
		menu.style.setProperty("height",highest+"px","");
	}
}

function fixColumnsHeights()
{
	return;
	
	var content = document.getElementById("wrapper_inner");
	var menu = document.getElementById("menu_inner");
	
	var highest = 0;

	var nums = new Array()
	nums[0] = content.scrollHeight;
	nums[1] = menu.scrollHeight;
	
	for(var i=0;i<nums.length;i++)
	{
		alert(nums[i]);
		if(nums[i] > highest) highest = nums[i];
	}
	
	if(detectBrowser() == "Microsoft Internet Explorer")
	{
		content.style.height = highest+"px";
		menu.style.height = highest+"px";
	}
	else
	{
		content.style.setProperty("height",highest+ADDITIONAL+"px","");
		menu.style.setProperty("height",highest+"px","");
	}
} */