// JavaScript Document

var _BTN = new clsBTN();
function clsBTN() {
   function cRED(_Button, _Status,domainCars) {
	   var goauto = ' http://carsozfreeonline.goauto.com.au/';
	   if(domainCars===undefined){
		   domainCars='http://cars.ozfreeonline.com/';
		}
	   _Status = parseInt(_Status);
	   if(_Button==1) {
	   		if(_Status>0) window.location.href = domainCars + 'PostOffer.php';
	           else window.location.href = domainCars + 'sell_your_car.php';
	   		}
	   else if(_Button==2) window.location.href = domainCars + 'advanced.php'; 
	   else if(_Button==3) { 
	           if(_Status>0) window.location.href = domainCars + 'logout.php';
	           else window.location.href = domainCars + 'login.php';
	        }
	   else if(_Button==4) {
		       if(_Status>0) window.location.href = domainCars + 'index.php';
			   else window.location.href = domainCars + 'r1.php';
	        }
	   else if(_Button==5){
		   livehelp();
	   }
	   else if(_Button==6) {
		       window.location.href = goauto; //+ 'news.php';
	        }
		else if(_Button==7) {
		       window.location.href = domainCars + 'index.php';
	        }
   }

   function cBLACK(_Button, domainCars) {
	   
	   if(domainCars===undefined){
		   domainCars='http://cars.ozfreeonline.com/';
		}
		
	   if(_Button==1) window.location.href = domainCars+'/help_center/help.html';
	   else if(_Button==2)
	   {//added by ronald 09/11/07
		   if(location.pathname == "/info.php"){
		   	window.location.href = 'friend.php?url=http://' +location.hostname+location.pathname+location.search;
		   }
		   else{
		   	window.location.href = domainCars+'friend.php?url=http://' + location.host ;
		   }
	   }
	   else if(_Button==3) window.location.href = domainCars+'suggest.php';
	   else if(_Button==4) window.location.href = domainCars+'/advertise.html';
   }
   
   this.cRED = cRED;
   this.cBLACK = cBLACK;
}
