// Java Scripts
	
function updateCollection(collection) {
	document.getElementById("collections").innerHTML = '<p><img src="images/page/loader.gif">Updating...</p>';
	ajax.requestFile = "get4ajax.php?act=collection&collection=" + collection;
	ajax.onCompletion = updatePage;
	ajax.runAJAX();
}

function updateSubCollection(collection) {
	document.getElementById("collections").innerHTML = '<p><img src="images/page/loader.gif">Updating...</p>';
	ajax.requestFile = "get4ajax.php?act=sub-collection&collection=" + collection;
	ajax.onCompletion = updatePage;
	ajax.runAJAX();
}

function updateDetails(productID) {
	document.getElementById("spacer").style.display = "none";
	document.getElementById("product-details").style.display = "block";
	document.getElementById("pr-description").style.display = "block";
	
	document.getElementById("product-details").innerHTML = '<p><img src="images/page/loader.gif">Updating...</p>';
	ajax.requestFile = "get4ajax.php?act=details&pid=" + productID;
	ajax.onCompletion = updatePage;
	ajax.runAJAX();
	
	window.scroll(0, 900);
}

function updateCart(productID) {
	document.getElementById("shopping-cart").innerHTML = '<p><img src="images/page/loader.gif">Updating...</p>';
	if (productID == 0) ajax.requestFile = "get4ajax.php?act=cart";
	else ajax.requestFile = "get4ajax.php?act=cart&pid=" + productID;
	ajax.onCompletion = updatePage;
	ajax.runAJAX();
	
	window.scroll(0, -900);
}

function removeFromCart(cartItemID) {
	document.getElementById("shopping-cart").innerHTML = '<p><img src="images/page/loader.gif">Updating...</p>';
	ajax.requestFile = "get4ajax.php?act=cart&cid=" + cartItemID;
	ajax.onCompletion = updatePage;
	ajax.runAJAX();
}

function updatePage() {
	eval(ajax.response);
}

function showShipInfo() {
	document.getElementById("btn-checkout").style.display = "none";
	document.getElementById("panel-pay").style.display = "block";
}

function validateShippingAddress(theForm) {
	return true;
}

// Render flash
function renderFlash(containerObj, movieName, width, height, wmode) {
	var flashContainerInnerHtml = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '">';
	flashContainerInnerHtml += '<param name="movie" value="' + movieName + '" />';
	flashContainerInnerHtml += '<param name="quality" value="high" />';
	flashContainerInnerHtml += '<param name="wmode" value="' + wmode + '" />';
	flashContainerInnerHtml += '<param name="menu" value="false" />';
	flashContainerInnerHtml += '<embed src="' + movieName + '" wmode="' + wmode + '" menu="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>';
	flashContainerInnerHtml += '</object>';
	document.getElementById(containerObj).innerHTML = flashContainerInnerHtml;
}

function closeWin() {
	document.getElementById("page-content").style.display = 'none';	
	document.getElementById("container-left").style.display = 'block';
	document.getElementById("container-right").style.display = 'block';
}

function inquireItem(itemCode) {
	document.getElementById("item_code").value = itemCode;
	document.getElementById("inquire-win").style.display = "block";
}

function inquireSend() {
	document.getElementById("inquire-win").style.display = "none";
	return true;
}

function cancelInquiry() {
	document.getElementById("inquire-win").style.display = 'none';
}
