/*-------------------------------------------------------------------------*/
function generateEmailLink(n,d) {
	var username = n;
	var hostname = d;
	var linktext = n+"@"+d;
	document.write("<a hr"+"ef=" + "mai"+"l" + "to:" + username +
	"@" + hostname + ">" + linktext + "</"+"a>")
}
/*-------------------------------------------------------------------------*/
function styleFormButtons() {
	var imgPath = "/img/"
	var buttons = new Array("submit-button", "continue-browsing-button", "submit-enquiry-button");
	var i=0;
	for(i==0;i<buttons.length;i++){
		var b=$(buttons[i]);
		if(b){
			b.addEvent('mouseover',function(){this.src=imgPath+this.id+'-over.gif'});
			b.addEvent('mouseout',function(){this.src=imgPath+this.id+'.gif'});
		}
	}	
}
window.addEvent('load', styleFormButtons);
/*-------------------------------------------------------------------------*/
function googleMap() {
	var mapExists = $('map');
	if(mapExists){
		if (GBrowserIsCompatible()) {
			var map = new GMap2($("map"));
			var geocoder = new GClientGeocoder();
			var street_address = "155 Barkly Avenue";
			var suburb = "Burnley";
			var state = "VIC";
			var address = street_address+", "+suburb+", "+state+", Australia";
			if (geocoder) {
				geocoder.getLatLng(
				address,
					function(point) {
						if (!point) {
							alert(address + " not found");
						} 
						else {
							map.setCenter(point, 10);
							var marker = new GMarker(point);
							map.addOverlay(marker);
							map.addControl(new GSmallMapControl());
						}
					}
				);
			}
		}
	}
}
window.addEvent('domready', googleMap);
/*-------------------------------------------------------------------------*/
function removeCopy(){
 var m = $('map');
 if(m){
 var childDivs = m.getChildren();
 childDivs[1].style.display ="none";
 }
}
window.addEvent('load', removeCopy);
/*-------------------------------------------------------------------------*/
function shuffle ( myArray ) {
  var i = myArray.length;
  if ( i == 0 ) return false;
  while ( --i ) {
     var j = Math.floor( Math.random() * ( i + 1 ) );
     var tempi = myArray[i];
     var tempj = myArray[j];
     myArray[i] = tempj;
     myArray[j] = tempi;
   }
}
function homeFlash(){			
			var list = new Array();
			var order = [1,2,3,4,5,6,7,8];
			shuffle(order);
			// loop over 5 times
			for(var i=0;i<5;i++){
			
			// random number between 1 and 8
			var randomnumber=order.pop();
			
			// add number to path
			var path = 'inc/flash/'+randomnumber+'.jpg'
			// add to array
			list.push(path);
			
			}
			var flashvars = {
				files: list
			};

			var params = {};
			var attributes = {};
			
			swfobject.embedSWF("/inc/flash/framework.swf", "feature", "950", "255", "9.0.0","expressInstall.swf", flashvars, params, attributes);
}
window.addEvent('load', homeFlash);
/*-------------------------------------------------------------------------*/
var font = {
 src: '/inc/flash/sifr.swf'
 };

 sIFR.useStyleCheck = true;
 sIFR.activate(font);

 sIFR.replace(font, {
 selector: '#conpro-caption p'
 ,css: [
	 '.sIFR-root { color: #1434da; text-transform: none; leading: 10; letter-spacing: -1; }'
 ],wmode: 'transparent'
 ,tuneHeight: -4
 });
 
 sIFR.replace(font, {
 selector: 'body .col h2'
 ,css: [
	 '.sIFR-root { color: #656565; text-transform: uppercase; letter-spacing: -1; }'
 ],wmode: 'transparent'
 ,tuneHeight: -4
 });
 
 sIFR.replace(font, {
 selector: '#sub-right-header h2'
 ,css: [
	 '.sIFR-root { color: #ffffff; text-transform: uppercase; letter-spacing: -1; }'
 ],wmode: 'transparent'
 ,tuneHeight: -4
 });
 
 sIFR.replace(font, {
 selector: '#feature-text h2'
 ,css: [
	 '.sIFR-root { color: #ffffff; text-transform: none; letter-spacing: -1; }'
 ],wmode: 'transparent'
 ,tuneHeight: -4
 });
 
 sIFR.replace(font, {
 selector: '#right-cont h2'
 ,css: [
	 '.sIFR-root { color: #656565; text-transform: uppercase; letter-spacing: -1; }'
 ],wmode: 'transparent'
 ,tuneHeight: -4
 });
 
 sIFR.replace(font, {
 selector: '#content h1'
 ,css: [
	 '.sIFR-root { color: #1434da; text-transform: uppercase; letter-spacing: -1; }'
 ],wmode: 'transparent'
 ,tuneHeight: -4
 });

 sIFR.replace(font, {
 selector: '#content h2'
 ,css: [
	 '.sIFR-root { color: #797979; text-transform: uppercase; letter-spacing: -1; }'
 ],wmode: 'transparent'
 ,tuneHeight: -4
 });