function changecolor(tr)
{
	tr.style.backgroundColor = '#FFFFD9';
}

function revertcolor(tr)	
{
	tr.style.backgroundColor = '#FFFFFF';
}
function callFilter(i)
{	
	if (i == '') myfilter.reset()
	if (i != '') 
	{
			myfilter.set(i)
	}
}
function doChangeDelType(){	
	document.frmBasket.submit();		
}
function UpdateBasket(){
	document.frmBasket.formaction.value='0';
	document.frmBasket.submit();		
}
function CheckOut(){
	document.frmBasket.formaction.value='1';
	document.frmBasket.submit();		
}
function viewimage(url)
{
window.open(url,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=500, height=500")
}
function ViewBrandProducts (selSelectObject)
{
   if (selSelectObject.options[selSelectObject.selectedIndex].value != "")
   { 
     location.href=selSelectObject.options[selSelectObject.selectedIndex].value
   }
}

function AddToBasketEx(id,qty){
	document.getElementById("quicksearchprodid").value = id;
	document.getElementById("quicksearchqty").value = qty;
	document.frmBasket.submit();		
}

function toggleCollapsable(linkId, contentId) {
	if (document.getElementById(contentId).style.display == "none") {
						
		for (var i = 2; i < arguments.length; i+=2) {	
			document.getElementById(arguments[i]).innerHTML = collapsableShowText ;
			document.getElementById(arguments[i]).className = 'show'; 
			document.getElementById(arguments[i+1]).style.display = "none";
		}
		document.getElementById(linkId).innerHTML = collapsableHideText ;
		document.getElementById(linkId).className = 'hide'; 
		document.getElementById(contentId).style.display = "";
	} else {
		document.getElementById(linkId).innerHTML = collapsableShowText;
		document.getElementById(linkId).className = 'show'; 
		document.getElementById(contentId).style.display = "none";
	}
}

/* Begin function to show/hide productslist.xsl */

function show_productslist_xsl(taba,tabb,tabc)
{
document.getElementById(taba).style.display="none";
document.getElementById(tabb).style.display="inline";
document.getElementById(tabc).style.display="none";
}

/* End function to show/hide productslist.xsl */
function showCaption(d0,selectedtab,tabcount,caption)
{
	var i;

	for(i=1;i<=tabcount;i++)
	{	
		document.getElementById('Tabs'+i).style.visibility = "hidden"
		document.getElementById('Tabs'+i).style.display = "none"	
		document.getElementById('Butt'+i).style.background = "#EEE"		
	}
		
	document.getElementById('main_shop_icons').style.visibility = "hidden"
	document.getElementById('main_shop_icons').style.display = "none"
		
	document.getElementById(d0).style.visibility = "visible"
	document.getElementById(d0).style.display = "block"	
	document.getElementById('Butt'+selectedtab).style.background = "#FAB5E1"
		
	if(caption == "BrandIcons")
	{
		document.getElementById('main_shop_icons').style.visibility = "visible"
		document.getElementById('main_shop_icons').style.display = "block"	
	}

}
function ValidateQty()
{
	if (!isInteger(document.getElementById("qty").value))
	{
		alert("Please enter integer in quantity fields");
		return false;
	}
	else
		return true;
}

function isInteger(n) {
return (!isNaN(n)) && (Math.floor(n)==n);
}
