  // Get css
  // Browser css specific
  if (document.all) 
  {
    var ies = "<link rel='stylesheet' href='/css/ieStyles.css' type='text/css'>";
        ies+="<link rel='stylesheet' href='/css/jquery-ui-1.7.2.custom.css' type='text/css'>";
        document.write(ies);
  }
  else 
  {
    var nns = "<link rel='stylesheet' href='/css/nnStyles.css' type='text/css'>";
        nns+="<link rel='stylesheet' href='/css/jquery-ui-1.7.2.custom.css' type='text/css'>";
        document.write(nns);
  }
  
  <!-- //********** Random Image Display v.1, 1997-2002. frogi.com  ***************** -->
  <!-- hide scripts for incapable browser.
  
  
  // ------------------------------------------
  // FUNCTIONS FOR RANDOMIZING IMAGE DISPLAYS
  // 
  
  // Variables for random number generator. 
  var today=new Date();
  currentTime=today.getTime(); 
  
  // Set to number of images available.
  var number=14;   //MediaNum(num);
  
  // Becomes generated random  number.
  var random_number=0;
   
  // Secondary vars for use in display random img on multiple areas.   
  var random_number2=0;
  var random_number3=0;
  
  // Set image name.
  var image="";
  var image2="";
  var image3="";
  
  // Random number generating function.
  function randomIMG(random_number)
  {
    onez=1010;
    tenz=11010;
    hundredz=100101;
    currentTime = (currentTime*onez+tenz) % hundredz;
    random_number=Math.ceil( (currentTime/(hundredz*1.0)) *number);
    
    //  set random numbers for these secondary vars for display random img on multiple areas.
    random_number2=Math.ceil( (currentTime/(hundredz*1.0)) *number);
    random_number3=Math.ceil( (currentTime/(hundredz*1.0)) *number);
    
    // Set absolute image path name for location img display area #1. Must, if you want to display random img.
    if (random_number==1)
      image="images/me.gif";
    if (random_number==2) 
      image="images/divingFrog.jpg";
    if (random_number==3)
      image="images/frogi_island.jpg";
    if (random_number==4)
      image="images/july28_2k1.jpg";
    
    if (random_number ==null)
      image="\/images/liz235x145.gif"
    else 
      image="\/images/liz235x145.gif";
    
    // Set absolute image path name for secondary location img display area #2. Optional.
    if (random_number2==1)
      image2="images/frogi_islang.gif";
    if (random_number2==2)
      image2="images/employer2.jpg";
    if (random_number2==3)
      image2="images/employer3.jpg";
      
    // Set absolute image path name for secondary location img display area #3. Optional.
    if (random_number3==1)
      image3="images/center1.jpg";
    if (random_number3==2)
      image3="images/center2.jpg";
    if (random_number3==3)
      image3="images/center3.jpg"; 
    
    return random_number;
    
  } // end function random image.
  
  
  //  function (MouseOver Event)
  //  If a browser not .js compatible, ignore .js show 1 image.
  function BrowZer(Netscape, Explorer) 
  {
    if ((navigator.appVersion.substring(0,3) >= Netscape && navigator.appName == 'Netscape') ||      
      (navigator.appVersion.substring(0,3) >= Explorer && navigator.appName.substring(0,9) == 'Microsoft'))
      return true;
    else 
      return false;
  } 
  
  // function onMouseOver turn imgOn
  function imgOn(imgName) 
  {
    if (document.images) 
    {  document[imgName].src = eval(imgName + "on.src");  }
  }
  
  function imgOff(imgName) 
  {
    if (document.images)
    { document[imgName].src = eval(imgName + "off.src");   }
  } 
  // close  hide script for incapable browser -->
  
  // *********** TimeStamp *******
  <!-- hide from .js incapable browser.
  // begin .js    --- 
  
  // Set Day.
  var dayName = new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  
  // Set Month.
  var monName = new Array ("January","February","March","April","May","June","July","August","September","October","November","December");
  
  // get 'now', the new instance of Date object
  var now = new Date;
  
  function datestamp() 
  {
    // Output to browser.	
    if ((parseInt(navigator.appVersion) >= 4 )) 
    {
      document.write("<span class=datestamp>&nbsp;&nbsp;"  + dayName[now.getDay()] + ' ' + monName[now.getMonth()] + ' ' + now.getDate() + ', ' + now.getFullYear() + '</span><br>');
    } 
  }
  
  // end datestamp
  // close hide .js tag -->
  
  
  // frogi 8/10/2001
  // javascript snippet, warn before deleting. -->
  <!--
  function Warn() 
  {
    var YesNo = confirm("If you delete this record, you will never retrieve it.");
    if (YesNo) 
    {
      return true;
    } 
    else
    { 
      return false;
    }
  }
  // End  Warn -->
  
  <!-- 
  // frogi 8/10/2001
  // javascript snippet, Confirm before Updating. -->
  
  function Confirm(str) 
  {
    if(!str)
      str = "Are you sure the records are correct?\n\nIf so, press \'OK\' button, otherwise press \'Cancel\' button.";
    
    var Yes = confirm(str);
    if (Yes) 
    {
      return true;
    } 
    else
    {  
      return false;
    }
  }
  // End  Confirm -->
  
  <!-- Begin  Dyna_footer // 1997-2002  frogi.com v.beta 
  function setVariables() 
  {
    imgwidth=700;  // logo width, in pixels
    imgheight=45;  // logo height, in pixels
    if (navigator.appName == "Netscape") 
    {
      horz=".left";
      vert=".top";
      docStyle="document.";
      styleDoc="";
      innerW="window.innerWidth";
      innerH="window.innerHeight";
      offsetX="window.pageXOffset";
      offsetY="window.pageYOffset";
    }
    else 
    {
      horz=".pixelLeft";
      vert=".pixelTop";
      docStyle="";
      styleDoc=".style";
      innerW="document.body.clientWidth";
      innerH="document.body.clientHeight";
      offsetX="document.body.scrollLeft";
      offsetY="document.body.scrollTop";
    }
  }
  // end function setVariables()
  
  // function to checkLocation
  function checkLocation() 
  {
    objectXY="layer9";
    var availableX=eval(innerW);
    var availableY=eval(innerH);
    var currentX=eval(offsetX);
    var currentY=eval(offsetY);
    x=availableX-(imgwidth+30)+currentX;
    y=availableY-(imgheight+20)+currentY;
    evalMove();
    setTimeout("checkLocation()",10);
  }
  // end function checkLocation
  
  // function evaluate Move / execute / eval move
  function evalMove() 
  {
    eval(docStyle + objectXY + styleDoc + horz + "=" + x);
    eval(docStyle + objectXY + styleDoc + vert + "=" + y);
  }
  // End Dyna_footer -->
  
  
  // Show or Hide a layer.   frogi.com   v.1.0 2/10/99
  // hide main layer 
  function hideit(n) 
  {   
    // pre-NN6
    if (document.layers)           
    {
      document.layers['layer' + n].visibility='hide';
    }
    // NN6
    if (document.getElementById)              
    {
      document.getElementById('layer' +n).style.visibility='hidden';
    }
    // IE4+
    if (document.all)
    {
      document.all['layer' +n].style.visibility='hidden';
    }
  }
  
  // show main layer
  function showit(n) 
  {
    // pre-NN6
    if (document.layers)                    
    {
      //alert('Pre NN6');
      document.layers['layer' +n].visibility='show';
    }   
    // NN6
    if (document.getElementById)              
    {
      //alert('NN6+');
      document.getElementById('layer' +n).style.visibility='visible';
    }
    // IE4+
    if (document.all)
    {
      //alert('IE4+');
      document.all["layer" +n].style.visibility='visible';
    }
  }
  // End Show or hide layer(s). -->
    
    
  <!-- X, Y : Coordinates  -->
  var PopupOffsetLeft = 100;
  var PopupOffsetTop = 100;
  
  // function x_click()
  function x_click(e)
  // This is always available to pinpoint the x-axis location of a click
  {
    if (navigator.appName == "Microsoft Internet Explorer")
    {
      mX = event.clientX;
    } 
    else 
    {
      mX = e.pageX;
    }
      return mX;
  }
  // end function x_click()
  
  // function y_click()
  function y_click(e)
  {
    if (navigator.appName == "Microsoft Internet Explorer")
    {
      mY = event.clientY;
    } 
    else 
    {
      mY = e.pageY;
    }
    return mY;
  } 
  // end function y_click()
  <!-- End X,Y : Coordinates function -->
  
    
  <!-- jioklate kukis -->
  // set cookie expiration date 
  var exp = new Date();
  exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 1)); // last digit 1 indicates one day before cookie expires.
  var exp2 = new Date; 
  exp2.setTime(exp2.getTime() + (1000 * 60 * 60 * 24 * (1/2))); // last digit 1/24 indicates 1 hour before cookie expires.
  
  // function get cookie 
  function getCookie(name)
  {
    var cname = name + "=";
    var dc= document.cookie;
    var theCookie = null;
    if (dc.length > 0) 
    {
      begin = dc.indexOf(cname);
      if(begin != -1) 
      {
        begin += cname.length;
        end = dc.indexOf(";",begin);
        if (end == -1) end = dc.length;
          theCookie = unescape(dc.substring(begin, end));
      }
    } 
    return theCookie;
  } 
  // end function getCookie()
  
  // function setCookie()
  function setCookie(name, value, expires) 
  {
    document.cookie = name + "=" + escape(value) + ";path=/" + ((expires == null) ? "" : ";expires=" + expires.toGMTString());
  }
  // end function setCookie()
  
  // function delete cookie/ delCookie()
  function delCookie(name)
  {
    document.cookie=name + "=; expires=Thu, 02-mar-99 00:00:00 GMT" + ";path=/"; 
  }
  // end function delete cookie
  <!-- end jioklate kukis -->
  
  
  <!-- Begin purge tango local variabes -->
  // 
  function purge()
  {
    //var s=document.write('<'+'@purge scope=local>');
    var s='<@purge scope=local>';
    var t=document.write(s);
    return t;
  }
  <!-- end purge tango local variables -->
  
   
  <!-- WEATHER CHANNEL TEMPLATE -->
  
  function IengedelBelau() 
  {
    var template="";
    
    <!-- BACKGROND IMAGE =  http://image.weather.com/web/services/oap/magnet_vtravel.jpg  -->
    
    document.write("<STYLE>.TRVLVcaptionText {font-family: Arial; font-size: 10px; color: black;}.TRVLVvertLinks,.TRVLVvertLinks:link,.TRVLVvertLinks:visited {font-family: Arial,Verdana; font-size: 10px; color: #D1D6FC; }.TRVLVvertLinks:hover { color: #99CCFF; } .TRVLVsmLinks,.TRVLVsmLinks:link,.TRVLVsmLinks:visited {font-family: Arial,Verdana; font-size: 10px; color: #D1D6FC; }.TRVLVsmLinks:hover { color: #99CCFF; } .TRVLVobs1 {color:#015206; font-family:verdana,arial; font-size:18px;}.TRVLVobs2 {color:#000000; font-family:verdana; font-size:10px;}.TRVLVobsWx {font-family: Arial;font-size: 11px; color:#000000;}.TRVLVcityInfo,.TRVLVcityInfo:link,.TRVLVcityInfo:visited{ font-family: Arial,Verdana; font-size: 11px;color: #FFFFFF; }.TRVLVcityInfo:hover { color: #99CCFF; }.TRVLValertInfo,.TRVLValertInfo:link,.TRVLValertInfo:visited{ font-family: Arial,Verdana; font-size: 11px;color: red;}.TRVLValertInfo:hover { color: #99CCFF; }.TRVLVblkVerdanaText11 {font-family:verdana,arial,helvetica; font-size: 11px; color: #000000; } </STYLE><TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' BACKGROUND='http://image.weather.com/web/services/oap/magnet_vtravel.jpg' WIDTH='175' HEIGHT='270'><TR><TD VALIGN='TOP'><TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='175' BACKGROUND=''><TR><TD><IMG SRC='http://image.weather.com/web/blank.gif' WIDTH=50 BORDER=0 HEIGHT=52 alt=''></TD><TD ALIGN='CENTER' VALIGN='TOP' CLASS='TRVLVcityInfo'><A target='blank' HREF='http://www.weather.com/outlook/travel/local/96940?par=OAP&site=TRVLV&code=1003107347' title='Click for more detail weather in Palau.' CLASS='TRVLVcityInfo'><BR><B>Palau, PW</B></A></TD></TR><TR><TD><IMG SRC='http://image.weather.com/web/blank.gif' WIDTH=50 BORDER=0 HEIGHT=1 alt=''></TD><TD ALIGN='CENTER'>&nbsp;&nbsp;<A target='blank' HREF='http://www.weather.com/outlook/travel/local/96940?par=OAP&site=TRVLV&code=1003107347' CLASS='TRVLVsmLinks'>Get the 10 day forecast</A></TD></TR></TABLE><TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' BACKGROUND=''><TR><TD><IMG SRC='http://image.weather.com/web/blank.gif' WIDTH=5 BORDER=0 HEIGHT=70 alt=''></TD><TD ALIGN='CENTER' VALIGN='TOP'><TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='160'><TR><TD COLSPAN='2'><IMG SRC='http://image.weather.com/web/common/blank.gif' BORDER='0' ALT='' WIDTH='1' HEIGHT='5'></TD></TR><TR><TD VALIGN='TOP' WIDTH='45' ALIGN='RIGHT'><IMG SRC='http://image.weather.com/web/common/wxicons/31/11.gif' BORDER='0' ALT='' ALIGN='ABSMIDDLE'></TD><TD ALIGN='CENTER' VALIGN='TOP' WIDTH='115'><FONT CLASS='TRVLVobs1'><B>77&deg;F</B></FONT><BR><FONT CLASS='TRVLVobs2'>Rain Shower</FONT></TD></TR><TR><TD COLSPAN='2'><IMG SRC='http://image.weather.com/web/blank.gif' WIDTH=1 BORDER=0 HEIGHT=5 alt=''></TD></TR><TR><TD COLSPAN='2' VALIGN='TOP' ALIGN='LEFT' CLASS='TRVLVobsWx'><IMG SRC='http://image.weather.com/web/common/blank.gif' BORDER='0' ALT='' WIDTH='25' HEIGHT='1' ALIGN='ABSMIDDLE'><B>Feels Like:</B> 82&deg;F<BR><IMG SRC='http://image.weather.com/web/common/blank.gif' BORDER='0' ALT='' WIDTH='25' HEIGHT='1' ALIGN='ABSMIDDLE'><B>Humidity:</B> 94%<BR><IMG SRC='http://image.weather.com/web/common/blank.gif' BORDER='0' ALT='' WIDTH='25' HEIGHT='1' ALIGN='ABSMIDDLE'><B>Wind:</B> W at 6 mph</TD></TR></TABLE><TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='170' BACKGROUND=''><FORM target='_blank' action='http://www.weather.com/search/search'><TR><TD ALIGN='CENTER' VALIGN='TOP' ALIGN='CENTER'><input type='hidden' name='what' value='WeatherLocalTravel'><INPUT TYPE='TEXT' name='where' onFocus='this.value=\"\"' SIZE='10' VALUE='Enter city/zip'> <INPUT TYPE='IMAGE' SRC='http://image.weather.com/web/common/icons/transparent_orange_go.gif' BORDER='0' ALIGN='ABSMIDDLE'></TD></TR></FORM></TABLE><TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='170' BACKGROUND=''><TR><TD><IMG SRC='http://image.weather.com/web/blank.gif' WIDTH=60 BORDER=0 HEIGHT=65 alt=''></TD><TD VALIGN='TOP' CLASS='TRVLVvertLinks'><BR>&nbsp;&nbsp;&nbsp;&nbsp;<A target='_blank' HREF='http://www.weather.com/outlook/travel/vacationplanner/weather/tenday/96940?par=OAP&site=TRVLV&code=1003107347' CLASS='TRVLVvertLinks'>Vacation Planner</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;<A target='_blank' HREF='http://www.weather.com/outlook/travel/flights/citywx/96940?par=OAP&site=TRVLV&code=1003107347' CLASS='TRVLVvertLinks'>Airport Delays</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;<A target='_blank' HREF='http://www.weather.com/outlook/events/sports/result/96940?when=thisweek&par=OAP&site=TRVLV&code=1003107347' CLASS='TRVLVvertLinks'>Sporting Events</A></TD></TR></TABLE><TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='170' BACKGROUND=''><TR><TD COLSPAN='2' ALIGN='CENTER'><A target='_blank' HREF='http://www.weather.com/services/desktop.html?par=OAP&site=TRVLV&code=1003107347' CLASS='TRVLVsmLinks'>Download Desktop Weather</A></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE>");
  }
  <!--  END WEATHER CHANNEL TEMPLATE -->
  
  
  // Diaz inline div
  function Morelii_a_Diaz()
  {
    L1="<OBJECT ID='Player' HEIGHT='50' WIDTH='150' border='1' bordercolor='red'";
    L1+=" classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' ";
    L1+="codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version";
    L1+="=6,4,7,1112'  ";
    //L2="Ulkum mak bai menga delul chum ma aikel elbis el diokang el kora yellow ma disch, e melim a mengur.";
    L1+="standby='Loading Microsoft Windows Media Player components...'  ";
    L1+="type='application/x-oleobject'> ";
    //L3="Alii, Ngdiak a buuch?";
    L1+=" <PARAM NAME='Filename' value='mms://media03.netenterprise.net/palauradio'> ";
    L1+=" <PARAM NAME='ShowControls' VALUE='true'> ";
    L1+=" <PARAM NAME='ShowStatusBar' VALUE='true'> ";
    L1+=" <PARAM NAME='Autostart' VALUE='<@Arg TrueFalse>'> ";
    //Alii="Meke di mekerang er elchang e kau?";
    L1+=" <PARAM NAME='ShowPositionControls' value='False'> ";
    L1+=" <PARAM NAME='ShowTracker' value='False'> ";
    L1+=" <EMBED type='application/x-mplayer2' ";
    L1+="  pluginspage = 'http://www.microsoft.com/Windows/MediaPlayer/' ";
    //Ei="Alii ngkel ngalk a meral daijob!";
    L1+="  SRC='mms://media03.netenterprise.net/palauradio' ";
    L1+="  name='Player' ";
    L1+="  width='150' ";
    L1+="  height='60' ";
    L1+="  AutoStart='False'  ";
    //L11-="3.1415+(8%2);"
    //saisel_move_ra_ngalk="math.random(3+L11)";
    L1+="  showcontrols='ture' showstatusbar='true' showdisplay=''> ";
    L1+="  </EMBED> ";
    L1+=" </OBJECT> ";
    LX="";
    NN="<OBJECT ID='Player' HEIGHT='50' WIDTH='150' border='1' bordercolor='red'";
    NN+=" classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' ";
    NN+="codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112'  ";
    //L2="Ulkum mak bai menga delul chum ma aikel elbis el diokang el kora yellow ma disch, e melim a mengur.";
    NN+="standby='Loading Microsoft Windows Media Player components...'  ";
    NN+="type='application/x-oleobject'> ";
    //L3="Alii, Ngdiak a buuch?";
    NN+=" <PARAM NAME='Filename' value='mms://media03.netenterprise.net/palauradio'>";//<@Arg station>'> ";
    NN+=" <PARAM NAME='ShowControls' VALUE='true'> ";
    NN+=" <PARAM NAME='ShowStatusBar' VALUE='true'> ";
    NN+=" <PARAM NAME='Autostart' VALUE='False'> ";
    //Alii="Meke di mekerang er elchang e kau?";
    NN+=" <PARAM NAME='ShowPositionControls' value='False'> ";
    NN+=" <PARAM NAME='ShowTracker' value='False'> ";
    NN+=" <EMBED type='application/x-mplayer2' ";
    NN+="  pluginspage = 'http://www.microsoft.com/Windows/MediaPlayer/' ";
    //Ei="Alii ngkel ngalk a meral daijob!";
    NN+="  SRC='<@Arg station>' ";
    NN+="  name='Player' ";
    NN+="  width='150' ";
    NN+="  height='60' ";
    NN+="  AutoStart='False'  ";
    //NN1-="3.1415+(8%2);"
    //saisel_move_ra_ngalk="math.random(3+NN1)";
    NN+="  showcontrols='ture' showstatusbar='true' showdisplay=''> ";
    NN+="  </EMBED> ";
    NN+=" </OBJECT> ";
    dw="document.write(NN)";
    
    // if ie4 or higher version, call ie4 ++ tag
    if (document.all) 
    {
      document.write(NN);    
      //document.write("<a href='<@Appfile>?Showit(1)&station=mms://media03.netenterprise.net/palauradio&TrueFalse=True'>Listen now!</a>"); 
    }
    // if pre nn6, call pre nn6 tag
    else if (document.layers) 
    {
      document.write(L1);
      //document.write("<a href='<@Appfile>?&station=mms://media03.netenterprise.net/palauradio/'>Listen now!</a>");
    }
    // if nn6 or higher version, call nn6 or higher version.
    else if (document.getElementById) 
    {
      document.write(ThisBrowser());
      //document.write("<a href='<@Appfile>?&station=mms://media03.netenterprise.net/palauradio/'>Listen now!</a>");
      //tial_netscape_el_browser(); 
      //document.write(NN);
    }
    //document.write(L1);
  }
  
  function tial_netscape_el_browser()  
  {
    NN=" <EMBED type='application/x-mplayer2' ";
    NN+= "pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' ";
    //Ei="Alii ngkel ngalk a meral daijob!";
    NN+="  SRC='mms://media03.netenterprise.net/palauradio/' ";
    NN+="  name='Player' ";
    NN+="  width='150' ";
    NN+="  height='60' ";
    NN+="  AutoStart='false' ";
    //L11-="3.1415+(8%2);"
    //saisel_move_ra_ngalk="math.random(3+L11)";
    NN+="  showcontrols='' showstatusbar='' showdisplay=''> ";
    NN+="  </EMBED> ";
    
    //writeIt="document.write(NN)";
    document.write(NN);
    
    //document.audio.writeln("<a href='javascript:tial_netscape_el_browser();'>" + "Listen now!" + "</a>";
  }
  //tial_netscape_el_browser();
  
  
  /* ******** ajax to load document area/layer from the server via XMLHttpRequest xml object. ******** */
  
  function getFile(url,doc,restype) // url is the file url, doc is a name of element area to render
  {  
    var xmlhttp = null;
    var nu =
    {
      "nuagent" : "navigator.userAgent",
      "bindex"  : "indexOf(browzer)"        
    } 
        
    if (window.XMLHttpRequest) // code for IE7+, Firefox, Chrome, Opera, Safari
    {
      xmlhttp = new XMLHttpRequest();
    }
    else // for IE6 and older versions
    {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // code for IE6, IE5      
    }
    
    if(xmlhttp == null)
    {
      alert("Your browser dosen't support Ajax");
    }
    else
    {      
      xmlhttp.onreadystatechange = function()  // better to implement function in here
      {                                        // so you don't have to use global var, or pass them.
        
        if (xmlhttp.readyState == 4) // 4 == file loaded completely
        {
          // responseText, response in text
          if(restype == 'responseText')
          {document.getElementById(doc).innerHTML=xmlhttp.responseText;}
          
          // responseXML, response in xml.
          if(restype == 'responseXML')
          {document.getElementById(doc).innerHTML=xmlhttp.responseXML;}
          
          // responseStream, response in stream.
          if(restype == 'responseStream')  
          {document.getElementById(doc).innerHTML=xmlhttp.responseStream;}        
        }
      } // end onreadystatechange property / function()
      
      xmlhttp.open("GET",url,true);  
      xmlhttp.send(null);      
      
    } // end else
    
    return xmlhttp;
  } 
    
  // function state_Change for file being opened
  function state_Change(xmlhttp,doc,restype)
  {
    //alert('xmlhttp: ' + xmlhttp);
    if (xmlhttp.readyState == 4) // 4 == file loaded completely
    {
      // responseText, response in text
      if(restype == 'responseText')
      {document.getElementById(doc).innerHTML=xmlhttp.responseText;}
        
      // responseXML, response in xml.
      if(restype == 'responseXML')
      {document.getElementById(doc).innerHTML=xmlhttp.responseXML;}
        
      // responseStream, response in stream.
      if(restype == 'responseStream')  
      {document.getElementById(doc).innerHTML=xmlhttp.responseStream;}        
    }
  }   // end function state_Change()
  
  
  /* ******** Ajax Constructor ******** */
    
  function ajaxLoad(url,areaName,responseType)                         // js object constructor
  {                                    
    var xmlHttpReq = null;                                          // Initialize the xmlHttpReq var
    var areaId = document.getElementById(areaName);                     
        
    if (window.XMLHttpRequest)                       
    {                                   
      xmlHttpReq=new XMLHttpRequest();                                  //  mozilla family
    } 
    else 
    {                                                       
      xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");                //  IE
    } 
                                                                        
    if (xmlHttpReq==null) 
    {                                              
      alert("Your browser doesn't support AJAX.");                
    } 
    else 
    {
      xmlHttpReq.onreadystatechange = function()                        // xmlHttpReq property 'onreadystatechange' tells us the change of state for it's request.
      {                      
        if (xmlHttpReq.readyState==4) // || xmlHttpReq.readyState=="complete") // readyState property == 4 indicates that the request is complete.
        { 
          if(responseType == 'responseText')                          //   If the request file is text, use responseText 
            areaId.innerHTML=xmlHttpReq.responseText;                 
          if(responseType == 'responseXML')
            areaId.innerHTML=xmlHttpReq.responseXML;                  //   If the request file is xml, use responseXML
          if(responseType == 'responseStream')
            areaId.innerHTML='<img src=xmlHttpReq.responseStream />';   //   If the request file is image, or any type of binary or none text base file, use responseStream 
        } 
      } // end oreadystatechange function 
      
      //url+='?&dateTimeStamp='+(now*1);   // add datetimestamp to url for cache prevention.
      xmlHttpReq.open("GET", url, true);                                // Open the url with "GET" method, and "true" for asynchronus file stream instead of "false" for synchronus file stream
      xmlHttpReq.send(null);                                            // Send the request with "null" if the file url is in the same server otherwise use "file server address" instead.
      //alert(url + '\n\n' + now + '\n\n' + xmlHttpReq);
      return true;                                               
    } // end else 
  }   // end function ajaxLoad()    
  
  /* -------- end AJAX --------                             */
    
  
  /* ********  Ajax 3 ******** */
   
   function ajax(url,areaId,responseType)
   {
     var xhreq = null;
     var docId = document.getElementById(areaId);
     
     if (window.XMLHttpRequest)
     {
       xhreq = new XMLHttpRequest();
     }
     else
     {
       xhreq = new ActiveXObject("Microsoft.XMLHTTP");
     }
     
     if (xhreq == null)
     {
       alert('Your browser does not support Ajax.');
       return null;
     }
     else
     {
       xhreq.onreadystatechange = function()
       {
         if(xhreq.readyState == 4)
         {
           if(responseType == 'responseText')
           {
             docId.innerHTML = xhreq.responseText;
           }
           if(responseType == 'responseXML')
           {
             docId.innerHTML = xhreq.responseXML;
           }
           if(responseType == 'responseStream')
           {
             if(xhreq.responseStream == 'undefined' || xhreq.responseStream == null)
             {
               alert('Binary file: could not be loaded via ajax correctly! \n\nObject loaded was : ' +
                     xhreq.responseStream + '\n\nAttempt to load it via straight url.');
               docId.innerHTML= '<img src = ' + url + '>';   //   If the request file is image, or any type of binary or none text base file, use responseStream 
             }
             else
             {
               docId.innerHTML= '<img src = ' + xhreq.responseStream + ' />';
             }
           }
         }
       }
       url+='?&dateTimeStamp='+(now*1);   // add datetimestamp to url for cache prevention.
       xhreq.open("GET",url,true);
       xhreq.send(null);
       return xhreq;
     }
   }
   // end function ajax()   
    
  /* ********  end Ajax 3 ******** */
  
  
  /* -------- TITLE, write title name as current dir -------- */
  
  function title() 
  {
    var path = location.pathname;
    var dir = path.substring(path.indexOf('/'),path.lastIndexOf('/'));
    var bdir="";
    var cdir="";
    
    //document.write('<br />' + dir + "/"); // directory path
    
    // make it backwards
    for(i=dir.length; i>=0; i--)
    {
      bdir+=dir.charAt(i);
    }  
    
    // show backwards directory path
    //document.write('<br />' + bdir);
    
    var str = bdir.substring(0,bdir.indexOf('/'));
    
    // make directory name spelled correct
    for(j=str.length; j>=0; j--)
    {
      cdir+=bdir.charAt(j);
    }
    
    // show current directory  
    //document.write('<title>Welcome to Palaulive | ' + cdir + '/</title>'); 
    
    return cdir;
  } // end function title()
  
  st = '<title>Welcome to Palaulive | ';
  st2 = '</title>';
  s = title();
  ns = "";
  
  // html bdo property tag <bdo dir="">s</bdo> dosen't work with javascript
  
  if(s.length>0)
    ns+= st +  s + '/' + st2;
  else
    ns+= st + '/Home/' + st2;
  
  document.write(ns);
  
  //testing
  //alert(ns);
  
  /* -------- End Title, write title name as current dir -------- */
  
  
  /* -------- function cred for Login -------- */
  
  function credentials()
  {
    var credStat = "";
    var logged = getCookie("loggedInCid");
    
    // JSON / javascript object notation
    var auth = 
    { "login"  : "<a href=\"/login/\">Login</a>",
      "logout" : "<a href=\"/logout/\">Logout</a>",      
      "loc"    : "document.getElementById('loginout').innerHTML = "
    }
    
    if(logged == null) 
    {
      //alert(logged); // test
      credStat += auth.login;
    } 
    else 
    {
      //alert(logged); // test
      credStat += auth.logout;
    }
    return credStat;
  }
  
  
  /* ******** end function credetntials() ******* */
  
  /* ******** onload for body property ******** */
  /*
  if(window.mbody!=null)
  {
    window.onload = function() // mbody is the main body tag
    {
      document.getElementById('yy').innerHTML=now.getFullYear(); // this is to populate current year in yy span
      alert(now.getFullYear());
      return true;
    }
  }

  else
  {
    //setTimeOut("document.getElementById('yy').innerHTML=now.getFullYear()",5000);
    setTimeout("alert(now.getFullYear());document.getElementBy('yy').innerHTML=now.getFullYear()",3000);
  }
  */
  
  function ajaxPicture(url,locId)
  {
    var req = null;
    var areaId = document.getElementById(locId);  
    
    if(window.XMLHttpRequest)
    {
      req = new XMLHttpRequest();
    }
    else
    {
      req = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
        
    if(req != null)
    {
      req.onreadystatechange = function() 
      {
        if(req.readyState == 4)
        {
          if (req.responseStream == null || req.responseStream == 'undefined') 
          {
            
            alert('Ajax could not load pic! \n\nAjax returned pic as ' +
                   req.responseStream + '\n\nAttempting to load your pic via straight url.');
            areaId.innerHTML = '<img src =' + url +' />';
          }
          else
          {
            areaId.innerHTML = '<img src =' + req.responseStream +'>';
          }
        }
      }
      req.open("GET", url, false); 
      req.send(null);
    }
    else
    {
      alert('Your browser does not support Ajax!');
    }
    return req.resonseStream;
  }
  
