var index = 0;
var maindombody;
var jsonsize;
var contenthight;
var hidebottom;
var speed = 500;
var topdombody;
var leftdombody;
var tipspop;
function dotips(){
leftdombody= $('body',window.frames["leftFrame"].document);
topdombody=$('body',window.frames["topFrame"].document);
maindombody=$('body',window.frames["mainFrame"].document);
setTimeout(function(){
tipspop = new TipsPop();
},1000)
}
function TipsPop(){
if(tipsJson.length<=0){
return;
}
this.init();
if(index == 0){
setTimeout(function(){
TipsPop.prototype.showTipsPop();
},500);
}
index ++;
return this;
}
TipsPop.prototype={
init:function(){
jsonsize = tipsJson.length;
if(jsonsize>5){
jsonsize=5;
}
contenthight = 100 * jsonsize;
hidebottom = contenthight+10;
if(typeof($("#supplytips",maindombody).html()) != "undefined" || $("#supplytips",maindombody).html() != null){
return;
}
$(maindombody).append('<div id="fade"></div>');
$("#fade",maindombody).css({'display':'none','background' : '#000','position':'fixed','top':'0','left':'0','width':'100%','height':'100%','opacity':'.80','z-index':'9999'});
$(topdombody).append('<div id="fade"></div>');
$("#fade",topdombody).css({'display':'none','background' : '#000','position':'fixed','top':'0','left':'0','width':'100%','height':'100%','opacity':'.80','z-index':'9999'});
$(leftdombody).append('<div id="fade"></div>');
$("#fade",leftdombody).css({'display':'none','background' : '#000','position':'fixed','top':'0','left':'0','width':'100%','height':'100%','opacity':'.80','z-index':'9999'});
$(maindombody).append('<div id="supplytips"></div>');
$("#supplytips",maindombody).css({
'padding':'5px'
,'position': 'fixed'
,'width': '250px'
,'bottom':'-'+hidebottom+'px'
,'z-index': '99999'
,'right': '1%'
,'background': 'white'
,'box-shadow': '0px 0px 20px #FFFFFF'
,'border-radius': '10px'
,'behavior': 'url(ie-css3.htc)'
})
$("#supplytips",maindombody).append('<div id="lm_bg" style="border-radius: 10px;behavior: url(ie-css3.htc);text-align: center;line-height: 35px">'+
'<b style="font-size: 15px;font-family: 微软雅黑">货源提醒</b>'+
'</div>');
var jsonHtmlStr = '<div style="width:99%;height:'+contenthight+'px;overflow:scroll;overflow-x:hidden;margin-top:10px;">';
$(tipsJson).each(function(){
jsonHtmlStr += '<p title="'+this.Content+'" style="padding: 5px 10px 5px 10px;font-size: 13px;word-break:break-all;border-width: 0;height:60px;">';
jsonHtmlStr +=this.Content;
jsonHtmlStr +='<hr style="display: block;padding: 0px;border-color:#a2c6de ;border-bottom-style : solid;border-width: 0 0 1px;"/></p>';
})
jsonHtmlStr += '</div>';
$("#supplytips",maindombody).append(jsonHtmlStr);
maindombody.click(function(){
TipsPop.prototype.removeTipsPop();
})
topdombody.click(function(){
TipsPop.prototype.removeTipsPop();
})
leftdombody.click(function(){
TipsPop.prototype.removeTipsPop();
})
$("#supplytips",maindombody).click(function(event){
event.stopPropagation();
})
$("#supplytips",maindombody).mouseover(function(){
TipsPop.prototype.showTipsPop();
})
}
,
showTipsPop:function(){
if($("#supplytips",maindombody).css('bottom')=='-'+hidebottom+'px'){
$('#fade',maindombody).css({'filter' : 'alpha(opacity=80)'}).fadeIn(speed);
$('#fade',topdombody).css({'filter' : 'alpha(opacity=80)'}).fadeIn(speed);
$('#fade',leftdombody).css({'filter' : 'alpha(opacity=80)'}).fadeIn(speed);
$("#supplytips",maindombody).animate({bottom: 0}, speed);
}
},
removeTipsPop:function(){
if($("#supplytips",maindombody).css('bottom')=='0px'){
$('#fade',topdombody).fadeOut(speed);
$('#fade',maindombody).fadeOut(speed);
$('#fade',leftdombody).fadeOut(speed);
$("#supplytips",maindombody).animate({bottom: -hidebottom}, speed);
}
}
}