function GetShortLink (linkstr) {
	return (linkstr.toString().substring(0,linkstr.toString().lastIndexOf('/'))+'/');
}

function openWin( url, name, width, height )
{
    if ( width < 1 )
    {
        width = 800;
    }
    if ( height < 1 )
    {
        height = 600;
    }
    w=window.open( url, name, 'width='+width+',height='+height+
        ',directories=no,location=no,menubar=no,scrollbars=yes,status=yes,resizable=yes,toolbar=no,top=50,left=50' );
    w.focus();
}


function openSendLink()
{
    openWin( '/popup/sendlink/index.php?link='+self.document.location, 'sendlink', 400, 340 );
}


function open_doc(cime,szelesseg,magassag)
{
    if (typeof usrwindow != 'undefined')
    {
        if (!usrwindow.closed)
        {
            usrwindow.close();
        }
    }
    usrwindow=window.open(cime,'ablak', 'top=0,left=0,resizable=no,hotkeys=yes,width='+szelesseg+',height='+magassag);
}

	function getChildren (node,type,attribute) {
		var collection = new Array();
		var j=0;
		for( var i = 0; node.childNodes[i]; i++ )
			if (node.childNodes[i].nodeName==type) {
			 	collection[j++]=node.childNodes[i].getAttribute(attribute);
			}
		return (collection);
	}

	function boxChange (menuName, boxName, sw) {
		var boxChildren = getChildren(document.getElementById ('box_headline'),'DIV','id');
		var boxSelf = document.getElementById (boxName);

		var menuChildren = getChildren(document.getElementById ('tab_headline'),'LI','id');
		var menuSelf = document.getElementById (menuName);

		for( var i = 0; i<boxChildren.length; i++ ){
			document.getElementById (boxChildren[i]).style.display = "none";
		}
		for( var i = 0; i<menuChildren.length; i++ ){
			if ( 	(document.getElementById (menuChildren[i]).className != "hype") && 
					(document.getElementById (menuChildren[i]).className != "hypecurrent")) {
				document.getElementById (menuChildren[i]).className = "";
			} else {
				//if ( document.getElementById (menuChildren[i]).className == "hype" ) {
					document.getElementById (menuChildren[i]).className = "hype";
				/*}
				if ( document.getElementById (menuChildren[i]).className == "hypecurrent" ) {
					document.getElementById (menuChildren[i]).className = "hypecurrent";
				}*/
			}
		}
		boxSelf.style.display = "block";
		if ( 	(document.getElementById (menuName).className == "hype") ||
				(document.getElementById (menuName).className == "hypecurrent") ) {
					document.getElementById (menuName).className = "hypecurrent";
		} else {
			document.getElementById(menuName).className = "current";
		}

		
	}

	function SetElementWidth (elementName,newWidth) {
		//alert('elem: '+elementName+'szelesseg: '+newWidth);
		document.getElementById (elementName).style.width = newWidth;
	}
function stuff (neve) {

	document.getElementById("eszk").innerHTML= neve;
	document.getElementById("eszk_bottom").innerHTML= neve;

}


