(function(a){a.fn.lightBox=function(c){c=jQuery.extend({overlayBgColor:"#000",overlayOpacity:0.8,auto:"false"},c);var g=this;function e(){d(this,g);return false}function d(m,l){a("embed, object, select").css({visibility:"hidden"});a("div#TellAFriend select").css({visibility:"visible"});k()}function f(){$j("div.TellAFriend div.frow-radio input").unbind("click").click(function(){var l=$j(this).attr("id");$j("div.TellAFriend div.frow-radio input").each(function(){$j(this).parent().parent().parent().parent().removeClass($j(this).attr("id")+"-selected");$j("div.product-shot").removeClass($j(this).attr("id"));var n="graphics/uk/components/tell_a_friend/"+$j(this).attr("id")+"text_off.gif";$j(this).parent().siblings("span.label").children("img").attr("src",n)});$j(this).parent().parent().parent().parent().addClass($j(this).attr("id")+"-selected");$j("div.product-shot").addClass(l);var m="graphics/uk/components/tell_a_friend/"+l+"text_on.gif";$j(this).parent().siblings("span.label").children("img").attr("src",m)})}function k(){a("body").append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box">'+$j("div#TellAFriendContainer").html()+"</div></div>");$j("div#TellAFriendContainer").remove();f();var l=j();a("#jquery-overlay").css({backgroundColor:c.overlayBgColor,opacity:c.overlayOpacity,width:l[0],height:l[1]}).fadeIn();var m=i();a("#jquery-lightbox").css({top:m[1]+(l[3]/10),left:m[0]}).show();a("div#TellAFriend h1 em").unbind("click").click(function(){b()});a(window).resize(function(){var n=j();a("#jquery-overlay").css({width:n[0],height:n[1]});var o=i();a("#jquery-lightbox").css({top:o[1]+(n[3]/10),left:o[0]})})}function b(){a("#content").append("<div id='TellAFriendContainer'>"+a("#lightbox-container-image-box").html()+"</div>");a("#TellAFriend h1 em").unbind("click");a("#jquery-lightbox").remove();a("#jquery-overlay").fadeOut(function(){a("#jquery-overlay").remove()});a("embed, object, select").css({visibility:"visible"});$j("div#TellAFriendContainer").css({display:"none"})}function j(){var n,l;if(window.innerHeight&&window.scrollMaxY){n=window.innerWidth+window.scrollMaxX;l=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){n=document.body.scrollWidth;l=document.body.scrollHeight}else{n=document.body.offsetWidth;l=document.body.offsetHeight}}var m,o;if(self.innerHeight){if(document.documentElement.clientWidth){m=document.documentElement.clientWidth}else{m=self.innerWidth}o=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){m=document.documentElement.clientWidth;o=document.documentElement.clientHeight}else{if(document.body){m=document.body.clientWidth;o=document.body.clientHeight}}}if(l<o){pageHeight=o}else{pageHeight=l}if(n<m){pageWidth=n}else{pageWidth=m}arrayPageSize=new Array(pageWidth,pageHeight,m,o);return arrayPageSize}function i(){var m,l;if(self.pageYOffset){l=self.pageYOffset;m=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){l=document.documentElement.scrollTop;m=document.documentElement.scrollLeft}else{if(document.body){l=document.body.scrollTop;m=document.body.scrollLeft}}}arrayPageScroll=new Array(m,l);return arrayPageScroll}function h(n){var m=new Date();l=null;do{var l=new Date()}while(l-m<n)}if(c.auto=="true"){e()}else{return this.unbind("click").click(e)}}})(jQuery);
