<!--
function addreviewform()
{
	getElm('addreviewdiv').style.display = '';
}

function submitreview(product,reviews,rating,reviewername)
{
	if(empty(rating)||rating<1)
	{
		alert('Please select a rating');
		return false;
	}
	
	if(empty(reviews))
	{
		alert('Please enter some reviews before proceeding.');
		return false;
	}
	// show adding tip aninimation	
	getElm('addreviewstatus').innerHTML = '';
	getElm('comlayer').style.display='none';
	getElm('anilayer').style.display='';
	 
	// make call to add the tip
	postServ('/bikeshop/bikeshopajax.php',submitreviewresult,'op=addreview&g='+product+'&c='+escape(reviews)+'&r='+rating+'&rn='+reviewername);
}

function submitreviewresult(xml)
{
	var passed = getTag(xml,'passed')[0].firstChild.data;
	var reason = getTag(xml,'reason')[0].firstChild.data;
	
	if(passed=='true')
	{
		getElm('anistatus').innerHTML = '<div class=\"msgblock\"><h4>'+reason+'</h4></div>';
	}
	else
	{
		getElm('comlayer').style.display='';
		getElm('anilayer').style.display='none';
		
		getElm('addreviewstatus').innerHTML = '<div class=\"msgblock\"><h4>'+reason+'</h4></div>';
		
	}
}

function productScatLoad(scat,page,order,bid,pref)
{
	if (pref==1) {
		getElm('pfilter2').value = getElm('pfilter1').value;
		getElm('rfilter2').value = getElm('rfilter1').value;
	}
	else
	{
		getElm('pfilter1').value = getElm('pfilter2').value;
		getElm('rfilter1').value = getElm('rfilter2').value;
	}
	
	// show temp loading page
	hide('productlist');
	show('productloading');
	
	// clear previous items
	var i=0;
	while(elm = getElm('product-'+i))
	{
		elm.innerHTML='';
		i++;
	}
	
	// settimeout
	productScat(scat,page,order,bid);
}

function productScat(scat,page,order,bid)
{
	jcall('/bikeshop/bikeshopjsn.php', productScatResult,'op=productscat&scatid='+scat+'&page='+page+'&order='+order+'&bid='+bid);
}

function productScatResult(res)
{
	var jsn = eval('('+res+')');
	
	// set new items
	for(var x in jsn.products)
	{
		product(jsn.products[x],x);
	}

	hide('productloading');
	show('productlist');
	
	
}

function product(prod,i)
{
	
	var out = "<div id=\"title\"><a href=\""+prod.url+"\">"+prod.name+"</a></div>"+
				"<a href=\""+prod.url+"\"><img src=\""+prod.img+"\" align=\"right\" /></a><br /><br />"+prod.desc+"...<br /><br />"+
				"<div style=\"clear:both;\"><a href=\""+prod.url+"\"><img src=\"/images/go.gif\" alt=\""+prod.name+" from &pound;"+prod.price+"\" title=\""+prod.name+"\" from &pound;"+prod.price+"\" style=\"margin:none;\" align=\"right\" /></a>"+
				"Prices from : <span id=\"price\">&pound;"+prod.price+"</span></div>";
	getElm('product-'+i).innerHTML=out;
				
}


-->
