function countChar(text,div,numar_caractere) {	
	val = text.value;
	if (val.length > numar_caractere) {
		alert('Textul dumneavoastra depaseste limita de '+numar_caractere+' de caractere!');
		text.value = val.substring(0,numar_caractere);
		text.focus();
	}
	document.getElementById(div).innerHTML = parseInt(val.length);
}

function Sterge(obj){
	for (x=0; x<eval(obj).elements.length; x++){
		objEl = eval(obj).elements[x];
		objEl.value = '';
	}
}

function Op(page)
{
	window.open("/"+page,'','width=420,height=550,scrollbars=yes');
}

function PressKey(obiect,clasa)
{
	obiect.className =clasa;
}
function Null(){}


function Large(poza,titlu,width,height)
{
	CreatePop(poza,titlu,width,height);
} 
var xx=new Object();
function CreatePop(poza,titlu,width,height)
{
	ttop=0;
	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		ttop=window.pageYOffset;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		ttop=document.documentElement.scrollTop;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		ttop=document.body.scrollTop;
	}
	
	if (width>myWidth-60) { width=myWidth-60;}
	if (height>myHeight-60) { height=myHeight-60;}
	
	l = (myWidth-width)/2;
	t = (myHeight-height-50)/2+ttop ; 
	
	//alert(myWidth+'    '+myHeight);
	
	var firefox = (navigator.appName=="Netscape")?'true':'false';
	
	xx=document.createElement("div");
	xx.innerHTML='<table><tr><td style="padding-top:7px; padding-left:10px;">'+titlu+'</td><td align="right" style="padding-top:7px; padding-right:10px;"><a href="javascript:ClosePop()" class="inchide">x Inchide</a></td></tr><td colspan="2" align="center"><img src="phpthumb/phpThumb.php?src=../'+poza+'&w='+width+'&h='+height+'" title='+titlu+'  alt='+titlu+' style="margin:10px"></td></tr></table>';
	xx.style.zIndex = '1000';	
	xx.style.backgroundColor = "transparent";  
	xx.style.position = "absolute";
	xx.style.border = "1px solid #FFAE38";
	xx.style.left = l+'px';
	xx.style.top = t+'px';
	xx.style.backgroundColor='#FFFFFF';
	/*if(firefox=='false')
		xx.style.filter="alpha(opacity=50)";
	else	
		xx.style.MozOpacity=.5;*/
		
	document.body.appendChild(xx);
	
} 
function ClosePop()
{
	xx.style.display = "none"; 
}


var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")

