////////////////////////////////////////////////////////////////////////////////////////////////////
//
//	shop.js
//
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//	layer functions
////////////////////////////////////////////////////////////////////////////////////////////////////

function shop_SetLayer (spIdent, spName, spSwitch)
{
	var spObjectA = document.getElementById (spIdent + '_close[' + spName + ']');
	var spObjectB = document.getElementById (spIdent + '_open[' + spName + ']');

	spObjectA.style.display = (spSwitch) ? 'none':'block';
	spObjectB.style.display = (spSwitch) ? 'block':'none';
}

function shop_SetCount (spIdent, spName, spSwitch)
{
	var spObjectA = document.getElementById (spIdent + '_count[' + spName + ']_close');
	var spObjectB = document.getElementById (spIdent + '_count[' + spName + ']_open');

	if (spSwitch) spObjectB.value = spObjectA.value;
	else          spObjectA.value = spObjectB.value;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
//	form functions
////////////////////////////////////////////////////////////////////////////////////////////////////

function shop_SetAddress (spAddress)
{
	document.location.href = spAddress;
}

function shop_SetForm (spObject, spElement, spValue, spQuery, spHash)
{
        if (spElement) document.forms[spObject].elements[spElement].value = spValue;
	if (spQuery)   document.forms[spObject].action += '&' + spQuery;
	if (spHash)    document.forms[spObject].action += '#' + spHash + '[' + spValue + ']';

	document.forms[spObject].submit ();
}

function shop_AskForm (spObject, spElement, spValue, spQuery, spHash)
{
	if (confirm ('Biztos benne?')) shop_SetForm (spObject, spElement, spValue, spQuery, spHash);
}

////////////////////////////////////////////////////////////////////////////////////////////////////
//	cookie functions
////////////////////////////////////////////////////////////////////////////////////////////////////

function shop_SetCookie (spObject, spValue)
{
	spExpire = new Date ();
	spExpire.setTime (spExpire.getTime () + 3E+9);
	spExpire = spExpire.toGMTString ();

	document.cookie = 'shopPanel[' + spObject + ']=' + spValue + '; expires=' + spExpire + '; path=/';
}

////////////////////////////////////////////////////////////////////////////////////////////////////
//
//	shop.js
//
////////////////////////////////////////////////////////////////////////////////////////////////////
