
//|ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
//| (c) 2001 http://www.orgdot.com/javaopensource<br>
//|_______________________________________________________________________

/* ************************************************************************<br>
* you can copy, use, modify and distribute this code for educational, <br>
* commercial or recreational use. all we ask is that you include <br>
* this copyright notice in the source code you distribute. for <br>
* compiled code, you will need to make accessible this copyright notice<br>
* somewhere in the distribution, and/or via a link on the web.<br>
* there are several reasons for this caveat - the most important being<br>
* that open source is based on one main principle: what you find and use, <br>
* others should also have access to. don't keep it to yourself!<br>
* credit where credit is due! http://www.orgdot.com/javaopensource<br>
* <br>
* <br>
* this software is provided by the author and contributors ``as is'' and<br>
* any express or implied warranties, including, but not limited to, the<br>
* implied warranties of merchantability and fitness for a particular purpose<br>
* are disclaimed.  in no event shall the author or contributors be liable<br>
* for any direct, indirect, incidental, special, exemplary, or consequential<br>
* damages (including, but not limited to, procurement of substitute goods<br>
* or services; loss of use, data, or profits; or business interruption)<br>
* however caused and on any theory of liability, whether in contract, strict<br>
* liability, or tort (including negligence or otherwise) arising in any way<br>
* out of the use of this software, even if advised of the possibility of<br>
* such damage.<br>
*<br>
************************************************************************ */


/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
                             UTILS
_______________________________________________________________________*/




                                                  //_____________________
                                                  //  the newline sign
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

var newline = unescape ("%0A");

                                                  //_____________________
                                                  //  no error messages
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

//window.onerror = stopErrors;

function stopErrors() { return true; }


                                                  //_____________________
                                                  //  get search string
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

function getSearchString()
{
	str = document.location.search;
	if (str != "") return replaceSpaces (unescape(str.substring (1)));
	else return "";
}


function replaceSpaces (str)
{
	while (str.indexOf ('+') > -1)
		str = str.substring (0, str.indexOf ('+')) + ' ' + str.substring (str.indexOf ('+') + 1)
	return str;
}

                                                  //_____________________
                                                  //  preload an image
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ


function preload(url)
{
     preloaded = new Image();
     preloaded.src = url;
     return preloaded;
}


                                                  //_____________________
                                                  //  preload images
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ


function preloadImages (urls)
{
     arr = new Array();
     if (document.images != null)
     for (i = 0; i < urls.length; i++)
     {
          arr [i] = new Array();
          for (j = 0; j < urls[i].length; j++) arr[i][j] = preload (urls[i][j]);
     }
     return arr;
}





                                                  //_____________________
                                                  //   get screen size
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

var screen_width = 800, screen_height = 600;

if ( self.screen!=null )
{
     screen_width = self.screen.availWidth;
     screen_height = self.screen.availHeight;
}

                                                  //_____________________
                                                  //   kerned string
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

function noBreakSpace (str)
{
     var kern_string = "";
     var i = 0;
     while (i < str.length)
     {
          kern_string = kern_string + str.substring (i, i + 1) + "&nbsp;";
          i++;
     }
     return kern_string;
}



                                                  //_____________________
                                                  //   random integer
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

var multiplier = 0x015a4e35;
var seed = new Date().getTime() % 0xffffffff;

function randomInteger(mask)
{
	seed = (multiplier * seed + 1) % 0x7fffffff;
	return (seed >> 16) % mask;
}


                                                  //_____________________
                                                  //   set cookie
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ


function setCookie (text)
{
     var d = new Date();
     d.setYear (d.getYear() + 1);
     document.cookie = "org_cooker=" + escape (text) + "; expires = " + d.toGMTString();
}

                                                  //_____________________
                                                  //   get cookie
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

function getCookie ()
{
     var c = document.cookie;
     if (c.indexOf ("org_cooker=" > -1)) c = c.substring (11);
     return unescape(c);
}


                                                  //_____________________
                                                  //   close window
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

function closeWindow ()
{
	self.top.close();
}


                                                  //_____________________
                                                  //   print window
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

function getPrintJob ()
{
	if (self.print) self.print();
}


/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
                             WYSIWIG
_______________________________________________________________________*/




                                                  //_____________________
                                                  //  rollover images
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ


function flipIm(i, j)
{
	status = "";
	if (ims.length > 0) eval ("document.images.im_" + i + ".src=ims[" + i + "][" + j + "].src");
	return true;
}

                                                  //_____________________
                                                  //  popup
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ


function popWin(win_url, win_width, win_height, win_x, win_y)
{
     var specs = "width=" + win_width + ",height=" + win_height + ",";
     specs = specs + "status=no,resizable=no,scrollbars=no,";
     specs = specs + "titlebar=no,directories=no,toolbar=no,";
     specs = specs + "screenX=" + win_x + ",screenY=" + win_y + ",";
     specs = specs + "left=" + win_x + ",top=" + win_y;
     popper = window.open(win_url,"pop",specs);

}


                                                  //_____________________
                                                  //  full screen
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

function fullWin(win_url)
{
     if (not_mac)
     {
          var f_width = screen_width - 10;
          var f_height = screen_height - 32;
     }
     else
     {
          var f_width = screen_width;
          var f_height = screen_height - 20;

     }
     var specs = "width=" + f_width + ",height=" + f_height + ",";
     specs = specs + "status=no,resizable=no,scrollbars=no,";
     specs = specs + "titlebar=no,directories=no,toolbar=no,"
     specs = specs + "fullscreen=yes,type=fullWindow,"
     specs = specs + "screenX=0,screenY=0,left=0,top=0";
     fuller=window.open(win_url,'full',specs);
}



                                                  //_____________________
                                                  //  center window
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

