/**
 * Initialize
 */ 
$(document).ready(function(){
    PCG.init();
    
/******************************************************/
});

/**
 * PCG NameSpace
 */
 
var pcgurl;
 
var PCG = window.PCG || 
{
    init: function() 
    {        
        this.cycle_init();
        this.menu_init();
        this.msgbanner_init();
    },
    
    cycle_init: function (id) {
    	$('#msgbanner').cycle({
             fx: 'fade',
             speed: 2000
             });    
		$('#banner').cycle({
			pause: 1,
			fx: 'scrollUp',
			speed: 900,
			timeout: 8500,
			height: 166,
            autostop: 1,
			autostopCount: 8
			/*pager: '#productsbox',
			pagerAnchorBuilder: function(idx, slide) {
				return '#productsbox a:eq(' + (idx) + ')'; 
			},
			pagerEvent: 'mouseover'*/
		});
	},
	
	menu_init: function()
	{
		$("#menucontent ul").removeClass("nj");
		$("#menucontent ul li").hover(
			function () {
				$(this).addClass("hovering");
				$(this).find(".dropdown_menu").show();
			},
			function () {
				$(this).find(".dropdown_menu").hide();
				$(this).removeClass("hovering");
			}
		);
		$(".rel").hover(
		    function () {
				$("#menucontent ul li a.main").addClass("hovering");
			},
			function () {
				$("#menucontent ul li a.main").removeClass("hovering");
			}
		);
	},
	msgbanner_init: function() 
	{
		 $("#msgbutton li a").mouseover(
	        function(){
		        $("#msgbanner a img").hide().attr({"src": $(this).attr("banner")});
	        });
		 $("#msgbanner a img").load(
			function(){
				$("#msgbanner a img:hidden").fadeIn("slow");
			});
	}
};