/*///////////////////// Roll over //////////////////////////////*/
$(function(){
    $(".ro").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"))
    })
})

/*///////////////////// Roll over fade  //////////////////////////////*/
$(document).ready(function(){
	
	$(".ro-f").each(function(){
		var bglink = $(this).attr("src").replace(".gif", "_on.gif");
		$(this).parent().parent().css("background-image","url("+bglink+")");
		
		$(this).hover(function () {
			$(this).stop().fadeTo(200,0);
		},function () {
			$(this).stop().fadeTo(200,1);
		});
	});
});


/*///////////////////// Form-Validate //////////////////////////////*/	
$(document).ready(function() {
	$("#form-host").validate();
});

/*///////////////////// print //////////////////////////////*/
function PrintPage(){
	if(document.getElementById || document.layers){
		window.print();	
	}}

/*///////////////////// Tab Coexistence //////////////////////////////*/
$(function(){
	$("a[href*='#']").filter(function(){
				return !$(this).parent().parent().hasClass("tab");
			}).slideScroll();
		});
		
	// animate to top
	$("#to-top-body").hide();
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#to-top-body').fadeIn();
			} else {
				$('#to-top-body').fadeOut();
			}
		});

		$('#to-top-body').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});
