function changeOpac(opacity, id)
{
	var object = document.getElementById(id).style;

	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function blendimage(divid, imageid, imagefile, millisec)
{
	var speed = Math.round(millisec / 10);
	var timer = 0;

	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
	changeOpac(0, imageid);
	document.getElementById(imageid).src = imagefile;
	for(i = 0; i <= 100; i++)
	{
		setTimeout("changeOpac(" + i + ",'" + imageid + "')", (timer * speed));
		timer++;
	}
}

function RunSlideShow(divid, imageid, imageFolder, imageFiles, displaySecs)
{
	var imageSeparator = imageFiles.indexOf(";");
	var nextImage = imageFiles.substring(0, imageSeparator);
	var futureImages = imageFiles.substring(imageSeparator + 1, imageFiles.length - 1) + ';' + nextImage + ';';
	blendimage(divid,imageid,imageFolder+nextImage,100);
	setTimeout("RunSlideShow('"+divid+"','"+imageid+"','"+imageFolder+"','"+futureImages+"',"+displaySecs+")",displaySecs*1000);
}

function SendForm(task, status)
{
	document.myForm.task.value = task;
	document.myForm.submit();  

	/*if (!status)
	{
		var list = document.getElementsByTagName('INPUT');
		for (i=0; i<list.length; i++)
		{
			list[i].disabled = true;
			list[i].readonly = true;
		}
		list = document.getElementsByTagName('SELECT');
		for (i=0; i<list.length; i++)
		{
			list[i].disabled = true;
			list[i].readonly = true;
		}
		list = document.getElementsByTagName('TEXTAREA');
		for (i=0; i<list.length; i++)
		{
			list[i].disabled = true;
			list[i].readonly = true;
		}
	}*/
}

function ViewImage(p, t)
{
	var w;
  
	w = window.open(p, 'Image', 'width=200,height=200,left=200,top=200,channelmode=no,copyhistory=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no');
	w.document.open();
	w.document.write('<html><head><title>Se incarca...</title></head><body leftmargin="0" topmargin="0" onload="var w=document.images[0].width+8;var h=document.images[0].height+26;window.resizeTo(w,h);window.moveTo((screen.width-w)/2,(screen.height-h)/2);"><img src="' + p + '" alt="' + t + '"></body></html>');
	w.document.close();
	w.document.title = t;
	w.focus(); 
}

function LoadPage(category, county)
{
	if (county != "0")
		window.location = '\/' + category + '\/judet-' + county + '/index.html';
}

function LoadOffers(category)
{
	window.location = '\/' + category + '\/' + document.myForm.subcategory.options[document.myForm.subcategory.selectedIndex].value + '\/judet-' + document.myForm.county.options[document.myForm.county.selectedIndex].value + '.html';
}
