var a_vars = Array();
var pagename='';

var phpmyvisitesSite = 4;
var phpmyvisitesURL = "http://stat.babblecom.co.uk/phpmyvisites.php";


var popUpWin=0;
function popUpWindow(URLStr) {
	if(popUpWin) {
    	if(!popUpWin.closed) popUpWin.close();
  	}
  	popUpWin = window.open('','popUpWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=400,height=500,left=250, top=100,screenX=250,screenY=100');
	var tmp = popUpWin.document;
	tmp.write('<html><head><title>Art-Oasis popup</title>');
	tmp.write('<meta http-equiv=\"Pragma\" content=\"no-cache\" />');
	tmp.write('<link rel=\"stylesheet\" href=\"http://www.art-oasis.com/css/default.css\">');
	tmp.write('<scr"+"ipt type=\"text/javascript\" src=\"http://www.art-oasis.com/js/popup.js\"></scr"+"ipt>');
	tmp.write('</head><body oncontextmenu="return false";><div id=\"popup\"><dl><dt>Art-Oasis image preview</dt>');
	tmp.write('<dd><img src=\"http://art-oasis.com/' + URLStr + '\" name="myImage" onload=\"window.resizeTo(document.myImage.width+58, document.myImage.height+132); window.moveTo((screen.width-document.myImage.width)/2,5); \" /></dd>');
	tmp.write('<dd><a href=\"javascript:self.close()\">Close window</a>.</dd>');
	tmp.write('</div></body></html>');
	tmp.close();
}

function addBookmark(title,url) {
	if (window.sidebar) { window.sidebar.addPanel(title, url,""); } 
	else if( document.all ) { window.external.AddFavorite( url, title); } 
	else if( window.opera && window.print ) { return true; }
}

function CheckContactForm() {
	var errorMsg = "";

	// Check first name
	if (document.Form.name.value == "" || document.Form.name.value == "Full name"){
		errorMsg += "\n\tName \t- Enter your Name";	
	}

	//Check for an e-mail address and that it is valid
	if ((document.Form.email.value == "") || (document.Form.email.value.length > 0 && (document.Form.email.value.indexOf("@",0) == - 1 || document.Form.email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter a valid e-mail address";
	}
	
	// Check hear about us
	if (document.Form.hearfrom.value == "" ){
		errorMsg += "\n\tWhere did you hear about us? \t- Please select...";	
	}
	
	// Check comment
	if (document.Form.comment.value == "" || document.Form.comment.value == "Message"){
		errorMsg += "\n\Comment \t- Enter your Message";	
	}
	
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: \n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}


function CheckRegistrationForm() {
	var errorMsg = "";

	// Check first name
	if (document.Form.firstname.value == ""){
		errorMsg += "\n\tFirst Name \t- Enter your First Name";	
	}
	
	//Check last name
	if (document.Form.lastname.value == ""){
		errorMsg += "\n\tLast Name \t- Enter your Last Name";
	}
	
	// Check address
	if (document.Form.house.value == ""){
		errorMsg += "\n\tAddress \t- Enter your Address";	
	}
	
	// Check Town/City
	if (document.Form.town.value == ""){
		errorMsg += "\n\tTown \t- Enter your Town";	
	}
	
	// Check Post Code
	if (document.Form.postcode.value == ""){
		errorMsg += "\n\tPost Code \t- Enter your Post Code";	
	}
	
	//Check for an e-mail address and that it is valid
	if ((document.Form.email.value == "") || (document.Form.email.value.length > 0 && (document.Form.email.value.indexOf("@",0) == - 1 || document.Form.email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter your valid e-mail address";
	}
	
	//Check Password is valid
	if (document.Form.password.value == "" || document.Form.password.value.length < 6){
		errorMsg += "\n\tPassword \t- Enter a valid Password.(It must have a minimum of 6 characters.)";
	}
	
	//Check Confirm Password is valid
	if (document.Form.password.value != document.Form.confirmpassword.value ) {
		errorMsg += "\n\tPassword \t- Your password and confirm password are different!!";
	}
	
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your registration has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: \n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}


function CheckInfoForm() {
	var errorMsg = "";

	// Check first name
	if (document.Form.firstname.value == ""){
		errorMsg += "\n\tFirst Name \t- Enter your First Name";	
	}
	
	//Check last name
	if (document.Form.lastname.value == ""){
		errorMsg += "\n\tLast Name \t- Enter your Last Name";
	}
	
	//Check for an e-mail address and that it is valid
	if ((document.Form.email.value == "") || (document.Form.email.value.length > 0 && (document.Form.email.value.indexOf("@",0) == - 1 || document.Form.email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter your valid e-mail address";
	}
		
	
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your registration has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: \n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}

function CheckNewsletterForm() {
	var errorMsg = "";

	// Check first name
	if (document.Form.member_name.value == ""){
		errorMsg += "\n\tMember Name \t- Enter your Name";	
	}
	
	//Check for an e-mail address and that it is valid
	if ((document.Form.member_email.value == "") || (document.Form.member_email.value.length > 0 && (document.Form.member_email.value.indexOf("@",0) == - 1 || document.Form.member_email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter your valid e-mail address";
	}
		
	
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your registration has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: \n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}

function CheckAddressBookForm() {
	var errorMsg = "";

	// Check first name
	if (document.Form.firstname.value == ""){
		errorMsg += "\n\tFirst Name \t- Enter your First Name";	
	}
	
	//Check last name
	if (document.Form.lastname.value == ""){
		errorMsg += "\n\tLast Name \t- Enter your Last Name";
	}
	
	// Check address
	if (document.Form.house.value == ""){
		errorMsg += "\n\tAddress \t- Enter your Address";	
	}
	
	// Check Town/City
	if (document.Form.town.value == ""){
		errorMsg += "\n\tTown \t- Enter your Town";	
	}
	
	// Check Post Code
	if (document.Form.postcode.value == ""){
		errorMsg += "\n\tPost Code \t- Enter your Post Code";	
	}
	
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your registration has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: \n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}

function CheckReviewForm() {
	var errorMsg = "";

	// Check first name
	if (document.Form.title.value == ""){
		errorMsg += "\n\tReview Title \t- Enter a Title";	
	}
	
	//Check for an e-mail address and that it is valid
	if (document.Form.review.value == ""){
		errorMsg += "\n\tReview Text \t- Enter a text plain message";
	}
		
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your review has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: \n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}