function searchboxClick(inputID){
	document.getElementById(inputID).value="";
	document.getElementById(inputID).style.color="#252525";
}

function searchboxClickout(inputID) {
	document.getElementById(inputID).style.color="#A0A0A0";
}

function inputClickIn(inputID){
	document.getElementById(inputID).value="";
	document.getElementById(inputID).style.color="#252525";
}

function inputClickOut(inputID) {
	document.getElementById(inputID).style.color="#A0A0A0";
}

// ID elements must be separated by spaces.
// example: showHide(form_box title_box, content_box header_box footer_box);
function showHide(id_string_show,id_string_hide)
{
	id_array_show=id_string_show.split(" ");
	id_array_hide=id_string_hide.split(" ");

	//loop through ids you want to show
	if (id_array_show != "") {
		for(var i=0; i <id_array_show.length; i++) {
			id_box = document.getElementById(id_array_show[i]);
			if (id_box) {
				id_box.style.display="";
			}
		}
	}
	//loop through ids you want to hide
	if (id_array_hide != "") {
		for(var i=0; i <id_array_hide.length; i++) {
			id_box = document.getElementById(id_array_hide[i]);
			if (id_box) {
				id_box.style.display="none";
			}
		}
	}
}

function getKeyCode(e) 
{
	var key = (window.event) ? event.keyCode : e.which;   
	if (window.event) key = event.keyCode   
	else key = e.which   // Was key that was pressed a numeric character (0-9) , backspace (8), or tab (9)?  
	return key;
}
function CheckNumeric(e) 
{   
	var key = getKeyCode(e);
	if ( key > 32 && key < 58 || key > 90 && key < 106 || key == 8 || key == 9 || key == 17 || key == 18 ) return; // if so, do nothing   
	else {
		if (window.event) //IE       
			window.event.returnValue = null;     
	else //Firefox       
		e.preventDefault(); 
	}
}

function nextField(e,id,nextId,numChars)
{
	var key = getKeyCode(e);
	if ( key > 32 && key < 48 || key == 8 || key == 9 || key == 16 ) return; // if key = backspace or tab, don't set new focus
	else if (document.getElementById(id).value.length==numChars) document.getElementById(nextId).focus(); //document.sms_form.eval(nextId).focus;
}
function isValidEmail(string) {
  if (string.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) != -1)
	return true;
  else
	return false;
}

function chkForm() {
  msg='';
	if(document.frmsms.pre.value.length<1) {
		msg=(msg+" - Your Country Code\n");
	}
	if( (document.frmsms.suffix.value.length<9) || (document.frmsms.suffix.value == '000 000 0000') ) {
		msg=(msg+" - Your 10(9 for Spain) digit Mobile Number \n");
	}
	if(msg.length>0) {
    alert("Please fill out the following:\n"+msg)
    return false;
	} else {
    return true;
	}
}

function chkShareForm() {
  msg='';
	if(document.frmshare.share-from-name.value.length<1) {
		msg=(msg+" - Your Name\n");
	}
	if(document.frmshare.share-from-mobile.value.length<9) {
		msg=(msg+" - Your 10(9 for Spain) digit Mobile Number \n");
	}
	if(msg.length>0) {
    alert("Please fill out the following:\n"+msg)
    return false;
	} else {
    return true;
	}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}