// JavaScript Document
// By Ahmad Abu Quboh

var motors_start = 0;
var old_category = "" ;

function increase_views(str)
{
   x_increase_pic_views_AJAX(str,get_result)
}

function ChangeNext(x){}

function ChangeBack(x){}

function FeaturedStateChanged()
{ 	
	if (xmlHttpFeatured.readyState==4 || xmlHttpFeatured.readyState=="complete")
	 { 
		document.getElementById(divs).innerHTML=xmlHttpFeatured.responseText;
	 } 
}

function GetXmlHttpObject()
{
	var xmlHttpFeatured=null;
	try{
		 //Firefox, Opera 8.0+, Safari
		 xmlHttpFeatured=new XMLHttpRequest();
	 }
	catch (e){
		 //Internet Explorer
		 try{
		  xmlHttpFeatured=new ActiveXObject("Msxml2.XMLHTTP");
		  }
		 catch (e){
		  xmlHttpFeatured=new ActiveXObject("Microsoft.XMLHTTP");
		  }
	 }
	return xmlHttpFeatured;
}

function GetItemsLive(category,country,item_per_page,page)
{
	
	document.getElementById('CatFeaturedItemsBox').innerHTML='<div align="center" style="padding:10px"><img src="/images/big-ajax-loader.gif" /></div>';
	
	xmlHttpFeatured=GetXmlHttpObject()	
	if (xmlHttpFeatured==null){
		 alert ("Browser does not support HTTP Request")
		 return
	}	
	var url="/MotorsGetCatFeaturedBox.php?category="+category+"&country="+country+"&item_per_page="+item_per_page+"&page="+page+"&type=catfeatured";	

	xmlHttpFeatured.onreadystatechange=FeaturedStateChanged	
	divs = 'CatFeaturedItemsBox';
	xmlHttpFeatured.open("GET",url,true)		
	xmlHttpFeatured.send(null) 		
}