<!--
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
/*
var message="Copyright Celebration.co.za - All Rights Reserved.\nUnauthorized use of Content & Images is strictly Prohibited";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
*/

function doQuote(hotelCode) 
{
	window.open('../transactions/user-booking.php?hotel='+hotelCode, '', 'resizable,scrollbars,width=700,height=600')
}

function openPhoto(fileName, dir, title) 
{
	theURL = "http://www.celebration.co.za/photo-display.php?nm="+fileName+"&dir="+dir+"&title="+title;
	window.open(theURL, '', 'resizable=no,scrollbars=no,width=600,height=420');
}

function showEnlarged(fileName, title) 
{
	theURL = "http://www.celebration.co.za/photo-enlarged.php?nm="+fileName+"&title="+title;
	window.open(theURL, '', 'resizable=no,scrollbars=no,width=600,height=420');
}

function showBeach() 
{
	theURL = "long-beach.php";
	window.open(theURL, '', 'resizable=no,scrollbars=yes,width=600,height=420');
}

function showFran() 
{
	theURL = "franschhoek.php";
	window.open(theURL, '', 'resizable=no,scrollbars=yes,width=600,height=420');
}

function showCon() 
{
	theURL = "constantia.php";
	window.open(theURL, '', 'resizable=no,scrollbars=yes,width=600,height=420');
}

function openGalleryPhoto(fileName, dir, title) 
{
	theURL = "http://www.celebration.co.za/photo-display.php?nm="+fileName+"&dir="+dir+"&title="+title;
	window.open(theURL, '', 'resizable=no,scrollbars=no,width=600,height=420');
}

function recommendUs(pre) 
{
	window.open(pre+'recommend.php', '', 'resizable=no,scrollbars=no,width=450,height=420');
}

//ie bookmark functionality
function bookmarkUs()
{
	window.external.AddFavorite('http://www.celebration.co.za', 'South Africa Wedding Guide - Celebration.co.za');
}

