/* - - - - - - - - - - - - - - - - - - - - - - -

 JavaScript

 Monday, November 17, 2008 4:08:45 PM

 HAPedit 3.1.11.111

 - - - - - - - - - - - - - - - - - - - - - - - */

var thinbox_width;
var thinbox_height;

var scrl_top;

function thinboxSetup(mywidth,myheight,scrl)

 {

   thinbox_width=mywidth;
   thinbox_height=myheight;

   if (typeof scrl == 'undefined' ) scrl = 300;

   scrl_top=scrl;

 }

 function showThinBox(disptype,disparam,hide,widthExternal,heightExternal)

 {

    if (typeof hide == 'undefined' ) hide = 0;

   elem=document.getElementById("thinBox");

   //elem.style.width=window.screen.width+"px";

   myvar1=document.body.scrollWidth-1;

  elem.style.width=myvar1+"px";

  //alert(elem.style.width);

  elem.style.height=document.body.scrollHeight+"px";

  mycalc= document.body.scrollTop+scrl_top;

  myvr="<br><br style='line-height:"+mycalc+"px;'>";

  myvr=myvr+"<table width='"+ thinbox_width +"' align='center' bgcolor='white' class='tabclass'><tr><td class='boxtop' align=right><a href='javascript:closeThinBox("+hide+");' class='boxtop'>Close</a>&nbsp; </td></tr><tr><td height='"+thinbox_height+"' valign=top class='boxtext'>";

  if (disptype==0)

  {//normal HTML Display

    myvr=myvr+disparam;

    //alert(myvr);

    myvr=myvr+"</td></tr></table>";

  elem.innerHTML=myvr;

  elem.style.visibility="visible";

  }

  if(disptype==1)

  {//iframed URL display
  	var widthaa;
	var heightaa;
	if(widthExternal != ''){widthaa=widthExternal;}else{widthaa=thinbox_width;}
	if(heightExternal != ''){heightaa=heightExternal;}else{heightaa=thinbox_height;}
	
   myvr=myvr+"<iframe width='"+ widthaa +"' align='center' height='"+heightaa+"' frameborder='0' scrolling='no' src='"+disparam+"' />";

   myvr=myvr+"</td></tr></table>";

  elem.innerHTML=myvr;

  elem.style.visibility="visible";

  }

  if(disptype==2)

  { //AJAX page

   myvr=myvr+"<div id='tbContent'>Loading...</div>";

    myfunc=disparam+"()";

    myvr=myvr+"</td></tr></table>";

  elem.innerHTML=myvr;

  elem.style.visibility="visible";

    eval(myfunc);



  }



 if(hide==1)

 {

  elem=document.getElementById("map");

  elem.style.visibility="hidden";

 }



 }

 function closeThinBox(show)

{

  elem=document.getElementById("thinBox");

  elem.innerHTML="";

  elem.style.visibility="hidden";

  elem.style.height=50;

  elem.style.width=50;



 if (typeof show == 'undefined' ) show = 0;



 if(show==1)

 {

  elem=document.getElementById("map");

  elem.style.visibility="visible";

 }



}

function showAjaxContent(ajvar)

{

  elem=document.getElementById("tbContent");

  elem.innerHTML=ajvar;



}
