

 onhome = new Image();
 onhome.src = "images/home_roll.gif";

 offhome = new Image();
 offhome.src = "images/home.gif";

////////////////////////////////////////////////////////////////

 onhistory = new Image();
 onhistory.src = "images/history_roll.gif";

 offhistory = new Image();
 offhistory.src = "images/history.gif";

////////////////////////////////////////////////////////////////

 onactivities = new Image();
 onactivities.src = "images/activities_roll.gif";

 offactivities = new Image();
 offactivities.src = "images/activities.gif";

////////////////////////////////////////////////////////////////

 oncommunity = new Image();
 oncommunity.src = "images/community_roll.gif";

 offcommunity = new Image();
 offcommunity.src = "images/community.gif";

///////////////////////////////////////////////////////////////

 oncontact = new Image();
 oncontact.src = "images/contact_roll.gif";

 offcontact = new Image();
 offcontact.src = "images/contact.gif";
 


///////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////


 
 function double_on(imgname)
 {        
    var text_imgname=imgname + "_text";
     var ImgOn = eval("on" + imgname + ".src");
    var TextImgOn = eval("on" + text_imgname + ".src");

    document[imgname].src = ImgOn;
    document['text'].src = TextImgOn;
    
    
 }
var TextImgOff="//images/where_your_ideas.gif";

 function double_off(imgname)
 {	var text_imgname=imgname + "_text";
     var ImgOff = eval("off" + imgname + ".src");
    
    document[imgname].src = ImgOff;
    document['text'].src = TextImgOff;

  }


var recent="basic";

function send()
{    
    var url="";
    if(recent == "ez")  url="#";
    if(recent == "basic")  url="#";
    if(recent == "prem")  url="#";
    if(recent == "hb")  url="#";

    location.href=url;
}



 function on(imgname)
 {

 	ImgOn = eval("on" + imgname + ".src");
	 document[imgname].src = ImgOn;
 }
 
 function off(imgname)
 {

 	ImgOff = eval("off" + imgname + ".src");
 	document[imgname].src = ImgOff;
 }


function stay(imgname)
{

   document[imgname].src = eval("on" + imgname + ".src");
   eval("off" + imgname).src = eval("on" + imgname + ".src");
   eval("on" + imgname).src = eval("on" + imgname + ".src");
}

function set_section_icon(section)
{ var section_icon;
  if(section != 'home' && section !='contact' && section !='about')
  	section_icon=eval("on" + section + "_icon.src");
  else
  	section_icon="//images/top_corner.gif";

  document['icon'].src = section_icon;

}

function set_section_text(section)
{ if(section != 'home' && section !='contact' && section !='about')
  	section_text=eval("on" + section + "_text.src");
  else
  	section_text="//images/where_your_ideas.gif";

  document['text'].src = section_text;
  TextImgOff=section_text;

}

function set_section(section)
{	
	set_section_icon(section);
	set_section_text(section);
	stay(section);

}


function openwin(desturl,wintitle, w, h, title) 
{

	if (wintitle == null) { wintitle = 'title'; }
	if (w == null) { w = 500; }
	if (h == null) { h = 550; }
	
	htmlpage="<html><title>"+ title +"</title><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><img src='"+desturl+"' height='"+h+"' width='"+w+"'></html>";
	
	win=window.open('', wintitle ,"titlebar=no, scrollbars=no,toolbar=no,resizable=no,location=no,directories=no,status=no,copyhistory=no,width="+w+",height="+h);
    
    win.document.write(htmlpage);
    
	win.focus();
}


function openwin2(desturl,wintitle, title) 
{

	if (wintitle == null) { wintitle = 'title'; }
	w = 500;
	h = 550;
	

	win=window.open(desturl, wintitle ,"titlebar=no, scrollbars=no,toolbar=no,resizable=no,location=no,directories=no,status=no,copyhistory=no,width="+w+",height="+h);
    
	win.focus();
}

/* Validate an e-mail address */
function validateEmail(emailString) {

    /* The characters don't belong in a valid e-mail address */
    invalidChars = " /:,;";

    /* You must enter something */
    if (emailString == "") {
            window.alert("Please enter your e-mail address!");
            return false;
    }
    /* There must be something before the at sign */
    if (emailString.indexOf("@", 0) == 0) {
            window.alert("Not a valid e-mail address.  Please try again!");
            return false;
    }
    /* There must be an at sign at, or after, the second character */
    if (emailString.indexOf("@", 1) == -1) {
            window.alert("Not a valid e-mail address.  Please try again!");
            return false;
    }
    /* There must be a period somewhere */
    if (emailString.indexOf(".", 0) == -1) {
            window.alert("Not a valid e-mail address.  Please try again!");
            return false;
    }
    /* Checking for invalid characters */
    for (i=0; i<invalidChars.length; i++) {
            if (emailString.indexOf(invalidChars.charAt(i), 0) > -1) {
                    window.alert("Not a valid e-mail address.  Please try again!");
                    return false;
            }
    }
    /* We made it. The e-mail looks good */
    return true;
}

/* Verify a form */
function formVerify(myform) {

    /* Check whether the user entered a first name */
    if (myform.firstName.value == "") {
            window.alert("Please enter your first name!");
            myform.firstName.focus();
            myform.firstName.select();
            return false;
    }

    /* Check whether the user entered a last name */
    if (myform.lastName.value == "") {
            window.alert("Please enter your last name!");
            myform.lastName.focus();
            myform.lastName.select();
            return false;
    }

    /* Validate the e-mail address */
    if (!validateEmail(myform.email.value)) {
            myform.email.focus();
            myform.email.select();
            return false
    }

    return true;
}

function communityFormVerify(serviceNo) {
    var counter = 0;
    for (var i=1; i<=serviceNo; i++) {
        if (document.getElementById(i).checked == true)
            counter ++;
    }
    if (counter == 0) {
        window.alert("Please make a selection before clicking on 'Submit'");
        return false;
    }

    return true;
}

// Changes the font color on mouse hover.
function chgeColor(id, action)  {
    var lang = document.getElementById(id);
    lang.className = action;
}

// Hides the unwanted divs.
function hideDivs(id) {
    for (var i=1; i<=5; i++) {
        if (i != id)
            document.getElementById("nav_" + i).style.display = 'none';
    }
}

// Hides a specific div.
function hideUnwantedEventDiv(toHide, toShow) {
    document.getElementById(toHide).style.display = 'none';
    document.getElementById(toShow).style.display = 'block';   
}

// Opens a new window to display and enlarged version of an image.
function enlargeImage(page, id) {
//    document.forms[0].action = document.forms[0].action + "?image=" + id;
//    document.forms[0].image.value = id;
    floaterWindow = window.open('', 'imageWindow', 'scrollbars=no, status=no, width=800, height=600');
    floaterWindow.location.href = page;
}


