<!-- 

// onmouseover="changeImg('name1','Big.gif')" onmouseout="changeImg('name1','Small.gif')
function changeImg(imgName,imgSrc)
{
	document[imgName].src=imgSrc;
}
function showlayer(layerID)
{
	var layerBox = document.getElementById(layerID)
	layerBox.style.display = (layerBox.style.display == 'none') ? 'block' : 'none';
}

//=====================================
// FTH: Change frame content

function changeFooterURL(strPath)
{
	parent.footer.location.href=strPath
}
function changeMainURL(strPath)
{
	parent.main.location.href=strPath
}
// FTH: From iFrames to Parent frame
function changeURL(strPath)
{
	parent.location.href=strPath
}

//=====================================
// Opens a link from a form selection - 
function submitSelection(form) 
{
//	parent.location=form.selectedOption.value
	location=form.selectedOption.value;
}

//=====================================
// Opens a link from a form selection - 
function submitSelectionInParent(formName,fieldName) 
{
	var el = document.forms[formName].elements[fieldName];
	if (el.value !=0)
	{
		parent.main.location=el.value
	}else{
		return false
	}
}
//=====================================
// FTH: New Location (link for input buttoms)
function linkTo(strURL)
{
	window.location = strURL
}

//=====================================
// FTH: open pop up window
function openWin(theURL,winName,W,H)
{
	features = 'height='+H+',width='+W+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1'
	window.open(theURL,winName,features);
}

//=====================================
// FTH: A New centered window opens for every new winName
function openCenteredWindow(strURL, winName, w, h, clear)
{
	if (w == 0 || w == ''){
		w = (screen.width - 160);
		var winLeft = 0;
	}else{
		var winLeft = Math.round((screen.width - w) / 2);
	}
	if (h == 0 || h == ''){
		h = (screen.height - 165);
		var winTop = 0;
	}else{
		var winTop = Math.round(((screen.height - 200) - h) / 2);
	}
	winProperties = 'height='+h+',width='+w+',top='+winTop+',left='+winLeft+',location=1,status=0,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes'
	clearProperties = 'height='+h+',width='+w+',top='+winTop+',left='+winLeft+',location=0,status=0,toolbar=no,menubar=no,scrollbars=yes,resizable=yes'
	properties = winProperties
	if (clear != '' && clear != null) {properties = clearProperties}
	window.open(strURL, winName, properties )
}

//=====================================
//Controlls for positive number in textbox
function validateNumber(field)
{
  var val = field.value;
  if(!/^\d*$/.test(val)||val==0)
  	{
	alert("Quantity must be a positive number");
	field.focus();
	field.select();
 	}
}
//=====================================
//Allow zero value in textbox
function validateZeroNumber(field)
{
  var val = field.value;
  if(!/^\d*$/.test(val)||val<0)
  	{
    alert("Quantity must be a positive number or zero (0)");
    field.focus();
    field.select();
 	}
}

//=====================================
// FTH: Validate login entries
function validateLogin()
{
	x=document.strLogin
	strSend=x.strCustomEmail.value
		strSend1=strSend.indexOf("@")
		strSend2=strSend.indexOf(".")
	strPass=x.strCustomPass.value
	submitOK="True"
	strAlert = ""

	if (strSend.length<1)
	{
		strAlert = "Please write your email address.\n"
		submitOK = "False"
	}
	if ((strSend1==-1 || strSend2==-1 || strSend.length<8) && strAlert == '')
	{
		strAlert = "Please write a correct email address!\n"
		submitOK = "False"
	}
	if (strPass.length<1 && strAlert == '')
	{
		strAlert = "Please write your password.\n"
		submitOK = "False"
	}

	if (submitOK=="False")
	{
		alert(strAlert)
		return false
	}
}

//=====================================
// FTH: Validation of a general registration form 
function validateReg()
{
// Field names: strFirst,strLast,strEmail,strPass,strPass1,strAddress,strCity,strPostalCode,strCountry,strPhone
	x=document.regForm
	mail=x.strEmail.value
		mail1=mail.indexOf("@")
		mail2=mail.indexOf(".")
	fName=x.strFirst.value
	lName=x.strLast.value
	pass1=x.strPass.value
	pass2=x.strPass1.value
	address=x.strAddress.value
	city=x.strCity.value
	postalCode=x.strPostalCode.value
	country=x.strCountry.value
	phone=x.strPhone.value
	submitOK="True"
	strAlert = ""

//	return false
		
	if (fName.length<1 || lName.length<2 || address.length<2 || city.length<2 || postalCode.length<2 || country.length<2 || phone.length<1 || mail.length<1)
	{
		strAlert = "Please fill all fields marked with an asterisk (*).\n"
		submitOK = "False"
	}
	if ((mail1==-1 || mail2==-1 || mail.length<7 ) && strAlert == '')
	{
		strAlert = strAlert + "Please write a correct email!\n"
		submitOK = "False"
	}
	if ((phone.length<8) && strAlert == '')
	{
		strAlert = strAlert + "Please write your telefone with the area number , e.g., 0310 123 456.\n"
		submitOK = "False"
	}
	if ((pass1.length<5 ||  pass2.length<5) && strAlert == '')
	{
		strAlert = strAlert + "Please write a code with at least 5 characters.\n"
		submitOK = "False"
	}
	if ((pass1.length != pass2.length) && strAlert == '')
	{
		strAlert = strAlert + "The codes in the two fields are not the same.\nPlease try again"
		submitOK = "False"
	}
	if (submitOK=="False")
	{
		alert(strAlert)
		return false
	}
}

// -->