//anchor links
$(function(){
    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 500);
                return false;
            }
        }
    });
});


//img rollover
$(function(){
	$(".rollover a img , a.rollover img , img.rollover , input.rollover , .rollover input").mouseover(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
	}).mouseout(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
	}).each(function(){
		$("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
	})
});


//externalLinks
$(function(){
  $('a.blank').click(function(){
    window.open(this.href);
    return false;
  })
});


//jquery.textresizer.js settings
$(function(){
	$("#change_size ul li a").textresizer({
	     target: "#wrapper,#globalfooter,#popwin",
		 type: "cssClass",
		 sizes: [ 
            "small", 
            "medium", 
            "large", 
         ],
		 selectedIndex: 1
	});
	$('.useHeightLine #change_size ul li a').click(function() {
		  location.reload();
	});
});
