// Main Javascript File
//YAHOO.namespace('anim');

function swapCSS(id, css) {
		var obj = document.getElementById(id);
		obj.className = css;
}

function swapImage(id, path) {
    var obj = document.getElementById(id);
	obj.src = path;
}

function show(id, type) {
    var element = document.getElementById(id);
    element.style.opacity = 1;
    if (type) {
        element.style.display = type;
    }else{
        element.style.display = "inline";
    }
}

function hide(id) {
    var element = document.getElementById(id);
    element.style.display = "none";
    element.style.opacity = 0;
}

function openWindow(url, id, params)
{
    var win = window.open(url, id, params);
}

function getQueryVariable(variable) {
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++)
	{
		var pair = vars[i].split("=");
		if (pair[0] == variable)
		{
		  return pair[1];
		}
	} 
}
		
function animatePanel(id, opacity, height) {
    var obj = document.getElementById(id);
    
	    var attributes = {
	      height: {to: height},
	      opacity: {to: opacity}
	    }
	    var myAnim = new YAHOO.util.Anim(id, attributes, .35, 
	                             YAHOO.util.Easing.easeOut);
		myAnim.animate();
	
}

function writeFlash(containerId, filepath, width, height, version)
{
	var so = new FlashObject(filepath, containerId, width, height, version);
    so.addParam('wmode', 'transparent'); 
 so.addParam("quality", "best");
  so.write(containerId);
} 





var divColor;
    
function changeColor(divHeader, mode)
{
    if (mode == '1')
    {
        divColor = divHeader.style.backgroundColor;
        divHeader.style.backgroundColor = '#381200';
    }
    else
        divHeader.style.backgroundColor = divColor;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


