$(document).ready(function() {
		$('#footer_search').focus(function() {	
			if($("#footer_search").val() == "search")	{
			$("#footer_search").val("");
			}
		});
		$('#footer_search').blur(function() {
			if($("#footer_search").val() == "")	{
			$("#footer_search").val("search");
			}
		});
});

	function flashevent(objEvent)
	{
		switch(objEvent)
		{
			case 'online_marketing':
				pageTracker._trackEvent('Flash', 'onClick', 'Online Marketing');
			break;
			case 'web_design':
				pageTracker._trackEvent('Flash', 'onClick', 'Web Design');
			break;
			case 'ecommerce':
				pageTracker._trackEvent('Flash', 'onClick', 'E-Commerce');
			break;
			case 'seo':
				pageTracker._trackEvent('Flash', 'onClick', 'SEO');
			break;
			case 'web':
				pageTracker._trackEvent('Flash', 'onClick', 'Web');
			break;
			case 'email_marketing':
				pageTracker._trackEvent('Flash', 'onClick', 'Email Marketing');
			break;
		}
	}

function popitup(url) 
	{var newwindow = '';
		if (newwindow.location && !newwindow.closed) 
		{ newwindow.location.href = url; newwindow.focus(); } 
		else 
		{ newwindow=window.open(url,'call_now','menubar=0,resizable=0,location=0,status=0,scrollbars=0,width=606,height=440') ; }
	}


$(document).ready(function() {
     $('#perth_div').simpletip({content: 'Perth (08) 7221 2888,<br/>Level 3, 1060 Hay St,<br/>West Perth, WA 6005',fixed:true, position: [-30,-54]});
		$('#melb_div').simpletip({content: 'Melbourne (03) 9889 6888,<br/>1186 Toorak Road,<br/>Camberwell VIC 3124,<br/>Australia',fixed:true, position: [-135,-71] });
		$('#sydney_div').simpletip({content: 'Sydney (02) 8004 1999,<br/>Level 39, 2 Park Street,<br/>Sydney, NSW 2000',fixed:true, position: [-170,-76] });
		$('#gold_div').simpletip({content: 'Gold Coast (07) 5538 8319,<br/>37 Bundall Rd,<br/>Surfers Paradise, QLD 4217',fixed:true, position: [-170,-20] });
});

/* Show hide functionality for sitemap page */
$(document).ready(function(){
	$('div.sub_items').css({'display' : 'none'});
	$('img[class="expand_alert"]').click(function(event) {
		var img_id = this.id;
		if($('#alert_div_'+img_id).css('display') == 'none'){
			$('div.sub_items').css({'display' : 'none'});
			$('img[src="../images/grey_minus_new.gif"]').attr({ 
				src: "../images/grey_plus_new.gif"
			});
		}
		$('#alert_div_'+img_id).toggle(200);
		var img_src = $("#"+img_id).attr("src");
		if(img_src.indexOf("grey_minus_new.gif") > 0){
			$("#"+img_id).attr({ 
				src: "../images/grey_plus_new.gif"
			});
		}else{
			$("#"+img_id).attr({ 
				src: "../images/grey_minus_new.gif"
			});
		}
		return false;
	});
});
$(document).ready(function(){
		$("input[@type=text]").focus(function(){
		$(this).addClass("formfield_focus");
		$(this).removeClass("formfield_blur");
		});
		$("textarea").focus(function(){
		$(this).addClass("formfield_focus");
		$(this).removeClass("formfield_blur");
		});
		
		$("input[@id=footer_search]").focus(function(){
		$(this).addClass("search_border");
		});
		$("input[@id=footer_search]").blur(function(){
		$(this).addClass("search_border");
		});
		$("input[@type=text]").blur(function(){
		$(this).addClass("formfield_blur");
		$(this).removeClass("formfield_focus");
		});
		$("textarea").blur(function(){
		$(this).addClass("formfield_blur");
		$(this).removeClass("formfield_focus");
		});
});
$(document).ready(function(){	
$('#firsthear').change(function() {
	if ($('#firsthear').val() == "Word of Mouth") {
	$('p#referee').show();
	$('p#cpny_name').show();
	}
	else{
	$('p#referee').hide();
	$('p#cpny_name').hide();
	}
});
});


