		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 show_hide_select(status){
			var selecturi=document.getElementsByTagName("select");
			for(var i=0;i<selecturi.length;i++){
				if(status=='disable'){
					selecturi.item(i).style.display="none";	
				}
				else{
					selecturi.item(i).style.display="";	
				}
			}
			return false;
		}
		
		function baga_hituri(cid){
			iframe_hit=document.getElementById("hituri");
			iframe_hit.setAttribute("src","include/hituri_poze.php?foto="+cid);	
		}
		
		function enlarge(filename,e,width,height,cid,make_hit){
			//asta e pentru a ascunde flashurile din pagina
			var flashuri=document.getElementsByTagName("span");
			for(var i=0;i<flashuri.length;i++){
				if(flashuri[i].getAttribute("attr")=="didi"){
					flashuri[i].style.visibility="hidden";
				}
			}
			
			if(make_hit=='yes')	baga_hituri(cid);
			////baga pe none orice select
			//show_hide_select("disable");
			
			//// redimensioneaza mediu
			var target=450;
			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

			divulet=document.getElementById("showimage");
			large=document.getElementById("large_image");
			large.setAttribute("src",filename,0);
			//large.setAttribute("width",width_mediu,0);
			//large.setAttribute("height",height_mediu,0);
			large.setAttribute("width",width,0);
			large.setAttribute("height",height,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="";
			//maxim.innerHTML="<a href='#' onClick='javascript: return maximizar("+width+","+height+","+width_mediu+","+height_mediu+");'><img src='images/window/maximize.gif' border=0></a>";
			
			maxim.innerHTML="<a href='#' onClick='javascript: return restore("+width+","+height+","+width_mediu+","+height_mediu+");'><img src='/images/window/restore.jpg' border=0></a>";
			divulet.setAttribute("style","position:absolute;top:"+vertpos+"px;left:"+horzpos+"px;z-index:300;",0);
			return false;

		}

		function maximizar(width,height,width_mediu,height_mediu){
			large=document.getElementById("large_image");
			large.setAttribute("width",width,0);
			large.setAttribute("height",height,0);

			maxim=document.getElementById("maxim_restore");
			maxim.innerHTML="<a href='#' onClick='javascript: return restore("+width+","+height+","+width_mediu+","+height_mediu+");'><img src='/images/window/restore.jpg' border=0></a>";

			return false;

		}

		function restore(width,height,width_mediu,height_mediu){
			large=document.getElementById("large_image");
			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("+width+","+height+","+width_mediu+","+height_mediu+");'><img src='/images/window/maximize.gif' border=0></a>";
			return false;
		}

		function close_div(){
			////refa orice select
			//show_hide_select("enable");
			
			divulet=document.getElementById("showimage");
			divulet.style.display="none";
			divulet.setAttribute("style","display:none",0);
			
			var large=document.getElementById("large_image");
			large.setAttribute("src","images/pixel.gif");
						//asta e pentru a ascunde flashurile din pagina
			var flashuri=document.getElementsByTagName("span");
			for(var i=0;i<flashuri.length;i++){
				if(flashuri[i].getAttribute("attr")=="didi"){
					flashuri[i].style.visibility="visible";
				}
			}
			return false;
		}

