jQuery.fn.popin=function(D){var B=jQuery.extend({width:250,height:250,className:"",loaderImg:"",opacity:0.5,onStart:null,onComplete:null,onExit:null},D);
jQuery(this).each(function(){jQuery(this).click(function(){A($(this).attr("href"));
return false
})
});
var E=new Image();
E.src=B.loaderImg;
ie6=($.browser.msie&&($.browser.version=="6.0"))?true:false;
$("body").css("position","relative");
function A(G){if(B.onStart!=null){B.onStart()
}if(ie6==true){$("#PPNCSS").remove();
$("body").append('<style type="text/css" id="PPNCSS">.popin-voile {top:expression(documentElement.scrollTop + body.scrollTop + "px")}.popin {top:expression(documentElement.scrollTop + body.scrollTop + (documentElement.clientHeight/2) - '+(B.height/2)+' + "px")}</style>')
}$("body").prepend('<div class="popin-voile"></div>');
$(".popin-voile").css("opacity",0).css("left",0).css("z-index","9000").css("width","100%").css("height",0).css("background-color","#000").css("background-position","center center").css("background-repeat","no-repeat");
if(ie6==true){$(".popin-voile").css("position","absolute")
}else{$(".popin-voile").css("top",0).css("position","fixed")
}if(ie6==true){PPNhtmlScroll=document.getElementsByTagName("html")[0].scrollTop;
var F=new Object();
F.top=parseInt($("body").css("margin-top"));
F.right=parseInt($("body").css("margin-right"));
F.bottom=parseInt($("body").css("margin-bottom"));
F.left=parseInt($("body").css("margin-left"));
$("html, body").css("height","100%");
$("html, body").css("overflow","hidden");
$("body").height($("body").height());
PPNbodyHeight=parseInt($("body").height());
$("html, body").css("overflow","visible");
$("html, body").css("overflow-x","visible");
PPNbodyTop=((F.top+F.bottom)<PPNhtmlScroll)?(F.top+F.bottom-PPNhtmlScroll):0;
$("body").css("top",PPNbodyTop);
$(".popin-voile").css("top",-(F.top+F.bottom-PPNhtmlScroll));
$(".popin-voile").css("left",(-F.left));
$(".popin-voile").css("width",$("html").width())
}else{$("html, body").css("overflow","hidden")
}$(".popin-voile").animate({opacity:B.opacity,height:((ie6==true)?(PPNbodyHeight+F.top+F.bottom):"100%")},function(){$(".popin-voile").css("background-image","url('"+B.loaderImg+"')");
$(".popin").css("height",$("body").height());
$.ajax({type:"GET",url:G,dataType:"html",success:function(H){$("body").prepend('<div class="popin '+B.className+'"><div class="popin-content"></div></div>');
$(".popin").css("left","50%").css("z-index","9500").css("width",B.width).css("height",B.height).css("overflow","hidden").css("margin-left",-(B.width/2));
$(".popin-content").css("overflow","auto").css("height",$(".popin").height()-parseInt($(".popin").css("padding-top"))-parseInt($(".popin").css("padding-bottom")));
if(ie6==true){$(".popin").css("position","absolute").css("margin-top",0)
}else{$(".popin").css("position","fixed").css("top","50%").css("margin-top",-(B.height/2))
}$(".popin-content").html(H)
},complete:function(){$(".popin-voile").css("background-image","");
if(ie6==true){$(".popin").css("top",parseInt($(".popin").css("top"))-PPNbodyTop)
}$(".popin").fadeIn("slow",function(){if(B.onComplete!=null){B.onComplete()
}});
$(".popin-close, .popin-voile").click(function(){C();
return false
})
}})
});
$("html").keydown(function(H){if(H.keyCode=="27"){C()
}})
}function C(){$("html").unbind("keydown");
$(".popin").fadeOut("slow",function(){$(".popin-voile").animate({opacity:0,height:0},function(){if(ie6==true){$("html, body").css("height","auto");
$("html, body").css("overflow","auto");
$("html, body").css("overflow-x","hidden");
$("body").css("top",0);
window.scrollTo(0,(PPNhtmlScroll))
}else{$("html, body").css("overflow","auto")
}$(".popin, .popin-voile").remove();
if(B.onExit!=null){B.onExit()
}})
})
}};
