function open_popup(url,popwidth,popheight) {
  var popup;
  popup = window.open(url,'survey',"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=0,top=0,width="+popwidth+",height="+popheight);
}

/** toggle info **/
function toggledisplay (id, indicator,text1, text2){
	if (document.getElementById) {
		var obj = document.getElementById(id);
		var indi = document.getElementById(indicator);
		obj.style.display = (obj.style.display=='block'?'none':'block');
		indi.innerHTML = (obj.style.display=='block'?text2:text1);
	} else if(document.all) { // IE
		id.style.display = (id.style.display=='block'?'none':'block');
		indi.innerHTML = (id.style.display=='block'?text2:text1);
	} else if (document.layers) { // Netscape 4.x
		document.id.style.display = (document.id.style.display=='block'?'none':'block');
		document["indicator"].document.open();
		if (document.id.style.display=='block')
		    document["indicator"].document.write(text2);
		if (document.id.style.display!='block')
		    document["indicator"].document.write(text1);
		document["indicator"].document.close();
	}
}

/** Language selection **/
function check_lang_sel() 
{
  var curselect = $('site_id');
  if (curselect.value != 0) 
  {
    document.langform.submit();
   }
}


/** Language selection **/

var Menu = new Class ({
  options: {
    id	: 'menu'
   },	
   initialize: function(options)
   {
      this.setOptions(options);
      var a = $$('#naviul ul li a.active');

		// Searching the li elements
		$ES('li', this.options.id).each(function(e, i) {
			// Events
			e.addEvents({
				'mouseover': this.show,
				'mouseout': this.hide,
				'click': this.hide
			});

			// Add an id for selector
			e.setAttribute( 'id', this.options.id + '_li_' + i );
		}.bind(this));
    },
    
	// Hide elements
	hide: function()
	{   
		// Select the sub_lists of the element
		var oUl = $E('ul', this.id);
		
		// Hide if exists
		if (oUl != null)
			oUl.setStyle('visibility', 'hidden');

                if (a != null) a.getParent().getParent().setStyle('visibility', 'visible');
	},
	
	// Show elements
	show: function()
	{
                if (a != null) a.getParent().getParent().setStyle('visibility', 'hidden');


		// Select the sub_lists of the element
		var oUl = $E('ul', this.id);
		
		// Show if exists
		if (oUl != null)
		oUl.setStyle('visibility', 'visible');

	}
});

Menu.implement(new Options);

Element.extend({
	addMenu: function() {
		var CMenu = new Menu({
			id: this.id
		});
	}
});