/**
* Created by guohe on 2016/1/25.
*/
function inf(title,con,pic,bot_n1,bot_fn1,bot_n2,bot_fn2,fnrun){
var show=$('.divinf').length;
if(show>0){
}else{
var div="
"
$('body').append(div);
$(".divinf").css({
'left':'0px',
'top':'0px',
'width':'100%',
'height':'100%',
'position': 'fixed',
'z-index': '99',
'display':'none',
'font-size': '16px',
'background-color': 'rgba(0,0,0,0.4)'
});
$(".divinf .divinf_hide").css({
'position':'relative',
'left':'0px',
'top':'0px',
'width':'100%',
'height':'100%'
});
$(".divinf .divinf_box").css({
'margin-right': 'auto',
'margin-left': 'auto',
'height': 'auto',
'width': 'auto',
'position': 'fixed'
});
$(".divinf .divinf_box .divinf_box_up").css({
'border-radius':'5px 5px 0px 0px',
'padding-top': '10px',
'padding-bottom': '10px',
'padding-left': '10px',
'padding-right': '20px',
'color': '#FFF',
'background-color': 'rgba(255,0,0,0.7)',
'border-top-width': '1px',
'border-right-width': '1px',
'border-left-width': '1px',
'border-top-style': 'solid',
'border-right-style': 'solid',
'border-left-style': 'solid',
'border-top-color': '#FFF',
'border-right-color': '#FFF',
'border-left-color': '#FFF',
'text-indent' : '23px'
});
$(".divinf .divinf_box .divinf_box_Down").css({
'border-radius':'0px 0px 5px 5px',
'padding-top': '10px',
'padding-bottom': '15px',
'padding-left': '10px',
'padding-right': '20px',
'color': '#FFF',
'line-height':'1.5em',
'background-color': 'rgba(0,200,200,0.7)',
'border-right-width': '1px',
'border-left-width': '1px',
'border-right-style': 'solid',
'border-left-style': 'solid',
'border-right-color': '#FFF',
'border-left-color': '#FFF',
'border-bottom-width': '1px',
'border-bottom-style': 'solid',
'border-bottom-color': '#FFF'
});
$('.divinf_hide').click(function(){
$(".divinf").animate({'opacity':0 }, 300 ,'swing',function(){
if(bot_fn2!=undefined){
bot_fn2();
}
$('.divinf').remove();
});
});
}
$('.divinf a').css('color',"#FFF");
$('.divinf_box_up').html(''+title+' ');
var mstr='';
if(pic!=undefined && pic>0) {
mstr=" "
$('.divinf_box_Down_pic').attr('width','50');
}else{
$('.divinf_box_Down_pic').attr('width','0');
}
$('.divinf_box_Down_pic').html(mstr);
$('.divinf_box_Down_text').html(con);
if($('.divinf_box_Down_table_tr_td').length==0){
mstr=' ';
$('.divinf_box_Down').append(mstr);
}
mstr='';
if(bot_n1!=undefined || bot_n1!='') {
if($('.bot_n1').length==0){
mstr=" ";
$('.divinf_box_Down_table_tr_td').append(mstr);
}
$('.bot_n1').val(bot_n1);
}
if(bot_fn1!=undefined){
$('.bot_n1').unbind();
$('.bot_n1').click(function(){
$(".divinf").animate({'opacity':0 }, 300 ,'swing',function(){
bot_fn1();
$('.divinf').remove();
});
})
}
if(bot_n2!=undefined){
if($('.bot_n2').length==0){
mstr=" ";
$('.divinf_box_Down_table_tr_td').append(mstr);
}
if(bot_n2=='c'){
$('.bot_n2').val("取消");
var bot_fn2=function(){};
}else{
$('.bot_n2').val(bot_n2);
}
if(bot_fn2!=undefined){
$('.bot_n2').unbind();
$('.bot_n2').click(function(){
$(".divinf").animate({'opacity':0 }, 300 ,'swing',function(){
bot_fn2();
$('.divinf').remove();
});
});
}
}
if(bot_fn1!=undefined){
$(".divinf .divinf_box .divinf_box_Down_table_tr_td input").css({
'background-color': 'rgba(0,0,0,0)',
'font-size': '16px',
'border': '1px solid #FFF',
'cursor': 'pointer',
'color': '#FFF',
'border-radius':'2px',
'padding-top': '2px',
'padding-right': '5px',
'padding-bottom': '2px',
'margin-left':'15px'
});
$(".divinf .divinf_box .divinf_box_Down_table_tr_td input").mouseover(function(){
$(this).css('background-color','rgba(255,0,0,0.6)');
});
$(".divinf .divinf_box .divinf_box_Down_table_tr_td input").mouseout(function(){
$(this).css('background-color','rgba(0,0,0,0)');
});
}
var ww=$(window).width()/2;
var wh=$(window).height()/2;
$(".divinf").css('opacity','0')
$(".divinf_box").css('left','0px').css('top','0px');
$(".divinf").show(0,function(){
var bw=$('.divinf_box').width()/2;
var bh=$('.divinf_box').height()/2;
$(".divinf_box").css('left',ww-bw+'px').css('top',wh-bh+"px");
});
$(".divinf").animate({'opacity':1 }, 300 ,'swing');
if(fnrun!=undefined){
fnrun();
$(".divinf input").each(function(){
$(this).keypress(function( event ) {
if ( event.which == 13 ) $('.bot_n1').click();
});
$(this).keyup(function( event ) {
if ( event.which == 27 ) $('.divinf').remove();
});
});
}
if($('.msg_input').length>0){
$('.msg_input').select().focus();
}
}