//opens a new window for links with rel=external or class=pdf
$(document).ready(function() {
$("a[@rel='external'], a[@class='pdf'], a[@class='external'").click(function() {
return !window.open($(this).attr("href"));
});
});

//slides the toolbox open when the tabs are clicked and switches out the up and down arrows
$(document).ready(function(){
	$("#mytoolbox").hide();  
	$("#tooltab-my a").click(function(){
		$("#mytoolbox").slideToggle("slow")
	}).toggle(
		function(){
			$("#myArrow").attr("src","img/arrow-up.gif")
		},
		function(){
			$("#myArrow").attr("src","img/arrow-down.gif")
		}
	);
	
});

$(document).ready(function(){
	$("#toolbox").hide();  
	$("#tooltab-news a").click(function(){
		$("#toolbox").slideToggle("slow")
	}).toggle(
		function(){
			$("#newsArrow").attr("src","img/arrow-up.gif")
		},
		function(){
			$("#newsArrow").attr("src","img/arrow-down.gif")
		}
	);
	
});

$(document).ready(function(){
	$("#mailbox").hide();  
	$("#tooltab-mail a").click(function(){
		$("#mailbox").slideToggle("slow")
	}).toggle(
		function(){
			$("#mailArrow").attr("src","img/arrow-up.gif")
		},
		function(){
			$("#mailArrow").attr("src","img/arrow-down.gif")
		}
	);
	
});

//watermark for the input box--zeroes out the default text inside the input box if user clicks inside it
$(document).ready(function()
    {
        swapValues=[];
        $(".swap_value").each(
            function(i){
                swapValues[i]=$(this).val();
                $(this).focus(function()
                    {
                        if($(this).val()==swapValues[i])
                        {
                            $(this).val("")
                        }
                    }
                ).blur(function()
                    {
                        if($.trim($(this).val())=="")
                            {
                                $(this).val(swapValues[i])
                            }
                     }
                 )
            }
      )
  }
);