parcindustrial = {
	curent : null,
	
	proceseazaImagini : function(){		    	    
	sursa = document.getElementById("containerMain");		
	imagini = sursa.getElementsByTagName("IMG");	
	
	for(i=0; i< imagini.length; i++){
		media = imagini[i].src.indexOf("images/media/");			
		th = imagini[i].src.indexOf("/th_");
		if(media > 0 && th > 0 && th > media){
			if(imagini[i].align){
				imagini[i].className = "imagine" + imagini[i].align;
			}
			imagini[i].onclick = function(){
				parcindustrial.deschide(this.src.replace('th_',''));
			}
			imagini[i].style.cursor = "hand";
		}
	}
	},
	
	deschide : function (imagine){
		win = window.open( "", "_blank", "resizable=1,HEIGHT=100,WIDTH=100"); 
		obiect = new Image();
		obiect.src = imagine;
		obiect.onload = function(){
			latime = document.all?win.document.body.clientWidth:win.window.innerWidth; 
			inaltime = document.all?win.document.body.clientHeight:win.window.innerHeight;
			win.document.write("<html><head style=\"margin: 0; padding: 0;\"></head><body style=\"margin: 0; padding: 0;\"><img src=\""+imagine+"\" alt=\"Click pentru a inchide poza\" onclick=\"window.close()\" /></body></html>");
			win.resizeBy((obiect.width - latime), (obiect.height - inaltime));
			win.focus();
		}
	}
}


function imgpopup(imagine){
	win = window.open( "", "_blank", "resizable=1,HEIGHT=100,WIDTH=100"); 
	obiect = new Image();
	obiect.src = imagine;
	obiect.onload = function(){
			latime = document.all?win.document.body.clientWidth:win.window.innerWidth; 
			inaltime = document.all?win.document.body.clientHeight:win.window.innerHeight;
			win.document.write("<html><head style=\"margin: 0; padding: 0;\"></head><body style=\"margin: 0; padding: 0;\"><img src=\""+imagine+"\" alt=\"Click pentru a inchide poza\" onclick=\"window.close()\" /></body></html>");
			win.resizeBy((obiect.width - latime), (obiect.height - inaltime));
			win.focus();
	}
}

//onload = parcindustrial.proceseazaImagini