function redirect(url){
	location.href=url;
}

function setSize(obj,w,h){
	document.getElementById(obj.id).style.width=w+"px";
	document.getElementById(obj.id).style.height=h+"px";
	return true;
}

var browser;
var version;
function detectBrowser(){
	browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);
}

function _IsCompatibleBrowser()
{
	var sAgent = navigator.userAgent.toLowerCase() ;

	// Internet Explorer 5.5+
	if ( /*@cc_on!@*/false && sAgent.indexOf("mac") == -1 )
	{
		var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ;
		return ( sBrowserVersion >= 7 ) ;
	}

	// Gecko (Opera 9 tries to behave like Gecko at this point).
	if ( navigator.product == "Gecko" && navigator.productSub >= 20030210 && !( typeof(opera) == 'object' && opera.postError ) )
		return true ;

	// Opera 9.50+
	if ( window.opera && window.opera.version && parseFloat( window.opera.version() ) >= 9.5 )
		return true ;

	// Adobe AIR
	// Checked before Safari because AIR have the WebKit rich text editor
	// features from Safari 3.0.4, but the version reported is 420.
	if ( sAgent.indexOf( ' adobeair/' ) != -1 )
		return ( sAgent.match( / adobeair\/(\d+)/ )[1] >= 1 ) ;	// Build must be at least v1

	// Safari 3+
	if ( sAgent.indexOf( ' applewebkit/' ) != -1 )
		return ( sAgent.match( / applewebkit\/(\d+)/ )[1] >= 522 ) ;	// Build must be at least 522 (v3)

	return false ;
}

function init(){
	if(!_IsCompatibleBrowser()){
		document.getElementById('foot').innerHTML='Honlapunk megtekintéséhez minimum Microsoft Internet Explorer 7, vagy Mozilla Firefox 3 böngésző program szükséges!';
	}
}

function addLoad(func) {
    var oldQueue = window.onload? window.onload: function() {};
    window.onload = function() {
        oldQueue();
        func();
    }
}
addLoad(init);
function useinput(obj,def){
	if(def&&((obj.value=='felhasználói név')||(obj.value=='username'))) obj.value='';
	obj.style.background="white";
	obj.select();
}

function blurinput(obj,def){
	if(def&&(obj.value=='')) obj.value='felhasználói név';
	obj.style.background="none";
}

function turn(div){
	var d=document.getElementById(div);
	d.style.display=(d.style.display&&(d.style.display!='block'))?'block':'none';
}
