  google.load("jquery", "1.3.2"); 
  google.setOnLoadCallback(function() {
   
   // Clear the Locator Box
    $('#zipsearch').val('');
    $('#citysearch').val('');	
	$("#dspState option:eq(0)").attr("selected", "selected");
   
   // Search Input
   $('.clearfield').focus(function() {   
     if (this.value == "Enter Search Term") {
       this.value = ''
	 }	 
	 if (this.value == "(optional)") {
       this.value = ''
	 }	 
   });  
   
   // Newletter Zip Input
   $('#newsZipInput').focus(function() {   
     if (this.value == "(optional)") {
       this.value = ''
	 }	 
   });   
   
   $('#dspWhy').click(function() {
     $('#email-why').show();  
   });  
   
   $('#closeWhy').click(function() {
     $('#email-why').hide();  
   });    
      
   $("#smallerText").click(function(){
	 decrease(); // found in textsize.js
	 this.src='/images/layout/franchisedev/frandev-utility-text-size-sm-active.gif';
	 $("#largerText").attr('src','/images/layout/franchisedev/frandev-utility-text-size-lg.gif');
     return false;
   });   
   $("#largerText").click(function(){
	 increase(); // found in textsize.js
	 $("#smallerText").attr('src','/images/layout/franchisedev/frandev-utility-text-size-sm.gif');
	 this.src = '/images/layout/franchisedev/frandev-utility-text-size-lg-active.gif'; 	 
     return false;
   });    
   
    // textsize functions
    // var cookie = parseInt(readCookie(siteID+"_style")); //reads the cookie and extracts the preferred stylesheet's number
	// textsize = (cookie ? cookie : 0); //checks to see if a cookie exists and gives "textsize" the correct value

	// setActiveStyleSheet(stylesheetTitles[textsize]); //sets the preferred stylesheet
   
   if (textsize == 1) { 
     $("#smallerText").attr('src','/images/layout/franchisedev/frandev-utility-text-size-sm.gif');
	 $("#largerText").attr('src','/images/layout/franchisedev/frandev-utility-text-size-lg-active.gif');  
   }
   else {
    $("#smallerText").attr('src','/images/layout/franchisedev/frandev-utility-text-size-sm-active.gif');
    $("#largerText").attr('src','/images/layout/franchisedev/frandev-utility-text-size-lg.gif');
   }
   // end textsize functions
      
   $('#share').change(function() {
    var pageURL = window.location;
    var pageTitle = document.title;
    var selectedBookmark = this.value;
	var gotoURL = '';

    if (selectedBookmark == 'digg') {
      gotoURL='http://digg.com/submit?url='+pageURL+'&title='+pageTitle;
    } 
    else if (selectedBookmark == 'delicious') {
      gotoURL='http://del.icio.us/post?url='+pageURL+'&title='+pageTitle;
  
    } 
    else if (selectedBookmark == 'facebook') {
      gotoURL='http://www.facebook.com/share.php?u='+pageURL;
  
    }		
    else if (selectedBookmark == 'myspace') {
      gotoURL='http://www.myspace.com/Modules/PostTo/Pages/?c='+pageURL+'&t='+pageTitle;
  
    } 	
    else if (selectedBookmark == 'netscape') {
      gotoURL='http://www.netscape.com/submit/?T='+pageURL+'&U=URL'+pageTitle;
  
    } 
    else if (selectedBookmark == 'reddit') {
      gotoURL='http://reddit.com/submit?url='+pageURL+'&title='+pageTitle
  
    }
    else if (selectedBookmark == 'stumble') {
      gotoURL='http://www.stumbleupon.com/submit?url='+pageURL+'&title='+pageTitle;    
  
    }	
    //else if (selectedBookmark == 'yahoo') {
      //gotoURL='http://myweb2.search.yahoo.com/myresults/bookmarklet?t='+pageTitle+'&u='+pageURL+'&ei=UTF-8';   
    //}	
	
	if (gotoURL != '') {
	  window.open(gotoURL);
	}		   
	
   });

  $('#find-city').click(function() {
    $('#dspCity').show();
    $('#dspState').show();
    $('#dspZipCode').hide();
    $('#dspZipCodeText').hide();			

    // Clear the Zip Field
    $('#zipsearch').val('');	
	
	this.className = "tab active";
	$('#find-zip').attr('class',"tab");
	$('#searchLabel').attr('class',"city");
	return false;
  });

  $('#find-zip').click(function() {
    $('#dspCity').hide();
    $('#dspState').hide();
    $('#dspZipCode').show();
    $('#dspZipCodeText').show();			
	
	
    // Clear the City & State Fields
    $('#citysearch').val('');	
	$("#dspState option:eq(0)").attr("selected", "selected");
	
	this.className = "tab active";
	$('#find-city').attr('class',"tab");
	$('#searchLabel').attr('class',"zip");		
	return false;
  });      
         
  });
  
  function checkEmail(emailStr) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailStr)){
	return (true);
    }
    return (false);
  }  
