var browser_type=navigator.appName;
var browser_version=parseInt(navigator.appVersion);
var ns4 = (document.layers) ? 1 : 0;
var ie4 = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;
 
var hasznosdb = new Object()
hasznosdb["kozig"] = [
		{value:"http://www.mkab.hu/", text:"Alkotmánybíróság"},
		{value:"http://www.th.hu/", text:"Állambiztonsági Levéltár"},
		{value:"http://www.asz.gov.hu/", text:"Állami Számvevőszék"},
		{value:"http://www.allamkincstar.gov.hu/cimlap", text:"Államkincstár"},
		{value:"http://www.antsz.hu/", text:"ÁNTSZ"},
		{value:"http://www.apeh.hu/", text:"APEH"},
		{value:"http://www.mbh.hu/", text:"Bányászati Hivatal"},
		{value:"http://www.birosag.hu/", text:"Bíróságok"},
		{value:"http://www.eh.gov.hu/", text:"Energia Hivatal"},
		{value:"http://www.fvf.hu/", text:"Fogyasztóvédelmi Főfelügyelőség"},
		{value:"http://www.gvh.hu/", text:"Gazdasági Versenyhivatal"},
		{value:"http://www.mgsz.hu/", text:"Geológiai Szolgálat"},
		{value:"http://www.nhh.hu/", text:"Hírközlési Hatóság"},
		{value:"http://www.magyarorszag.hu/", text:"Kormányzati Portál"},
		{value:"http://www.keh.hu/", text:"Köztársasági Elnök"},
		{value:"http://www.kozbeszerzes.hu/", text:"Közbeszerzések Tanácsa"},
		{value:"http://www.ksh.hu/", text:"KSH"},
		{value:"http://www.kvi.hu/", text:"KVI"},
		{value:"http://www.meh.hu/", text:"Miniszterelnöki Hivatal"},
		{value:"http://www.mnb.hu/", text:"MNB"},
		{value:"http://www.oep.hu/", text:"OEP"},
		{value:"http://www.onyf.hu/", text:"ONYF"},
		{value:"http://www.ortt.hu/", text:"ORTT"},
		{value:"http://www.mkogy.hu/", text:"Országgyűlés"},
		{value:"http://www.obh.hu/", text:"Országgyűlési biztosok"},
		{value:"http://www.valasztas.hu/ovb/hu/ovbinf.html", text:"Országos Választási Bizottság"},
		{value:"http://www.valasztas.hu", text:"Országos Választási Iroda"},
		{value:"http://www.pszaf.hu/", text:"PSZÁF"},
		{value:"http://www.rendorseg.hu/", text:"Rendőrség"},
		{value:"http://www.mszh.hu/index.html", text:"Szabadalmi Hivatal"},
		{value:"http://www.mklu.hu/", text:"Ügyészség"},
		{value:"http://www.vam.hu/", text:"VPOP"}
			];

hasznosdb["menetrend"] = [
			{value:"http://www.balatonihajozas.hu/hu/aktualis.htm#komp", text:"Balatoni komp"},
			{value:"http://www.balatonihajozas.hu/hu/setahajok.htm", text:"Balatoni sétahajó"},
			{value:"http://www.balatonihajozas.hu/hu/menetrend.htm", text:"Balatoni személyhajó"},
			{value:"http://www.bkv.hu/home/index.html", text:"BKV"},
			{value:"http://dunainform.rsoe.hu/fontos/dunakomp.htm", text:"Dunai kompok"},
			{value:"http://reiseauskunft.bahn.de/bin/query.exe/en", text:"EU Vasút"},
			{value:"http://www.bud.hu/jaratinformacio/?tPath=/jaratinformacio&jaratinfo_table=1&SID=1864116&larticle=&lapplication=&lPath=/jaratinformacio", text:"Ferihegy érkezés"},
			{value:"http://www.bud.hu/jaratinformacio/?tPath=/jaratinformacio&jaratinfo_table=3&SID=1864116&larticle=&lapplication=&lPath=/", text:"Ferihegy indulás"},
			{value:"http://www.mahartpassnave.hu/webset32.cgi?MAHART@@HU@@32@@1037790520", text:"MAHART (Duna, Tisza)"},
			{value:"http://www.malev.hu/bp/hun/I_FLIGHTTIMETABLE", text:"MALÉV"},
			{value:"http://www.elvira.hu", text:"MÁV"},
			{value:"http://www.menetrendek.hu/cgi-bin/menetrend/html.cgi", text:"Volán országos"},
			{value:"http://www.volanbusz.hu/search.php?page=timetable", text:"Volánbusz nemzetközi"}
			];

