// code for rollover images
function MouseOver(imgName) {
	if(document.images) {
		// get the image type
		suffixType = imgName.src.substring(imgName.src.lastIndexOf("."),imgName.src.length);
		
		// swap to new image
		if (imgName.src.indexOf("_over") == -1) {
			imgName.src = imgName.src.substring(0,(imgName.src.indexOf(suffixType))) + "_over" + suffixType;
		}
	}
}

function MouseOut(imgName) {
	if(document.images) {
		// get the image type
		suffixType = imgName.src.substring(imgName.src.lastIndexOf("."),imgName.src.length);
		
		// swap image back to original
		if (imgName.src.indexOf("_over") != -1) {
			imgName.src = imgName.src.substring(0,(imgName.src.indexOf("_over"))) + suffixType;
		}
	}
}

// code to open browser window
function popWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}


// code to mask emails
function maskMail(contact,domain) { 
  var linktext = contact+"@"+domain;
  document.write("<a class=linkwhite href="+"m"+"a"+"i"+"l"+"t"+"o"+":"+contact+"@"+domain+">"+linktext+"</a>")
}


// code to email the page
function mailFriend(){
var sSubject = 'Collins Plant Hire';
var sBody    = 'Hi,\nI found this webpage and I thought it might interest you\n' + location.href;
var sDisplay = 'Email page';
document.write(
    '<a href="mailto:?subject=' +
    escape(sSubject) + '&body=' + escape(sBody) +
    '" class="linkgrey">' + sDisplay + '</a>'
    )
}

// add the bookmark
function addBookmark(){
if (document.all)
window.external.AddFavorite(location.href,document.title)
}

// print the window
function printWindow(){
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}