/*-------------------------------------------------------------------------*/
function init() {
	var preloaded = new Array();
	function preload_images() {
		for (var i = 0; i < arguments.length; i++){
			preloaded[i] = document.createElement('img');
			preloaded[i].setAttribute('src',arguments[i]);
		};
	};
	preload_images(
		'/favicon.ico',
		'send-button',
		'send-button-over'
	);
}
window.addEvent('domready', init);
/*-------------------------------------------------------------------------*/
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 doInputHovers(){
	inputList = $$('.input_text');
	inputList.each(function(i){
	i.addEvent('mouseover',function(){this.addClass('ie_hover');});
	i.addEvent('mouseout',function(){this.removeClass('ie_hover');});
	i.addEvent('focus',function(){this.removeClass('ie_hover');this.addClass('ie_focus');});
	i.addEvent('blur',function(){this.removeClass('ie_hover');this.removeClass('ie_focus');});
	});
}
window.addEvent('domready', doInputHovers);
/*-------------------------------------------------------------------------*/
function styleFormButtons() {
	var imgPath = "/img/"
	var buttons = new Array(
		"send-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 = "265 Wickham Road";
			var suburb = "Moorabbin";
			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);
/*-------------------------------------------------------------------------*/

var font = {
 src: '/inc/flash/sifr.swf'
 };

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

 sIFR.replace(font, {
 selector: '#content h1'
 ,css: [
	 '.sIFR-root { color: #00AEEF; }'
 ],wmode: 'transparent'
 ,tuneHeight: -4
 });