
/* ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

(c) 2001 http://www.orgdot.com/javaopensource

you can copy, use, modify and distribute this code for educational,
commercial or recreational use. all we ask is that you include
this copyright notice in the source code you distribute. for
compiled code, you will need to make accessible this copyright notice
somewhere in the distribution, and/or via a link on the web.
there are several reasons for this caveat - the most important being
that open source is based on one main principle: what you find and use,
others should also have access to. don't keep it to yourself!
this software is provided by the author and contributors "as is"
and any express or implied warranties, including, but not limited to,
the implied warranties of merchantability and fitness for a particular
purpose are disclaimed. in no event shall the author or contributors
be liable for any direct, indirect, incidental, special, exemplary,
or consequential damages (including, but not limited to, procurement
of substitute goods or services; loss of use, data, or profits; or
business interruption) however caused and on any theory of liability,
whether in contract, strict liability, or tort (including negligence
or otherwise) arising in any way out of the use of this software,
even if advised of the possibility of such damage.

_______________________________________________________________________*/


/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
                             UTILS
_______________________________________________________________________*/





                                                  //_____________________
                                                  //  no error messages
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

//window.onerror = stopErrors;

function stopErrors() { return true; }


                                                  //_____________________
                                                  //  get search string
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ


function replaceSpaces (str)
{
	while (str.indexOf ('+') > -1)
	str = str.substring (0, str.indexOf ('+')) + ' ' + str.substring (str.indexOf ('+') + 1)

	return str;
}


function getSearchVars ()
{
	arr = new Array ();
	arr [0] = new Array ();
	arr [1] = new Array ();
	str = document.location.search;
	if (str.indexOf ('?') == 0) str = replaceSpaces ( unescape( undoFancyURLencoding( str.substring (1) ) ));
	else return arr;
	
	len = 0;
	str_ = str;
	where = -1;
	while ( (where = str_.indexOf ("=")) > -1) 
	{
		str_ = str_.substring (where + 1);
		len ++;
	}
	for (i = 0; i < len; i++)
	{
		where = str.indexOf ('=');
		arr [0][i] = str.substring (0, where);
		str = str.substring (where + 1);
		if ( ( where = str.indexOf ('&') ) < 0 ) where = str.length;
		arr [1][i] = unescape ( str.substring (0, where) );
		if (i < len - 1) str = str.substring (where + 1);
	}
	return arr;
}


function findSearchVar (arr, url_var) 
{
	for (i = 0; i < arr.length; i++)
	if ( arr[0][i] == url_var ) return arr[1][i];
	return "";
}

function undoFancyURLencoding (str)
{
	where = 0;
	while ( (where = str.indexOf ('%u')) > - 1) str = str.substring (0, where + 1) + str.substring (where + 4);
//	alert (str);
	return str;
}

function getSearchString()
{
	str = document.location.search;
	if (str != "") return replaceSpaces (unescape( str.substring (1) ));
	else return "";
}


function urlEncVar (str)
{
	return str + "=" + escape (eval (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);

}

function popWinNu (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;
     return 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 - 32;
          var f_height = screen_height - 22;

     }
     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 4 movie
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ



function flash4Code (mov_src, mov_wdt, mov_hgt, mov_col)
{
	code_ = '<object \n';
	code_ += '  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n';
	code_ += '  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"\n';
	code_ += '  width="' + mov_wdt + '" height="' + mov_hgt + '">\n';
	code_ += '  <param name="movie" value="' + mov_src + '">\n';
	code_ += '  <param name="quality" value="best">\n';
	code_ += '  <param name="menu" value="false">\n';
	code_ += '  <param name="align" value="lt">\n';
	code_ += '  <param name="scale" value="exactfit" \n';
	code_ += '  <param name="bgcolor" value="' + mov_col + '">\n';
	code_ += '<embed \n';
	code_ += '  src="' + mov_src + '" \n';
	code_ += '  quality="best" scale="exactfit" salign="lt" menu="false" \n';
	code_ += '  bgcolor=' + mov_col + ' \n';
	code_ += '  width="' + mov_wdt + '" \n';
	code_ += '  height="' + mov_hgt + '" \n';
	code_ += '  type="application/x-shockwave-flash" \n';
	code_ += '  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash">\n';
	code_ += '</embed></object>';
	return code_;
}


/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
                             FLAGS
_______________________________________________________________________*/

                                                  //_____________________
                                                  //  this file loaded
                                                  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

var extend_ok = true;


