function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		pavaj_over = newImage("images/pavaj-over.jpg");
		elementeaditionale_over = newImage("images/elementeaditionale-over.jpg");
		elementedefatada_over = newImage("images/elementedefatada-over.jpg");
		garduridebeton_over = newImage("images/garduridebeton-over.jpg");
		preturi_over = newImage("images/preturi-over.jpg");
		desprenoi_over = newImage("images/desprenoi-over.gif");
		oferta_over = newImage("images/oferta-over.gif");
		portofoliu_over = newImage("images/portofoliu-over.gif");
		comanda_over = newImage("images/comanda-over.gif");
		certificari_over = newImage("images/certificari-over.gif");
		preloadFlag = true;
	}
}
////////////// POPUP HARTA
function harta(var1){

newWindow=window.open("","Harta","width=500,height=400,resizable=yes");

newWindow.document.write("<title>Pavaj.ro Harta Contact</title>");
newWindow.document.write("<body topmargin=0 leftmargin=0><table width=500 align=center><tr><td width=100% height=100% align=center valign=middle>");
newWindow.document.write("<img src=images/harta/");
newWindow.document.write(var1);
newWindow.document.write(" onClick='window.close();' title='Click pentru inchiderea pozei'></td></tr></table>");
newWindow.document.bgColor="#cccccc";
newWindow.document.close();
newWindow.focus();
//newWindow.close();
}

function gard(var1)
{
switch(var1)
{ 
  case 'gard0-mare.jpg':
     newWindow=window.open("","Garduri","width=400,height=300,resizable=yes");
	 break;
  case 'gard1-mare.jpg':
     newWindow=window.open("","Garduri","width=400,height=276,resizable=yes");
	 break;
  case 'gard2-mare.jpg':
     newWindow=window.open("","Garduri","width=400,height=184,resizable=yes");
	 break;
  case 'gard3-mare.jpg':
     newWindow=window.open("","Garduri","width=400,height=252,resizable=yes");
	 break;
  case 'gard4-mare.jpg':
     newWindow=window.open("","Garduri","width=400,height=282,resizable=yes");
	 break;
  case 'poarta-dubla-mare.jpg':
     newWindow=window.open("","Garduri","width=400,height=196,resizable=yes");
	 break;	 
  default:
     newWindow=window.open("","Garduri","width=400,height=300,resizable=yes");
	 break;
}	

newWindow.document.write("<title>Pavaj.ro Garduri beton</title>");
newWindow.document.write("<body topmargin=0 leftmargin=0><table width=400 align=center><tr><td width=100% height=100% align=center valign=middle>");
newWindow.document.write("<img src=images/garduri/");
newWindow.document.write(var1);
newWindow.document.write(" onClick='window.close();' title='Click pentru inchiderea pozei'></td></tr></table>");
newWindow.document.bgColor="#cccccc";
newWindow.document.close();
newWindow.focus();
//newWindow.close();
}

function galerie_imag(var1){

newWindow=window.open("","DinuMarinGalerieFoto","width=500,height=333,resizable=no");
newWindow.document.write("<title>DinuMarin.ro Galerie Foto</title>");
newWindow.document.write("<body topmargin=0 leftmargin=0 bgcolor=#ffffff><table width=500 align=center><tr><td width=100% height=100% align=center valign=middle>");
newWindow.document.write("<img src=poze/");
newWindow.document.write(var1);
newWindow.document.write("-mare.jpg onClick='window.close();' title='Click pentru inchiderea pozei'></td></tr></table>");
newWindow.document.bgColor="#ffffff";
newWindow.document.close();
newWindow.focus();
//newWindow.close();
}
/////////////////////////////////////////

function setBgPagini(theCell, thePointerColor)
{
	if (thePointerColor == '' || typeof(theCell.style) == 'undefined') {
        return false;
    }
	theCell.style.backgroundColor=thePointerColor;
    return true;
}