
//////////////////////////////////////////////////

function RotCap()
{
var t = new Date();
document.getElementById('capt').src='aspcaptcha.asp?t=' + t.valueOf();
}

//////////////////////////////////////////////////
/*
 * Create email adresses
 * Used instead of mailto: for preventing spam
 */
 
sendMail = function(user,domain) {
	try {
		locationstring = "mailto:" + user + "@" + domain; 
		window.location = locationstring; 
	}
	catch(error) {
		errorMessage(error, "There was an error when trying to send mail to:\n\n"+user+"@"+domain);
		return false;
	}
}

//////////////////////////////////////////////////
/*
 * POPUP FUNCTIONS
 */

// Open Centered Popup

openCenteredPopup = function(mypage,w,h,scroll,resizable) {
	var win = null;

	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resizable+'';
	
	win = window.open(mypage,"centerpopup",settings)
	win.focus();
}

// Open Popup 

openPopup = function(mypage,w,h,scroll,resizable,Lpos,Tpos) {
	var win = null;
	
	settings = 'height='+h+',width='+w+',top='+Tpos+',left='+Lpos+',scrollbars='+scroll+',resizable='+resizable+'';
	
	win = window.open(mypage,"popUp",settings)
	win.focus();
}


//////////////////////////////////////////////////
/*
 * VALIDATE FORM
 */

// subscribe

//////////////////////////////////////////////////

// Form Field checker - Contact


function Validate(objForm)
{
	if (objForm.txtName.value == "")
	{
		window.alert("Name is a required Field");
		objForm.txtName.focus();
		return false;
	}
	
	
	if (objForm.txtEmail.value == "")
	{
		window.alert("Email Address is a required Field");
		objForm.txtEmail.focus();
		return false;
	}

	if (objForm.txtEmail.value.indexOf("@", 0) == -1 || (objForm.txtEmail.value.indexOf("@", 0) != objForm.txtEmail.value.lastIndexOf("@", (objForm.txtEmail.value.length - 1))) || objForm.txtEmail.value.indexOf(".", 0) == -1)
	{
		window.alert("Email Address must be a valid Email Address");
		objForm.txtEmail.focus();
		return false;
	}

	return true;
}

// -->

//////////////////////////////////////////////////
/*
 * VALIDATE FORM
 */

// enquiry

function ValidateFriend(objForm)
{
	if (objForm.C_Name.value == "")
	{
		window.alert("Name is a required Field!");
		objForm.C_Name.focus();
		return false;
	}

	if (objForm.C_Email.value == "")
	{
		window.alert("Email Address is a required Field!");
		objForm.C_Email.focus();
		return false;
	}

	if (objForm.C_Email.value.indexOf("@", 0) == -1 || (objForm.C_Email.value.indexOf("@", 0) != objForm.C_Email.value.lastIndexOf("@", (objForm.C_Email.value.length - 1))) || objForm.C_Email.value.indexOf(".", 0) == -1)
	{
		window.alert("Email Address must be a valid Email Address!");
		objForm.C_Email.focus();
		return false;
	}

	if (objForm.C_Enquiry.value == "")
		{
			window.alert("Please fill out your enquiry.");
			objForm.C_Enquiry.focus();
			return false;
	}

	return true;
}
// -->

// Show Hide Div

function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()
//Netscape check
function showHide(div,nest){
	obj=bw.dom?document.getElementById("pnl_" + div).style:bw.ie4?document.all["pnl_" + div].style:bw.ns4?nest?document[nest].document["pnl_" + div]  : document["pnl_" + div]:0;
	
	var objImg= document.getElementById("img_" + div);
	
	if (obj.visibility == 'visible' || obj.visibility == 'show') 
	{
		obj.visibility = 'hidden';
		obj.display = 'none';
		
		if (typeof(objImg) == "object")
		{
			objImg.src = "images/on.gif";
		}
	}
	else 
	{
		obj.visibility = 'visible';
		obj.display = '';
		
		if (typeof(objImg) == "object")
		{
			objImg.src = "images/off.gif";
		}
	}
}

//Shows the div
function show(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
	obj.visibility='visible'
	obj.display='';

}
//Hides the div
function hide(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
	obj.visibility='hidden'
	obj.display='none';

}



