function validateUserBlog(){
	var root = document.blogUser;
	var name = root.name;
	var date = root.date;
	var author = root.author;
	if(name.value==''){
		alert('Please enter your name.');
		name.focus();
		return false;
	}
	if(date.value==''){
		alert("Please Pick a date for the blog.");
		date.focus();
		return false;
	}
	if(author.value==''){
		alert("Please type the author's name.");
		author.focus();
		return false;
	}
	return true;
}

function submitNewsletter(){
	var root = document.newsletter;
	var name = root.name.value;
	var email = root.email.value;
															
	if (name == ''){
		alert('Please give your name');
		root.name.focus();
		return false;
	}
	if (email == ''){
		alert('Please give your email');
		root.email.focus();
		return false;
	}
	var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var email = root.email.value;
	flag=email.match(pattern);
	if(!flag){
		alert('Please insert a valid email address.');
		root.email.select();
		return false;
	}

	var subscribe1 = root.subscribtion[0].checked;
	var subscribe2 = root.subscribtion[1].checked;
	if (!subscribe1 && !subscribe2) {
		alert('Please make a selection');
		return false;
	}
	
	return true;
}
function validateTellAFriend() {
	var root = document.tellafriend;
	
	var fname = root.friend_name.value;
	var femail = root.friend_email.value;
	var name = root.your_name.value;
	var email = root.your_email.value;
	
	if (fname == '') {
		alert('Please enter your friend\'s name.');
		root.friend_name.focus();
		return false;
	}
	if (femail == '') {
		alert('Please enter your friend\'s email.');
		root.friend_email.focus();
		return false;
	}
	if (name == '') {
		alert('Please enter your name.');
		root.your_name.focus();
		return false;
	}
	if (email == '') {
		alert('Please enter your email.');
		root.your_email.focus();
		return false;
	}
	return true;
}

function validateContact() {
	var root = document.contactus;
	
	var name = root.name.value;
	var email = root.email.value;
	var country = root.country.value;
	var feedback = root.feedback.value;
	
	if (name == '') {
		alert('Please enter your name.');
		root.name.focus();
		return false;
	}
	if (email == '') {
		alert('Please enter your email.');
		root.email.focus();
		return false;
	}
	if (country == '') {
		alert('Please enter your country.');
		root.country.focus();
		return false;
	}
	if (feedback == '') {
		alert('Please enter your feedback.');
		root.feedback.focus();
		return false;
	}
	return true;
}

function resetForm() {
	var root = document.contactus;
	
	var myconfirm = confirm('Are you sure you want to clear the text you have entered?');
	
	if (myconfirm){
		root.name.value = '';
		root.email.value = '';
		root.feedback.value = '';
	}
	else return ;
}

function reloadLyricsPage(url){
	var id = document.lyrics_form.lyrics[document.lyrics_form.lyrics.selectedIndex].value;
	if (id == ''){
		return false;
	}
	location.href = url + '' + id + '#middle';
	return false;
}



var MENU_FOCUSED = false;
var MENU_NAME = '';

IE4 = (document.all) ? 1 : 0;       // browser is Internet Explorer 4
NS4 = (document.layers) ? 1 : 0;    // browser is Netscape 4

ver4 = (IE4 || NS4) ? 1 : 0;  // know that we have version 4 browser
                              // this will be required for non-dhtml browsers

function setMenuFocused() {
	MENU_FOCUSED = true;
}
function startHideMenu(whichElement) {
	MENU_FOCUSED = false;
	MENU_NAME = whichElement;
	setTimeout("hideMenu()", 1000);
	return;
} // end startHideMenu()

function hideMenu() {
	if (!MENU_FOCUSED) hoverMenu(MENU_NAME,false);
	return;
}

function hoverMenu(whichElement,status) {
arrayOfLayers = ['onair_menu','music_menu','downloads_menu','contest_menu','community_menu','services_menu','events_menu','about_menu','moviesdvds_menu'];
maxNbrOfLayers = 9;

	if (status == true) {
		setMenuFocused()
	    vis = 'visible';
	}
	else if (status == false) {
	   vis = 'hidden';
	}


	  // checking which browser
	  if (IE4) {
    	 for (i=0;i<maxNbrOfLayers;i++) {
        	 layerName = arrayOfLayers[i];
	         if (layerName == whichElement) {
    	        // get its index first
        	    layerIndex = i;
            	theElement = eval("document.all." + arrayOfLayers[i] + ".style");
	            theElement.visibility=vis;
    	     } // check if layer exists
        	 else {
	            theElement = eval("document.all." + arrayOfLayers[i] + ".style");
    	        theElement.visibility='hidden'; 
        	 } // set other layers to hidden
	     } // end if for loop
 	  } // end of IE4

	  else if (NS4) { // netscape or similar browser
	     for (i=0;i<maxNbrOfLayers;i++) {
    	     layerName = arrayOfLayers[i];
	         if (layerName == whichElement) {
    	        // get its index first
	            layerIndex = i;
    	        theElement = eval("document." + arrayOfLayers[i]);
	            theElement.visibility=vis; 
    	     } // check if layer exists
	         else {
	            theElement = eval("document." + arrayOfLayers[i]);         
    	        theElement.visibility='hidden'; 
        	 } // set other layers to hidden
	     } // end if for loop
	  } // end of NS
	  else { // for Opera browser
	     for (i=0;i<maxNbrOfLayers;i++) {
    	     layerName = arrayOfLayers[i];
        	 if (layerName == whichElement) {
	            // get its index first
    	        layerIndex = i;
        	    theElement = eval(document.getElementById(arrayOfLayers[i])).style;  
	            theElement.visibility=vis; 
    	     } // check if layer exists
	         else {
    	        theElement = eval(document.getElementById(arrayOfLayers[i])).style;  
        	    theElement.visibility='hidden'; 
	         } // set other layers to hidden
	     } // end if for loop
	  } // end of Opera

} // end hoverOver function



imgFile = new Array();

imgFile[0]="/images/header/home_on.gif";
imgFile[1]="/images/header/onair_on.gif";
imgFile[2]="/images/header/music_on.gif";
imgFile[3]="/images/header/downloads_on.gif";
imgFile[4]="/images/header/moviesdvds_on.gif";
imgFile[5]="/images/header/contest_on.gif";
imgFile[6]="/images/header/services_on.gif";
imgFile[7]="/images/header/events_on.gif";
imgFile[8]="/images/header/about_on.gif";
imgFile[9]="/images/header/community_on.gif";

// store the image srcs inside an array for later reference
imgSrc=new Array();

for(i=0;i<imgFile.length;i++) 
{
  imgSrc[i]=new Image();
  imgSrc[i].src=imgFile[i];
}

function switchImgs(nameOfImg,imgFilename) {

// changing the image for the link
document.images[nameOfImg].src=imgFilename;
}

