function expert_adm_trans() {
	showHide('div1');
	 if(document.getElementById('minus_plus').innerHTML=='+') 
	  document.getElementById('minus_plus').innerHTML='-';
	   else document.getElementById('minus_plus').innerHTML='-';
	    return false;
}
function men_itm_ok(id) {
	if ($id('men_itm_'+id).style.display=='none')
	$id('men_itm_'+id).style.display='block';
	else $id('men_itm_'+id).style.display='none';
	//Ajax_cos(window.siteurl+"content/produse_ajax.php?id_categ="+id,'content_div');
}
function afisareDivCont(t) {
	if (t=='personale') {
		$id('datePersonale').style.display='block';
		$id('modificaEmail').style.display='none';
		$id('modificaParola').style.display='none';
		$id('modificaFirma').style.display='none';
	} else {
		if (t=='email') {
			$id('datePersonale').style.display='none';
			$id('modificaEmail').style.display='block';
			$id('modificaParola').style.display='none';
			$id('modificaFirma').style.display='none';
		} else {
			if (t=='parola') {
				$id('datePersonale').style.display='none';
				$id('modificaEmail').style.display='none';
				$id('modificaParola').style.display='block';
				$id('modificaFirma').style.display='none';
			} else {
				if (t=='firma') {
					$id('datePersonale').style.display='none';
					$id('modificaEmail').style.display='none';
					$id('modificaParola').style.display='none';
					$id('modificaFirma').style.display='block';
				}
			}
		}
	}
}
function divImgPord() {
	divwin=dhtmlwindow.open('divbox', 'div', 'somediv', 'Imagini Produs',
	'width=280px,height=200px,left=200px,top=150px,resize=1,scrolling=1');
	return false;
}
// ajaxg('lim=ceva'content/poze.php','contine_poze');

// Eroare daca nu exista elementul
function ErrorNoId(cine) {
	alert(' Reporniti browserul /n/r elementul '+cine+' nu exista ! ');
	return false;
}
// Get By Id
function ById(id){
	try{
		return document.getElementById(id);
	}
	catch(e){
		ErrorNoId(id);
	}
}
// Get By Name
function ByName(name){
	try{
		return document.getElementsByName(name);
	}
	catch(e){
		ErrorNoId(name);
	}
}
// Insert HTML
function InHtml(id,code){
	try{
		document.getElementById(id).innerHTML=code;
		return true;
	}
	catch(e){
		ErrorNoId(id);
	}
}
// EXTRACT HTML
function OutHtml(id){
	try{
		var code=document.getElementById(id).innerHTML;
		return code;
	}
	catch(e){
		ErrorNoId(id);
	}
}
// Insert Value By Name
function ValByName(name,val){
	try{
		ByName(name).value=val;
	}
	catch(e){
		ErrorNoId(name);
	}
}
// Insert Value By Id
function ValById(id,val){
	try{
		ById(id).value=val;
	}
	catch(e){
		ErrorNoId(id);
	}
}
var nr_ferestre=0;

