/***********************************************
* Safe email links
***********************************************/

function hideEmail() {
	var s1 = "info";
			var s2 = "@";
			var s3 = "argosee.com.au";
			var s4 = "?Subject=Enquiry%20from%20" + s3;
			var s5 = s1 + s2 + s3;
			document.write("<a href=" + "mail" + "to:" + s1 + s2 + s3 + s4 + ">" + s5 + "</a>");
}



/***********************************************
* Form fields Validation Script
***********************************************/

function ValidateForm(f){

	with(f){
		if (isEmpty(_1_Name.value)) {alert("Please enter your Name");_1_Name.focus();return false;}
		if (isEmpty(_2_Email_From.value)) {alert("Please enter your Email Address");_2_Email_From.focus();return false;}
		if ( !isEmail(_2_Email_From.value) ) {alert("Please enter a valid Email Address."); _2_Email_From.focus();return false;}
		if (!isEmpty(_3_Phone.value)) {if (!IsNumber(_3_Phone.value, true)) {alert("Please enter only numbers for your Phone");_3_Phone.focus();return false;}}
		if (!isEmpty(_4_Fax.value)) {if (!IsNumber(_4_Fax.value, true)) {alert("Please enter only numbers for your Fax");_4_Fax.focus();return false;}}
		if (isEmpty(_5_Enquiries.value)) {alert("Please enter your Enquiry");_5_Enquiries.focus();return false;}
	}
	return true;
 }


/***********************************************
* Calling external link instead of target="_blank"
***********************************************/

function externalLinks() { 

if (!document.getElementsByTagName) return; 

var anchors = document.getElementsByTagName("a"); 
for (var i=0; i<anchors.length; i++) { 
var anchor = anchors[i]; 
var relvalue = anchor.getAttribute("rel");

if (anchor.getAttribute("href")) {
var external = /external/;
var relvalue = anchor.getAttribute("rel");
if (external.test(relvalue)) { anchor.target = "_blank"; }
} 
}
} 
window.onload = externalLinks;


/***********************************************
* Dropdown Fix for IE
***********************************************/

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



/***********************************************
* ShowandHide Script
***********************************************/

//<!--
function viewinfo(id) {
	box = document.getElementById(id);
	box.className = "visible";

	//Now hide all other divs that are visible
	var oDivs = document.getElementsByTagName("div")

	for (var i=0; i<oDivs.length; i++)
		if (oDivs[i].className=="visible" && oDivs[i].id != id)
			oDivs[i].className = "hidden";
}
//-->

