   var ie4 = (document.all)? true:false;         //IE 4
   var dom = (document.getElementById)? true:false;   //NS 6 ou IE 5
   
function bodyOnload()
{
	switchButton(0);
	getOrders('reqprint','&page=0&request=reqprint&order=dateOrdered&dir=DESC');
}
function bodyOnloadFeatured()
{
	switchButton(0);
	getOrders('reqprint','&page=0&request=reqprint&order=dateOrdered&dir=DESC&limit=3');
}
function bodyOnloadCustomer(customerorderids, pending)
{
	switchButton(0);
	var strPending = "";
	if (pending == 1) strPending = "&pending=1";
	getOrders('reqprint','&page=0&request=reqprint&order=dateOrdered&dir=DESC&customerorderids='+customerorderids+strPending);
}
//---------SEARCH----------------
function doSearch()
{
	if (document.getElementById('searchThis').value != '')
	{
		getOrders('searchOrderStatus','&request=searchOrderStatus&page=0&query='+document.getElementById('searchThis').value);
	}
}
//---------END SEARCH----------------

//********* DATE FUNCTIONS **********
  function createDate(strDate){	  
	year = strDate.substring(0,4);
	month = strDate.substring(6,7);
	day = strDate.substring(8,10);
	d = new Date();
	d.setFullYear(year); 
	d.setMonth(month-1);
	d.setDate(day);
	return d;  
  }
  
  //Return:
  //   0 if date_1=date_2
  //   1 if date_1>date_2
  //  -1 if date_1<date_2	  
  function compare(date_1, date_2){
	diff = date_1.getTime()-date_2.getTime();
	return (diff==0?diff:diff/Math.abs(diff));
  }
//***************************************

//------------ PRODUCT FILTER
function filterType(product)
{
	document.getElementById('divProductFilter').innerHTML = product;
	
}

function reorder()
{
	window.location.reload();
}