function validateNoticeboard()
{
	fv = new formValidator();
	
	if (fv.isEmpty("your_name"))
		fv.raiseError("Please specify your name.");
		

	if (fv.isEmpty("email"))
		fv.raiseError("Please specify your email.");
	else
	{
		if (!fv.isEmailAddress("email"))
			fv.raiseError("Please specify a your valid email address.");
	}
	
	if (fv.findObj("area").value == "ALL")
		fv.raiseError("Please specify the province in which you reside.");	
	
	if (fv.isEmpty("notice_title"))
		fv.raiseError("Please specify your notice title.");	
		
	if (!fv.isSelected("notice_category"))
		fv.raiseError("Please specify the noticeboard category where you would like your notice displayed.");		

	if (fv.isEmpty("notice_description"))
		fv.raiseError("Please specify some details or description.");	
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function validateRecommend()
{
	fv = new formValidator();
	
	if (fv.isEmpty("your_name"))
		fv.raiseError("Please specify your name.");
	
	if (fv.isEmpty("your_email"))
		fv.raiseError("Please specify your email.");
	else
	{
		if (!fv.isEmailAddress("your_email"))
			fv.raiseError("Please specify a your valid email address.");
	}
		
	if (fv.isEmpty("friend_name"))
		fv.raiseError("Please specify your friend's name.");

	if (fv.isEmpty("friend_email"))
		fv.raiseError("Please specify your friend's email address.");
	else
	{
		if (!fv.isEmailAddress("friend_email"))
			fv.raiseError("Please specify a valid email address for your friend.");
	}

	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

/*
function validateContactUsForm()
{
	fv = new formValidator();
	
	if (fv.isEmpty("email"))
		fv.raiseError("Please specify your email address.");
		
	if (!fv.isEmpty("email"))
	{
		if (!fv.isEmailAddress("email"))
			fv.raiseError("Please specify a valid email address.");
	}	
	
	if (fv.isEmpty("contact_no"))
		fv.raiseError("Please specify a contact number.");
	
	if (fv.isEmpty("your_name"))
		fv.raiseError("Please specify your name.");
		
	if (!fv.isSelected("region"))
		fv.raiseError("Please specify where in South Africa you are based.");
		
	if (fv.isEmpty("message"))
		fv.raiseError("Please specify your message.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}
*/

function validateAccommodationForm()
{
	fv = new formValidator();
	
	if (fv.isEmpty("name"))
		fv.raiseError("Please specify your name.");
		
	if (fv.isEmpty("email"))
		fv.raiseError("Please specify your email address.");
		
	if (!fv.isEmpty("email"))
	{
		if (!fv.isEmailAddress("email"))
			fv.raiseError("Please specify a valid email address.");
	}
	
	if (fv.isEmpty("from_date") || fv.isEmpty("to_date"))
		fv.raiseError("Please specify a from and to date.");
	
	if (fv.isEmpty("no_of_guests"))
		fv.raiseError("Please specify the number of adults and / or children.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function validateContactForm()
{
	fv = new formValidator();

	if (fv.isEmpty("name"))
		fv.raiseError("Please specify your name.");
		
	if (fv.isEmpty("email"))
		fv.raiseError("Please specify your email address.");
		
	if (!fv.isEmpty("email"))
	{
		if (!fv.isEmailAddress("email"))
			fv.raiseError("Please specify a valid email address.");
	}
	
	if (fv.isEmpty("event_date"))
		fv.raiseError("Please specify the event date.");
	
	if (fv.isEmpty("venue"))
		fv.raiseError("Please specify the venue.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function validateContactForm2()
{
	fv = new formValidator();
	
	if (!fv.isSelected("toEmail"))
		fv.raiseError("Please specify which branch you would like to contact.");	
	
	if (fv.isEmpty("name"))
		fv.raiseError("Please specify your name.");
		
	if (fv.isEmpty("email"))
		fv.raiseError("Please specify your email address.");
		
	if (!fv.isEmpty("email"))
	{
		if (!fv.isEmailAddress("email"))
			fv.raiseError("Please specify a valid email address.");
	}
	
	if (fv.isEmpty("event_date"))
		fv.raiseError("Please specify the event date.");
	
	if (fv.isEmpty("venue"))
		fv.raiseError("Please specify the venue.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function swopPhoto(imgName) {
	
	if (ns3up || ie4up) 
		imgOn = ("" + imgName);
		
	document.mainpic.src = imgOn;
}

function swopPhoto2(imgName) {
	
	if (ns3up || ie4up) 
		imgOn = ("" + imgName);
		
	document.mainpic2.src = imgOn;
}

function swopPhoto3(imgName) {
	
	if (ns3up || ie4up) 
		imgOn = ("" + imgName);
		
	document.mainpic3.src = imgOn;
}

function swopPhoto4(imgName) {
	
	if (ns3up || ie4up) 
		imgOn = ("" + imgName);
		
	document.mainpic4.src = imgOn;
}

function validateJoinForm()
{
	fv = new formValidator();
	
	if (fv.isEmpty("business_name"))
		fv.raiseError("Please specify your business' name.");
		
	if (fv.isEmpty("your_name"))
		fv.raiseError("Please specify your name.");
	if (!fv.isSelected("region"))
		fv.raiseError("Please specify in what province you reside.");
		
	// make sure a contact number or email address has been specified
	if ((fv.isEmpty("email")) && (fv.isEmpty("contact_no")))
		fv.raiseError("Please specify either a contact number or email address.");
		
	if (!fv.isEmpty("email"))
	{
		// check it's valid
		if (!fv.isEmailAddress("email"))
			fv.raiseError("Please specify a valid email address.");
	}	
		
	if ((!fv.isSelected("category")) && (fv.isEmpty("category_other")))
		fv.raiseError("Please specify what category you would like to list your business in.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function validateContactUsForm()
{
	fv = new formValidator();
	
	if (!fv.isEmpty("email_address"))
	{
		if (!fv.isEmailAddress("email_address"))
			fv.raiseError("Please specify a valid email address.");
	}	
	else
	  fv.raiseError("Please specify an email address.");
	
	if (fv.isEmpty("contact_no"))
		fv.raiseError("Please specify a contact number.");	
	
	if (fv.isEmpty("your_name"))
		fv.raiseError("Please specify your name.");
		
	if (!fv.isSelected("region"))
		fv.raiseError("Please specify a region.");
		
	if (fv.isEmpty("message"))
		fv.raiseError("Please specify a comment / question.");
		
	if (fv.isEmpty("code"))
		fv.raiseError("Please specify the spam prevention code.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function validateReferrals()
{
	fv = new formValidator();
	
	if (fv.isEmpty("answer1"))
		fv.raiseError("Question 1 needs to still be answered.");
	
	if (fv.isEmpty("your_name"))
		fv.raiseError("Please specify your name.");

	if (fv.isEmpty("your_email"))
		fv.raiseError("Please specify an email address.");
	else
	{
		if (!fv.isEmailAddress("your_email"))
			fv.raiseError("Please enter a valid email address.");
	}
	
	if (fv.isEmpty("your_phone"))
		fv.raiseError("Please specify a day time contact number.");
	
	friend1 = fv.isEmpty("friend_name_1");
	friend2 = fv.isEmpty("friend_name_2");
	friend3 = fv.isEmpty("friend_name_3");
	friend4 = fv.isEmpty("friend_name_4");
	friend5 = fv.isEmpty("friend_name_5");
	
	friendEmail1 = fv.isEmpty("friend_1");
	friendEmail2 = fv.isEmpty("friend_2");
	friendEmail3 = fv.isEmpty("friend_3");
	friendEmail4 = fv.isEmpty("friend_4");
	friendEmail5 = fv.isEmpty("friend_5");
	
	if (!friend1 || !friendEmail1)
	{
		if ((friend1 || friendEmail1))
			fv.raiseError("Please enter both a name and valid email address for friend #1.");
		
		if (!friendEmail1)
		{
			if (!fv.isEmailAddress("friend_1"))
				fv.raiseError("Please enter a valid email address for friend #1.");
		}
	}
	
	if (!friend2 || !friendEmail2)
	{
		if ((friend2 || friendEmail2))
			fv.raiseError("Please enter both a name and valid email address for friend #2.");
		
		if (!friendEmail2)
		{
			if (!fv.isEmailAddress("friend_2"))
				fv.raiseError("Please enter a valid email address for friend #2.");
		}
	}
	
	if (!friend3 || !friendEmail3)
	{
		if ((friend3 || friendEmail3))
			fv.raiseError("Please enter both a name and valid email address for friend #3.");
		
		if (!friendEmail3)
		{
			if (!fv.isEmailAddress("friend_3"))
				fv.raiseError("Please enter a valid email address for friend #3.");
		}
	}

	if (!friend4 || !friendEmail4)
	{
		if ((friend4 || friendEmail4))
			fv.raiseError("Please enter both a name and valid email address for friend #4.");
		
		if (!friendEmail4)
		{
			if (!fv.isEmailAddress("friend_4"))
				fv.raiseError("Please enter a valid email address for friend #4.");
		}
	}
	
	if (!friend5 || !friendEmail5)
	{
		if ((friend5 || friendEmail5))
			fv.raiseError("Please enter both a name and valid email address for friend #5.");
		
		if (!friendEmail5)
		{
			if (!fv.isEmailAddress("friend_5"))
				fv.raiseError("Please enter a valid email address for friend #5.");
		}
	}
		
	if (!fv.isChecked("terms"))
	  fv.raiseError("Please confirm you have read the terms and conditions.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true; 
}

function right(e) {
	if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
		return false;
	else if (navigator.appName == 'Microsoft Internet Explorer' && 	(event.button == 2 || event.button == 3)) {
		alert("Copyright Celebration.co.za - All Rights Reserved.\nCopying of content and / or images is strictly prohibited!");
		return false;
	}
	return true;
}

function validateSubscriber()
{
	fv = new formValidator();
	
	if (fv.isEmpty("yn"))
		fv.raiseError("Please specify your name.");
		
	if (fv.isEmpty("ye"))
		fv.raiseError("Please specify your email address.");
		
	if (!fv.isEmpty("ye"))
	{
		if (!fv.isEmailAddress("ye"))
			fv.raiseError("Please specify a valid email address.");
	}
	
	if (!fv.isSelected("yp"))
		fv.raiseError("Please specify a province.");
	else
	{
		if (fv.findObj("yp").value == "ALL")
			fv.raiseError("Please specify a province.");
	}
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function validateHoneymoonPlanners()
{
	fv = new formValidator();
	
	if (fv.isEmpty("your_name"))
		fv.raiseError("Please specify your name.");

	if (fv.isEmpty("email"))
		fv.raiseError("Please specify your email.");
	else
	{
		if (!fv.isEmailAddress("email"))
			fv.raiseError("Please specify a your valid email address.");
	}
	
	if ((fv.isEmpty("telephone")) && (fv.isEmpty("cellphone")))
		fv.raiseError("Please specify at least one contact number (telephone / cellphone).");
	
	if (fv.isEmpty("from_date"))
		fv.raiseError("Please specify a from date.");	

	if (fv.isEmpty("to_date"))
		fv.raiseError("Please specify a to date.");	
		
	if (fv.isEmpty("departing_city"))
		fv.raiseError("Please specify which city you will be departing from.");		

	if (fv.isEmpty("budget"))
		fv.raiseError("Please specify your budget.");		
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;

-->