function bookmark(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

function ValidateContact(form) {
	with (form) {
		if (!realname.value || !surname.value || !email.value) {
			alert("Please fill in all the fields");
			return false;
		} else {
			// validate e-mail address
			with (email) {
				apos = value.indexOf("@"); 
				dotpos = value.lastIndexOf(".");
				lastpos = value.length - 1;
				if (apos < 1 || dotpos - apos < 2 || lastpos - dotpos > 3 || lastpos - dotpos < 2) {
					alert("Your e-mail address does not appear to be valid.");
					return false;
				} else {
					return true;
				}
			}
		}
	}
}

function ValidateCompetition(form) {
	with (form) {
		if (!answer.value || !realname.value || !surname.value || !email.value || !contact.value) {
			alert("Please fill in all the fields");
			return false;
		} else {
			// validate e-mail address
			with (email) {
				apos = value.indexOf("@"); 
				dotpos = value.lastIndexOf(".");
				lastpos = value.length - 1;
				if (apos < 1 || dotpos - apos < 2 || lastpos - dotpos > 3 || lastpos - dotpos < 2) {
					alert("Your e-mail address does not appear to be valid.");
					return false;
				} else {
					return true;
				}
			}
		}
	}
}

function imenus_data0(){

	this.unlock = "nnbj^o[]";
	this.enable_visual_design_mode = false

	this.main_is_horizontal = false
	this.menu_showhide_delay = 150
   /*---------------------------------------------
   Images (expand and pointer icons)
   ---------------------------------------------*/
	this.main_expand_image = ''
	this.main_expand_image_hover = ''
	this.main_expand_image_width = ''
	this.main_expand_image_height = ''
/*/	this.main_expand_image = 'http://www.opencube.com/vim/img/sample14_main_expand_default.gif'
	this.main_expand_image_hover = 'http://www.opencube.com/vim/img/sample14_main_expand_on.gif'
	this.main_expand_image_width = '13'
	this.main_expand_image_height = '9'/*/
	this.main_expand_image_offx = '0'
	this.main_expand_image_offy = '2'

//	this.sub_expand_image = 'http://www.opencube.com/vim/img/sample14_sub_expand_default.gif'
	//this.sub_expand_image_hover = 'http://www.opencube.com/vim/img/sample14_sub_expand_on.gif'
	this.sub_expand_image = ''
	this.sub_expand_image_hover = ''
	this.sub_expand_image_width = '4'
	this.sub_expand_image_height = '7'
	this.sub_expand_image_offx = '0'
	this.sub_expand_image_offy = '3'

   /*---------------------------------------------
   Global Menu Styles
   ---------------------------------------------*/

	//Main Menu

	this.main_container_styles = "background:#CC0000; border-width:0px; "
//	this.main_item_styles = "color:#ffffff; text-align:center; font-family:comic sans ms; font-size:11px; font-weight:bold; text-decoration:none; border-style:outset; border-color:#ffffcc; border-width:1px 2px 2px 1px; padding:4px 9px 4px 4px; "
	this.main_item_styles = "text-align:center;	text-decoration:none;	display:block;	color: #FFFFFF;font-family:comic sans ms; font-weight:bold;	border: 1px solid #FFFFFF;	margin-bottom: 3px;	margin-top: 3px;	margin-right: 3px;	margin-left: 3px;	padding: 2px;"
	this.main_item_hover_styles = "background-color:#E06666; color:#ffffff; "
	//Sub Menu

	this.subs_container_styles = "filter:progid:DXImageTransform.Microsoft.Fade(duration=0.3); background-color:#CC0000;padding:1px; margin:1px 0px 0px; "
	this.subs_item_styles = this.main_item_styles;//"background-color:#000000; color:#cccccc; text-align:left; font-size:11px; font-weight:normal; text-decoration:none; border-style:none; border-color:#000000; border-width:1px; padding:2px 5px; "
	this.subs_item_hover_styles = this.main_item_hover_styles; //"background-color:#333333; color:#ffffff; "
	this.subs_item_active_styles = ""

}


function checkWholeForm(theForm) {
    var why = "";
    why += isEmptyStr(theForm.Name.value,"Please enter your Name.");
    why += isEmptyStr(theForm.Surname.value,"Please enter your Surname.");
    why += isEmptyStr(theForm.Address.value,"Please enter your Address.");
    why += checkEmail(theForm.email.value);
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}


function checkEvent(theForm) { 
    var why = "";
    why += isEmptyStr(theForm.name.value,"Please enter your Name.");
    why += isEmptyTel(theForm.tel.value,"Please enter your Address.");
    why += checkEmail(theForm.email.value);
    why += isEmptyStr(theForm.event_title.value,"Please enter your Event Name.");
    why += isEmptyStr(theForm.start_date.value,"Please enter your Start Date.");
    why += isEmptyStr(theForm.start_time.value,"Please enter your Start Time.");
    why += isEmptyStr(theForm.end_date.value,"Please enter your End Date.");
    why += isEmptyStr(theForm.end_time.value,"Please enter your End Time.");
    why += dropdown(theForm.region,"Please select the Region where the event is taking place.");
    why += isEmptyStr(theForm.venue.value,"Please enter the Venue address for the event.");
    why += isBlank(theForm.eventdetails.value,"Please enter the Event Details.");
    why += isBlank(theForm.contactdetails.value,"Please enter the Contact Details for the event.");
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}


// email
function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "You didn't enter an email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n";
       }
    }
return error;    
}

function isEmptyStr(field,strng) {
var error = "";
  if (field.length == 0) {
     error = strng+"\n";
  }
return error;	  
}
function isEmptyName(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please include your name.\n";
  }
return error;	  
}function isEmptySName(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please include your surname.\n";
  }
return error;	  
}
// non-empty textbox
function isEmptyTel(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please provide a contact number. \n";
  }
return error;	  
}
function isEmptyCo(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please tell us the name of your Company. \n";
  }
return error;	  
}
// non-empty textbox

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
 
function isBlank(str,msg){
	var error = "";
	str = trim(str)
	if(str.length == 0){ error = msg +'\n'; }
	return error;
	}



function isEmptyDomain(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please tell us the what the address of your new website will be. \n";
  }
return error;	  
}

function isEmptyObjectives(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please indicate what you want people to be able to do on your website. \n";
  }
return error;	  
}
function isEmptyContent(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please indicate the content you intend to publish and the different sections your website will have. \n";
  }
return error;	  
}


function radio_button_checker(radiobut,strng){
var radio_choice = false;
var error = "";
for (counter = 0; counter < radiobut.length; counter++){
if (radiobut[counter].checked)
radio_choice = true; 
}
if (!radio_choice){
error = ""+strng+"\n";
//return (false);
}
//return (true);
return error; }
function dropdown(menu,strng){
var error = "";
 if ( menu.selectedIndex == 0 )
    {
        error = strng+" \n";
        valid = false;
    }
	return error; }



