// Include file for my javascript functions
// Tamas E. Gunda      11.11.2002





function level()
	{
    var Words1 ="m%61i"+"lto%3At%67un%64a2";
	var Words2 = "%40%70uma%2E%75nideb%2E%68%75";
	 var NewWords;
     NewWords = unescape(Words1 + Words2);
     document.location=NewWords;	
	}

function loadImages (iName, firstImage, lastImage)
        {
        imgArray=new Array()
        for (i=firstImage; i<=lastImage; i++) 
                {imgArray[i-firstImage]=new Image()
                imgArray[i-firstImage].src=iName + i + ".gif"} 
        return imgArray 
}

//-------- mint az elözö, de csak egy megadott----------

function preload(img)
 {
  	var a=new Image()
  	a.src=img
  	return a
 }

//---------------------------------------------------------
	function GetCookie (name) {
	  var arg = name + "=";
	  var alen = arg.length;
	  var clen = document.cookie.length;
	  var i = 0;
	  while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		  return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break; 
	  }
	  return null;
	}

//---------------------------------------------------------
	function getCookieVal (offset) {
	  var endstr = document.cookie.indexOf (";", offset);
	  if (endstr == -1)
		endstr = document.cookie.length;
	  return unescape(document.cookie.substring(offset, endstr));
	}
//--------- window.open document.write-ban, ha tul sok a "" --------

function chimeWindow (htmlfile) 
     {
     	window.open ( htmlfile,'dnsWindow' ,'fullscreen=yes,resizable=yes')
     }

//------- Show MIMEtypes------------

function showMimes()
   {
   document.writeln("<OL>")
   for (i = 0; i < navigator.mimeTypes.length; i++) 
   {
      document.writeln(
         "<LI>Type: ", navigator.mimeTypes[i].type,
         "<UL><LI>Description: ", 
               navigator.mimeTypes[i].description,
         "<LI>Suffixes: ", navigator.mimeTypes[i].suffixes,
         "</UL>")
   }
   document.writeln("</OL>")
}

//----------------------------------------------------------------
//Takes aString object, the string to search for,
//and optionally the index to start the search from.
//Searches from left to right.
function indexOf(aString, searchString, startFrom)
{
   if (indexOf.arguments.length < 1)
   {
      alert("from indexOf: specify the string to search")
      return -1
   }
   if (indexOf.arguments.length < 2)
   {
      alert("from indexOf: specify a string to search")
      return -1
   }
   if (indexOf.arguments.length < 3)
      startFrom = 0
   if (!((startFrom >= 0) && (startFrom < aString.length)))
   {
      alert("from indexOf: wrong string index")
      return -1
   }
      return aString.indexOf(searchString, startFrom)
}


//----------- navigator version-------------

//function version()

function version()
{
var ver = ""
if (navigator.appName == "Netscape")
	{
	 if  (indexOf(navigator.appVersion,"4.0",0) == 0)
		{ ver = 'N4.0' } 
	 else
		{    if  (indexOf(navigator.appVersion,"3.0",0) == 0)
		      {ver ='N3.0'}
		}
             if (ver == "")
		{
		ver = "-1"
 		}
             }
if (navigator.appName == "Microsoft Internet Explorer")
	{
	
	 if  (indexOf(navigator.appVersion,"4.0",0) == 0)
		{ ver = 'MSIE4.0' } 
	 else
		{    if  (indexOf(navigator.appVersion,"3.0",0) == 0)
		      {ver ='MSIE3.0'}
		}
             if (ver == "")
		{
		ver = "-1"
 		}
             }
	if (ver =="-1") 
        {document.write('<BR>Legalább 3.03-es Netscape vagy 3.0 MS Internet Explorer verzió szükséges a honlap megfelelő működéséhez!<P>')
         document.write('This home-page works best with Netscape 3.03+ or Internet Explorer 3.0+')}

return ver
}

//------ user agent version -------

function user_agent ()
	{
  var ver=false
  ver=(((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) ||   ((navigator.appName == "Microsoft Internet Explorer") &&   (parseInt(navigator.appVersion) >= 4 )))
 
  return ver
}

//------ show selected check button number-------
// rad=NAME

function showCheckedButton(formName) 
   { 
   for ( var i = 0; formName.rad.length; i++)
       if (formName.rad[i].checked)
            break
  return i  
}

//----------- is Chemscape Chime installed? ------


function isChime ()
	{	
	if (GetCookie ("Chime")=="yes")
		return -1
    else
		return 0
}

//---------------------------------------------------------
	function SetCookie (name, value) {
	  var argv = SetCookie.arguments;
	  var argc = SetCookie.arguments.length;
	  var expires = (argc > 2) ? argv[2] : null;
	  var path = (argc > 3) ? argv[3] : null;
	  var domain = (argc > 4) ? argv[4] : null;
	  var secure = (argc > 5) ? argv[5] : false;
 	  document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}


//----------- name and version of navigator----------

function navig ()
	{ 
	return (navigator.appName+", version "+navigator.appVersion)
	
}
//---------------last modified, y2K corrigated


function lastModified ()
{ 
   
    var days = new Array ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
    
    var months = new Array ('January','February','March','April','May','June','July','August','September','October','November','December');
    
    function nths(day) {
       if (day == 1 || day == 21 || day == 31)
         return 'st';
       if (day == 2 || day == 22)
         return 'nd';
       if (day == 3 || day == 23)
         return 'rd';
       return 'th';
    }
    
    function y2k(number) { return (number < 1000) ? number + 1900 : number; }
    
    function getCorrectedYear(year) {
        year = year - 0;
        if (year < 70) return (2000 + year);
        if (year < 1900) return (1900 + year);
        return year;
    }
    
    var dateError = new Date(document.lastModified);
    var date = new Date(getCorrectedYear(dateError.getYear()),dateError.getMonth(),dateError.getDate());
    
   if (y2k(date.getYear()) < 1995)
	{
		document.write ("- - -");
		return;
	}

    document.write('<div align="left"><font size="-1">Last modified on ' + days[date.getDay()] + ' ' +
      date.getDate() + nths(date.getDate()) + ' ' +
      months[date.getMonth()] + ', ' + y2k(date.getYear()) + '</font></div><div align="right"><a href="http://www.mozilla.org/products/firefox/"><img align="bottom" src="getff2.gif" width="120" height="60" border="0"></a></div><p>&nbsp;<p>');
    
 }  

//---------------utoljára módosítva


function utolsoMod ()
{ 
     
    var days = new Array ('vasárnap','hétfő','kedd','szerda','csütörtök','péntek','szombat');
    
    var months = new Array ('január','február','március','április','május','június','július','augusztus','szeptember','október','november','december');
    
    function y2k(number) { return (number < 1000) ? number + 1900 : number; }
    
    function getCorrectedYear(year) {
        year = year - 0;
        if (year < 70) return (2000 + year);
        if (year < 1900) return (1900 + year);
        return year;
    }
    
    var dateError = new Date(document.lastModified);
    var date = new Date(getCorrectedYear(dateError.getYear()), dateError.getMonth(), dateError.getDate());
 
   if (y2k(date.getYear()) < 1995)
	{
		document.write ("- - -");
		return;
	}
    document.write('<div align="left"><font size="-1">Utolsó módosítás ' + y2k(date.getYear()) +'. ' + months[date.getMonth()] +' '+ date.getDate() +'., '+  days[date.getDay()] +
     '</font> </div><div align="right"><a href="http://www.mozilla.org/products/firefox/"><img align="bottom" src="getff2.gif" width="120" height="60" border="0"></a></div><p>&nbsp;<p>');
    
 }  

//----------- ends here ---------------------

