// JavaScript Document
function updateCSS(f, node){
	document.getElementsByTagName('link')[node].setAttribute('href', f);
	SetCookie('CFM_CSS',f,1);
}
function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

function getCookie(c_name){
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(c_name + "=");
	  if (c_start!=-1)
		{ 
		c_start=c_start + c_name.length+1; 
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	  }
	return "";
}
function popUp(URL, w, h) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=" + w  + ",height=" + h + "');");
}

function valMailList() {
    var failed = false;
    var message = "You must enter the following before the form can be processed \n\n";
    if (document.form1.foEmail.value == "") {
        if (!failed){ firstfocus = document.form1.foEmail;}
        failed = true;
        message += "Valid Email Address \n";
    }
   // stick some form field validation in here
    if (failed){
        alert(message);
        firstfocus.focus();
        return false;
    }    
    return true;
}  


function setOpacity (namein, step) 
{
		fadinthis = document.getElementById(namein);
		if (document.all) {fadinthis.style.filter = 'alpha(opacity = ' + step + ')';}
  		if (step < 100){
				step = step+step;
				setTimeout('setOpacity("' + namein + '",' + step + ')', 50);
		}
}

function fadeInThis(namein, nameout1, nameout2) 
{
			document.getElementById(namein).style.filter = 'alpha(opacity = ' + 0 + ')';
		  	document.getElementById(nameout1).style.filter = 'alpha(opacity = ' + 0 + ')';
			document.getElementById(nameout2).style.filter = 'alpha(opacity = ' + 0 + ')';
			document.getElementById(namein).style.display = '';
		  	document.getElementById(nameout1).style.display = 'none';
			document.getElementById(nameout2).style.display = 'none';
			
			setOpacity (namein, 5)
}