function Swindow(continut_f,titlu,latime,inaltime) {
	nr_ferestre++;

	var div_nou = document.createElement('div');
	div_nou.id='div_over_window_nr_'+nr_ferestre;
	div_nou.className='s_fereastra_bg';
	div_nou.style.zIndex=nr_ferestre;

	div_nou.onclick=function () { SwindowClose(nr_ferestre); }

	ById('contine_window').appendChild(div_nou);
	div_nou = document.createElement('div');
	div_nou.id='fereastra_nr_'+nr_ferestre;
	div_nou.className='s_fereastra';
	div_nou.style.zIndex=nr_ferestre+1;
	ById('contine_window').appendChild(div_nou);
	var continut='';
	continut+='<div class="s_fereastra_top" id="top_fereastra_nr_'+nr_ferestre+'">';
	continut+='<div class="s_fereastra_titlu">'+titlu+'</div>';
	//continut+='<img class="s_fereastra_close" onclick="SwindowClose('+nr_ferestre+');" src="" /></div>';
	continut+='<div class="s_fereastra_close" onclick="SwindowClose('+nr_ferestre+');">&nbsp;</div></div>';
	continut+='<div style="padding :10px">'+continut_f+'</div>';
	div_nou.innerHTML=continut;



	var docH=document.body.scrollHeight;
	var docW=document.body.scrollWidth;
	ById('div_over_window_nr_'+nr_ferestre).style.height=docH+'px';
	ById('div_over_window_nr_'+nr_ferestre).style.width=docW+'px';


	var de = document.documentElement;
	var b = document.body;
	var cat_scrool = (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
	var cat_sus = cat_scrool + 100;;
	var cat_am=(docW-latime)/2;
	ById('fereastra_nr_'+nr_ferestre).style.top=cat_sus+'px';
	ById('fereastra_nr_'+nr_ferestre).style.left=cat_am+'px';
	ById('fereastra_nr_'+nr_ferestre).style.width=latime+'px';
	ById('fereastra_nr_'+nr_ferestre).style.height=inaltime+'px';

	Drag.init(ById('top_fereastra_nr_'+nr_ferestre), ById('fereastra_nr_'+nr_ferestre),4,docW-latime-10,4,docH-inaltime-10);
}
function SwindowClose(nr_fer_cl) {
	ById('div_over_window_nr_'+nr_fer_cl).style.height='0px';
	ById('div_over_window_nr_'+nr_fer_cl).style.width='0px';
	ById('fereastra_nr_'+nr_fer_cl).style.display='none';
	InHtml('fereastra_nr_'+nr_fer_cl,'');
}

var globalimage='';
function afImagesProd(nume_prod) {
	NSS_win('div_img',nume_prod,OutHtml('divImagini'),550,600);
	if (globalimage != '') {
		afImagineProdus(globalimage);
	}
}


function afImagineProdus(v) {
	document.getElementById('imgProdusMare').src=window.siteurl+v;
}
function afImagineProdus2(unde,ce,glce) {
	document.getElementById(unde).src=window.siteurl+ce;
	globalimage=glce;
}

function recomandaProdus() {
	Swindow(OutHtml('recomandaProdus'),'Recomanda produs',400,400);
}

function Cereprodus() {
	Swindow(OutHtml('cereProdus'),'Produsul nu este pe stoc',400,150);
}

function Cereprodusstoc() {
	Swindow(OutHtml('cereProdusStoc'),'Produsul nu este pe stoc in cantitatea solicitata',400,180);
}
function VerificareDateComanda() {
	Swindow(OutHtml('verificadateclientptcomanda'),'Completati datele personale!',400,180);
}
//===========================================================================
var dau_in_div='';  											         //||
var xmlHttp=GetXmlHttpObject();										     //||
//||
function GetXmlHttpObject() {									         //||
	var xmlHttp=null;														 //||
	try															             //||
	{															             //||
		//||
		xmlHttp=new XMLHttpRequest();											 //||
	}															             //||
	catch (e)															     //||
	{															             //||
		//||
		try															         //||
		{															         //||
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");						 //||
		}															         //||
		catch (e)															     //||
		{															         //||
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");					     //||
		}															         //||
	}															             //||
	return xmlHttp;															 //||
} 														                 //||
//||
function Ajax(parametru_get,fisier,unde_dau) { 			     		     //||
	var sid = Math.random();				    					   	 //||
	dau_in_div=unde_dau;				                                 //||
	var ureleu=fisier+'?'+parametru_get+'&sid='+sid;	                 //||
	xmlHttp.open("GET",ureleu);  										 //||
	xmlHttp.onreadystatechange=stateChanged;					         //||
	xmlHttp.send(null);			                                         //||
	return false;                                                        //||
}	     													             //||
function stateChanged() { 									             //||
	if (xmlHttp.readyState==4) {		                                     //||
		if (dau_in_div!='') {		                                         //||
			if (dau_in_div=='alert') {		                             //||
				alert(xmlHttp.responseText); 		                     //||
			} 		                                                     //||
			else {		                                             //||
				InHtml(dau_in_div,xmlHttp.responseText); 		 //||
			}			                                             //||
			dau_in_div=''; 						                         //||
		}		                                                     //||
	}		                                                                 //||
}														                 //||
//===========================================================================
function efectInputCauta(v) {
	if (v=='cuvinte cheie') {
		document.getElementById('numeProdus').value='';
	}
}
function cautaSubmit() {
	var x=document.getElementById('cautaForm');
	x.submit();
}







//===============================================================
//MENU IMPLEMENTATION
//function getElementLeft(Elem) {
//	var elem = document.getElementById(Elem);
//	xPos = elem.offsetLeft;
//	tempEl = elem.offsetParent;
//	while (tempEl != null) {
//		xPos += tempEl.offsetLeft;
//		tempEl = tempEl.offsetParent;
//	}
//	return xPos;
//}
//function getElementTop(Elem) {
//	var elem = document.getElementById(Elem);
//	yPos = elem.offsetTop;
//	tempEl = elem.offsetParent;
//	while (tempEl != null) {
//		yPos += tempEl.offsetTop;
//		tempEl = tempEl.offsetParent;
//	}
//	return yPos;
//}
//function getElementHeight(Elem) {
//	var elem = document.getElementById(Elem);
//	if (elem.style.pixelHeight) {
//		xPos = elem.style.pixelHeight;
//	} else {
//		xPos = elem.offsetHeight;
//	}
//	return xPos;
//}
//function getElementWidth(Elem) {
//	var elem = document.getElementById(Elem);
//	if (elem.style.pixelWidth) {
//		xPos = elem.style.pixelWidth;
//	} else {
//		xPos = elem.offsetWidth;
//	}
//	return xPos;
//}
//
//
//
//var menu_maxheight=0;
//var menu_t_hide=0;
//var menu_t_ani=0;
//
//function menu_hide() {
//	clearTimeout(menu_t_hide);
//	menu_t_hide=setTimeout("menu_hide_ta()",50);
//}
//function menu_show(id,div,top,left) {
//	//alert(id);
//	clearTimeout(menu_t_hide);clearTimeout(menu_t_ani);
//	var divelem=document.getElementById(id+"_div");
//	var maindiv=document.getElementById("menu_content");
//	//alert(id);
//	maindiv.style.top=top+"px";
//	maindiv.style.left=left+"px";
//	maindiv.innerHTML=divelem.innerHTML;
//	maindiv.style.height="auto";
//	menu_maxheight=getElementHeight(maindiv.id);
//	maindiv.style.height=0;
//	menu_ani_extend(maindiv);
//	maindiv.style.visibility="visible";
//	menu_ani_extend(maindiv);
//}
//function menu_hide_ta() {
//	var maindiv=document.getElementById("menu_content");
//	maindiv.innerHTML='';
//	maindiv.style.visibility="hidden";
//}
//function menu_lhide(elem) {
//	menu_hide();
//}
//function menu_ani_extend(elem) {
//	if (menu_maxheight<1) {return;}
//	elem.style.height=(getElementHeight(elem.id)+(Math.round(menu_maxheight/70)))+"px";
//	if (getElementHeight(elem.id)>=menu_maxheight) {return false;}
//	menu_t_ani=setTimeout("menu_ani_extend(document.getElementById('"+elem.id+"'))",30);
//}
////end meniu dhtml
////==========================================================================
//function limitText(v,id) {
//	var max_ch=1000;
//	if (v.length<=max_ch) {
//		document.getElementById(id).innerHTML=max_ch-v.length;
//	} else {
//		alert('Ai atins numarul maxim de caractere!');
//		document.getElementById('comentariu').value=v.substr(0,max_ch-1);
//	}
//}
//function lasaComentariu(t,p2,p) {
//	if (t=='paginare') {
//		var trim='';
//		trim+='id_produs='+$val('idProdusCom');
//		trim+='&af_pag='+p2;
//		trim+='&tip='+t;
//		Ejax(window.siteurl+'includes/ajax_php/comentarii_produs_op.php',trim,'comentarii');
//	} else {
//		if ($val('comentariu')=='') {
//			alert('Completati comentariul!');
//		} else {
//			var trim='';
//			trim+='id_produs='+p;
//			trim+='&comentariu='+eurl($val('comentariu'));
//			trim+='&tip='+t;
//			Ejax(window.siteurl+'includes/ajax_php/comentarii_produs_op.php',trim,'comentarii');
//			document.getElementById('comentariu').value='';
//			document.getElementById('countdown').innerHTML='1000';
//		}
//	}
//}