// Replaces getElementById
function get_obj(id)
{
	return document.getElementById(id);
}

function validare_add_cos()
{
	if (document.form_add.marime.value=="")
	{
		alert('Alegeti marimea!');
		return false;
	}
	else if (document.form_add.culoare.value=="")
	{
		alert('Alegeti culoarea!');
		return false;
	}
	else if (document.form_add.q.value=="")
	{
		alert('Alegeti marimea!');
		return false;
	}
	
	document.form_add.action='/index.php?obj=cos&action=add';
	return true;
}

function validare_add_wish()
{
	if (document.form_add.marime.value=="")
	{
		alert('Alegeti marimea!');
		return false;
	}
	else if (document.form_add.culoare.value=="")
	{
		alert('Alegeti culoarea!');
		return false;
	}
	
	document.form_add.action='/index.php?obj=produse&action=add_wish';
	return true;
}

function block_facturare()
{
	if (document.form_pas_2.identica.checked)
	{
		document.form_pas_2.adresaf.disabled="disabled";
		document.form_pas_2.judetf.disabled="disabled";
		document.form_pas_2.orasf.disabled="disabled";
	}
	else
	{
		document.form_pas_2.adresaf.disabled=false;
		document.form_pas_2.judetf.disabled=false;
		document.form_pas_2.orasf.disabled=false;
	}
}

function block_mesaj()
{
	if (document.form_pas_3.ambalare_mesaj.checked)
	{
		document.form_pas_3.mesaj.disabled="disabled";
	}
	else
	{
		document.form_pas_3.mesaj.disabled=false;
	}
}

function pageBack(id)
{
	if (currentPages[id]>1)
	{
		document.getElementById("page_"+id+"_"+currentPages[id]).style.display='none';
		currentPages[id] -= 1;
		
		if (document.getElementById("page_"+id+"_"+currentPages[id]))
		{
			document.getElementById("page_"+id+"_"+currentPages[id]).style.display='block';
		}
	}
}
function pageNext(id)
{
	if (currentPages[id] < noPages[id])
	{
		document.getElementById("page_"+id+"_"+currentPages[id]).style.display='none';
		currentPages[id] += 1;
		
		if (document.getElementById("page_"+id+"_"+currentPages[id]))
		{
			document.getElementById("page_"+id+"_"+currentPages[id]).style.display='block';
		}
	}
}

function animBoxSchimba(k)
{
	if ($('schimba_'+k).style.display!="block")
	{
		hideBoxCumpara(k)
		$('schimba_'+k).style.display='block';
	
		var attributes = { height: { to: 50 } };
		var anim = new YAHOO.util.Anim('schimba_'+k, attributes, 5, YAHOO.util.Easing.backIn);
		anim.animate();
	}
	else
	{
		$('schimba_'+k).style.display='none';
	}
}

function animBoxCumpara(k)
{
	if ($('cumpara_'+k).style.display!='block')
	{
		hideBoxSchimba(k)
		$('cumpara_'+k).style.display='block';
	}
	else
	{
		$('cumpara_'+k).style.display='none';
	}
}

function hideBoxCumpara(k)
{
	$('cumpara_'+k).style.display='none';
}

function hideBoxSchimba(k)
{
	$('schimba_'+k).style.display='none';
}
