var globaparam;var indicator_img_path=image_server+"/images/community_images/indicator.gif";var indicator_img_html='<img name="ibox_indicator" src="'+indicator_img_path+'" alt="Loading..." style="width:128px;height:128px;"/>';function init_ibox(j,a){var k="ibox";createIbox(document.getElementsByTagName("body")[0]);var g=(document.all)?document.all:document.getElementsByTagName("*");var f="rel";var d;if(j=="yes"){var b="height=488&width=532";var b=parseQuery(b);var h="";if(a.match("/subscription/register/controlPanel.htm")){window.location.href=a}else{showBG();showIbox(a,h,b);window.onscroll=maintPos;window.onresize=maintPos}return false}else{if(j=="cooper"){var b="height=488&width=532";showBG();var b=parseQuery(b);showIbox(a,h,b);window.onscroll=maintPos;window.onresize=maintPos;return false}else{if(j=="laveryinsight"){var b="height=488&width=532";showBG();var b=parseQuery(b);showIbox(a,h,b);window.onscroll=maintPos;window.onresize=maintPos;return false}else{if(j=="cartconfirm"){var b="height=160&width=320";showBG();var b=parseQuery(b);showIbox(a,h,b);window.onscroll=maintPos;window.onresize=maintPos;return false}else{for(var c=0;c<g.length-1;c++){d=g[c];if(d.getAttribute(f)){var l=d.getAttribute(f);if((l.indexOf("ibox")!=-1)||l.toLowerCase()=="ibox"){d.onclick=function(){var i=this.getAttribute(f);var n=parseQuery(i.substr(5,999));globaparam=n;var e=this.href;if(this.target!=""){e=this.target}var m=this.title;showBG();showIbox(e,m,n);window.onscroll=maintPos;window.onresize=maintPos;return false}}}}}}}}}showBG=function(){var f=getElem("ibox_w");var d=8;f.style.opacity=0;f.style.filter="alpha(opacity=0)";setBGOpacity=setOpacity;for(var c=0;c<=d;c++){setTimeout("setIboxOpacity('ibox_w',"+c+")",70*c)}f.style.display="";var b=new getPgSize();var e=new getScrollPos();var a=navigator.userAgent;if(a.indexOf("MSIE ")!=-1){f.style.width=b.width+"px"}else{f.style.width=b.width-20+"px"}f.style.height=b.height+e.scrollY+"px";selectVisibility("hidden")};selectVisibility=function(b){var a=document.getElementsByTagName("select");for(var c=0;c<a.length;++c){a[c].style.visibility=b}};hideBG=function(){var a=getElem("ibox_w");a.style.display="none";selectVisibility("visible")};var loadCancelled=false;showIndicator=function(){var a=getElem("ibox_progress");a.style.display="";posToCenter(a);a.onclick=function(){hideIbox();hideIndicator();loadCancelled=true}};hideIndicator=function(){var a=getElem("ibox_progress");a.style.display="none";a.onclick=null};createIbox=function(c){var a='<div id="ibox_w" style="display:none;"></div>';a+='<div id="ibox_progress" style="display:none;">';a+=indicator_img_html;a+="</div>";a+='<div id="ibox_wrapper" style="display:none">';a+='<div id="ibox_content"></div>';a+='<div id="ibox_footer_wrapper"><div id="ibox_close" style="float:right;">';a+='<a id="ibox_close_a" href="javascript:void(null);" ></a></div>';var b=document.getElementsByTagName("body")[0];var d=document.createElement("div");d.setAttribute("id","ibox");d.innerHTML=a;c.appendChild(d)};var ibox_w_height=0;showIbox=function(b,l,f){var a=getElem("ibox_wrapper");var e=0;b=b.toLowerCase();var g=/\.jpg|\.jpeg|\.png|\.gif|\.html|\.htm|\.php|\.cfm|\.asp|\.aspx|\.jsp|\.jst|\.rb|\.txt/g;var n=b.match(g);if(n==".jpg"||n==".jpeg"||n==".png"||n==".gif"){e=0;showIndicator();var c=new Image();c.onload=function(){c=resizeImageToScreen(c);hideIndicator();getElem("ibox_content").style.overflow="hidden";var i='<a href="javascript:void(null);"><img name="ibox_img" src="'+b+'" style="width:'+c.width+"px;height:"+c.height+'px;border:0;"/></a>';if(loadCancelled==false){a.style.height=c.height+"px";a.style.width=c.width+"px";a.style.display="";a.style.visibility="hidden";posToCenter(a);a.style.visibility="visible";setIBoxContent(i)}};loadCancelled=false;c.src=b}else{if(b.indexOf("#")>0){var j="";e=1;if(f.height){a.style.height=f.height+"px"}else{a.style.height="280px"}if(f.width){a.style.width=f.width+"px"}else{a.style.width="450px"}a.style.display="";a.style.visibility="hidden";posToCenter(a);a.style.visibility="visible";var d=b.substr(b.indexOf("#")+1,1000);var m=getElem(d);if(m){j=m.innerHTML}setIBoxContent(j)}else{if(n==".htm"||n==".html"||n==".php"||n==".asp"||n==".aspx"||n==".jsp"||n==".jst"||n==".rb"||n==".txt"||n==".cfm"){e=2;showIndicator();http.open("get",b,true);http.onreadystatechange=function(){var o=b.match("defaultadframe.php");if(http.readyState==4){hideIndicator();if(f.height){a.style.height=f.height+"px"}else{a.style.height="400px"}if(f.width){a.style.width=f.width+"px"}else{a.style.width="530px"}a.style.display="";a.style.visibility="hidden";posToCenter(a);a.style.visibility="visible";var i=http.responseText;setIBoxContent(i)}};http.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");http.send(null)}}}a.style.opacity=0;a.style.filter="alpha(opacity=0)";var k=10;setIboxOpacity=setOpacity;for(var h=0;h<=k;h++){setTimeout("setIboxOpacity('ibox_wrapper',"+h+")",30*h)}if(e==1||e==2){a.onclick=null;getElem("ibox_close_a").onclick=function(){hideIbox()}}else{a.onclick=hideIbox;getElem("ibox_close_a").onclick=null}};setOpacity=function(b,a){var c=getElem(b);c.style.opacity=a/10;c.style.filter="alpha(opacity="+a*10+")"};resizeImageToScreen=function(c){var b=new getPgSize();var a=b.width-100;var d=b.height-100;if(c.width>a){c.height=c.height*(a/c.width);c.width=a;if(c.height>d){c.width=c.width*(d/c.height);c.height=d}}else{if(c.height>d){c.width=c.width*(d/c.height);c.height=d;if(c.width>a){c.height=c.height*(a/c.width);c.width=a}}}return c};maintPos=function(){var d=getElem("ibox_wrapper");var c=getElem("ibox_w");var b=new getPgSize();var a=navigator.userAgent;if(a.indexOf("MSIE ")!=-1){c.style.width=b.width+"px"}else{c.style.width=b.width-20+"px"}if(a.indexOf("Opera/9")!=-1){c.style.height=document.body.scrollHeight+"px"}else{c.style.height=document.body.scrollHeight+50+"px"}posToCenter(d)};hideIbox=function(){hideBG();var a=getElem("ibox_wrapper");a.style.display="none";clearIboxContent();window.onscroll=null};posToCenter=function(d){var f=new getScrollPos();var b=new getPgSize();var c=new getElementSize(d);var a=Math.round(b.width/2)-(c.width/2)+f.scrollX;var e=Math.round(b.height/2)-(c.height/2)+f.scrollY;d.style.left=a+"px";d.style.top=e+"px"};getScrollPos=function(){var a=document.documentElement;this.scrollX=self.pageXOffset||(a&&a.scrollLeft)||document.body.scrollLeft;this.scrollY=self.pageYOffset||(a&&a.scrollTop)||document.body.scrollTop};getPgSize=function(){var a=document.documentElement;this.width=self.innerWidth||(a&&a.clientWidth)||document.body.clientWidth;this.height=self.innerHeight||(a&&a.clientHeight)||document.body.clientHeight};getElementSize=function(a){this.width=a.offsetWidth||a.style.pixelWidth;this.height=a.offsetHeight||a.style.pixelHeight};setIBoxContent=function(g){clearIboxContent();var f=getElem("ibox_content");f.innerHTML=g;try{var c=globaparam.targeturl;var d=c.replace("~","?");var a=d.replace("-","=");$("targeturl").value=a}catch(b){}f.style.overflow="auto"};clearIboxContent=function(){var a=getElem("ibox_content");a.innerHTML="";a.style.overflow="hidden"};getElem=function(a){return document.getElementById(a)};parseQuery=function(d){var e=new Object();if(!d){return e}var a=d.split(/[;&]/);for(var c=0;c<a.length;c++){var g=a[c].split("=");if(!g||g.length!=2){continue}var b=unescape(g[0]);var f=unescape(g[1]);f=f.replace(/\+/g," ");e[b]=f}return e};createRequestObject=function(){var xmlhttp;
/*@cc_on
	@if (@_jscript_version>= 5)
			try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
					try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
					catch (E) {xmlhttp = false;}
			}
	@else
		xmlhttp = false;
	@end @*/
if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){try{xmlhttp=new XMLHttpRequest()}catch(e){xmlhttp=false}}return xmlhttp};var http=createRequestObject();function addEvent(d,c,a){if(d.addEventListener){d.addEventListener(c,a,false);return true}else{if(d.attachEvent){var b=d.attachEvent("on"+c,a);return b}else{return false}}}addEvent(window,"load",init_ibox);function iboxclose(){hideIbox()};
