// JavaScript Document

// form submit
function formSubmit(element)
	{
	document.forms[element].submit();
	}

// Ajax
	
function showMenu(id)
	{
		if(document.getElementById(id).style.visibility == 'hidden') {
			document.getElementById(id).style.visibility = 'visible';
			document.getElementById(id).style.height = 'auto';
			document.getElementById(id).style.padding = '4px 0px 2px 8px';
		}
		else {
			document.getElementById(id).style.visibility = 'hidden';
			document.getElementById(id).style.height = '0px';
			document.getElementById(id).style.padding = '0';
		}
	}	

url = document.location.href;
	xend = url.lastIndexOf("/") + 1;
	var base_url = url.substring(0, xend);
	
	function ajax_do (url) {
			// Does URL begin with http?
			if (url.substring(0, 4) != 'http') {
					url = base_url + url;
			}
	
			// Create new JS element
			var jsel = document.createElement('SCRIPT');
			jsel.type = 'text/javascript';
			jsel.src = url;
	
			// Append JS element (therefore executing the 'AJAX' call)
			document.body.appendChild (jsel);
	}
	function showBigPic(url)
	{
		document.getElementById('bigPic').style.background='url('+ url +') no-repeat center';
	}
 function openWin(link, handler, width, height) {
 	  window.open(link, handler, 'scrollbars=0, statusbar=1, width='+width+', height='+height+', ScreenX=100, ScreenY=50');
}
 function actions(link, handler, width, height) {
    window.open(link, handler, 'scrollbars=1, statusbar=1, width='+width+', height='+height+', ScreenX=100, ScreenY=50');
}

// printare

	function printpage() 
	{
		window.print();  
	}
// 

	function one2two(elso, masodik, maxlength) {
	 var m1 = document.getElementById(elso);
	 var m2 = document.getElementById(masodik);
		m1len = m1.length ;
		for ( i=0; i<m1len ; i++){
			if (m1.options[i].selected == true ) {
				m2len = m2.length;
			if(maxlength>m2len)
					m2.options[m2len]= new Option(m1.options[i].text, m1.options[i].value);
			else
			{
			if(maxlength == 10000)
				alert("!");
			if(maxlength == 10000)
				alert("!");
			m1.options[i].selected = false;
			}
			}
		}
	
		for ( i = (m1len -1); i>=0; i--){
			if (m1.options[i].selected == true ) {
				m1.options[i] = null;
			}
		}
	}
	function two2one(elso,masodik) {
	 var m1 = document.getElementById(elso);
	 var m2 = document.getElementById(masodik);
	
		m2len = m2.length ;
			for ( i=0; i<m2len ; i++){
				if (m2.options[i].selected == true)                {
					m1len = m1.length;
					m1.options[m1len]= new Option(m2.options[i].text, m2.options[i].value);
				}
			}
			for ( i=(m2len-1); i>=0; i--) {
				if (m2.options[i].selected == true ) {
					m2.options[i] = null;
				}
			}
	}
	
	function leaving(){
		   var i=0;
		   m2=document.getElementById('marca_sel');
		   for (i=0; i<m2.length; i++) {
		   m2.options[i].selected = true;}
	}
	