// JavaScript Document
/*
function openAdvertise(popURL){

	passPop=window.open ('http://www.anuntmagic.ro/advertising/?url='+popURL,'w','width=1024, height=768, toolbar=1, resizable=1, menubar=1, location=1, status=1, scrollbars=1,').blur(); 
	window.focus();

}
*/
function displayDiv(id, v)
{ 
	sub = new Array;
	eval(v);
	for(var i=0; i<sub.length; i++){
			if(sub[i] != id){
				document.getElementById(sub[i]).style.display = 'none';
				}
		}
	if(document.getElementById(id).style.display == 'block'){
		document.getElementById(id).style.display = 'none';
	}
	else {
		document.getElementById(id).style.display = 'block';
	}
}


function PoP(page){
	var page;
	window.open(page,"Anunturi","menubar=0,resizable=0,width=700,height=600");
	}
function PoSTvar(VaR, field){
	 document.getElementById(field).value = VaR;
	 document.myForm.submit();
	}
function ErrDiv(id)
{
	if(document.getElementById(id).style.display == 'block'){
		document.getElementById(id).style.display = 'none';
}
}

function displayConvertor(id)
{ 
	if(document.getElementById(id).style.display == 'block'){
		document.getElementById(id).style.display = 'none';
	}
	else {
		document.getElementById(id).style.display = 'block';
	}
}

function setMaxLength() {
	var x = document.getElementsByTagName('textarea');
	var counter = document.createElement('div');
	counter.className = 'counter';
	for (var i=0;i<x.length;i++) {
		if (x[i].getAttribute('maxlength')) {
			var counterClone = counter.cloneNode(true);
			counterClone.relatedElement = x[i];
			counterClone.innerHTML = '<span>0</span>/'+x[i].getAttribute('maxlength');
			x[i].parentNode.insertBefore(counterClone,x[i].nextSibling);
			x[i].relatedElement = counterClone.getElementsByTagName('span')[0];

			x[i].onkeyup = x[i].onchange = checkMaxLength;
			x[i].onkeyup();
		}
	}
}
function checkMaxLength() {
	var maxLength = this.getAttribute('maxlength');
	var currentLength = this.value.length;
	if (currentLength > maxLength)
		this.value = this.value.substr(0,maxLength);
	this.relatedElement.firstChild.nodeValue = currentLength;
	// not innerHTML
}

////////////////////////////////////////////////////////////////
