		$(function() {
			$('a[href^=http]').click( function() {
				if ($(this).attr("href").indexOf('www.debtreductionservices.org')<0){
					window.open(this.href);
					return false;					
				}
					
			});
	        $('li.ct').hover(function(){
	               $(this).addClass('over');
	        }, function() {
	               $(this).removeClass('over');
	        });
			
			var zIndexNumber = 1000;
			$('div').each(function() {
				$(this).css('zIndex', zIndexNumber);
				zIndexNumber -= 10;
			});
		});


		this.randomtip = function(){
		
			var pause = 4000; // define the pause for each tip (in milliseconds) Feel free to make the pause longer so users can have time to read the tips :)
			var length = $("#testimonial_data li").length;
			var temp = -1;		
		
			this.getRan = function(){
				// get the random number
				var ran = Math.floor(Math.random()*length) + 1;
				return ran;
			};
			this.show = function(){
				var ran = getRan();
				// to avoid repeating tips we need to check 
				while (ran == temp){
					ran = getRan();
				}; 
				temp = ran;
				var test=$("#testimonial_data li:nth-child(" + ran + ") .testimonial").html();
				var auth=$("#testimonial_data li:nth-child(" + ran + ") .author").html();
				$("#testimonial").html('').fadeIn();
				$("#author").html('').fadeIn();
				$("#testimonial").html(test).fadeIn(pause*2);
				$("#author").html(auth).fadeIn(pause*2);
			};
			// initiate the script and also set an interval
			show(); setInterval(show,pause*3);
			
		};
		
		$(document).ready(function(){	
			var id=$("body").attr('id');
			if (id!='srch'){
				randomtip();
			}
		});
	


    var map = null;
    var geocoder = null;

    function initialize(address) {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map-block"));
         geocoder = new GClientGeocoder();
		 showAddress(address);
      }
    }

    function showAddress(address,text) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
	          map.setUIToDefault();
            }
          }
        );
      }
    }
		
