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 browsetrul /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.nr_ferestre=nr_ferestre;
	div_nou.onclick=function () {SwindowClose(this.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+='';
	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,'');
}

//function afImagesProd() {
//Swindow(OutHtml('divImagini'),'Imagini Produse',550,600);
//}
function afImagineProdus(v) {
	var v1='http://fitzeshop.ro/'+v+'';
	document.getElementById('imgProdusMare').src=v1;
}
var globalimage='';
function afImagesProd(nume_prod) {
Swindow(OutHtml('divImagini'),nume_prod,550,600);
if (globalimage != '') {
	afImagineProdus(globalimage);
}
}
function afImagineProdus2(unde,ce,glce) {
	document.getElementById(unde).src=window.siteurl+ce;
	globalimage=glce;
}
function recomandaProdus() {
Swindow(OutHtml('recomandaProdus'),'Recomanda produs',400,400);
}