$(document).ready(function(){

	var initialEmail = 'Email Address'; var initialPass = 'Password';
	$("#email").val(initialEmail); $("#pass").val(initialPass);
	$("#email").focus(function(){
		var value = $("#email").val();
		if(value == initialEmail){
			$("#email").val('');
		}	
	});
	$("#email").blur(function(){
		var value = $("#email").val();
		if(value == ''){
			$("#email").val(initialEmail);
		}
	});
	$("#pass").focus(function(){
		var value = $("#pass").val();
		if(value == initialPass){
			$("#pass").val('');
		}	
	});
	$("#pass").blur(function(){
		var value = $("#pass").val();
		if(value == ''){
			$("#pass").val(initialPass);
		}
	});
});

function calculateServiceScore(){
		
	var answers = '';
	$("input[type='radio']:checked").each( function(){
		if(this.value > 0)
		answers = answers + this.name;
		else
		answers = answers + '0';
	});
			
	if(answers.length == 3){
	
		$("#error").slideUp("fast");
		$("#result").load('which-service-results', 'answers='+answers, function(){
			$("#result").slideDown("slow");
		});
				
	}else{
				
		$("#error").html("<ul><li>Please answer all questions to continue.</li></ul>");
		$("#error").slideDown("slow");
			
	}
}


function contactMap(target){
	if (GBrowserIsCompatible()) {
         var map = new GMap2(document.getElementById(target));
         var marker = new GMarker(new GLatLng(32.42653033759966, -110.96097214317322));
         var html = '<div style="width:210px; padding-right:10px; line-height:1.3em;">'+
            		'<strong>Strategic Growth Advisors</strong><br />12112 Rancho Vistoso Boulevard<br />Suite A150-115<br />Tucson, Arizona 85737</div>';

         map.setCenter(new GLatLng(32.440305680742025, -110.95927476882935), 13);
         map.addControl(new GSmallMapControl());
         map.addControl(new GHierarchicalMapTypeControl());
         map.addOverlay(marker);
         marker.openInfoWindowHtml(html);
         GEvent.addListener(marker, "click", function() {
    		marker.openInfoWindowHtml(html);
  		});
    }
}


/*------------------------------------------------------------
	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
	
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.
--------------------------------------------------------------*/

//Specify affected tags. Add or remove from list:
var tgs = new Array( 'p','h3','h4');

//Specify spectrum of different font sizes:
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}