//Global Variables
var loadedobjects=""


/***********************************************
* Safe email links
***********************************************/
function hideEmail() {
	var s1 = "sales";
	var s2 = "@";
	var s3 = "unleashed.net.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>");
}

	
/***********************************************
* Dropdown Fix for IE
***********************************************/
sfHover = function() {
	var sfEls = document.getElementById("search").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);



/***********************************************
* Equal Div height script
***********************************************/
//<!--
function equalColumns(){
	var l = document.getElementById('left-contents');
	var r = document.getElementById('right-contents');
            
		r.offsetHeight >= l.offsetHeight ? l.style.height = r.offsetHeight + "px" : r.style.height = l.offsetHeight + "px";
	}
//-->


/***********************************************
* 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;


/***********************************************
* Popup URL Script
***********************************************/
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


/***********************************************
* Loads Objects into an Ajax page
***********************************************/
function loadobjs(){
//if (document.getElementById)
	//return
	for (i=0; i<arguments.length; i++){
		var file=arguments[i]
		var fileref=""
		if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
			if (file.indexOf(".js")!=-1){ //If object is a js file
				fileref=document.createElement('script')
				fileref.setAttribute("type","text/javascript");
				fileref.setAttribute("src", file);
			}
			else if (file.indexOf(".css")!=-1){ //If object is a css file
				fileref=document.createElement("link")
				fileref.setAttribute("rel", "stylesheet");
				fileref.setAttribute("type", "text/css");
				fileref.setAttribute("href", file);
			}
		}
		if (fileref!=""){
			document.getElementsByTagName("head").item(0).appendChild(fileref)
			loadedobjects+=file+" " //Remember this object as being already added to page
		}
	}
}



/***********************************************
* 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";
}
//-->

