//------------------------------------//
//        Reengage Idle Customer      //
//------------------------------------//

var reengageIdleCustomers = {

	init: function()	{
    if (!htz.idleCustomer.Display) return 
 		timeStamp = new Date().getTime();
    lightBoxIC = new lightBox
		setTimeout('reengageIdleCustomers.show()', htz.idleCustomer.Timeout);
	},

  show: function() {
		if( htz.idleCustomer.AttemptsLeft < 2 ) return
  	htz.idleCustomer.AttemptsLeft--;
    lightBoxIC.parms.url = "/rentacar/customersupport/templates/reengageIdleCustomers.jsp?time=" + timeStamp
    lightBoxIC.jspRequest("IC");      
  }

}

Event.observe( document , 'load' , reengageIdleCustomers.init() )

//------------------------------------//
//                POS                 //
//------------------------------------//
changeLanguage = function() {
  document.selectLanguageTopNav.submit()
}

setCountryCode = function(u) {
  v = $F("country_code")
	parms = ( v != "" ) ? "selectedPOS=" + v : "" ;
	u = "/rentacar/PointOfSaleHandler?" + parms
  new Ajax.Request( u,  { 
    method: 'post', 
    onFailure: function(){alert(htz.messages.ajaxFail)},
    onSuccess: updateLanguages
    });
    }
  
updateLanguages = function(req) {
  o = '<select name="language" id="language">' + req.responseText + '</select>'
	$("spLanguages").innerHTML =  o
  }

//------------------------------------//
//          Right Now Search          //
//------------------------------------//
rightNow = function(o) { 
  if (!htz.rightNow.Display) return;
	lightBoxRN = new lightBox;
  lightBoxRN.reset();  
  lightBoxRN.menu.top = "true"; 
  lightBoxRN.menu.bottom = "true";
  lightBoxRN.parms.scroll = "false";  
  lightBoxRN.parms.width = 760;   
  lightBoxRN.init() ; 
  domain = htz.rightNow.URL;
  path = '?sys=iRac&p_search_text=';
  url = (domain + path + escape(o.value));
  $('divWorkSpace').innerHTML = '<iframe id="ifrRightNow" style="border:0px;" frameborder="0" width="760" height="460" src="' + url + '"></iframe>';
  lightBoxRN.show();
  }  
  
//------------------------------------//
//             Navigation             //
//------------------------------------//

goHome = function() {
  location.href = htz.navigation.homeURL
}

//------------------------------------//
//              eStara               //
//------------------------------------//

function eStara_quick_append(u) { 
	var s=document.createElement('script'); 
	s.setAttribute('type','text/javascript'); 
	s.setAttribute('src',u); 
	s.setAttribute('charset','UTF-8'); 
	if (typeof(window.attachEvent)!='undefined') document.body.appendChild(s); 
	else document.getElementsByTagName('head').item(0).appendChild(s); 
}

function eStara_loadlr() { 
  u = (htz.config.protocol + '://as00.estara.com/fs/lr.php?onload=1&accountid=200106292623')
	try {	eStara_quick_append(u,0) } 
  catch(e){} 
}


