
function processGetPost() {
	var myajax=ajaxpack.ajaxobj
	var myfiletype=ajaxpack.filetype
	if (myajax.readyState == 4)
	{ 	//if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1)
		{ //if request was successful or running script locally
			if (myfiletype=="txt")
				document.getElementById('CatSortBy').innerHTML = myajax.responseText
				//alert(myajax.responseText)
			else
				alert(myajax.responseXML)
		}
	}
}

function tabShowAll()
{
	Category.expandit('UrlViewAll')
}


function _AjxSubCat(mCat,sCat)
{
	var poststr = "prc=sublist&maincat=" + encodeURI(mCat) + "&subcat=" + encodeURI(sCat)
	ajaxpack.getAjaxRequest("/ajaxed/category.asp", poststr, processGetPost, "txt")
	
	Category.expandit('UrlSortBy')
}

function _AjxSortBy(mCat)
{
	//var poststr = "prc=sortby&maincat=" + encodeURI(mCat) + "&subcat=" + encodeURI(sCat)
	var SizeSelect = document.getElementById("slcSize").value
	var PriceSelect = document.getElementById("slcPrice").value
	
	if ((SizeSelect == "") && (PriceSelect == ""))
	{
		Category.expandit('UrlViewAll')
	} else
	{
		var poststr = "prc=sortby&maincat=" + encodeURI(mCat) + "&sizeselect=" + encodeURI(SizeSelect) + "&priceselect=" + encodeURI(PriceSelect)
		ajaxpack.getAjaxRequest("/ajaxed/category.asp", poststr, processGetPost, "txt")
		Category.expandit('UrlSortBy')
	}

}


function _AjxViewMore(mCat,sCat)
{
	if (sCat != "")
	{
		_AjxSubCat(mCat,sCat)
	}
}