var g2=new G2;function G2(){}G2.prototype.init=function(a){g2.v=a;g2.showdel=0;g2.pagenumber=0;for(i=10;i>=0;i--){var b=document.getElementById("dot-"+i);if(b){g2.totalpage=i;break;}}if(g2.totalpage==0){$("#btnNext").addClass("btnNextDisabled");}g2.barInterval=5000;g2.barTimer=-1;g2.loadRecent();g2.loadMylist();g2.loadNotify();g2.loadRecommend();g2.showInput("l-price",0);g2.showInput("h-price",0);g2.showInput("discount",0);g2.initNav();$("img.gimg").load(g2.imageOnload);g2.windowResize();$("form").submit(g2.formSubmit);g2.delayCloseTips();if($.browser.msie&&$.browser.version=="6.0"){return;}$(window).resize(g2.windowResize);};G2.prototype.fixpng=function(d){if($.browser.msie&&$.browser.version=="6.0"){var b=(d.id)?"id='"+d.id+"' ":"";var f=(d.className)?"class='"+d.className+"' ":"";var g=(d.title)?"title='"+d.title+"' ":"title='"+d.alt+"' ";var c="display:inline-block;"+d.style.cssText;var a="<span "+b+f+g+' style="width:'+d.width+"px; height:"+d.height+"px;"+c+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d.src+"', sizingMethod='scale');\"></span>";d.outerHTML=a;}};G2.prototype.delayCloseTips=function(){self.setTimeout(function(){$("#tips-1").fadeOut(1000,function(){$("#tips-1").hide();});},5000);};G2.prototype.post=function(a,c,b){$.post(a,c,function(d){b(d);});};G2.prototype.showItem=function(g,b){if(b>0){var c=document.getElementById("m-"+g);if(c){c.className+=" selected";var c=$(c);var d=$("#c-"+g);var a=(c.offset().top-352);if(a<0){a=0;}d.css("top",a+"px");d.show();}}else{var c=document.getElementById("m-"+g);if(c){c.className=c.className.replace(" selected","");}$("#c-"+g).hide();}};G2.prototype.initNav=function(){var a=["nav-cla","nav-brand","nav-price"];for(i in a){var b=$("#c-"+a[i]);if(b&&b.length>0){$("#a-"+a[i]).attr("class","open");$("#l-"+a[i]).show();}}};G2.prototype.home5tab=function(a){self.clearInterval(g2.home5Timer);var b=-1;$(".home-5-tab li").each(function(d,c){if(c!=a){c.className="";}else{if(c.className!="selected"){c.className="selected";b=d;}}});if(b>-1){$("#home-5-ul ul").hide();$("#home-5-ul ul").each(function(d,c){if(b==d){$(c).fadeIn(600);}});}};G2.prototype.showHome5=function(b){self.clearInterval(g2.home5Timer);var a=$(".home-5-tab li");a.each(function(c,d){if(c==b){d.className="selected";}else{d.className="";}});$("#home-5-ul ul").hide();$("#home-5-ul ul").each(function(c,d){if(c==b){$(d).fadeIn(600);}});};G2.prototype.bar=function(d){self.clearInterval(g2.barTimer);var c=d-1;var a=0;$(".bar-icon li").each(function(b,f){if(b==c){if(f.className!="selected"){f.className="selected";a=1;}}else{f.className="";}});if(a>0){$("#bar-2-p .l1").hide();$("#b-p-"+d).fadeIn(400);}};G2.prototype.startHome5=function(a){self.clearInterval(g2.home5Timer);g2.home5Timer=self.setInterval(g2.nextHome5,g2.home5Interval);};G2.prototype.startBar=function(a){self.clearInterval(g2.barTimer);g2.barTimer=self.setInterval(g2.nextBar,g2.barInterval);};G2.prototype.showNav=function(b){var d=$("#a-"+b);if(d&&d.length>0){var g=d.attr("class");if(g=="open"){d.attr("class","close");$("#l-"+b).hide();}else{d.attr("class","open");$("#l-"+b).show();var a=["nav-cla","nav-brand","nav-price"];for(i in a){if(a[i]!=b){var f=$("#c-"+a[i]);if(!f||f.length==0){$("#a-"+a[i]).attr("class","close");$("#l-"+a[i]).hide();}}}}}};G2.prototype.copyLink=function(url){url=gview.clearUrl(url);var p={};p.url="http://www.giisoo.com/redirect.htm?url="+url;p.hours=168;$.post("/ajax/surl.htm",p,function(data){var d=eval(data);if(d.ok>0){alert("您可以通过这个链接访问该商品：["+d.url+"]");}});};G2.prototype.addMylist=function(url){var p={};p.url=url;p.a="add";$.post("/ajax/mylist2.htm",p,function(data){var d=eval(data);if(d.ok==1){$("#id-mylist-num").html(d.n);alert("已经收藏该商品！");}else{alert("收藏商品失败！请先登录吉搜网.");}});};G2.prototype.delMylist=function(url){var p={};p.url=url;p.a="del";$.post("/ajax/mylist2.htm",p,function(data){var d=eval(data);if(d.ok==1){alert("已经从收藏盒中删除该商品！");$("#id-mylist-num").html(d.n);$("#id-"+url).hide();}else{alert("收藏商品失败！");}});};G2.prototype.addNotify=function(url){var v=$("#n-"+url+" input").attr("value");if(v.length>0){var p={};p.a="set";p.url=url;p.price=v;$.post("/ajax/notify2.htm",p,function(data){var d=eval(data);if(d.ok==1){$("#id-notify-num").html(d.n);alert(d.m);g2.showNotify(url,0);}else{alert(d.m);}});}};G2.prototype.delNotify=function(url){var p={};p.a="set";p.url=url;p.price=0;$.post("/ajax/notify2.htm",p,function(data){var d=eval(data);if(d.ok==1){$("#id-notify-num").html(d.n);alert(d.m);$("#id-"+url).hide();}else{alert(d.m);}});};G2.prototype.delRecommend=function(url){var p={};p.a="del";p.url=url;$.post("/ajax/recommend2.htm",p,function(data){var d=eval(data);if(d.ok==1){$("#id-recommend-num").html(d.n);alert("已经 删除！");$("#id-"+url).hide();}else{alert("删除 失败！");}});};G2.prototype.addRecommend=function(url){var e=$("#r-"+url+" input").attr("value");if(e.length>0){var p={};p.other=e;p.a="send";p.url=url;$.post("/ajax/recommend2.htm",p,function(data){var d=eval(data);if(d.ok==1){$("#id-recommend-num").html(d.n);alert("已经发送给["+e+"]！");g2.showRecommend(url,0);}else{alert("发送给["+e+"] 失败！请先登录吉搜网.");}});}};G2.prototype.formSubmit=function(){var a=$("#id-q").attr("value");if(a.length>0&&a!=empty){g2.addRecent(a);}};G2.prototype.header=function(a){$("#id-t").attr("value",a);$(".gbar-left a").removeClass("selected");$("#id-"+a).addClass("selected");};G2.prototype.nextHome5=function(){var a=-1;var c=$(".home-5-tab li");c.each(function(b,d){if(a==-1&&d.className=="selected"){a=b+1;}});if(a==-1||a>=c.length){a=0;}g2.showHome5(a);g2.startHome5();};G2.prototype.nextBar=function(){var a=0;$(".bar-icon li").each(function(b,c){if(a==0){if(c.className=="selected"){if(b>3){b=-1;}g2.bar(b+2);a=1;}}});if(a==0){g2.bar(1);}g2.startBar(-1);};G2.prototype.page=function(a){if(a>0){g2.pagenumber++;a=910;}else{g2.pagenumber--;a=-910;}if(g2.pagenumber>g2.totalpage){g2.pagenumber=g2.totalpage;return;}if(g2.pagenumber<0){g2.pagenumber=0;return;}if(g2.pagenumber==0){$("#btnPrev").addClass("btnPrevDisabled");}else{$("#btnPrev").removeClass("btnPrevDisabled");}if(g2.pagenumber==g2.totalpage){$("#btnNext").addClass("btnNextDisabled");}else{$("#btnNext").removeClass("btnNextDisabled");}$(".carouselList").animate({left:"-="+a},function(){$(".carouselDots span").removeClass("selectedDot");$("#dot-"+g2.pagenumber).addClass("selectedDot");});};G2.prototype.addRecent=function(a){var c=$.cookie("_gr");if(c){var b=c.split("$$$",9);c="";for(i=0;i<b.length;i++){if(b[i]==a){return;}c+="$$$"+b[i];}c=a+c;}else{c=a;}$.cookie("_gr",c,{expires:30});g2.loadRecent();};G2.prototype.loadMylist=function(){$.post("/ajax/mylist2.htm",{},function(data){var d=eval(data);if(d.ok==1){$("#id-mylist-num").html(d.n);}});};G2.prototype.loadNotify=function(){$.post("/ajax/notify2.htm",{},function(data){var d=eval(data);if(d.ok==1){$("#id-notify-num").html(d.n);}});};G2.prototype.loadRecommend=function(){$.post("/ajax/recommend2.htm",{},function(data){if(data!=null){var d=eval(data);if(d!=null&&d.ok==1){$("#id-recommend-num").html(d.n);}}});};G2.prototype.loadRecent=function(){var c=$.cookie("_gr");if(c){var b=c.split("$$$",10);c="";for(i=0;i<b.length;i++){var a=b[i];if(a.length>6){a=a.substring(0,5)+"...";}c+='<li><a href="/?q='+encodeURIComponent(b[i])+'" target="_blank" title="'+b[i]+'">'+a+"</a></li>";}$("#contentRecent").html(c);}};G2.prototype.showDel=function(a){if(a>0){if(g2.showdel>0){return;}g2.showdel=1;$("#del-recent").fadeIn();}else{g2.showdel=0;setTimeout(function(){if(g2.showdel>0){return;}$("#del-recent").fadeOut();},500);}};G2.prototype.delRecent=function(){$.cookie("_gr","");$("#contentRecent").html("");};G2.prototype.showInput=function(c,a){if(a>0){$("#id-"+c).hide();$("#in-"+c).show();$("#in-"+c).focus();}else{var b=$("#in-"+c).attr("value");if(b&&b.length>0){if(b.length<1||b=="0"){$("#id-"+c).show();$("#in-"+c).hide();$("#"+c).attr("value","");}else{$("#"+c).attr("value",b);$("#id-"+c).hide();$("#in-"+c).show();}}else{$("#id-"+c).show();$("#in-"+c).hide();$("#"+c).attr("value","");}}};G2.prototype.showNotify=function(a,b){if(b>0){$("#n-"+a).show();$("#n-"+a+" input").focus();}else{$("#n-"+a).hide();}};G2.prototype.showRecommend=function(a,b){if(b>0){$("#r-"+a).show();$("#r-"+a+" input").focus();}else{$("#r-"+a).hide();}};G2.prototype.imageOnload=function(g){g=g.target||g.srcElement;g=$(g);var d=new Image();d.src=g.attr("src");var l=d.width;var f=d.height;var k=0;var b=0;var a=150;var m=150;if(g.attr("width")>0){a=g.attr("width");}if(g.attr("height")>0){m=g.attr("height");}if(l>a||f>m){var c=a/l;var n=m/f;if(c<n){l=a;f=c*f;}else{f=m;l=n*l;}}k=(m-f)/2;b=(a-l)/2;g.css("height",parseInt(f)+"px");g.css("width",parseInt(l)+"px");g.css("margin-top",parseInt(k)+"px");g.css("margin-left",parseInt(b)+"px");};G2.prototype.view=function(a,c){if(g2.v!=a){if(g2.v=="t"||a=="t"){$("#view").attr("value",a);var b=$("<input type='hidden' name='s' value='"+c+"'/>");$("#header form").append(b);$("#header form").submit();}else{dash_view=a;g2.v=a;gview.curr.changed=1;changeView();}}};G2.prototype.windowResize=function(){var a=$(document.body).width();if(a<1100){$("#shopnav").hide();$("#result").css("margin-left","20px");}else{$("#shopnav").show();$("#result").css("margin-left","200px");}if(a>=1100){$("#result").css("width",(a-210)+"px");}else{if(a>=995){$("#result").css("width",(a-30)+"px");}else{$("#result").css("width",(995-30)+"px");}}gview.resize();};G2.prototype.get=function(a){window.location=a;};G2.prototype.showMenu=function(a,c){if(c==1){var b=$("#bar-"+a);a=$("#"+a);a.css("left",b.offset().left+"px");a.css("top",(b.offset().top+28)+"px");a.show();}else{a=$("#"+a);a.hide();}};var gview=new GView;var layer=[{left:-595,top:-60,scale:0.25,z:1},{left:-440,top:-60,scale:0.25,z:2},{left:-285,top:-60,scale:0.25,z:3},{left:-130,top:-60,scale:0.25,z:4},{left:250,top:0,scale:1,z:5},{left:630,top:-60,scale:0.25,z:4},{left:785,top:-60,scale:0.25,z:3},{left:940,top:-60,scale:0.25,z:2},{left:1095,top:-60,scale:0.25,z:1}];var ie_layer=[{left:-400,top:200,scale:0.25,z:1},{left:-300,top:200,scale:0.25,z:2},{left:-70,top:200,scale:0.25,z:3},{left:90,top:200,scale:0.25,z:4},{left:250,top:0,scale:1,z:5},{left:860,top:200,scale:0.25,z:4},{left:1020,top:200,scale:0.25,z:3},{left:1200,top:200,scale:0.25,z:2},{left:1300,top:200,scale:0.25,z:1}];function GView(){this.mode="x";this.view="search";this.favorite=new Array;}GView.prototype.isFavoriteView=function(){return this.view==="favorite";};GView.prototype.isSearchView=function(){return this.view==="search";};GView.prototype.isNotifyView=function(){return this.view==="notify";};GView.prototype.isRecommendView=function(){return this.view==="recommend";};GView.prototype.extraMessage=function(a){if(this.isNotifyView()){a=this.clearUrl(a);for(var b=0;b<this.notify.length;b++){if(a==this.notify[b].url){return"价格到 &lt;"+this.notify[b].door+"&gt; 通知您 ...";}}}else{if(this.isRecommendView()){a=this.clearUrl(a);for(var b=0;b<this.recommend.length;b++){if(a==this.recommend[b].url){return"&lt;"+this.recommend[b].sender+"&gt; 向您推荐...";}}}}return"";};GView.prototype.sendRecommend=function(a,b){a=gview.clearUrl(a);b.a="send";b.url=a;$.post("/ajax/reco.htm",b,function(c){alert("已经送到您朋友的推荐盒里！");});};GView.prototype.recommend=function(a){guser.recommend(a);};GView.prototype.addNotify=function(url,p){url=gview.clearUrl(url);p.a="set";p.url=url;$.post("/ajax/notify2.htm",p,function(data){var d=eval(data);if(d.ok==1){$("#id-notify-num").html(d.n);alert(d.m);g2.showNotify(url,0);}else{alert(d.m);}});};GView.prototype.remove=function(a){if(gview.isNotifyView()){gview.removeNotify(a);}else{if(gview.isRecommendView()){gview.removeRecommend(a);}}};GView.prototype.removeRecommend=function(url){url=this.clearUrl(url);var params={};params.a="remove";params.url=url;$.post("/ajax/reco.htm",params,function(data){var d=eval(data);gview.recommend=new Array;for(i=0;i<d.length;i++){gview.recommend.push(d[i]);}gview.setRecommendNumber();if(gview.recommend.length==0&&gview.isRecommendView()){gview.openSearchView();}else{if(gview.isRecommendView()){gview.view="search";gview.openRecommendView();}}});alert("已经从 推荐盒 里删除该商品！");};GView.prototype.removeNotify=function(a){var b={};b.price=-1;gview.addNotify(a,b);alert("已经从 降价通知中 删除该商品！");};GView.prototype.addFavorite=function(a){a=this.clearUrl(a);g2.addMylist(a);};GView.prototype.setFavoriteNumber=function(a){gview.favorite_number.html(gview.favorite.length);};GView.prototype.setNotifyNumber=function(a){gview.notify_number.html(gview.notify.length);};GView.prototype.setRecommendNumber=function(a){gview.recommend_number.html(gview.recommend.length);};GView.prototype.clearUrl=function(a){if(a==""||a==null){return null;}var b=a.indexOf("url=");if(b>-1){a=a.substring(b+4);}return a;};GView.prototype.removeFavorite=function(url){url=this.clearUrl(url);var temp=$.cookie("_gf");temp=temp.replace(url,"");var params={};params.a="reset";params.url=temp;$.post("/ajax/favorite.htm",params,function(data){var d=eval(data);var urls="";gview.favorite=new Array;for(var i=0;i<d.length;i++){gview.favorite.push(d[i].url);if(urls!=""){urls+=".";}urls+=d[i].url;}gview.setFavoriteNumber();$.cookie("_gf",urls,{expires:30});if(gview.favorite.length==0&&gview.isFavoriteView()){gview.openSearchView();}else{if(gview.isFavoriteView()){gview.view="search";gview.openFavoriteView();}}});alert("已经从收藏盒中删除！");};GView.prototype.mergeFavorite=function(url){var params={};params.a="merge";params.url=url;$.post("/ajax/favorite.htm",params,function(data){var d=eval(data);var urls="";gview.favorite=new Array;for(var i=0;i<d.length;i++){gview.favorite.push(d[i].url);if(urls!=""){urls+=".";}urls+=d[i].url;}gview.setFavoriteNumber();$.cookie("_gf",urls,{expires:30});});};GView.prototype.showOrhidePricePanel=function(a){gview.showPriceHistory(a);};GView.prototype.showPriceHistory=function(a){$("#price_panel_img").attr("src","http://img.giisoo.com/images/p_blank.png");gview.price_url=a;var a=this.clearUrl(a);$("#price_panel_img").attr("src","http://img.giisoo.com/prices.htm?m=2&url="+a);$("#price_panel_img").show();};GView.prototype.init=function(a,b){this.curr_search=new GPosition();this.curr=this.curr_search;this.data=a;this.flicker_icon={};this.flicker_interval=0;this.g_animate=$.cookie("_ga");if(!this.g_animate){this.g_animate="1";}this.dash_1=$("#dash_1");this.dash_x=$("#dash_x");this.dash_view_1=$("#dash_view_1");this.dash_view_x=$("#dash_view_x");this.price_panel=$("#price_panel");this.dash_view_x.html("");this.x={};this.x.image_width=200;this.x.image_height=180;this.s={};this.s.image_width=330;this.s.image_height=250;this.s.b_image_width=600;this.s.b_image_height=400;if(b=="-1"){this.curr.set(a.length-1);}if(this.product){for(i=0;i<this.product.length;i++){if(this.product[i]){this.product[i].remove();}}}if(this.product_x){for(i=0;i<this.product_x.length;i++){if(this.product_x[i]){this.product_x[i].remove();}}}this.product=new Array();this.product_x=new Array();$(document).unbind("keydown");$(document).bind("keydown",this.keydown);this.resize();};GView.prototype.resize=function(a){try{gview.left_align=parseInt((gview.dash_1.width()-1109)/2);if(gview.left_align<-250){gview.left_align=0;}for(i=0;i<gview.data.length;i++){if(gview.product[i]){gview.product[i].target=null;}}gview.price_panel.css("left",(860+gview.left_align)+"px");gview.price_panel.css("width",(gview.dash_1.width()-870-gview.left_align)+"px");gview.render();}catch(a){}};GView.prototype.animate=function(a){if(arguments.length>0){if(a=="1"||a==1){$.cookie("_ga","1",{expires:30});this.g_animate="1";for(i=0;i<gview.data.length;i++){if(this.product[i]){this.product[i].dash.addClass("g_transition");}}}else{$.cookie("_ga","0",{expires:30});this.g_animate="0";for(i=0;i<gview.data.length;i++){if(this.product[i]){this.product[i].dash.removeClass("g_transition");}}}}else{return this.g_animate;}};GView.prototype.resizeImage=function(k){k=k.target||k.srcElement;k=$(k);var f=k.attr("i");k.unbind("load");try{img=new Image();img.src=gview.data[f].img;var m=img.width;var g=img.height;var l=0;var b=0;var a=gview.x.image_width;var n=gview.x.image_height;if(m>(a-10)||g>(n-10)){var d=(a-10)/m;var o=(n-10)/g;if(d<o){m=a-10;g=d*g;}else{g=n-10;m=o*m;}}l=(n-g)/2;b=(a-m)/2;k.css("height",g+"px");k.css("width",m+"px");k.css("marginTop",l+"px");k.css("marginLeft",b+"px");}catch(c){}};GView.prototype.keydown=function(a){if(a.target.tagName=="BODY"||a.target.tagName=="HTML"||a.target.tagName=="DIV"){if(a.keyCode==39){gview.next();return false;}else{if(a.keyCode==37){gview.prev();return false;}else{if(a.keyCode==32||a.keyCode==13){if(gview.mode=="1"){dash_view="x";g2.v="x";}else{dash_view="1";g2.v="1";}gview.curr.changed=1;changeView();if(a.keyCode==13){return true;}else{return false;}}else{if(a.keyCode==27||a.keyCode==8){if(gview.mode=="1"){dash_view="x";g2.v="x";gview.curr.changed=1;changeView();return false;}}}}}}return true;};GView.prototype.next=function(a){this.curr.next();this.render();};GView.prototype.prev=function(a){this.curr.prev();this.render();};GView.prototype.selectx=function(a){if(gview.mode=="x"){a=a||window.event;if(a.type=="mouseout"){return;}a=a.target||a.srcElement;if($(a).attr("i")){gview.curr.set(parseInt($(a).attr("i")));}else{a=gview.findX(a);if(a){gview.curr.set(parseInt($(a).attr("i")));}}gview.render();}};GView.prototype.select1=function(a){if(gview.mode=="1"){a=a||window.event;a=a.target||a.srcElement;if($(a).attr("i")){gview.curr.set(parseInt($(a).attr("i")));}else{a=gview.findX(a);if(a){gview.curr.set(parseInt($(a).attr("i")));}}gview.render();}};GView.prototype.click=function(a){a=a.target;g2.view("1");};GView.prototype.render=function(){var b=this.curr.get();if(b>=gview.data.length){this.curr.set(gview.data.length-1);b=this.curr.get();}if(this.mode=="1"){this.dash_1.show();this.dash_x.hide();if(!this.product[b]){this.product[b]=new GProduct(b);this.product[b].render(this.dash_view_1,this.curr.layer(b));}else{this.product[b].moveTo(this.curr.layer(b));}for(j=1;j<4;j++){var a=b+j;if(a>gview.data.length-1){break;}if(this.product[a]){this.product[a].moveTo(this.curr.layer(a));}else{this.product[a]=new GProduct(a);this.product[a].render(this.dash_view_1,this.curr.layer(a));}}for(j=4;j<30;j++){var a=b+j;if(a>gview.data.length-1){break;}if(this.product[a]){this.product[a].moveTo(this.curr.layer(a));}}for(j=-1;j>-4;j--){var a=b+j;if(a<0){break;}if(this.product[a]){this.product[a].moveTo(this.curr.layer(a));}else{this.product[a]=new GProduct(a);this.product[a].render(this.dash_view_1,this.curr.layer(a));}}for(j=-4;j>-30;j--){var a=b+j;if(a<0){break;}if(this.product[a]){this.product[a].moveTo(this.curr.layer(a));}}this.center();this.showOrhidePricePanel(gview.data[b].url);}else{this.dash_1.hide();this.dash_x.show();for(a=0;a<gview.data.length;a++){if(this.product_x[a]){if(this.curr.get()==a){this.product_x[a].mouseover();}else{this.product_x[a].mouseout();}}else{this.product_x[a]=new GProduct_x(a);this.product_x[a].render(this.dash_view_x);}}}};GView.prototype.findX=function(a){var b=a;while(b){if($(b).is(".dash_shop_x")){return b;}if($.browser.firefox){b=b.parentNode;}else{b=b.parentElement;}}return null;};GView.prototype.center=function(){if(this.curr.changed==0){return;}this.curr.changed=0;};function GProduct_x(a){this.i=a;this.dash=null;}GProduct_x.prototype.mouseover=function(){this.dash.addClass("shop_hover");gview.center();};GProduct_x.prototype.mouseout=function(){this.dash.removeClass("shop_hover");};GProduct_x.prototype.render=function(b){var a='<div id="res'+this.i+'" class="dash_shop_x" i="'+this.i+'">';a+='<div style="position: reltive; display: inline-block;width:'+gview.x.image_width+"px; height:"+gview.x.image_height+'px">';a+='<img id="image_x_'+this.i+'" src="'+gview.data[this.i].img+'" i="'+this.i+'" style="position:relative; height:'+(gview.x.image_height-10)+"px; width:"+(gview.x.image_width-10)+'px; margin:5px;">';if(gview.data[this.i].removal=="1"){a+='<div class="r-mask"></div>';}a+="</div>";a+='<h3><font color="#2D32FB"><b>['+gview.data[this.i].domain+"]</b> </font>";a+=gview.data[this.i].title+"</h3>";a+='<div class="state" ';if(gview.data[this.i].discount>9.99){a+='style="margin-top: 10px"';}a+=">";if(gview.data[this.i].sold>0){a+='<span class="sold">已售：'+gview.data[this.i].sold+"</span>";}a+='<span class="price">￥'+gview.data[this.i].price+"</span>";a+='<span class="region">'+gview.data[this.i].region+"</span>";a+="</div>";if(gview.data[this.i].discount<9.99){a+='<div class="rebate">';a+='<span class="oldprice" title="一月内实卖最高价">最高价:￥'+gview.data[this.i].oldprice+"</span>";a+='<span class="rebate">折扣:<em>'+gview.data[this.i].discount+"</em></span>";a+="</div>";}a+="</div>";this.dash=$(a);b.append(this.dash);$("#image_x_"+this.i).load(gview.resizeImage);this.dash.unbind("click");this.dash.unbind("mouseover");this.dash.click(gview.click);this.dash.mouseover(gview.selectx);};function GProduct(a){this.i=a;this.scale=0;this.z=-1;this.left=0;this.top=0;this.to=null;this.reflect_to=null;this.dash=null;this.mask=null;this.reflect=null;}GProduct.prototype.moveTo=function(b){if(this.target==b){return false;}this.target=b;this.scale=b.scale;this.left=b.left+gview.left_align;this.top=b.top;this.z=b.z;e=this.dash;e.css("z-index",this.z);if($.browser.msie){if(this.z>1){var a=new GTransition(e);a.dest(this.left,this.top,this.scale);a.run();}}else{e.css("-webkit-transform","matrix("+this.scale+", 0, 0, "+this.scale+", 0, 0)");e.css("-moz-transform","matrix("+this.scale+", 0, 0, "+this.scale+", 0, 0)");e.css("-o-transform","matrix("+this.scale+", 0, 0, "+this.scale+", 0, 0)");e.css("transform","matrix("+this.scale+", 0, 0, "+this.scale+",0, 0)");e.css("filter","progid:DXImageTransform.Microsoft.Matrix(M11="+this.scale+", M12=0, M21=0, M22="+this.scale+", SizingMethod='auto expand')");e.css("-ms-filter","progid:DXImageTransform.Microsoft.Matrix(M11="+this.scale+", M12=0, M21=0, M22="+this.scale+", SizingMethod='auto expand')");e.css("left",this.left+"px");e.css("top",this.top+"px");}if(this.z<2){e.hide();this.visible=0;return false;}else{if(this.visible!==1){e.show();this.visible=1;}if(this.scale==1){this.mask.hide();this.mask_reflect.hide();this.prod.show();this.prod_reflect.show();}else{this.mask.show();this.mask_reflect.show();this.prod.hide();this.prod_reflect.hide();}return true;}};GProduct.prototype.move=function(){if(this.z<2){if(this.dash){this.dash.hide();}}else{if(this.scale==1){this.mask.hide();this.mask_reflect.hide();this.prod.show();this.prod_reflect.show();}else{this.mask.show();this.mark_reflect.show();this.prod.hide();this.prod_reflect.hide();}if(this.dash){this.dash.show();if(this.to){this.animate(this.to);this.to=null;}}else{}}};GProduct.prototype.animate=function(a){this.dash.animate(a,1000);};GProduct.prototype.remove=function(){if(this.dash){this.dash.remove();}};GProduct.prototype.onload=function(l){l=l.target||l.srcElement;l=$(l);var d=l.attr("i");$(".image_1_big_"+d).unbind("load");$(".image_1_small_"+d).unbind("load");var f=new Image;var s=new Image;f.src=gview.data[d].img;s.src=gview.data[d].bimg;var r=s.width;var g=s.height;var k=f.width;var m=f.height;var o=gview.s.image_height-10;var b=gview.s.image_width-10;var q=gview.s.b_image_width-10;var a=gview.s.b_image_height-10;if(r==0||g==0){r=o;g=o;k=q;m=a;}else{fw=b/r;fh=o/g;if(fw<fh){r=b;g=parseInt(fw*g);}else{g=o;r=parseInt(r*fh);}fw1=q/k;fh1=a/m;if(fw1<fh1){k=q;m=parseInt(fw1*m);}else{m=a;k=parseInt(k*fh1);}}if(g>o){g=o;}if(r>b){r=b;}if(m>a){m=a;}if(k>q){k=q;}var n=parseInt((o-g)/2)+5;var c=parseInt((b-r)/2)+5;var p=parseInt((a-m)/2)+5;var t=parseInt((q-k)/2)+5;e1=$(".image_1_big_"+d);e2=$(".image_1_small_"+d);e1.css("margin",n+"px "+c+"px "+n+"px "+c+"px");e1.css("width",r+"px");e1.css("height",g+"px");e2.css("margin",p+"px "+t+"px "+p+"px "+t+"px");e2.css("width",k+"px");e2.css("height",m+"px");};GProduct.prototype.render=function(m,f){if(this.dash){return;}this.scale=f.scale;this.left=f.left+gview.left_align;this.top=f.top;this.z=f.z;var o='<div id="gproduct_'+this.i+'" class="product_dash ';if(gview.g_animate=="1"){o+="g_transition";}o+='" scale='+this.scale+" top="+this.top+" left="+this.left+' style="backgroun: red; z-index:'+this.z+"; -webkit-transform: matrix("+this.scale+", 0, 0, "+this.scale+", 0, 0);-moz-transform: matrix("+this.scale+", 0, 0, "+this.scale+", 0, 0);-o-transform: matrix("+this.scale+", 0, 0, "+this.scale+", 0, 0);transform: matrix("+this.scale+", 0, 0, "+this.scale+", 0, 0);filter: progid:DXImageTransform.Microsoft.Matrix(M11="+this.scale+", M12=0, M21=0, M22="+this.scale+", SizingMethod='auto expand');-ms-filter: progid:DXImageTransform.Microsoft.Matrix(M11="+this.scale+", M12=0, M21=0, M22="+this.scale+", SizingMethod='auto expand');top:"+this.top+"px;left:"+this.left+'px;"></div>';this.dash=$(o);m.append(this.dash);var l=5;var b=5;var n=gview.s.image_width-10;var c=gview.s.image_height-10;var d=gview.s.b_image_width-10;var k=gview.s.b_image_height-10;var p='<div class="p_img_1_panel"><a id="url_'+this.i+'" target="_blank" href="'+gview.data[this.i].url+'">';p+='<img id="p_img_1_'+this.i+'" class="p_img_1 image_1_big_'+this.i+'" src="'+gview.data[this.i].bimg+'" i='+this.i+"></a>";if(gview.data[this.i].removal=="1"){p+='<div class="r-mask"></div>';}var a=gview.extraMessage(gview.data[this.i].url);if(a!=""){p+='<div class="p_img_extra_message" onmouseover="this.className=\'p_img_extra_message_hover\'" onmouseout="this.className=\'p_img_extra_message\'"><span>'+a+'<img style="float: right;height:16px;width:16px;" onclick="gview.remove(\''+gview.data[this.i].url+'\')" src="http://img.giisoo.com/images/delete.png"/><span></div>';}p+="</div>";p+='<div class="p_state_1">';p+='<div class="p_state_1_inner">';p+='<div class="p_title_1"><a target="_blank" href="'+gview.data[this.i].url+'">';p+='<font color="#2D32FB"><b>['+gview.data[this.i].domain+"]</b> </font>";p+=gview.data[this.i].title;p+="</a></div>";p+='<div style="width: 100%; position: relative; float: left; margin: 5px;">';p+='<div class="p_price_1">￥'+gview.data[this.i].price+"</div>";if(gview.data[this.i].sold>0){p+='<div class="p_sold_1">已售：<span id="p_sold_1">'+gview.data[this.i].sold+"</span></div>";}var g=this.getRate(gview.data[this.i].rate);p+='<div id="p_rate_1" class="modalRate'+g+'" style="position: relative;float: right;margin: 2px 5px;"></div>';p+="</div>";if(gview.data[this.i].discount<9.9){p+='<div id="p_discount_bar" style="width: 100%; postion: relative; float: left; margin: 2px;">';p+='<div class="p_oldprice_1" title="一月内实卖最高价">最高价：<span style="text-decoration: line-through;color: #999;">￥'+gview.data[this.i].oldprice+"</span></div>";p+='<div class="p_discount_1">折扣：<span style="color: #F60;font-size: 12px;">'+gview.data[this.i].discount+"</span></div>";p+="</div>";}p+='<hr style="position: relative; float: left; width: 100%"/>';p+='<div class="p_comments_1">';p+=gview.data[this.i].desc;p+="</div>";p+="</div>";p+="</div>";p+='<div class="p_desc_1">';p+='<div class="p_desc_1_inner">';p+=gview.data[this.i].comments;p+="</div>";p+="</div>";p+='<div id="p_app_1" class="p_app_1">';p+='<div class="p_app_1_inner">';p+='<a class="btn" target="_blank" href="'+gview.data[this.i].url+'">去 ['+gview.data[this.i].domain+"]</a><br/>";if(gview.isFavoriteView()){p+='<a class="btn" href="javascript:void(0)" onclick="gview.removeFavorite(\''+gview.data[this.i].url+"')\">从收藏盒 删除</a>";}else{p+='<a class="btn" href="javascript:void(0)" onclick="gview.addFavorite(\''+gview.data[this.i].url+"')\">放入 收藏盒</a>";}p+='<a class="btn" href="javascript:void(0)" onclick="guser.notify(\''+gview.data[this.i].url+"','"+gview.data[this.i].price+"')\">降价通知我</a>";p+='<a class="btn" href="javascript:void(0)" onclick="guser.recommend(\''+gview.data[this.i].url+"')\">向朋友推荐</a>";p+='<a class="btn" href="javascript:void(0)" onclick="g2.copyLink(\''+gview.data[this.i].url+"')\">复制链接</a>";p+="</div>";p+="</div>";this.prod=$('<div class="product_1">'+p+"</div>");this.dash.append(this.prod);o='<div id="gproduct_reflect_'+this.i+'" class="product_reflect_1" ';o+=">"+p+"</div>";this.prod_reflect=$(o);this.dash.append(this.prod_reflect);if(!$.browser.msie){o='<div id="gproduct_reflect_b_'+this.i+'" class="product_reflect_1" style="z-index: 3;background: url(http://img.giisoo.com/images/product_reflect_1.png) repeat-x;"><div>';e=$(o);this.dash.append(e);}p='<img class="image_1_small_'+this.i+'" i='+this.i+' src="'+gview.data[this.i].img+'" style="height:'+k+"px; width:"+d+"px;margin:"+l+"px 0px "+l+"px "+b+'px;">';o='<div class="product_1" style="z-index: 2;background: white; cursor: pointer;';if(this.scale==1){o+="display: none;";}o+='" i="'+this.i+'">'+p+ +"</div>";this.mask=$(o);this.mask.click(gview.select1);this.dash.append(this.mask);o='<div class="product_reflect_1" style="z-index: 2;background: white;';if(this.scale==1){o+="display: none;";}o+='">'+p+ +"</div>";this.mask_reflect=$(o);this.dash.append(this.mask_reflect);$(".image_1_big_"+this.i).load(this.onload);$(".image_1_small_"+this.i).load(this.onload);};GProduct.prototype.getRate=function(a){if(a>4.9){return"5";}else{if(a>4.1&&a<=4.9){return"4b5";}else{if(a>3.9&&a<=4.1){return"4";}else{if(a>0&&a<=0.9){return"0b5";}else{if(a>0.9&&a<=1.1){return"1";}else{if(a>1.1&&a<=1.9){return"1b5";}else{if(a>1.9&&a<=2.1){return"2";}else{if(a>2.1&&a<=2.9){return"2b5";}else{if(a>2.9&&a<=3.1){return"3";}else{if(a>3.1&&a<=3.9){return"3b5";}}}}}}}}}}return"0";};GPosition=function(){this.curr=0;this.direction=0;this.changed=0;};GPosition.prototype.layer=function(a){var b=a-this.curr+4;if(b<0){b=0;}else{if(b>layer.length-1){b=layer.length-1;}}if($.browser.msie){return ie_layer[b];}else{return layer[b];}};GPosition.prototype.get=function(){return this.curr;};GPosition.prototype.set=function(a){this.direction=a-this.curr;this.changed=this.direction;this.curr=a;};GPosition.prototype.next=function(){this.curr++;this.direction=1;this.changed=1;if(this.curr==gview.data.length){this.curr=gview.data.length-1;this.changed=0;if(gview.isSearchView()){dd=gview.data[this.curr].id;nextPage();}}};GPosition.prototype.prev=function(){this.curr--;this.direction=-1;this.changed=1;if(this.curr<0){this.curr=0;this.changed=0;if(gview.isSearchView()){prevPage();}}};GTransition=function(a){this.e=a;this.duration=800;this.left=parseInt(a.attr("left"));this.top=parseInt(a.attr("top"));this.scale=parseFloat(a.attr("scale"));};GTransition.prototype.dest=function(b,a,c){this.des_left=parseInt(b);this.des_top=parseInt(a);this.des_scale=parseFloat(c);};GTransition.prototype.run=function(){this.time=new Date().getTime();timer.run(this);};GTransition.prototype.run=function(g){try{var a=false;if(gview.g_animate=="1"&&(this.time+this.duration)>g){var f=(g-this.time)/this.duration;var d=(this.des_left-this.left)*f+this.left;var c=(this.des_top-this.top)*f+this.top;var k=(this.des_scale-this.scale)*f+this.scale;a=true;}}catch(b){}if(!a){var c=this.des_top;var d=this.des_left;var k=this.des_scale;}var h=false;if(this.e.attr("top")!=c){this.e.attr("top",c);this.e.css("top",c+"px");h=true;}if(this.e.attr("left")!=d){this.e.attr("left",d);this.e.css("left",d+"px");h=true;}if(this.e.attr("scale")!=k){this.e.attr("scale",k);this.e.css("-webkit-transform","matrix("+k+", 0, 0, "+k+", 0, 0)");this.e.css("-moz-transform","matrix("+k+", 0, 0, "+k+", 0, 0)");this.e.css("-o-transform","matrix("+k+", 0, 0, "+k+", 0, 0)");this.e.css("transform","matrix("+k+", 0, 0, "+k+", 0, 0)");this.e.css("filter","progid:DXImageTransform.Microsoft.Matrix(M11="+k+", M12=0, M21=0, M22="+k+", SizingMethod='auto expand')");this.e.css("-ms-filter","progid:DXImageTransform.Microsoft.Matrix(M11="+k+", M12=0, M21=0, M22="+k+", SizingMethod='auto expand')");h=true;}return a&&h;};GTask=function(a){this.func=a;this.time=new Date().getTime();this.duration=400;};GTask.prototype.run=function(b){var a=(b-this.time)/this.duration;return this.func(a);};GTimer=function(a){this.queue=new Array();this.id=null;this.interval=a;};GTimer.prototype.run=function(a){this.queue.push(a);if(this.id===null){var b=this;this.id=self.setInterval(function(){b.execute();},this.interval);}};GTimer.prototype.execute=function(){if(this.queue.length==0){self.clearInterval(this.id);this.id=null;}else{for(i=this.queue.length-1;i>=0;i--){var a=this.queue[i];if(a!=undefined&&!a.run(new Date().getTime())){this.queue.splice(i,1);}}}};var timer=new GTimer(20);var _page_changed=0;var dd=0;function nextPage(){if(_page_changed==1){return;}var b=$("#page_next");if(b){var a=b.attr("href");if(a){_page_changed=1;a+="&v="+gview.mode+"&di="+gview.curr.direction;window.location=a;}}}function prevPage(){if(_page_changed==1){return;}var b=$("#page_prev");if(b){var a=b.attr("href");if(a){_page_changed=1;a+="&v="+gview.mode+"&di="+gview.curr.direction;window.location=a;}}}function changeView(){if(dash_view=="1"){gview.mode="1";$("#tips-2").fadeIn();self.setTimeout(function(){$("#tips-2").hide();},10000);}else{gview.mode="x";$("#tips-2").hide();}gview.render();}var guser=new GUser;function GUser(){this.modal_login=null;this.modal_changepwd=null;this.modal_lostpwd=null;this.model_priceDown=null;this.price=null;this.user=null;var params={};params.a="myself";$.post("/ajax/user.htm",params,function(data){try{var d=eval(data);if(d.login==1){guser.user=d;}}catch(e){}});}GUser.prototype.recommend=function(a){if(guser.user==null){guser.login();}else{this.url=a;if(this.model_recommend==null){this.render_recommend();}this.model_recommend.modal();$("#recommend_status").html("");}};GUser.prototype.notify=function(a,b){if(guser.user==null){guser.login();}else{this.url=a;if(this.model_notify==null){this.render_notify();}this.model_notify.modal();$("#notify_status").html("");b=b.replace(",","");this.price=parseInt(b);b=parseInt(this.price*0.91);$("#modal_price").attr("value",b);$("#modal_phone").attr("value",guser.user.phone);$("#modal_email").attr("value",guser.user.email);}};GUser.prototype.login=function(){if(this.modal_login==null){this.render_login();}this.modal_login.modal();};GUser.prototype.render_recommend=function(){var a='<div class="modal_panel" ><div class="fields"><nobr><label class="label">您朋友的邮箱：</label><input style="margin-right: 20px;" class="input" type="text" id="modal_user" size="20" onkeydown="if(event.keyCode==13){guser._recommend();}"></nobr></div><div class="fields"><nobr><label class="label">或您朋友的手机：</label><input style="margin-right: 20px;" class="input" type="text" id="modal_phone" size="20" onkeydown="if(event.keyCode==13){guser._recommend();}"></nobr></div><div class="fields" style="height: 16px;"><span id="recommend_status" style="font-size: 12px;width:100%;text-align:center;color:#FF0000"> </span></div><div class="fields"><button style="margin: 2px 0px 0px 55px" onclick="guser._recommend()">确定</button><button style="margin-left: 20px;" onclick="guser._cancel()">取消</button></div></div>';this.model_recommend=$(a);};GUser.prototype.render_notify=function(){var a='<div class="modal_panel" ><div class="fields"><nobr><label class="label">你期望的价格:</label><input style="margin-right: 20px;" class="input" type="text" id="modal_price" size="20" onkeydown="if(event.keyCode==13){guser._notify();}"></nobr></div><div class="fields"><nobr><label class="label">通知到手机:</label><input style="margin-right: 20px;" class="input" type="text" id="modal_phone" size="20" value="" onkeydown="if(event.keyCode==13){guser._notify();}"></nobr></div><div class="fields"><nobr><label class="label">或通知到邮箱:</label><input style="margin-right: 20px;" class="input" type="text" id="modal_email" size="20" value="" onkeydown="if(event.keyCode==13){guser._notify();}"></nobr></div><div class="fields" style="height: 16px;"><span id="notify_status" style="font-size: 12px;width:100%;text-align:center;color:#FF0000"> </span></div><div class="fields"><button style="margin: 2px 0px 0px 55px" onclick="guser._notify()">确定</button><button style="margin-left: 20px;" onclick="guser._cancel()">取消</button></div></div>';this.model_notify=$(a);};GUser.prototype._recommend=function(){var c=this.url;var b=$("#modal_user").attr("value");var a=$("#modal_phone").attr("value");if(b==""&&a==""){$("#recommend_status").html("请填写一个邮箱或手机号码！");return false;}else{var d={};d.user=b;d.phone=a;gview.sendRecommend(c,d);}$.modal.close();};GUser.prototype._notify=function(){var c=this.url;var d=parseInt($("#modal_price").attr("value"));var a=$("#modal_phone").attr("value");var b=$("#modal_email").attr("value");if(d<0){$("#notify_status").html("期望值设置不能低于0!");return false;}else{if(d>guser.price){$("#notify_status").html("期望值设置不能高于原价！");return false;}else{if(a==""&&b.indexOf("@")<0){$("#notify_status").html("请填写一个手机号码或邮箱！");return false;}var f={};f.price=d;f.phone=a;f.email=b;gview.addNotify(c,f);}}$.modal.close();};GUser.prototype.logout=function(){var a={};a.a="logout";$.post("/ajax/user.htm",a,function(b){$.cookie("_sid","");$("#user-login-bar").html("<a href='https://www.giisoo.com/my/login.htm'>登陆</a>|<a href='https://www.giisoo.com/my/register.htm'>注册</a>|<a href='/help/help.htm'>帮助</a>");g2.showMenu("usermenu",0);});};GUser.prototype._login=function(){var u=$("#id_username").attr("value");var p=$("#id_password").attr("value");var auto=$("#id_autoLogin").attr("value");if(u.length<1||p.length<1){$("#login_status").html("请输入用户名或者密码！");return false;}var params={};params.u=u;params.p=p;params.auto=auto;params.a="login";$.post("/ajax/user.htm",params,function(data){var d=eval(data);if(d.ok==1){$.modal.close();if(d.sid){$.cookie("_sid",d.sid,{expires:7});}$("#user-login-bar").html("欢迎<b style='margin-right: 5px;'> "+d.display+"</b>|<a id='bar-usermenu' class='menubar' onmouseover='g2.showMenu(\"usermenu\",1)' onmouseout='g2.showMenu(\"usermenu\",0)' href='javascript:void(0)'><span>我的吉搜</span><span class='i2 arrow_down'></span></a>|<a href='/help/help.htm'>帮助</a>'");return true;}else{$("#login_status").html(d.m);return false;}});};GUser.prototype.isValidEmailAddress=function(b){var a=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return a.test(b);};
