function ExpandItemInfo(o) {
var ob=document.getElementById(o);
if (ob){
	if (ob.style.display != "none") {
		ob.style.display = "none";
		} else {
		ob.style.display = "";
		}
	}
}

function CloseItemInfo(o) {
var ob=document.getElementById(o);
ob.style.display = "none";
}

function Add2Order(PID){
var a = document.encPost;
/* getElementById */
	a.loja_action.value='additem';
	a.loja_action_id.value=PID;
	a.loja_action_qty.value='1';
	a.submit();
	}
function HideObject(objid){
var obj = document.getElementById(objid)
if (obj) { 
	obj.style.visibility='hidden'; 
	obj.style.display='none'; 
	}
}
function ShowObject(objid){
var obj = document.getElementById(objid)
if (obj) { 
	obj.style.visibility=''; 
	obj.style.display=''; 
	}
}
function ShowSpecifyDetailsAlert(){
alert('Para adicionar ao carrinho, necessita de especificar os detalhes para o produto em questão');
}

function UpdatePrice(pid,ov,nv) {
if (document.getElementById('pprice_' + pid)) {
	var a = document.getElementById('pprice_' + pid)
	if (ov==nv) {
		a.innerHTML = nv;
		} else {
		a.innerHTML = '<strong><sup><strike style="color:red;">' + ov + '</strike></sup></strong><br/><strong style="color:blue;">' + nv + '</strong>';
		}
	}
}
function HideItem(pid) {
HideObject('product_' + pid);
/** Find('div_inf' + pid).style.display='none'; **/
}

function UnhideItem(pid) {
ShowObject('product_' + pid);
}

function DisableItem(pid) {
if (document.getElementById('product_' + pid)) {
/**	a.style.display='none'; 
	var a = document.getElementById('pdiv_' + pid);
	a.style.height='24px';
	a.style.padding='0px';
	var a = document.getElementById('product_' + pid);
	a.style.border='padding-left: 20px; 2px solid #CCC';
	a.style.backgroundColor='#CCC';
	alert(a.src);
	HideObject ('padd_' + pid);
	find('div_inf' + pid).style.display='none';
	HideObject ('pimg_' + pid);
	HideObject ('ptdimg_' + pid);
**/
	Find('padd_' + pid).src = 'img/ws/loja/incart.png';
	HideObject ('div_inf_' + pid);
	HideObject ('pprice_' + pid);
	HideObject ("pinfo_" + pid);
	Find('pmain_td' + pid).style.backgroundColor='#FFFFFF';
	Find('ptbl_' + pid).style.backgroundColor='#FFFFFF';
	CloseItemInfo ('div_inf'+pid);	
	}
}
function EnableItem(pid) {
if (document.getElementById('product_' + pid)) {
/**
	var a = document.getElementById('pdiv_' + pid);
	a.style.height='auto';
	a.style.display='';
	a.style.border='padding-left: 0px; 0px';
	a.style.backgroundColor='#FFFFF';
	alert(a.filename);
	var a = document.getElementById('padd_' + pid);
	alert(a.src);
	a.src = 'img/ws/loja/add2cart.gif';
	ShowObject ('pimg_' + pid);
	ShowObject ('ptdimg_' + pid);
**/
	Find('padd_' + pid).src = 'img/ws/loja/add2cart.gif';
	ShowObject ('div_inf_' + pid);
	ShowObject ('pprice_' + pid);
	ShowObject ("pinfo_" + pid);
	Find('pmain_td' + pid).style.backgroundColor='#FAFAFA';
	Find('ptbl_' + pid).style.backgroundColor='#FAFAFA';
	}
}

