function GetWindowWidth()
{
    if(window.innerWidth) return window.innerWidth;
    else if(document.documentElement && document.documentElement.clientWidth) return document.documentElement.clientWidth;
    else if(document.body) return document.body.clientWidth;
	else return 0;
}

if(!isMenu)
{ s=String(window.location.href);
  s=s.toUpperCase();
  if(s.indexOf("TOPTROPICALS.COM")<0)
  {  if(!parent.frames.length) window.location.href="http://ukrop.info/index.htm?file="+self.location.href;
     else if(!window.parent.header && !window.parent.contents) top.location.href="http://ukrop.info/index.htm?file="+self.location.href;
  }
}
IE4=0;
NS4=0;
isMac = (navigator.appVersion.indexOf("Mac") != -1);
if(navigator.userAgent.indexOf("MSIE") >= 0) IE4=1;
if(navigator.userAgent.indexOf("Netscape") >= 0 || navigator.userAgent.indexOf("Gecko") >= 0) NS4=1;
isMenu =(NS4 || (IE4 && !isMac));
function WM_readCookie(name) 
{ if(document.cookie == '') return false; 
  else return unescape(WM_getCookieValue(name));
}
function WM_getCookieValue(name) 
{ var firstChar, lastChar, endOfName;
  var theBigCookie = document.cookie;
  firstChar = theBigCookie.indexOf(name);
  if((firstChar != -1) && (theBigCookie.charAt(firstChar + name.length) == '=')) 
  { firstChar += name.length + 1;
    lastChar = theBigCookie.indexOf(';', firstChar);
    if(lastChar == -1) lastChar = theBigCookie.length;
    return theBigCookie.substring(firstChar, lastChar);
  } 
  else  { return ''; }
}
function GetSearchValueEx(ArgName,toUpr)
{
 if(location.search=="") return "";
 arrayOfStrings=location.search.substr(1).split('&');
 for(var i=0; i<arrayOfStrings.length;i++) 
 if(arrayOfStrings[i].split('=')[0].toUpperCase()==ArgName.toUpperCase()) 
 if(toUpr) return arrayOfStrings[i].split('=')[1].toUpperCase();
 else return arrayOfStrings[i].split('=')[1];
}
function GetSearchValue(ArgName)
{
 return GetSearchValueEx(ArgName,1);
}
function GetFrameSearchValue(ArgName)
{
 arrayOfStrings=top.location.search.substr(1).split('&');
 for(var i=0; i<arrayOfStrings.length;i++) 
 if(arrayOfStrings[i].split('=')[0].toUpperCase()==ArgName.toUpperCase()) 
 return arrayOfStrings[i].split('=')[1].toUpperCase();
 return "";
}
function MD_ShowImage(FileName,FileExt,AttribString)
{
//document.write('<img src="'+FileName+'.'+FileExt+'" '+AttribString+'>');
}

function MD_ShowLargeImageOnly(FileName,FileExt,AttribString)
{
//document.writeln('<img src="'+FileName+'.'+FileExt+'" '+AttribString+'>');
}

