    window.ondom = function(fn){
        window.__ondom_functionArray.push(fn);
    };
    (function(){
        window.__ondom_functionArray = [];
        function _runFunctions(){
            for (var i in window.__ondom_functionArray){
                (window.__ondom_functionArray[i])();
            }
        };
        var _khtml = /(WebKit|khtml)/i.test(navigator.userAgent);
        if(document.addEventListener && !_khtml){
            document.addEventListener("DOMContentLoaded", _runFunctions, false);
        }else if(_khtml){
            var _timer = setInterval(function(){
                if(/loaded|complete/.test(document.readyState)){
                    clearInterval(_timer);
                    _runFunctions();
                }
            }, 10);
        }else{
            document.write("<script id=__ie_ondom defer src=javascript:void(0)><\/script>");
            var script = document.getElementById("__ie_ondom");
            script.onreadystatechange = function(){
                if(this.readyState == "complete"){
                    _runFunctions();
                }
            };
        }
    })();
	
	window.onload = function()
	{
		// begin *** toggle Interational Websites selector
		
		var internationalWebsites = document.getElementById("international-websites");
		var isClickedCountrySeletor = false;
		
		if (typeof stateCountrySelector == "undefined")
		{
			stateCountrySelector = 'none';
		}
		
		document.getElementById("languages").getElementsByTagName("a")[0].onclick = function()
		{
			
			if (stateCountrySelector == 'none')
			{
				internationalWebsites.className = "showcountryselector";
				stateCountrySelector = 'show';
				isClickedCountrySeletor = true;
			}
			
			return false;
		}

		document.getElementsByTagName("body")[0].onclick = function()
		{
			if (stateCountrySelector == 'show' && isClickedCountrySeletor == false)
			{
				internationalWebsites.className = "hidecountryselector";
				stateCountrySelector = 'none';
			}
			else
			{
				isClickedCountrySeletor = false;
			}
		}
		
		// end *** toggle Interational Websites selector
	}

	function jump(object)
	{
		if (object.value != "")
		{
			window.open(object.value);
		}
	}

	function jumpURL(url)
	{
		if (url != "")
		{
			window.open(url);
		}
	}

	function showHide(id, state)
	{
		if (state == 'show')
		{
			document.getElementById(id).style.display = '';
			document.getElementById(id + 'link').style.display = 'none';
		}
		else
		{
			document.getElementById(id).style.display = 'none';
			document.getElementById(id + 'link').style.display = '';
		}
	}
	
	//
	
	function toggleItemsUnderSectionMenu(aItem, ulLevelId)
	{
	
		if (document.getElementById(ulLevelId) == null) return true;
	
		parentNodeItemsLevel = document.getElementById(ulLevelId).parentNode;
		classParentNodeItemsLevel = getClassAttribute(parentNodeItemsLevel);
		
		documentLocation = document.location.href.indexOf("#") != -1 ? document.location.href.substring(0, document.location.href.indexOf("#")) : document.location.href;
		
		if (documentLocation != aItem.href && aItem.href.match(/.*\#$/) == null)
		{
			return true;
		}
		
		if (classParentNodeItemsLevel.indexOf('selected') != -1)
		{
			setClassAttribute(parentNodeItemsLevel, classParentNodeItemsLevel.replace(/\bselected\b/g, ''));
			document.getElementById(ulLevelId).style.display = "none";
		}
		else
		{
			var navUl = document.getElementById("section-menu-items").getElementsByTagName('ul');
			for (var i=0; i<navUl.length; i++)
			{
				if (navUl[i].id.match(/^section-menu-[0-9]{1,2}-[0-9]{1,2}$/))
				{
					anothersParentNodeItemsLevel = document.getElementById(navUl[i].id).parentNode;
					anothersClassParentNodeItemsLevel = getClassAttribute(anothersParentNodeItemsLevel)
					setClassAttribute(anothersParentNodeItemsLevel, anothersClassParentNodeItemsLevel.replace(/\bselected\b/g, ''));
					document.getElementById(navUl[i].id).style.display = "none";
				}
			}
			
			document.getElementById(ulLevelId).style.display = "block";
			setClassAttribute(parentNodeItemsLevel, classParentNodeItemsLevel + " selected");
		}
		
		if (!aItem.href.match(/.*\#$/) && classParentNodeItemsLevel.indexOf('selected') == -1 && classParentNodeItemsLevel.indexOf('opened') == -1)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	function setClassAttribute(elem, valueAttr)
	{
		navigator.userAgent.indexOf('MSIE') != -1 ? elem.setAttribute("className", valueAttr) : elem.setAttribute("class", valueAttr);
	}
	
	function getClassAttribute(elem)
	{
		classValue = navigator.userAgent.indexOf('MSIE') != -1 ? elem.getAttribute("className") : elem.getAttribute("class");
		return classValue != null ? classValue : "";
	}
	
	//

	function showHideStaff(id, state)
	{
		if (state == 'show')
		{
			document.getElementById(id).style.display = 'block';
			document.getElementById(id + 'link').style.display = 'none';
		}
		else
		{
			document.getElementById(id).style.display = 'none';
			document.getElementById(id + 'link').style.display = 'block';
		}
	}

	var state = new Object();
	
	// custom Show Hide - Toggle Destinations
	
	function toggleDestinations(id, state)
	{		
		if (state == 'show') 
		{
			document.getElementById(id).style.display = '';
		}
		else
		{
			document.getElementById(id).style.display = 'none';
		}
	}

	function reveal(id, dir, height) {
		var dim = getDims(id);
		var step = 5;
		var alphaStep = (step*100)/dim.height;
		
		if (dir == 'down') 
		{
			if (typeof (height) == 'undefined') {
				height = 0;
				alpha = 0;
			}
			if (height < dim.height) 
			{
				height += step;
				alpha += alphaStep;
				setOpacity(document.getElementById(id), alpha); 
				document.getElementById(id).style.clip = "rect(0px," + dim.width + "px," + height + "px,0px)";
				setTimeout('reveal("' + id + '", "down", ' + height + ');', 10);
			}
		state[id] = 'show';
		} 
		else if (dir == 'up') 
		{
			if (typeof (height) == 'undefined') {
				height = dim.height;
				alpha = 100;
			}
			if (height > 0) 
			{
				height -= 5;
				alpha -= alphaStep;
				setOpacity(document.getElementById(id), alpha);  
				document.getElementById(id).style.clip = "rect(0px," + dim.width + "px," + height + "px,0px)";
				setTimeout('reveal("' + id + '", "up", ' + height + ');', 10);
			}
		state[id] = 'none';
		}
	}
	
	function setOpacity(e,opacity){
	  var o=e.style;
	  o.opacity=(opacity/100); //Opera
	  o.MozOpacity=(opacity/100); //Mozilla+Firefox
	  o.KhtmlOpacity=(opacity/100); //Konqueror
	  //o.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+opacity+", style=0, enabled=true)"; //IE
	}

	function getDims(id) 
	{
		var x = document.getElementById(id).offsetWidth;
		var y = document.getElementById(id).offsetHeight;
		
		return {"width" : x, "height" : y};
	}
	
	function bookmarkLink()
	{
		title = document.title;
		url = location.href;

		if (window.sidebar)
		{
			window.sidebar.addPanel(title, url,"");
		}
		else if ( window.external )
		{
			window.external.AddFavorite( url, title);
		}
		else if (window.opera && window.print)
		{
			return true;
		}
	}

	function validateMyProjectsAbroadLoginForm()
	{
		var msg = 'Mandatory fields:\n\n';
		var fields = '';
		if ((document.login.login_username.value == '') || (document.login.login_username.value == '[username]')) fields += 'Name \n';
		if ((document.login.login_password.value == '') || (document.login.login_password.value == '[password]')) fields += 'Password \n';

		if (fields != '')
		{
			alert(msg + fields);
		} else {
			document.login.submit();
		}
	}

    clickInputs = [
        {
            id: 'search_box',
            text: '[חפש]'
        },
        {
            id: 'name_box',
            text: '[name]'
        },
        {
            id: 'email_box',
            text: '[email]'
        },
        {
            id: 'username_box',
            text: '[שם משתמש]'
        },
        {
            id: 'password_box',
            text: '[סיסמא]'
        }
    ];

    window.ondom(function() {
        var input_element;
        for (var i = 0; i < clickInputs.length; i++) {
            var input_element = document.getElementById(clickInputs[i].id)
            if (input_element) {
                input_element.setAttribute('alt', clickInputs[i].text);
                input_element.onfocus = function() {
                    if (this.value == this.getAttribute('alt')) {
                        this.value = '';
                    }
                }
                input_element.onblur = function() {
                    if (this.value == '') {
                        this.value = this.getAttribute('alt');
                    }
                }

            }
        }
    });
	
	function openNewWindowForDownloadsSWF(path, filename, title, width, height)
	{
		var swfWin = window.open("","playswf","width=" + width + ",height=" + height + "status=no,toolbar=no,menubar=no");
		var output = "";
		swfWin.document.open();
			output += '<html><head><title>' + title + '</title></head>';
			output += '<body style="margin: 0px;">';
			output += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '">';
			output += '<param name="movie" value="' + path + filename + '" />';
			output += '<param name="quality" value="high" />';
			output += '<embed src="' + path + filename + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>';
			output += '</object>';
			output += '</body>';
			output += '</html>';
		swfWin.document.write(output);
		swfWin.document.close();
	}