function shiftToCenter(b_width, b_height)
{
     del_x = (screen_width - b_width) / 2;
     if (del_x < 0) del_x = 0;
     del_y = (screen_height - b_height) / 2;
     if (del_y < 0) del_y = 0;
     shiftTo(del_x, del_y);
}



                                                  //_____________________
                                                  //  move window
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

function shiftTo(x, y) { if ( window.moveTo!=null ) window.moveTo(x, y); }





                                                  //_____________________
                                                  //  resize & move
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

function reBound(min_width, min_height)
{
     if ((document.body!=null) && (document.body.clientHeight!=null) &&
     (window.resizeTo!=null))
     {
          if ((document.body.clientHeight < min_height) ||
          (document.body.clientWidth < min_width))
          {
               window.resizeTo(min_width, min_height);
               var chrome_x = min_width - document.body.clientWidth;
               var chrome_y = min_height - document.body.clientHeight;
               window.resizeTo(min_width + chrome_x, min_height + chrome_y);
               window.resizeTo(min_width + chrome_x / 2, min_height + chrome_y);
               shiftToCenter(chrome_x + min_width, chrome_y + min_height);
          }
     }
     else if ((window.innerWidth!=null) && (window.moveBy!=null) && (window.resizeTo!=null))
     {
          if ((window.innerHeight < min_height) || (window.innerWidth < min_width))
          {
               window.resizeTo(min_width, min_height);
               shiftToCenter(window.outerWidth, window.outerHeight);
          }
     }
}







/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
                             SNIFFING
_______________________________________________________________________*/


                                                  //_____________________
                                                  //  browser
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

var explorer = (document.all) ? true : false;




                                                  //_____________________
                                                  //  os
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

var not_mac = (navigator.userAgent!=null &&
navigator.userAgent.indexOf("Mac") >= 0) ? false : true;




                                                  //_____________________
                                                  //  flash 4
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ


var fok = false;

if (not_mac && explorer)
{
      document.writeln ('<scri' + 'pt lang' + 'uage=VBS' + 'cript>');
      document.writeln ('on error resume next');
      document.writeln ('fok=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))');
      document.writeln ('</scr' + 'ipt>');
}
else
{
     var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ?
     navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
     if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))
     >= 4 ) fok = true;
}



/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
                             PLUGIN COMMANDS
_______________________________________________________________________*/

                                                  //_____________________
                                                  //  flash
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

function flash_0_DoFSCommand(command, arg)
{
     eval (command + '("' + arg + '")' );
}

if (explorer && not_mac)
{
     document.writeln ('<scri' + 'pt lang' + 'uage=VBS' + 'cript>');
     document.writeln ('on error resume next');
     document.writeln ('sub flash_0_FSCommand(ByVal command, ByVal arg)');
     document.writeln ('call flash_0_DoFSCommand(command, arg)');
     document.writeln ('end sub');
     document.writeln ('</scr' + 'ipt>');
}

function evalURLCommand (str)
{
	command = readParam (str, "command");
	which_arg = 0;
	while (true)
	{
		arg = readParam (str, "arg_" + which_arg);
		if (arg == "") break;
		else
		{
			args [which_arg] = arg;
			which_arg ++;
		}
	}
	eval (command + "()");
}

function readParam (str, name)
{
	if (str.indexOf (name) < 0) return "";
	chopper = this_search.substring (this_search.indexOf (name) + name.length + 1);
	where = chopper.indexOf ("&") ;
	if (where < 0) return chopper;
	else return chopper.substring (0, where);
}




/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
                             GENERATE HTML CODE
_______________________________________________________________________*/

                                                  //_____________________
                                                  //  flash movie
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ



var codebase = '"http://download.macromedia.com/pub/shockwave/';
codebase = codebase + 'cabs/flash/swflash.cab#version=5,0,0,0"';
var pluginspace = '"http://www.macromedia.com/shockwave/';
pluginspace = pluginspace + 'download/index.cgi?p1_prod_version=shockwaveflash"'

function flash4Code (mov_src, mov_wdt, mov_hgt, mov_col)
{
	code_ = '<object ' + newline;
	code_ = code_ + '  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' + newline;
	code_ = code_ +  '  codebase=' + codebase  + newline;
	code_ = code_ +  '  width="' + mov_wdt + '" ' + newline;
	code_ = code_ +  '  height="' + mov_hgt + '" ' + newline;
	code_ = code_ +  '> ' + newline;
	code_ = code_ +  '  <param name="movie" value="' + mov_src + '"> ' + newline;
	code_ = code_ +  '  <param name="quality" value="best"> ' + newline;
	code_ = code_ +  '  <param name="menu" value="false"> ' + newline;
	code_ = code_ +  '  <param name="align" value="lt"> ' + newline;
	code_ = code_ +  '  <param name="scale" value="exactfit"> ' + newline;
	code_ = code_ +  '  <param name="bgcolor" value="' + mov_col + '"> ' + newline;
	code_ = code_ +  '<embed ' + newline;
	code_ = code_ +  '  src="' + mov_src + '" ' + newline;
	code_ = code_ +  '  quality="best" scale="exactfit" salign="lt" menu="false" ' + newline;
	code_ = code_ +  '  bgcolor=' + mov_col + ' ' + newline;
	code_ = code_ +  '  width="' + mov_wdt + '" ' + newline;
	code_ = code_ +  '  height="' + mov_hgt + '" ' + newline;
	code_ = code_ +  '  type="application/x-shockwave-flash" ' + newline;
	code_ = code_ +  '  pluginspage=' + pluginspace + newline;
	code_ = code_ +  '</embed></object>';
	return code_;
}


/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
                             FLAGS
_______________________________________________________________________*/

                                                  //_____________________
                                                  //  this file loaded
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

var extend_ok = true;
