$(document).ready(function(){					
	$(".qy-h-nav ul ").css({display: "none"}); // Opera Fix
	$(".qy-h-nav li").hover(function(){	
		$(this).closest("li").find("a:first").addClass("on");
		$(this).find('ul').css({visibility: "visible",display: "none"}).show();
	},function(){
		$(this).closest("li").find("a:first").removeClass("on");
		$(this).find('ul').css({visibility: "hidden"});
	})
	
	
	$('.qye-photo li').soChange({
		thumbObj:'.qye-btn li a',
		thumbNowClass:'on',//自定义导航对象当前class为on
		changeTime:4000//自定义切换时间为4s

	});
	$('.qys-content li').soChange({
		thumbObj:'.qys-tabs a',
		slideTime:0,
		thumbNowClass:'on',
		thumbOverEvent:true,
		autoChange:false//自动切换为 false，默认为true
	});
	
	$('.case-detail-box li').soChange({
		thumbNowClass:'on',//自定义导航对象当前class为on
		thumbObj:'.case-detail-tabs img',//导航图标
		botPrev:'.a_last',
		botNext:'.a_next'
	});
	
	
	$(".sethomepage").click(function(){						 
        var url = this.href;
        try {
            this.style.behavior = "url(#default#homepage)";
            this.setHomePage(url);
        } catch (e) {
            if (window.netscape) {
                try {
                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                } catch (e) {
                    alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
                    return false;
                }
                var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
                prefs.setCharPref('browser.startup.homepage',url);
            }
        }
        return false;
    });
	
});
function bookmarkit(){  
	var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL'; 
	if (document.all){ 
		window.external.addFavorite('http://www.chinyiad.com/','上海秦艺广告有限公司'); 
	}else if (window.sidebar){ 
		window.sidebar.addPanel('上海秦艺广告有限公司', 'http://www.chinyiad.com/', ""); 
	}else { 
	   alert('您可以尝试通过快捷键' + ctrl + ' + D 加入到收藏夹~'); 
	} 
} 

