﻿///////////////////////////////////////////////////////////////jQ LoadIMGFilter PLUGIN Load ////////////////////////
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){$.J.L=5(r){8 1={d:0,A:0,b:"h",v:"N",3:4};6(r){$.D(1,r)}8 m=9;6("h"==1.b){$(1.3).p("h",5(b){8 C=0;m.t(5(){6(!$.k(9,1)&&!$.l(9,1)){$(9).z("o")}j{6(C++>1.A){g B}}});8 w=$.M(m,5(f){g!f.e});m=$(w)})}g 9.t(5(){8 2=9;$(2).c("s",$(2).c("i"));6("h"!=1.b||$.k(2,1)||$.l(2,1)){6(1.u){$(2).c("i",1.u)}j{$(2).K("i")}2.e=B}j{2.e=x}$(2).T("o",5(){6(!9.e){$("<V />").p("X",5(){$(2).Y().c("i",$(2).c("s"))[1.v](1.Z);2.e=x}).c("i",$(2).c("s"))}});6("h"!=1.b){$(2).p(1.b,5(b){6(!2.e){$(2).z("o")}})}})};$.k=5(f,1){6(1.3===E||1.3===4){8 7=$(4).F()+$(4).O()}j{8 7=$(1.3).n().G+$(1.3).F()}g 7<=$(f).n().G-1.d};$.l=5(f,1){6(1.3===E||1.3===4){8 7=$(4).I()+$(4).U()}j{8 7=$(1.3).n().q+$(1.3).I()}g 7<=$(f).n().q-1.d};$.D($.P[\':\'],{"Q-H-7":"$.k(a, {d : 0, 3: 4})","R-H-7":"!$.k(a, {d : 0, 3: 4})","S-y-7":"$.l(a, {d : 0, 3: 4})","q-y-7":"!$.l(a, {d : 0, 3: 4})"})})(W);',62,62,'|settings|self|container|window|function|if|fold|var|this||event|attr|threshold|loaded|element|return|scroll|src|else|belowthefold|rightoffold|elements|offset|appear|bind|left|options|original|each|placeholder|effect|temp|true|of|trigger|failurelimit|false|counter|extend|undefined|height|top|the|width|fn|removeAttr|lazyload|grep|show|scrollTop|expr|below|above|right|one|scrollLeft|img|jQuery|load|hide|effectspeed'.split('|'),0,{}))
////jQuery(document).ready(function($){$("img").lazyload({placeholder : "/themes/Sean_Taobao/source/grey.gif",effect: "fadeIn"})});
///////////////////////////////////////////////////////////////jQ LoadIMGFilter PLUGIN Load END////////////////////////
(function(c){c.expr[':'].linkingToImage=function(a,g,e){return!!(c(a).attr(e[3])&&c(a).attr(e[3]).match(/\.(gif|jpe?g|png|bmp)$/i))};c.fn.imgPreview=function(j){var b=c.extend({imgCSS:{},distanceFromCursor:{top:10,left:10},preloadImages:true,onShow:function(){},onHide:function(){},onLoad:function(){},containerID:'imgPreviewContainer',containerLoadingClass:'loading',thumbPrefix:'',srcAttr:'href'},j),d=c('<div/>').attr('id',b.containerID).append('<img/>').hide().css('position','absolute').appendTo('body'),f=c('img',d).css(b.imgCSS),h=this.filter(':linkingToImage('+b.srcAttr+')');function i(a){return a.replace(/(\/?)([^\/]+)$/,'$1'+b.thumbPrefix+'$2')}if(b.preloadImages){(function(a){var g=new Image(),e=arguments.callee;g.src=i(c(h[a]).attr(b.srcAttr));g.onload=function(){h[a+1]&&e(a+1)}})(0)}h.mousemove(function(a){d.css({top:a.pageY+b.distanceFromCursor.top+'px',left:a.pageX+b.distanceFromCursor.left+'px'})}).hover(function(){var a=this;d.addClass(b.containerLoadingClass).show();f.load(function(){d.removeClass(b.containerLoadingClass);f.show();b.onLoad.call(f[0],a)}).attr('src',i(c(a).attr(b.srcAttr)));b.onShow.call(d[0],a)},function(){d.hide();f.unbind('load').attr('src','').hide();b.onHide.call(d[0],this)});return this}})(jQuery);

function cur(ele){ 
	$(ele).addClass("choose").siblings().removeClass("choose"); 
} 

function tab(id_tab,tag_tab,id_con,tag_con,act){ 
	$(id_tab).find(tag_tab).eq(0).addClass("choose"); 
	$(id_con).find(tag_con).eq(0).show().siblings(tag_con).hide(); 
	if(!act){ act="click"}; 
	if(act=="click"){ 
	$(id_tab).find(tag_tab).each(function(i){ 
	$(id_tab).find(tag_tab).eq(i).click(function(){ 
	cur(this); 
	$(id_con).find(tag_con).eq(i).show().siblings(tag_con).hide();})}) 
} if(act=="mouseover"){ 
	$(id_tab).find(tag_tab).each(function(i){ 
	$(id_tab).find(tag_tab).eq(i).mouseover(function(){ 
	cur(this); 
	$(id_con).find(tag_con).eq(i).show().siblings(tag_con).hide(); 
})})} 
} 

function Showsearchcontent(id){
	for (var i = 0;i < 2;i++){
	var searchnav = document.getElementById("searchnav" + i);
	var searchcontent = document.getElementById("searchcontent" + i);
	if (i == id){
	searchnav.className = 'search_nav';
	searchcontent.style.display = "";
	}
	else{
	searchnav.className = 'search_nav_current';
	searchcontent.style.display = "none";
	}}
}

function switch_tab(tab_id){
	hide_tab_id = $("#comment_tab .on")[0].id;
	if (hide_tab_id==tab_id)
	return false;
	$("#"+tab_id).addClass("on");
	$("#"+hide_tab_id).removeClass("on");
	$("#w"+hide_tab_id).hide();
	$("#w"+tab_id).show();
}

function sb(){
	if(document.documentElement.scrollTop==0){
		idBackTop.style.display="none";
	}else{
		idBackTop.style.display="block";
	}
}
				
function replaceLink(){
	var arr		= document.getElementsByTagName('a');
	for(var i=0,l = arr.length;i<l;i++){
		var	e	= arr[i];
		if(e.attributes['linktype']!=undefined){
			if(e.attributes['linktype'].nodeValue=='click-url'){
				e.href	= defaultClickUrl.replace('defaultId',e.attributes['nid'].nodeValue);
			}else if(e.attributes['linktype'].nodeValue=='shop-click-url'){
				e.href	= defaultClickUrl.replace('id/defaultId','sid/'+e.attributes['nid'].nodeValue);
				e.href	= defaultClickUrl.replace('id=defaultId','sid='+e.attributes['nid'].nodeValue);
				e.href	= defaultClickUrl.replace('id-defaultId','sid-'+e.attributes['nid'].nodeValue);
			}
		}
	}
}

function replaceImage(){
	var arr		= document.getElementsByTagName('img');
	for(var i=0,l = arr.length;i<l;i++){
		var	e	= arr[i];
		if(e.attributes['u']!=undefined){
			var tmp 	= e.attributes['u'].nodeValue;
			var src 	= "";
			var strs	= tmp.split("_");
			for (ii=0;ii<strs.length ;ii++ )
			{
				if(ii==0){
					src = src + base64decode(strs[ii]);
				}else{
					src = src + "_" + strs[ii];
				}
			} 
			e.src = src;
		}
	}
}

// JavaScript Document
function setPic(pic,width,height,alt){
	pic =  base64decode(pic);
	writestr = "<img src='"+pic+"' ";
	if(width!=0){
		writestr+=" width="+width;
	}
	if(height!=0){
		writestr+=" height="+height;
	}
	writestr = writestr+" alt='"+alt+"' align=\"absmiddle\" />";
	document.write(writestr);
}

function getpic(thispic,pic){
	pic =  base64decode(pic);
	thispic.src = pic;
}

function Getinfo(){
	strr = unescape(base64decode(str));
	document.getElementById("goods_desc").innerHTML = strr;
}

function clickurl(urlid){
	urlid =  base64decode(urlid);
	window.open(urlid);	
}

function showgoods(c,k,o){
	url="/themes/sean_taobao/plugin/Sean_Show.asp?classid="+c+"&keyword="+k+"&order="+o
	str01=url+"&act=showarticlebottom"
	str02=url+"&act=showarticleright01"
	str03=url+"&act=showarticleright02"
	str04=url+"&act=showarticleright03"
	str05=url+"&act=showarticleright04"
	$("#tuijian").load(str01);
	$("#zxgz").load(str02);
	$("#zxgz_wz").load(str03);
	$("#rmgm").load(str04);
	$("#rmgm_wz").load(str05);
}

function base64encode(str) { 
str = utf16to8(str); 
var out, i, len;    
var c1, c2, c3;    
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 
len = str.length;    
i = 0;    
out = "";    
while(i < len) { 
c1 = str.charCodeAt(i++) & 0xff;    
if(i == len){ 
out += base64EncodeChars.charAt(c1 >> 2); 
out += base64EncodeChars.charAt((c1 & 0x3) << 4); 
out += "==";       
break;    
}    
c2 = str.charCodeAt(i++);    
if(i == len)    {        
out += base64EncodeChars.charAt(c1 >> 2);        
out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));        
out += base64EncodeChars.charAt((c2 & 0xF) << 2);        
out += "=";        
break;    
} 
c3 = str.charCodeAt(i++);    
out += base64EncodeChars.charAt(c1 >> 2);    
out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));    
out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6));    
out += base64EncodeChars.charAt(c3 & 0x3F);    
}   
return out; 
} 
function base64decode(str){ 
var c1, c2, c3, c4;    
var i, len, out;   
var base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, 
-1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, 
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1); 
len = str.length;    
i = 0;    
out = "";    
while(i < len) {    
do {        
c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];    
} 
while(i < len && c1 == -1);    
if(c1 == -1) break;   
do {        
c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];    
} 
while(i < len && c2 == -1);    
if(c2 == -1)  break;    
out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));    
do {        
c3 = str.charCodeAt(i++) & 0xff;        
if(c3 == 61) return out;        
c3 = base64DecodeChars[c3];    
} 
while(i < len && c3 == -1);    
if(c3 == -1) break;    
out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));    
do {        
c4 = str.charCodeAt(i++) & 0xff;        
if(c4 == 61) return out;        
c4 = base64DecodeChars[c4];    
} 
while(i < len && c4 == -1);    
if(c4 == -1) break;    
out += String.fromCharCode(((c3 & 0x03) << 6) | c4);    
} 
out = utf8to16(out); 
return out; 
} 
function utf16to8(str) {    
var out, i, len, c;    
out = "";    len = str.length;    
for(i = 0; i < len; i++) {    
c = str.charCodeAt(i);    
if ((c >= 0x0001) && (c <= 0x007F)) {        
out += str.charAt(i);    
} else if (c > 0x07FF) {        
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));        
out += String.fromCharCode(0x80 | ((c >>  6) & 0x3F));        
out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));    
} else {        
out += String.fromCharCode(0xC0 | ((c >>  6) & 0x1F));        
out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));    
}    
}    
return out; 
} 

function utf8to16(str) {    
var out, i, len, c;    
var char2, char3;    
out = "";    
len = str.length;    
i = 0;    
while(i < len) {    
c = str.charCodeAt(i++);    
switch(c >> 4){       
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:            
out += str.charAt(i-1);        
break;      
case 12: case 13:              
char2 = str.charCodeAt(i++);        
out += String.fromCharCode(((c & 0x1F) << 6)|(char2 & 0x3F));        
break;      
case 14:               
char2 = str.charCodeAt(i++);        
char3 = str.charCodeAt(i++);        
out += String.fromCharCode(((c & 0x0F) << 12)|((char2 & 0x3F) << 6)|((char3 & 0x3F) << 0)); 
break;    
} 
}   
return out; 
}
