<!--
if (document.images) {
	roadbuttonup       = new Image();
	roadbuttonup.src   = "/i/u/image/road1.gif" ;
	roadbuttondown     = new Image() ;
	roadbuttondown.src = "/i/u/image/road2.gif" ;

	trainbuttonup       = new Image();
	trainbuttonup.src   = "/i/u/image/train1.gif" ;
	trainbuttondown     = new Image() ;
	trainbuttondown.src = "/i/u/image/train2.gif" ;

	busbuttonup       = new Image();
	busbuttonup.src   = "/i/u/image/bus1.gif" ;
	busbuttondown     = new Image() ;
	busbuttondown.src = "/i/u/image/bus2.gif" ;

	airbuttonup       = new Image();
	airbuttonup.src   = "/i/u/image/air1.gif" ;
	airbuttondown     = new Image() ;
	airbuttondown.src = "/i/u/image/air2.gif" ;

	roadactivebuttonup       = new Image();
	roadactivebuttonup.src   = "/i/u/image/road2.gif" ;
	roadactivebuttondown     = new Image() ;
	roadactivebuttondown.src = "/i/u/image/road1.gif" ;

	trainactivebuttonup       = new Image();
	trainactivebuttonup.src   = "/i/u/image/train2.gif" ;
	trainactivebuttondown     = new Image() ;
	trainactivebuttondown.src = "/i/u/image/train1.gif" ;

	busactivebuttonup       = new Image();
	busactivebuttonup.src   = "/i/u/image/bus2.gif" ;
	busactivebuttondown     = new Image() ;
	busactivebuttondown.src = "/i/u/image/bus1.gif" ;

	airactivebuttonup       = new Image();
	airactivebuttonup.src   = "/i/u/image/air2.gif" ;
	airactivebuttondown     = new Image() ;
	airactivebuttondown.src = "/i/u/image/air1.gif" ;
	
	mapactivebuttonup       = new Image();
	mapactivebuttonup.src   = "/i/u/image/map2.gif" ;
	mapactivebuttondown     = new Image() ;
	mapactivebuttondown.src = "/i/u/image/map1.gif" ;

	listactivebuttonup       = new Image();
	listactivebuttonup.src   = "/i/u/image/list2.gif" ;
	listactivebuttondown     = new Image() ;
	listactivebuttondown.src = "/i/u/image/list1.gif" ;

}
function buttondown( buttonname )
{
	if (document.images) {
	  document[ buttonname ].src = eval( buttonname + "down.src" );
	}
}
function buttonup ( buttonname )
{
	if (document.images) {
	  document[ buttonname ].src = eval( buttonname + "up.src" );
	}
}
// -->


function popup(url)
{
	newwindow= window.open (url, "mywindow","location=0,status=0,scrollbars=1,width=1000,height=740");
	newwindow.moveTo(100,100);
}
function validateEnquiry()
{
	if(document.frmEnquiry.txtName.value=="")
	{
		alert("Please enter name");
		document.frmEnquiry.txtName.focus();
		document.frmEnquiry.txtName.style.background='red';
		return false;
	}
	else if(document.frmEnquiry.txtEmail.value=="")
	{
		alert("Please enter email address");
		document.frmEnquiry.txtEmail.focus();
		document.frmEnquiry.txtEmail.style.background='red';
		return false;
	}
	else if (validateEmail(document.frmEnquiry.txtEmail.value)==false){
		alert("Please enter a valid email address");
		document.frmEnquiry.txtEmail.focus();
		document.frmEnquiry.txtEmail.style.background='red';
		return false;
	}
	else if(document.frmEnquiry.txtEnquiry.value=="")
	{
		alert("Please enter your enquiry");
		document.frmEnquiry.txtEnquiry.focus();
		document.frmEnquiry.txtEnquiry.style.background='red';
		return false;
	}
	document.frmEnquiry.submit();
}

function validateCallBack()
{
	if(document.frmCallback.txtName.value=="")
	{
		alert("Please enter name");
		document.frmCallback.txtName.focus();
		document.frmCallback.txtName.style.background='red';
		return false;
	}
	else if(document.frmCallback.txtEmail.value=="")
	{
		alert("Please enter email address");
		document.frmCallback.txtEmail.focus();
		document.frmCallback.txtEmail.style.background='red';
		return false;
	}
	else if (validateEmail(document.frmCallback.txtEmail.value)==false){
		alert("Please enter a valid email address");
		document.frmCallback.txtEmail.focus();
		document.frmCallback.txtEmail.style.background='red';
		return false;
	}
	document.frmCallback.submit();
}

/*
This function makes sure the email address has one (@), atleast one (.). It also makes sure that there are no spaces, extra '@'s or a (.) just before or after the @. It also makes sure that there is atleast one (.) after the @.
*/
function validateEmail(str,form) 
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	var lastdot=str.lastIndexOf(dot)
	if (str.indexOf(at)==-1){
	   return false
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr || str.substring(lastdot+1)==""){
		return false
	}	 
	if (str.indexOf(at,(lat+1))!=-1){
	  	 return false
	 }
	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		return false
	 }
	 if (str.indexOf(dot,(lat+2))==-1){
		return false
	 }
	 if (str.indexOf(" ")!=-1){
		return false
	 }
	if(CharsInBag(str)==false){
		return false
	 }
	 var arrEmail=str.split("@")
	 var ldot=arrEmail[1].indexOf(".")
	 if(isInteger(arrEmail[1].substring(ldot+1))==false){
		return false
	 }
}

var bugchars = '!#$^&*()+|}{[]?><~%:;/,=`"\'';
function CharsInBag(s)
{   
	var i;
	var lchar="";
    // Search through string's characters one by one.
    // If character is not in bag.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
		if(i>0)lchar=s.charAt(i-1)
        if (bugchars.indexOf(c) != -1 || (lchar=="." && c==".")) return false;
    }
    return true;
}
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is not a number.
        var c = s.charAt(i);
        if ((c >= "0") && (c <= "9") && (c != ".")) return false;
    }
    // All characters are numbers.
    return true;
}



/*
script for venue space page - show and hide element by ID - 30/09/08 SC
*/

//here you place the ids of every element you want.
var ids=new Array('stand','capacity');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
