/***********************************************
* Safe email links
***********************************************/

function hideEmail() {
	var s1 = "info";
			var s2 = "@";
			var s3 = "gocrete.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>");
}

function hideEmail1() {
	var s1 = "info";
			var s2 = "@";
			var s3 = "gocrete.com.au";
			var s4 = "?Subject=Enquiry%20from%20" + s3;
			var s5 = "Click to email us";
			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)) {
         alert("Please enter your Phone number");
         _3_Phone.focus();
         return false;
      }

			if (isEmpty(_4_Fax.value)) {
	        alert("Please enter your Phone number");
	        _4_Fax.focus();
	        return false;
	     }

			if (isEmpty(_5_Enquiries.value)) {
         alert("Please enter your query in the comments field");
         _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;