hasznosdb["sztar"] = [
			{value:"http://www.uno.hu/movies/actors/", text:"Színészek"},
			{value:"http://www.uno.hu/music/artists/", text:"Zenészek / Együttesek"},
			{value:"http://www.uno.hu/olimpia/olimpicons/", text:"Sportolók"},
			{value:"http://www.uno.hu/movies/directors/", text:"Rendezők"}
			];

hasznosdb["telefonkonyv"] = [
			{value:"http://www.hungarotel.hu/index.php?id=82&no_cache=1", text:"Hungarotel"},
			{value:"http://tudakozo.invitel.hu/", text:"Invitel"},
			{value:"http://monortel.hu/index.php?pageid=352", text:"Monortel"},
			{value:"http://map.pgsm.hu/da/tudakozo.asp", text:"Pannon"},
			{value:"http://tudakozo.t-com.hu/", text:"T-Com"},
			{value:"http://www.t-mobile.hu/PhoneBook/directory", text:"T-Mobile"},
			{value:"http://tudakozo.vodafone.hu/", text:"Vodafone"}
			];

hasznosdb["szotar"] = [
			{value:"http://www.mobidic.hu", text:"MobiDic"},
			{value:"http://onlinefordito.micom.hu/index.php?page=3", text:"Online fordítóprogram"},
			{value:"http://www.rovidites.hu/index.php?action=kereses", text:"Rövidítések"},
			{value:"http://szotar.sztaki.hu/index.hu.jhtml", text:"Sztaki"}
			];

hasznosdb["partok"] = [
			{value:"http://www.centrum-part.hu/", text:"Centrum"},
			{value:"http://www.fidesz.hu/", text:"Fidesz MPSZ"},
			{value:"http://www.jobbik.hu/", text:"Jobbik"},
			{value:"http://www.kdnp.hu/", text:"KDNP"},
			{value:"http://www.mdf.hu/", text:"MDF"},
			{value:"http://www.miep.hu/", text:"MIÉP"},
			{value:"http://www.mszp.hu/", text:"MSZP"},
			{value:"http://www.munkaspart.hu/", text:"Munkáspárt"},
			{value:"http://www.munkaspart-2006.hu/", text:"Magyarországi Munkáspárt 2006"},
			{value:"http://www.szdsz.hu/", text:"SZDSZ"}
			];

hasznosdb["eunio"] = [
			{value:"http://europa.eu.int/constitution/", text:"Európai Alkotmány"},
			{value:"http://www.curia.eu.int/", text:"Európai Bíróság"},
			{value:"http://ue.eu.int/cms3_fo/showPage.ASP?lang=HU", text:"Európai Unió Tanácsa"},
			{value:"http://www.europarl.eu.int/news/public/default_hu.htm", text:"Európai Parlament"},
			];

hasznosdb["valutavalto"] = [
			{value:"http://www.xe.com/ucc/full.shtml", text:"Valutaváltó"}
			];

