function querycheckers()
{

  //----------------------------------------------------------------------------------------------
  //--------begin functions to read querystring and change frames---------------------------------
  //----------------------------------------------------------------------------------------------
  //alert(DefaultPages);
  var qsParm = new Array();
  qsParm[0] = 0;
  qsParm[1] = 0;
  qsParm[2] = 0;
  //alert(qsParm);
  var query = top.window.location.search.substring(1);
  //alert(query.length);

  if (query.length > 0)
  {
    var parms = query.split("&");
    for (var i=0;i<parms.length;i++) 
    {
      var pair = parms[i].split("=");  
      if (pair[0].length > 0)
       {
         var key = pair[0];
         var val = pair[1];
         //qsParm[i] = val;
         if (key == "page")
           {
             //alert("Page Found!");
             qsParm[0] = val;
           }
         else if (key == "menu")
           {
             //alert("Menu Found!");
             qsParm[1] = val;
           }
         else if (key == "title")
           {
             //alert("Title Found!");
             qsParm[2] = val;
           }

         //alert(i + ' ' + qsParm[i]);
       }
    }
  }
  else
  {
    qsParm[0] = 1; //body page
    qsParm[1] = 1; //menu page
    qsParm[2] = 1; //title page
    //alert(qsParm);    
  }


    //showalerts();
    //getQueryVariable();
    rightframeload();
    leftframeload();
    topframeload();
    checkcookies();


  function showalerts()
  {
    //alert( getQueryVariable('page') );
    //alert( getQueryVariable('menu') ); 
    //alert( getQueryVariable('title') ); 
    alert(qsParm[0]);
    alert(qsParm[1]); 
    alert(qsParm[2]); 
  }


  function leftframeload()
  {
    //alert(qsParm[1]);    
    if (qsParm[1].length > 2)
    {
    parent.left_frame.location=qsParm[1];
   }
    else
    {
    parent.left_frame.location=DefaultPages[1];
    }
  }

  function rightframeload()
  {
    //alert(qsParm[0]);
    //parent.right_frame.location="war_related/wwii/reference/ts-9.html";
    if (qsParm[0].length > 2)
    {
    parent.right_frame.location=qsParm[0];
    }
    else
    {
    parent.right_frame.location=DefaultPages[0];
    }
  }

  function topframeload()
  {
    //alert(qsParm[2]);    
    if (qsParm[2].length > 2)
    {
    parent.top_frame.location=qsParm[2];
    }
    else
    {
    parent.top_frame.location=DefaultPages[2];
    }
  }
  //----------------------------------------------------------------------------------------------
  //--------end functions to read querystring and change frames-----------------------------------
  //----------------------------------------------------------------------------------------------

} // end function querycheckers


  //----------------------------------------------------------------------------------------------
  //--------begin functions for cookies-----------------------------------------------------------
  //----------------------------------------------------------------------------------------------
  function checkcookies()
  {
     var DRfrr = document.referrer;
     //alert('DRfrr =' + DRfrr);
     //alert(DRfrr.length);
     if (DRfrr.length < 2)
     {
       DRfrr = "U<2";
     }

    //alert('Function CheckCookies entered');

    // remember, these are the possible parameters for Set_Cookie:
    // name, value, expires, path, domain, secure
    Set_Cookie( 'initial-check', 'Cookies Enabled.', '365', '/', '', '' );


    // if Get_Cookie succeeds, cookies are enabled, since
    //the cookie was successfully created.

    //alert('Past Set_Cookie');


    if ( Get_Cookie( 'button-position' ) )
    {
      var valueFromCookie = Get_Cookie( 'button-position' );
      //alert( 'cookie "button-position" found. Value = ' +valueFromCookie);
    }
    else
    {
      Set_Cookie( 'button-position', '0', '365', '/', '', '' );
      var valueFromCookie = Get_Cookie( 'button-position' );
      //alert( 'cookie "button-position" not found. Value set to ' +valueFromCookie);
    }

    if ( Get_Cookie( 'rh-view' ) )
    {
      var valueFromCookie1 = Get_Cookie( 'rh-view' );
      //alert( 'cookie "rh-view" found. Value = ' +valueFromCookie1);
    }
    else
    {
      Set_Cookie( 'rh-view', '0', '365', '/', '', '' );
      var valueFromCookie1 = Get_Cookie( 'rh-view' );
      //alert( 'cookie "rh-view" not found. Value set to ' +valueFromCookie1);
    }

    if ( Get_Cookie( 'referring-url' ) )
    {
      var valueFromCookie2 = Get_Cookie( 'referring-url' );
      //alert( 'cookie "referring-url" found. Value = ' +valueFromCookie2);
      if (valueFromCookie2.length < 4)
      {
        Set_Cookie( 'referring-url', DRfrr, '365', '/', '', '' );
        var valueFromCookie2 = Get_Cookie( 'referring-url' );
        //alert( 'cookie "referring-url" found and length < 4. Value = ' +valueFromCookie2);
      }
    }
    else
    {
      Set_Cookie( 'referring-url', DRfrr , '365', '/', '', '' );
      var valueFromCookie2 = Get_Cookie( 'referring-url' );
      //alert( 'cookie "referring-url" not found. Value set to ' +valueFromCookie2);
    }

    //alert( 'Function CheckCookies finished.' );
  }


  /*
  Script Name: Javascript Cookie Script
  Author: Public Domain, with some modifications
  Script Source URI: http://techpatterns.com/downloads/javascript_cookies.php
  Version 1.1.1
  Last Update: 4 October 2007

  Changes:
  1.1.1 fixes a problem with Get_Cookie that did not correctly handle case
  where cookie is initialized but it has no "=" and thus no value, the 
  Get_Cookie function generates a NULL exception. This was pointed out by olivier, thanks

  1.1.0 fixes a problem with Get_Cookie that did not correctly handle
  cases where multiple cookies might test as the same, like: site1, site

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  */

  // this fixes an issue with the old method, ambiguous values 
  // with this test document.cookie.indexOf( name + "=" );

  // To use, simple do: Get_Cookie('cookie_name'); 
  // replace cookie_name with the real cookie name, '' are required
  function Get_Cookie( check_name ) {
    // first we'll split this cookie up into name/value pairs
    // note: document.cookie only returns name=value, not the other components
    var a_all_cookies = document.cookie.split( ';' );
    var a_temp_cookie = '';
    var cookie_name = '';
    var cookie_value = '';
    var b_cookie_found = false; // set boolean t/f default f
	
    for ( i = 0; i < a_all_cookies.length; i++ )
    {
      // now we'll split apart each name=value pair
      a_temp_cookie = a_all_cookies[i].split( '=' );		
		
      // and trim left/right whitespace while we're at it
      cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
      // if the extracted name matches passed check_name
      if ( cookie_name == check_name )
      {
        b_cookie_found = true;
        // we need to handle case where cookie has no value but exists (no = sign, that is):
        if ( a_temp_cookie.length > 1 )
        {
          cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
        }
        // note that in cases where cookie is initialized but no value, null is returned
        //alert(cookie_value);
        return cookie_value;
        break;
      }
      a_temp_cookie = null;
      cookie_name = '';
    }
    if ( !b_cookie_found ) 
    {
      return null;
    }
  }

  /*
  only the first 2 parameters are required, the cookie name, the cookie
  value. Cookie time is in milliseconds, so the below expires will make the 
  number you pass in the Set_Cookie function call the number of days the cookie
  lasts, if you want it to be hours or minutes, just get rid of 24 and 60.

  Generally you don't need to worry about domain, path or secure for most applications
  so unless you need that, leave those parameters blank in the function call.
  */

  function Set_Cookie( name, value, expires, path, domain, secure ) 
  {
    //alert('function Set_Cookie entered');
    // set time, it's in milliseconds
    var today = new Date();
    //alert(today);
    today.setTime( today.getTime() );

    // if the expires variable is set, make the correct expires time, the
    // current script below will set it for x number of days, to make it
    // for hours, delete * 24, for minutes, delete * 60 * 24

    if ( expires )
    {
      expires = expires * 1000 * 60 * 60 * 24;
    }

    //alert( 'today ' + today.toGMTString() );// this is for testing purpose only

    var expires_date = new Date( today.getTime() + (expires) );

    //alert('expires ' + expires_date.toGMTString());// this is for testing purposes only

    document.cookie = name + "=" + escape( value ) +
      ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
      ( ( path ) ? ";path=" + path : "" ) + 
      ( ( domain ) ? ";domain=" + domain : "" ) +
      ( ( secure ) ? ";secure" : "" );
  }

  // this deletes the cookie when called
  function Delete_Cookie( name, path, domain ) 
  {
    if ( Get_Cookie( name ) ) document.cookie = name + "=" +
      ( ( path ) ? ";path=" + path : "") +
      ( ( domain ) ? ";domain=" + domain : "" ) +
      ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
  }
  //----------------------------------------------------------------------------------------------
  //--------end functions for cookies-------------------------------------------------------------
  //----------------------------------------------------------------------------------------------
