var toId;
var ttId;
var showWait;
var topMenuElement;


/*startList = function() {
  
  get_text_size();
  
	if (document.all&&document.getElementById) {
		function listhover(navRoot) {
			for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
				  hide_calendar();
					this.className+=" over";
					}
				node.onmouseout=function() {
				  show_calendar();
					this.className=this.className.replace(" over", "");
					}
				}
			}
		}
		listhover(document.getElementById("nav"));	
		listhover(document.getElementById("tools"));	
	}
}
window.onload=startList;*/

startList = function() {
 get_text_size();
 my_xml();
 }



/*startList = function() {
  if (document.all&&document.getElementById) {
		function listhover(navRoot) {
			for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
				  hide_calendar();
				  //clearTimeout(toId);
          //toId = setTimeout('topMenuOver()',1000);
          topMenuElement = this;
          //showWait = true;
          topMenuOver();
					}
				node.onmouseout=function() {
				  show_calendar();
					topMenuElement = this;
					//showWait = false;
					//clearTimeout(ttId);
					//ttId = setTimeout('topMenuOut()',10);
					topMenuOut();
					}
				}
			}
		}
		listhover(document.getElementById("nav"));	
		listhover(document.getElementById("tools"));	
	}
}
window.onload=startList;*/

function topMenuOver(){
  topMenuElement.className += " over";  
  //$('footer').innerHTML += 1;
  //clearTimeout(ttId);
  //showWait = false;  
}

function topMenuOut(){
  //$('footer').innerHTML += 2;
  //if (!showWait){
    //clearTimeout(toId);
    topMenuElement.className = topMenuElement.className.replace(" over", "");
  //}
}

function hide_calendar() {

  if ($('calendarwrapper'))
  {
    $('calendarwrapper').style.visibility = "hidden";
  }
}

function show_calendar() {

  if ($('calendarwrapper'))
  {
    $('calendarwrapper').style.visibility = "visible";
  }
}

function inlinepopup() {
	$('profilename').innerHTML =" \""+inlinepopup.arguments[2]+"\"!";
	for (var i=0; i<inlinepopup.arguments.length - 1; i++) {
		var element = document.getElementById(inlinepopup.arguments[i]);
		element.style.display = (element.style.display != "block") ? "block" : "none";
	}
}


function Set_Cookie( name, value, expires, path, domain, secure ){
  
  var today = new Date();
  today.setTime( today.getTime() );
  
  if ( expires ){
    expires = expires * 1000 * 60 * 60 * 24;
  }
  var expires_date = new Date( today.getTime() + (expires) );
  
  document.cookie = name + "=" +escape( value ) +
  ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
  ( ( path ) ? ";path=" + path : "" ) + 
  ( ( domain ) ? ";domain=" + domain : "" ) +
  ( ( secure ) ? ";secure" : "" );
}

function getCookie( name ) {
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}


function setStartPage(lang, path){
  Set_Cookie('pl', lang, 360, "/");
  Set_Cookie('pp', path, 360, "/");
}

function change_text_size(name){
  document.getElementById("content_").className = name;
  Set_Cookie('ts', name, 360, "/");
}

function get_text_size() {
  // alert( getCookie('ts') );
  document.getElementById("content_").className = getCookie('ts');
}

// EJ JS
/*
	Copyright Robert Nyman, http://www.robertnyman.com
	Free to use if this text is included
*/
// ---
function $(strId){
	return document.getElementById(strId);
}
// ---
function getElementsByClassName(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];		
		if(oRegExp.test(oElement.className)){
			arrReturnElements.push(oElement);
		}	
	}
	return (arrReturnElements)
}

// ---
function addClassName(oElm, strClassName){
	var strCurrentClass = oElm.className;
	if(!new RegExp(strClassName, "i").test(strCurrentClass)){
		oElm.className = strCurrentClass + ((strCurrentClass.length > 0)? " " : "") + strClassName;
	}
}
// ---
function removeClassName(oElm, strClassName){
	var oClassToRemove = new RegExp((strClassName + "\s?"), "i");
	oElm.className = oElm.className.replace(oClassToRemove, "").replace(/^\s?|\s?$/g, "");
}
// ---
/* EJ-E functions */
function getElementsByAttribute(oElm, strTagName, strAttributeName, strAttributeValue){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var oAttributeValue = (typeof strAttributeValue != "undefined")? new RegExp("(^|\\s)" + strAttributeValue + "(\\s|$)") : null;
	var oCurrent;
	var oAttribute;
	for(var i=0; i<arrElements.length; i++){
		oCurrent = arrElements[i];
		oAttribute = oCurrent.getAttribute && oCurrent.getAttribute(strAttributeName);
		if(typeof oAttribute == "string" && oAttribute.length > 0){
			if(typeof strAttributeValue == "undefined" || (oAttributeValue && oAttributeValue.test(oAttribute))){
				arrReturnElements.push(oCurrent);
			}
		}
	}
	return arrReturnElements;
}
// ---
function preventDefaultBehavior(event){
	event.returnValue = false;
	if(event.preventDefault){
		event.preventDefault();
	}
}
// ---
function getStyle(oElm, strCssRule){
	var strValue = "";
	if(document.defaultView && document.defaultView.getComputedStyle){
		strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
	}
	else if(oElm.currentStyle){
		strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
			return p1.toUpperCase();
		});
		strValue = oElm.currentStyle[strCssRule];
	}
	return strValue;
}
// ---
if(typeof Array.prototype.push != "function"){
	Array.prototype.push = function (){
		for(var i=0; i<arguments.length; i++){
        	this[this.length] = arguments[i];
        }
		return this.length;
	}
}
// ---

// functions from main.js
function openwin (uri) {
  sh=window.open("popup/"+uri+'.html', 'wn', 'toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=1, resizable=1, width=350, height=200, top=100, left=100');
}


/*function openwin (uri) {
  sh=window.open("/html/popup/"+uri+'.html', 'wn', 'toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=1, resizable=1, width=350, height=200, top=100, left=100');
}*/

function openwine (uri) {
  sh=window.open("/html/popup/eng/"+uri+'.html', 'wn', 'toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=1, resizable=1, width=350, height=200, top=100, left=100');
}