function ugras(url)
{
	startDate= new Date();	
//	url=URLEncode(url);
	if (parseInt(navigator.appVersion) >= 4) 
	{
		var width=screen.width/100*95;
		var height=((screen.height/100)*80)-100;
		var top=(screen.height-(height+100))/5;
		var left=(screen.width-width)/2;
		tmpWin2=window.open(url,startDate.getTime(),"toolbar=yes,location=yes,resizable=yes,status=yes,scrollbars=yes,menubar=yes,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
	}
	else
	{
		tmpWin2=window.open(url,startDate.getTime(),"toolbar=yes,location=yes,resizable=yes,status=yes,scrollbars=yes,menubar=yes,width=640,height=400");
	}
}

function logClick(id){
	var d = new Date();
	URL = "http://www.hirlista.hu/plink.php?id=" + id + "&foo=" + d.getTime();
	webBug = new Image();
	webBug.src = URL;
	webBug=null;
	d=null;
	return true;
} 

function newWin(urlLoc,h,w) {
  _winName = "sendmail";
  _info  = "toolbar=no";      // yes|no
  _info += ",location=no";    // yes|no
  _info += ",directories=no"; // yes|no
  _info += ",status=no";    // yes|no
  _info += ",menubar=no";    // yes|no
  _info += ",scrollbars=no"; // yes|no
  _info += ",resizable=no";  // yes|no
  _info += ",dependent";      // close the parent, close the popup, omit if you want otherwise
  _info += ",height="+h;
  _info += ",width="+w;
  sLeft=(screen.width-w)/2;
  sTop=(screen.height-h)/2;
  _info += ",left="+sLeft;
  _info += ",top="+sTop;
  DispWin=window.open(urlLoc,_winName,_info);
}

function kezdolap()
{
	//if IE 4+
	if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
	{
		sethome.style.behavior = "url('#default#homePage')";
		sethome.setHomePage("http://www.hirlista.hu/");
	}
}

var expDays = 30; // number of days the cookie should last
function SetCookie(sName, sValue)
{
	var expdate = new Date();
	expdate.setTime(expdate.getTime() + expDays*24*60*60*1000);
	//document.cookie = sName + "=" + escape(sValue) + "; expires=" + expdate.toGMTString() + "; domain=www.hirlista.hu; path=/; ";
	document.cookie = sName + "=" + escape(sValue) + "; expires=" + expdate.toGMTString() + ";";
}
function GetCookie(Name)
{
	var search = Name + "="; 
	if (document.cookie.length > 0)
	{
		offset = document.cookie.indexOf(search);
		if (offset != -1)
		{
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
				return unescape(document.cookie.substring(offset, end));
		} else { return false;}
	} else { return false;}
}

function set_refresh_time(sTime)
{
	SetCookie("refresh_time", sTime);
}

function set_autoscroll(sOff)
{
	if (sOff==1)
	{
		SetCookie("refresh_autoscroll", 1); //bekapcs
	}
	else
	{
		SetCookie("refresh_autoscroll", 0); //kikapcs
	}
}

function get_offset(){
	var _offset = window.pageYOffset ? window.pageYOffset : document[(document.compatMode == 'CSS1Compat') ? 'documentElement' : 'body'].scrollTop; 
	if (_offset>0)
	{
		SetCookie("refresh_autoscroll_offset", _offset);
		return "";
	} else {
		return "";
	}
}

function createAutoRefresh()
{
	var rfrst = 0;
	rfrst = GetCookie("refresh_time");
	if (!rfrst)
		rfrst = 3;
	rfrst = (rfrst * 60 * 1000);
	setTimeout("document.location=document.location+get_offset()", rfrst);
}

function DeleteCookie (name)
{
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);  
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


function change_hasznosholmik(chooser) {
    var newElem;
    var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
    var cityChooser = chooser.form.elements["hhdd"];
    while (cityChooser.options.length) {
        cityChooser.remove(0);
    }
    var choice = chooser.options[chooser.selectedIndex].value;
    var db = hasznosdb[choice];
    newElem = document.createElement("option");
    newElem.text = "Válasszon:";
    newElem.value = "";
    cityChooser.add(newElem, where);
    if (choice != "") {
        for (var i = 0; i < db.length; i++) {
            newElem = document.createElement("option");
            newElem.text = db[i].text;
            newElem.value = db[i].value;
            cityChooser.add(newElem, where);
        }
    }
}

/*******************************************************/
/* KERESO DOBOZ: GOOGLE ÉS HIRLISTA CHECKBOX SHOW HIDE */
/*******************************************************/
function formSearch(formobj){
	var obj = formobj.elements['selist'];
	if(obj.value=='google')
	{
		q = formobj.elements['q'].value;
		var w = window.open('http://www.google.co.hu/search?hl=hu&q='+q, 'google', '');
		w.focus();
		return false;
	}
}
function formSearchShowHide(selobj){
	obj = document.getElementById('search_div');
	if (selobj.value=='google')
	{
		obj.style.visibility='hidden';
		obj.style.display='none';
	} else {
		obj.style.visibility='visible';
		obj.style.display='block';
	}
}

/*******************************************/
/* PÉNZÜGYEK DOBOZ: EGYES FORMOK SHOW HIDE */
/*******************************************/
function formPenzugyShowHide(selobj){
	obj = document.getElementById('penzugyek_'+selobj);
	for(i=1;i<5;i++)
	{
		sty=document.getElementById('penzugyek_'+i).style;
		sty.visibility='hidden';
		sty.display='none';
	}
	obj.style.visibility='visible';
	obj.style.display='block';
}
/*******************************************/
/* FLOAT BANNER                            */
/*******************************************/
function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}
function float_offset(){
	var _offset = window.pageYOffset ? window.pageYOffset : document[(document.compatMode == 'CSS1Compat') ? 'documentElement' : 'body'].scrollTop; 
	return _offset;
}
var a=1;
var b=1;
var c=13;
function float_init()
{
	//var label = document.getElementById('label');
	var fl = document.getElementById('floatbanner');
	if (fl)
	{
		a = parseInt(fl.style.top); //ez mögé adja a px-et
		b = float_offset();
		a = a + (b - a)/8 + c + 'px';
		fl.style.top = a;
		setTimeout("float_init()", 25);
	}
}