﻿//javascript:AddFavorite(window.location,document.title);

function AddFavorite(sURL, sTitle) {   
    try {   
        window.external.addFavorite(sURL, sTitle);   
    } catch (e) {   
        try {   
            window.sidebar.addPanel(sTitle, sURL, "");   
        } catch (e) {   
            alert("加入收藏失败，请使用Ctrl+D进行添加");   
        }   
    }   
}  
//SetHome(this,window.location);
function SetHome(obj,vrl){
        try{
                obj.style.behavior='url(#default#homepage)';
				obj.setHomePage(vrl);
        }
        catch(e){
                if(window.netscape) {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                        }
                        catch (e) {
                                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
                        }
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',vrl);
                 }
        }
}

function tab(c,show,type){
	
 $(c).bind(type,function(){
   var num=$(this).index();
   $(this).addClass('cur').siblings().removeClass('cur');
   $(show).eq(num).show().siblings(show).hide();
 })
}

//眉部篇js
function DY_scroll(wraper,prev,next,img,speed,or)
	{	
		var wraper = $(wraper);
		var prev = $(prev);
		var next = $(next);
		var img = $(img).find('ul');
		var w = img.find('li').outerWidth(true);
		var s = speed;
		next.click(function()
							{
								img.animate({'margin-left':-w},function()
																		{
																			img.find('li').eq(0).appendTo(img);
																			img.css({'margin-left':0});
																			});
								});
		prev.click(function()
							{
								img.find('li:last').prependTo(img);
								img.css({'margin-left':-w});
								img.animate({'margin-left':0});
								});
		if (or == true)
		{
			ad = setInterval(function() { next.click();},s*3300);
			wraper.hover(function(){clearInterval(ad);},function(){ad = setInterval(function() { next.click();},s*3300);});
		}
	}
$(document).ready(function(){	

 DY_scroll('.img-scroll','.prev','.next','.img-list',3,true);// true为自动播放，不加此参数或false就默认不自动
})	
//唇漾篇js
function DY_scrolla(wrapera,preva,nexta,imga,speed,or)
	{	
		var wrapera = $(wrapera);
		var preva = $(preva);
		var nexta = $(nexta);
		var imga = $(imga).find('ul');
		var w = imga.find('li').outerWidth(true);
		var s = speed;
		nexta.click(function()
							{
								imga.animate({'margin-left':-w},function()
																		{
																			imga.find('li').eq(0).appendTo(imga);
																			imga.css({'margin-left':0});
																			});
								});
		preva.click(function()
							{
								imga.find('li:last').prependTo(imga);
								imga.css({'margin-left':-w});
								imga.animate({'margin-left':0});
								});
		if (or == true)
		{
			ad = setInterval(function() { nexta.click();},s*3300);
			wrapera.hover(function(){clearInterval(ad);},function(){ad = setInterval(function() { nexta.click();},s*3300);});
		}
	}


$(document).ready(function(){	
 tab('#custom li','.txdzs','click');
 DY_scrolla('.img-scrolla','.preva','.nexta','.img-lista',3,true);// true为自动播放，不加此参数或false就默认不自动
})

//乳晕篇js
function DY_scrollb(wraperb,prevb,nextb,imgb,speed,or)
	{	
		var wraperb = $(wraperb);
		var prevb = $(prevb);
		var nextb = $(nextb);
		var imgb = $(imgb).find('ul');
		var w = imgb.find('li').outerWidth(true);
		var s = speed;
		nextb.click(function()
							{
								imgb.animate({'margin-left':-w},function()
																		{
																			imgb.find('li').eq(0).appendTo(imgb);
																			imgb.css({'margin-left':0});
																			});
								});
		prevb.click(function()
							{
								imgb.find('li:last').prependTo(imgb);
								imgb.css({'margin-left':-w});
								imgb.animate({'margin-left':0});
								});
		if (or == true)
		{
			ad = setInterval(function() { nextb.click();},s*3300);
			wraperb.hover(function(){clearInterval(ad);},function(){ad = setInterval(function() { nextb.click();},s*3300);});
		}
	}


$(document).ready(function(){	
 tab('#custom li','.txdzs','click');
 DY_scrollb('.img-scrollb','.prevb','.nextb','.img-listb',3,true);// true为自动播放，不加此参数或false就默认不自动
})	