/* //\/\\
 * Id: jliteframe.js v1.1.10 04-DEC-09 mikel
 * Description: Lightbox inspired javascript iframe minibrowser for displaying remote content
 * Requires: jquery, jquery-ui
 * Copyright (C) 2009 Michael Liberatore (www.michaelliberatore.com)
 */

(function($){$.fn.extend({liteFrame:function(g){var A={title:'MiniBrowser'};var g=$.extend(A,g);return this.each(function(){var l=$(this);function B(){$(".jLiteFrameWrapper").css({'background-color':'#444444','display':'none','height':'100%','width':'100%','position':'absolute','z-index':'90','top':'0','left':'0'});$(".jLiteFrameContainer").css({'background-color':'#FFFFFF','border':'2px outset','display':'none','height':'50%','width':'50%','position':'absolute','z-index':'95','top':'0','left':'0'});$(".jLiteFrameTitle").css({'background-color':'#FFFFFF','border-bottom':'1px solid #AAAAAA','height':'20px','width':'100%'});$(".jLiteFrameTitle td").css({'padding':'0 5px'});$(".jLiteFrame").css({'height':'100%','width':'100%','overflow':'auto'});};function o(title){var c;c='<div class="jLiteFrameWrapper"></div>';c+='<div class="jLiteFrameContainer">';c+='<table border="0" cellpadding="0" cellspacing="0" class="jLiteFrameTitle">';c+='<tr>';c+='<td align="left" valign="middle" width="25%">';c+='<img src="/images/icon_back.png" alt="Back" class="jLiteFrameImgBack" />';c+='<img src="/images/icon_forward.png" alt="Forward" class="jLiteFrameImgForward" />';c+='</td>';c+='<td align="center" valign="middle" width="50%">';c+=title;c+='</td>';c+='<td align="right" valign="middle" width="25%">';c+='<img src="/images/icon_close.png" alt="Close Window" class="jLiteFrameImgClose" />';c+='</td>';c+='</tr>';c+='</table>';c+='<div class="jLiteFrameLoader" style="text-align:center;font-size:16px;font-weight:bold;padding: 40px 0;">';c+='Loading Content...';c+='<div class="jLiteFrameProgressBar" style="margin:auto;width:50%;"></div>';c+='</div>';c+='<iframe class="jLiteFrame" src="" frameborder="0"></iframe>';c+='</div>';l.after(c);B();$(".jLiteFrameProgressBar").progressbar();};function f(k){var h=$(window).height();var w=$(window).width();$(".jLiteFrameWrapper").css('opacity',0.75);$(".jLiteFrameWrapper").css('height',h);$(".jLiteFrameWrapper").css('width',w);if(typeof(k)=='number'){$(".jLiteFrameContainer").css('height',k);}else{$(".jLiteFrameContainer").css('height',h*.75);}$(".jLiteFrameContainer").css('width',w*.75);var top=(h*.25)/2;if(!$.browser.msie&& !$.browser.mozilla){alert('using 120');if(top<120)top=120;}$(".jLiteFrameContainer").css('top',top);$(".jLiteFrameContainer").css('left',(w*.25)/2);$(".jLiteFrame").css('height',(h*.75)-25);};var d=0;function v(){if(d<100){$(".jLiteFrameProgressBar").progressbar('option','value',d++);}else{clearInterval(j);$(".jLiteFrameLoader").hide();d=0;$(".jLiteFrameProgressBar").progressbar('option','value',d);f();$(".jLiteFrame").fadeIn();}};function r(url,callback){$(".jLiteFrame").attr({src:url});$(".jLiteFrame").load(function(){callback(this);});};var j;function m(url){clearInterval(j);$(".jLiteFrame").hide();f(160);$(".jLiteFrameWrapper").fadeIn();$(".jLiteFrameContainer").fadeIn();$(".jLiteFrameLoader").fadeIn();j=setInterval(v,100);r(url,function(){d=90;});};function t(){$(".jLiteFrameWrapper").fadeOut();$(".jLiteFrameContainer").fadeOut();};o(g.title);jQuery.event.add(window,"resize",f);$("a",l).click(function(e){e.preventDefault();var url=$(this).attr('href');m(url);});$(".jLiteFrameImgClose").click(function(){t();});$(".jLiteFrameImgBack").click(function(){$(".jLiteFrame").attr({src:history.go(-1)});});$(".jLiteFrameImgForward").click(function(){$(".jLiteFrame").attr({src:history.go(+1)});});});}});})(jQuery);
