
var topWin=window;var SimpleModal=function(){var that={};that.open=function(url,height,width,callback){if(!window.SimpleModal.isController){if(typeof topWin.SimpleModal!=='object'){alert('Simple modals need the JavaScript available in the top window.');}else{topWin.SimpleModal.open(url,height,width,callback);}
return;}
if(jQuery.browser.msie){$('select').css('visibility','hidden');$('html').css('overflow','hidden');}
var mask=document.createElement('div'),eDiv=document.createElement('div');$(document.body).append(mask).append(eDiv);$(mask).addClass('_simpleModalMask').css({'position':'absolute','top':'0px','left':'0px','width':$(document).width()+'px','height':$(document).height()+'px','margin':'0px','padding':'0px','background-color':'#FFFFFF','opacity':0.8,'overflow':'hidden'});$(eDiv).addClass('_simpleModal').css({'height':height+'px','width':width+'px','padding':'0px','margin':'0px','border':'1px solid #ccc','position':'absolute','background-color':'#FFF','left':(($(window).width()/2)-(width/2))+$(document).scrollLeft()+'px','top':(($(window).height()/2)-(height/2))+$(document).scrollTop()+'px'}).append("<iframe frameborder='0' scrolling='no'></iframe>");$('iframe:first',eDiv).attr('src',url).css({'height':'100%','width':'100%','background-color':'#FFF','border':'none','overflow':'hidden'});$(window).scroll(function(){$('div._simpleModal').css({'left':(($(window).width()/2)-(width/2))+$(document).scrollLeft()+'px','top':(($(window).height()/2)-(height/2))+$(document).scrollTop()+'px'});});that.callbacks.push(callback);};that.close=function(data){if(!window.SimpleModal.isController){if(typeof topWin.SimpleModal!=='object'){alert('Simple modals need the JavaScript available in the top window.');}else{topWin.SimpleModal.close(data);}
return;}
$('div._simpleModal:last').remove();$('div._simpleModalMask:last').remove();if($('div._simpleModal').length<1){if(jQuery.browser.msie){$('select').css('visibility','visible');$('html').css('overflow','auto');}}
if(that.callbacks.length>0){var fn=that.callbacks.pop();if(typeof fn==='function'){fn(data);}}};that.isController=false;that.callbacks=[];return that;}();(function(){var previousTopWin;while(true){var ref;try{ref=topWin.parent.location.href;}
catch(err){ref=undefined;}
if(typeof ref==='undefined'||previousTopWin===topWin){break;}
else{previousTopWin=topWin;topWin=topWin.parent;}}
if(typeof topWin.SimpleModal==='object'){topWin.SimpleModal.isController=true;}}());
