';}};html+='';document.getelementbyid("miaozhen"+arg.gi_pid).innerhtml=html;gi_focus__.now++;};gi_focus__.deliver=function(arg){gi_focus__.arg=arg;var ad_arr=arg.gi_ad_arr;var newelement=document.createelement("div");newelement.innerhtml=gi_get_monitor_code(gi_ga(ad_arr[0].gi_ldp,"k"),gi_ga(ad_arr[0].gi_ldp,"p"));document.getelementbyid("miaozhen"+arg.gi_pid).parentnode.appendchild(newelement);gi_focus__.now=0;gi_focus__.timer=setinterval(gi_focus__.next,arg.gi_interval);gi_focus__.next();};var gi_rotate__=new object();gi_rotate__.deliver=function(arg){var ad_arr=arg.gi_ad_arr;var i=ad_arr[0][math.floor(math.random()*ad_arr[0].l)];if(arg.gi_automatchscreen&&screen.width>=1280){arg.gi_width=arg.gi_width_w;};var click='';if(ad_arr[i].gi_type=="img"){var ad='';}else if(ad_arr[i].gi_type=="flash"){var ad='';};ad=click+ad;var gi_k=gi_ga(ad_arr[i].gi_ldp,"k");var gi_p=gi_ga(ad_arr[i].gi_ldp,"p");document.getelementbyid("miaozhen"+arg.gi_pid).innerhtml+=ad+gi_get_monitor_code(gi_k,gi_p);;};
var initscrolly=0;
var proids=new array();
function compare(){
if($("#compare").get(0)==null){
$("body").append("
商品比较
");
$("#compare").css({position:"absolute",top:"220px",right:"0px"});
iscoo();}
if($.browser.msie){
var defaulty=document.documentelement.scrolltop;
var perceh=0.3*(defaulty-initscrolly);
if(perceh>0){perceh=math.ceil(perceh);}
else{perceh=math.floor(perceh);}
$("#compare").get(0).style.top=parseint($("#compare").get(0).style.top)+perceh+"px";
initscrolly=initscrolly+perceh;
settimeout("compare()",50)}else{
window.onscroll=function(){
$("#compare").get(0).style.top=parseint($("#compare").get(0).style.top)+"px";
$("#compare").get(0).style.position="fixed";}}}
function clearcompare(){
$("#comprolist").empty();
$("#compare").hide();
createcookie("compare","");
proids=new array();}
function addtocompare(checkobj,checkid,checkproname){
$("#compare").show();
$(".compro").show();
var proidstemp=proids.join(".");
if(proidstemp.indexof(checkid)==-1){
if(proids.length<3){
proids.push(checkid);
$("#comprolist").append("
"+checkproname+"
");
writecompare(checkid,checkproname);}else{
alert("对不起,最多可以选择三种商品进行对比!");}}else{
alert("对不起,您已经选择此商品!");
return;}}
function reducecompare(checkid){
$("#check_"+checkid).remove();
$.each(proids,function(i,n){
if(checkid==n){
proids.splice(i,1);}});
var coo=readcookie("compare");
var idindexstart=coo.indexof(checkid);
var idindexend=coo.indexof("|||",idindexstart)+3;
var delstr=coo.substring(idindexstart,idindexend);
var innerstr=coo.replace(delstr,"")
createcookie("compare",innerstr);
if(proids.length==0){$(".compro").hide();}}
function opencompare(){
switch(proids.length){
case 1:
alert("对不起,最少选择两种商品进行对比!");
break;
case 2:
window.open("http://www.360buy.com/pcompare.aspx?s1="+proids[0]+"&s2="+proids[1]);
break;
case 3:
window.open("http://www.360buy.com/pcompare.aspx?s1="+proids[0]+"&s2="+proids[1]+"&s3="+proids[2]);
break;
default:
alert("请选择2-3件商品进行对比!");
return;}}
function writecompare(checkid,checkproname){
var comparelist=readcookie("compare");
if(comparelist==null){comparelist="";}
comparelist+=checkid+"||"+escape(checkproname)+"|||";
createcookie("compare",comparelist);}
function iscoo(){
var coo=readcookie("compare");
if(coo){
var cootemp=coo.split("|||");
var comparelisttemp="";
for(var i=0;i"+unescape(cootemp[i].split("||")[1])+"";
proids.push(cootemp[i].split("||")[0]);}
$("#comprolist").html(comparelisttemp);
$("#compare").show();
$(".compro").show();}}
function createcookie(name,value,days,tdom){
var tdom=(tdom)?tdom:"/";
if(days){
var date=new date();
date.settime(date.gettime()+(days*24*60*60*1000));
var expires="; expires="+date.togmtstring();}else{
var expires="";}
document.cookie=name+"="+value+expires+"; path="+tdom;}
function readcookie(name){
var nameeq=name+"=";
var ca=document.cookie.split(';');
for(var i=0;i