$(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;
			case 'video_testimonial':
				pageTracker._trackEvent('Flash', 'onClick', 'Video Testimonial');
			break;
case 'video_stop':
				pageTracker._trackEvent('Flash', 'onClick', 'Video Stop');
			break;
case 'HQ_Video':
				pageTracker._trackEvent('Flash', 'onClick', 'High Resolution');
			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',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: 'Brisbane (07) 3173 1667,<br/>Level 18, Riverside Centre,<br/>123 Eagle Street,<br/>Brisbane Qld 4000',fixed:true, position: [-170,-20] });
		$('#ald_div').simpletip({content: 'Adelaide (08) 7002 9409,<br/>Level 3, 18 Dequetteville Terrace, Kent Town,<br/>Adelaide SA 5067',fixed:true, position: [-83,-82] });
});

/* 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" || $('#firsthear').val() == "Client Referral") {
	$('p#referee').show();
	$('p#cpny_name').show();
	}
	else{
	$('p#referee').hide();
	$('p#cpny_name').hide();
	}
});
});



function loadLargeTestimonial(){
	var soTestimonial = new SWFObject("http://www.exa.com.au/tv/flash/tv_ad.swf", "large_testimonial_video", "510", "375", "9", "");
	var var_load_img_path;
	if($("a#video_name").attr("rel") == 'hi_res.flv'){
		var_load_img_path = 'http://www.exa.com.au/images/home_page/loading_img.jpg';
	}
	else{
		var_load_img_path = 'http://www.exa.com.au/images/home_page/loading_exa.jpg';
	}
	soTestimonial.addParam("allowFullScreen","true");	
	soTestimonial.addParam("allowScriptAccess","sameDomain");
	soTestimonial.addParam("wmode","transparent");

	soTestimonial.addParam('FlashVars','stageW=590&stageH=380&autoStart=false&autoHide=true&autoHideTime=3&hideLogo=true&volAudio=60&disableMiddleButton=false&playSounds=true&extendVideo=true&videoPath=http://www.exacap.com/ad/flash/'+$("a#video_name").attr("rel")+'&imagePath=http://www.exa.com.au/images/home_page/loading_img.jpg');	
	soTestimonial.write("large_testimonial_video");
}
function unloadLargeTestimonial(){
$('#large_testimonial_video').html("");
}