		var ie=document.all
		var ns6=document.getElementById&&!document.all

		function ietruebody(){
			return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)?document.documentElement : document.body

		}

		function enlarge(path,name,e,width,height){
			//// redimensioneaza mediu
			/*
			target=640;
			if (width > height) {
				percentage = (target / width);
			}

			else {
				percentage = (target / height);
			}

			//in cazul in care dimensiunea imaginii este mai mica decat thumbnail-ul nu se va mai redimensiona

			if(width<target && height<target){
				width_mediu=width;
				height_mediu=height;
			}

			else{
				width_mediu = parseInt(width * percentage);
				height_mediu = parseInt(height * percentage);
			}*/


			if (ie||ns6){
				var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
				var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY
			}
			////END redimensioneaza mediu
			//alert(horzpos+" --- "+vertpos);
			divulet=document.getElementById("showimage");
			large=document.getElementById("large_image");
			large.setAttribute("src",path+"full/"+name,0);
			//large.setAttribute("width",width_mediu,0);
			//large.setAttribute("height",height_mediu,0);
			divulet.style.display="";
			divulet.style.top=vertpos+"px";
			divulet.style.left=horzpos+"px";
			//divulet.style.z-index="200";

			//maxim=document.getElementById("maxim_restore");
			//maxim.innerHTML="<a href='#' onClick=\"javascript: return maximizar('"+path+"','"+name+"');\"><img src='img/maximize.jpg' border=0></a>";
			divulet.setAttribute("style","position:absolute;top:"+vertpos+"px;left:"+horzpos+"px;z-index:300;",0);
			return false;

		}

		function maximizar(path,name){
			large=document.getElementById("large_image");
			large.setAttribute("src",path+"full/"+name,0);
			//large.setAttribute("width",width,0);
			//large.setAttribute("height",height,0);

			maxim=document.getElementById("maxim_restore");
			maxim.innerHTML="<a href='#' onClick=\"javascript: return restore('"+path+"','"+name+"');\"><img src='img/restore.jpg' border=0></a>";

			return false;

		}

		function restore(path,name){
			large=document.getElementById("large_image");
			large.setAttribute("src",path+"zoom/"+name,0);
			//large.setAttribute("width",width_mediu,0);
			//large.setAttribute("height",height_mediu,0);

			maxim=document.getElementById("maxim_restore");
			maxim.innerHTML="<a href='#' onClick=\"javascript: return maximizar('"+path+"','"+name+"');\"><img src='img/maximize.jpg' border=0></a>";
			return false;
		}

		function close_div(){
			divulet=document.getElementById("showimage");
			divulet.style.display="none";
			divulet.setAttribute("style","display:none",0);
			return false;
		}







var ie=document.all
var ns6=document.getElementById&&!document.all

var dragapproved=false
var z,x,y

function move(e){
if (dragapproved){
z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
return false
}
}

function drags(e){
if (!ie&&!ns6)
return
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "HTML" : "BODY"

while (firedobj.tagName!=topelement&&firedobj.className!="drag"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.className=="drag"){
dragapproved=true
z=firedobj
temp1=parseInt(z.style.left+0)
temp2=parseInt(z.style.top+0)
x=ns6? e.clientX: event.clientX
y=ns6? e.clientY: event.clientY
document.onmousemove=move
return false
}
}
document.onmousedown=drags
document.onmouseup=new Function("dragapproved=false")



























function mover(id){
	x = document.getElementById(id).getAttribute("src");
	document.getElementById(id).setAttribute("src", "img/buttons/"+id+"_over.gif", 0);
}
function mout(id){
	document.getElementById(id).setAttribute("src", x, 0);
}

function ch_bg(id,state){
	document.getElementById(id).style.background = state;
}

function arata(id){
	document.getElementById(id).style.display = '';
}

function ascunde(id){
	document.getElementById(id).style.display = 'none';
}


window.onresize= place_div;


function place_div() {
	id = 'form_comanda';
	if(document.getElementById(id) && (document.getElementById(id).style.display == '')){
		myWidth = document.body.clientWidth;
	 	if(myWidth>760)
			ox = (myWidth-760)/2+220;
		else
			ox = 220;		
		document.getElementById(id).style.left = ox;
	}
}

function arata_fc(id){
	document.getElementById(id).style.display = '';
    place_div();
}

function ascunde_fc(id){
	document.getElementById(id).style.display = 'none';
}

function arata_cmd(id){
	document.getElementById(id).style.display = '';
	document.getElementById("tr_"+id).style.display = 'none';
	document.getElementById("tr_a"+id).style.display = '';
}

function ascunde_cmd(id){
	document.getElementById(id).style.display = 'none';
	document.getElementById("tr_a"+id).style.display = 'none';
	document.getElementById("tr_"+id).style.display = '';
}

function verifica_campuri(obj){
	email = obj.email.value;
	nume = obj.nume.value;
	text = obj.continut.value;
	error_string="";
	emp = /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/
	if(nume.length>0){
		t1 = 1;
	}
	else{
		t1 = 0;
		error_string+="Va rugam sa completati campul de nume.\n";
	}


	if(emp.test(email)){
		t2 = 1;
	}
	else{
		t2 = 0;
		error_string+="Va rugam sa introduceti o adresa valida de email.\n";
	}
	if(text.length>0){
		t3 = 1;
	}
	else{
		t3 = 0;
		error_string+="Va rugam sa completati campul de mesaj.\n";
	}

	if(t1 && t2  && t3){
		return true;
		//document.form_trimite_prieten.submit();
	}
	else{
		alert(error_string);
	}
	return false;
}