function WM_acceptsCookies() {
var answer;
document.cookie = 'OptoAquaHomePage_acceptsCookies=yes';
if(document.cookie == '') answer = false; else answer = true;
document.cookie = 'OptoAquaHomePage_acceptsCookies=yes; expires=Fri, 13-Apr-1970 00:00:00 GMT';
return answer;
}
function WM_setCookie (name, value, hours, path, domain, secure) {
if (WM_acceptsCookies()) {
if (hours) {
if (typeof hours != 'string') {
	// this whole section would be only one line if ns3 was smarter
var ns3hack = new Date(); 
ns3hack = ns3hack.getTime() + hours*3600000; 
var expirationDate = ns3hack.toGMTString();
} else {
var expirationDate = hours;
}
}
document.cookie = name + '=' + escape(value) + ((hours)?(';expires=' + expirationDate):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'') + ((secure && (secure == true))?'; secure':'');
}
}
function WM_killCookie(name, path, domain) {
var theValue = WM_getCookieValue(name);
if(theValue) {
document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'');
}
}
function MD_SetName()
{
var the_name=document.text_entry_form.user_name.value;
if(the_name) 
{var the_date = new Date("December 31, 2023");
 var the_cookie_date=the_date.toGMTString();
 WM_setCookie('OptoAquaHomePage',the_name,the_cookie_date)
}
}
function MD_PrintYear()
{ Today = new Date();
  document.writeln(Today.getFullYear());
  delete Today;
}
function MD_NewSearchString(Name,Value) 
{
var found_arg=0;
if(location.search=="") 
{ document.write(Name+"="+Value);
  return;
}
sArgs=location.search.substr(1).split('&');
for(var i=0;i<sArgs.length;i++) 
{ if(i) document.write('&');
  if(sArgs[i].split('=')[0].toUpperCase()==Name.toUpperCase()) 
  {  found_arg=1; 
     document.write(Name+"="+Value);
  }
  else document.write(sArgs[i]);
}
if(!found_arg)
{  if(sArgs) document.writeln('&');
   document.write(Name+"="+Value);
}
return;
}
function MD_NewSearchStringValues(Name,Value) 
{

var found_arg= new Array();
var found_this_arg=0;

if(location.search=="") 
{ document.write(Name+"="+Value);
  return;
}
sArgs=location.search.substr(1).split('&');
for(var j=0;j<Name.length;j++) found_arg[j]=0;
for(var i=0;i<sArgs.length;i++) 
{ if(i) document.write('&');
  found_this_arg=0;
  for(j=0;j<Name.length;j++)
  {  if(!found_arg[j] && sArgs[i].split('=')[0].toUpperCase()==Name[j].toUpperCase()) 
     {  found_arg[j]=1;
        found_this_arg=1; 
        document.write(Name[j]+"="+Value[j]);
        break;
     }
  }
  if(!found_this_arg) document.write(sArgs[i]);
}
for(var j=0;j<Name.length;j++)
{  if(!found_arg[j])
   {  if(sArgs) document.writeln('&');
      document.write(Name[j]+"="+Value[j]);
   }
}
delete found_arg;
return;
}
function GetWidth() {
if( typeof( window.innerWidth ) == 'number' ) return window.innerWidth;
else if(document.documentElement && document.documentElement.clientWidth) return document.documentElement.clientWidth;
else if(document.body && document.body.clientWidth) return document.body.clientWidth;
else return 0;
}

shown_layer='';
function TT_ShowLayer(oEvent,id)
{  if(shown_layer) shown_layer.style.display='none';
   shown_layer=document.getElementById(id);
   if(!shown_layer) return false;
   offset=10; Y0=0; X0=0;
   if(document.all)
   {   X=event.clientX+document.body.scrollLeft;
       Y=event.clientY+document.body.scrollTop;
   } else 
   {   X=oEvent.pageX;
       Y=oEvent.pageY;
       if(document.documentElement) 
       {   Y=Y-document.documentElement.scrollTop;
           X=X-document.documentElement.scrollLeft;
       }
   }
   if(X<0) X=0;
   if(Y<0) Y=0;
   X+=offset;
   Y+=offset;
   if(document.documentElement)
   {  W=document.documentElement.clientWidth;
      H=document.documentElement.clientHeight;
   }
   else 
   {  W=window.innerWidth;
      H=window.innerHeight;
   }
   Wdiv=Math.floor(W/3);
   Right=X+Wdiv;
   if(Right>W-50) X=W-50-Wdiv;
   shown_layer.style.top=Y+'px';
   shown_layer.style.left=X+'px';
   shown_layer.style.width=Wdiv+'px';
   shown_layer.style.display='block';
   Hdiv=shown_layer.offsetHeight;
   if(Y+Hdiv>H-50)
   {  Y=H-50-Hdiv;;
      shown_layer.style.top=Y+'px';
   }
   return false;
}
function TT_HideLayer(id)
{  if(shown_layer) shown_layer.style.display='none';
   shown_layer='';
   return false;
}

