$(document).ready(function(){
						   
	$.fn.hoverClass = function(c) {
		return this.each(function(){							  
			$(this).hover( 					  
				function() { $(this).addClass(c);  },
				function() { $(this).removeClass(c); }				
			);
		});
	};
	
	jQuery.fn.fadeToggle = function(speed, easing, callback) {
	   return this.animate({opacity: 'toggle'}, speed, easing, callback);
	
	}; 
	
	$("div.gg_btn a").click(function() {
		$("div.gg_translate").fadeToggle(250);
	})
	
	resizeFontACC('10px','12px','14px');
	
	// right boxes and tabs
	if($("#tabs").length > 0) {
		$(function() { 
			$("#tabs").tabs("#tabPanes > div", { effect: 'fade' });
		});
	}
		
	if($("#mnv li").length > 0) {
		$("#mnv li").hover(							   
			function(){ $("ul", this).fadeIn("fast"); }, 
			function() { }			
		);
		if (document.all) {		
			$("#mnv li").hoverClass("act");		
		}
	}
	 
	 $(function() {
		var imgWrapper = $('.slideshow > a');
		// only show the first image, hide the rest
		imgWrapper.hide().filter(':first').show();
			
		$('ul.recentlist li a').click(function () {
			
			// check if this item doesn't have class "current"
			// if it has class "current" it must not execute the script again
			if (this.className.indexOf('current') == -1){
				imgWrapper.hide();
				imgWrapper.filter(this.hash).fadeIn(500);
				$('ul.recentlist li a').removeClass('current');
				$(this).addClass('current');
			}
			return false;
		});
	});
	 
	if($('#nws_wr').length > 0) {
		$('#nws_wr').cycle({ 
			fx:     'scrollUp', 
			speed:   600, 
			timeout: 7000,
			pause:   7
		});
	}
	
	if($("a.fancybox").length > 0) {
		$("a.fancybox").fancybox({
			'overlayOpacity': .8,
			'zoomSpeedIn'	: 600,
			'zoomSpeedOut'	: 500,
			'easingIn'		: 'easeOutBack',
			'easingOut'		: 'easeInBack',
			'hideOnContentClick' : false,
			'frameWidth' : 600,
			'frameHeight' : 495,
			'centerOnScroll' : true	
		});
	}
	
	// SITEMAP TOOGLER
	if($("li.sm_trigger").length > 0) {
		$(".sm_container").hide();	
		$("li.sm_trigger").toggle(function(){
			$(this).addClass("act"); 
			}, function () {
			$(this).removeClass("act");
		});		
		$("li.sm_trigger").click(function(){
			$(this).next(".sm_container").slideToggle("slow,");
		});
	}	
});

function printpage() {
	window.print();
}

function mailpage() {
	mail_str = "mailto:?subject= Check out the " + document.title;
	mail_str += "&body= I recommend this page " + document.title;
	mail_str += ". You can view it by clicking this link, " + location.href; 
	location.href = mail_str;
}

/* Modified To support Opera */
function cmd_bookmark(title,url) {	
	if (window.sidebar) {// firefox    
		window.sidebar.addPanel(title, url, "");	
	} else if(window.opera && window.print) { // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} else if(document.all) {// ie
		window.external.AddFavorite(url, title);
	}	
}