// JavaScript Document
//nav
$(function(){
		$(".nav>li").each(function(i,o){
				$(this).hover(function(){$("div.subnav",this).slideDown(400);$(this).children("a").addClass("hover");},function(){$("div.subnav",this).slideUp(400);$(this).children("a").removeClass("hover")});
		})
})

//hotgames:all
function AutoScroll(obj){
        $(obj).find("ul:first").animate({
                marginTop:"-=30px"
        },500,function(){
                $(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
        });
}
function menu()
{
	var scrollid = setInterval('AutoScroll("#scrollDiv")',4000);
	$("#scrollDiv").mouseover(function(){
		window.clearInterval(scrollid);
	});
	$("#scrollDiv").mouseout(function(){
		scrollid=setInterval('AutoScroll("#scrollDiv")',4000);
		});
}
$(document).ready(function(){
	menu();
});

//studio
$(function(){
	$("dl.studio").hover(function(){
		$(this).addClass("hover");
	},function(){
		$(this).removeClass("hover");
	});
})


//joinus-delias
/*$(document).ready(function(){  
     $("#job").click(function(){  
          var windowWidth = document.documentElement.clientWidth;     
           var windowHeight = document.documentElement.clientHeight;      
           var popupHeight = $("#topDiv").height();     
           var popupWidth = $("#topDiv").width();      
           //居中显示层  
           $("#topDiv").css({     
             "top": windowHeight/2-popupHeight/2,     
              "left": windowWidth/2-popupWidth/2     
              });   
                
       $("#adivbackground").fadeIn("normal"); 
       $("#topDiv").fadeIn("normal",function(){
           $("#topDiv").css("display","block");
		   var scroller  = null;
		   var scrollbar = null;
		   scroller  = new jsScroller(document.getElementById("Scroller-1"), 580, 186);
  		   scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container"), scroller, false);
           if ($.browser.msie && $.browser.version <= 7)  
               {  
                 $("#adivbackground").css("filter","alpha(opacity=60);");     
               }  
           else{  
                $("#adivbackground").css({  
                "mozOpacity":"0.6",  
                 "opacity":"0.6"  
                 });
              }//end else  
           });  //fadein  
      });//end display top layer  
        
        $("#close").click(function(){  
        $("#topDiv").fadeOut("normal",  function(){  
                $("#topDiv").css("display","none");  
                $("#adivbackground").css("display","none");
              });   
          });//end close  
}) ;*/


//png
function filterPNG(img)
   {
    var arVersion = navigator.appVersion.split("MSIE");
    var version = parseFloat(arVersion[1]);
   if ((version >= 5.5) && (document.body.filters)) 
    { 

     var img = img;
     var imgName = img.src.toUpperCase()
     if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
        {
       var imgID = (img.id) ? "id='" + img.id + "' " : ""
       var imgClass = (img.className) ? "class='" + img.className + "' " : ""
       var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
       var imgStyle = "display:inline-block;" + img.style.cssText
       if (img.align == "left") imgStyle = "float:left;" + imgStyle
       if (img.align == "right") imgStyle = "float:right;" + imgStyle
       if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle     
       var strNewHTML = "<span " + imgID + imgClass + imgTitle
       + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
        + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
       + "(src=\'" + img.src + "\', sizingMethod='crop');\"></span>"
       img.outerHTML = strNewHTML
       i = i-1
        }
    
      }
   }
