<!--
function writeDate(RL) {
  
  //alert(RL);
  
  // get a date object
  var today = new Date();
  var dayWord;
  var monthWord;

  // ask the object for some information
  var month = today.getMonth();
  var date = today.getDate();
  var hour = today.getHours();
  var minutes = today.getMinutes();
  var year = today.getYear();
  var dayname = today.getDay();

  
  // stored month names in different languages
  var arrE = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  var arrF = new Array("Janvier", "F&eacute;vrier", "Mars", "Avril", "Mai", "Juin", "Juillet", "Ao&ucirc;t", "Septembre", "Octobre", "Novembre", "D&eacute;cembre");
  var arrG = new Array("Januar", "Februar", "M&auml;rz", "April", "Mai", "Juni", "Julil", "August", "September", "Oktober", "November", "Dezember");
  var arrI = new Array("Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre");
  var arrP = new Array("Janeiro", "Fevereiro", "Mar&ccedil;o", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro");
  var arrS = new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
  
  //deteremine the language by getting the last letter of the RL
  var language = RL.substr(2, 1)
  
  
  //Print military time with 0 for one digit hours
	if (hour < 10) {
		hour = "0" + hour
	}	
	
	if (minutes < 10) {
		minutes = "0" + minutes
	}
  
  // help Netscape print a readable year	
	if (year < 2000) {
		year = year + 1900
	}
							  
  // format the output
  if (language == "M") 
  {
  	// assign string (Mandarin) values to numeric variables: day
	
	//if (dayname == 0) daytext =
	//###########################################################
	//switch statement doesn't work in IE 3.0
	/*switch (dayname)
		{
		case 0:
			dayText = "&#26143;&#26399;&#26085;";  //Sunday
			break;
		case 1:
			dayText = "&#26143;&#26399;&#19968;";  //Monday
			break;
		case 2:
			dayText = "&#26143;&#26399;&#20108;";  //Tuesday
			break;
		case 3:
			dayText = "&#26143;&#26399;&#19977;";  //Wednesday
			break;
		case 4:
			dayText = "&#26143;&#26399;&#22235;";  //Thursday
			break;
		case 5:
			dayText = "&#26143;&#26399;&#20116;";  //Friday
			break;
		case 6:
			dayText = "&#26143;&#26399;&#20845;";  //Saturday
			break;
		}
	*/
	
	if (dayname == 0) 
		dayText = "&#26143;&#26399;&#26085;";  //Sunday
	else if (dayname == 1)
		dayText = "&#26143;&#26399;&#19968;";  //Monday
	else if (dayname == 2)
		dayText = "&#26143;&#26399;&#20108;";  //Tuesday
	else if (dayname == 3)
		dayText = "&#26143;&#26399;&#19977;";  //Wednesday
	else if (dayname == 4)
		dayText = "&#26143;&#26399;&#22235;";  //Thursday
	else if (dayname == 5)
		dayText = "&#26143;&#26399;&#20116;";  //Friday
	else if (dayname == 6)
		dayText = "&#26143;&#26399;&#20845;";  //Saturday
		
	//Mandarin variables
	var yearMand = "<span id=timedate>&#24180;</span>"                //Mandarin for Year
	var monthMand = "<span id=timedate>&#26376;</span>"               //Mandarin for Month
	var dayMand = "<span id=timedate>&#26085;</span>"                 //Mandarin for Day
	var commaMand = "<span id=timedate>&#65292;</span>"               //Mandarin text for comma
	month = month + 1;
	//final output
	var theDay = year + yearMand + month + monthMand + date + dayMand + commaMand + " " + dayText;
	return(theDay);
  }
  else
  {
  	  // choose the month
	  /*switch (language)
	  {
	  		case "E":
				monthWord = arrE[month];
				break;
			case "F":
				monthWord = arrF[month];
				break;
			case "G":
				monthWord = arrG[month];
				break;
			case "I":
				monthWord = arrI[month];
				break;
			case "P":
				monthWord = arrP[month];
				break;
			case "S":
				monthWord = arrS[month];
				break;
	  }*/
	  if (language == "E")
	  		monthWord = arrE[month];
	  else if (language == "F")
	  		monthWord = arrF[month];
	  else if (language == "G")
	  		monthWord = arrG[month];
	  else if (language == "I")
	  		monthWord = arrI[month];
	  else if (language == "P")
	  		monthWord = arrP[month];
	  else if (language == "S")
	  		monthWord = arrS[month];
  
	var theDay = date + " " + monthWord + " " + year + " ";
	return(theDay);
  }

}

function help(url){
	window.open(url,'Help','width=450,height=300,scrollbars')
}

function locator() {
	window.open('http://www.casece.com/cgi-bin/websql/locator/NorthAmer.hts','locator','width=660,height=430,scrollbars')
}

function setHomePage(varRL){
	window.open('/sethomepage.asp' + varRL,'SetPage','width=550,height=350,scrollbars');
}

function locateDealer(varRL){
	//alert (varRL);
	if (varRL == "NAE")
	{
	var str = "left=0,screenX=0,top=0,screenY=0";

	if (window.screen) {

	  var ah = screen.availHeight - 20;
	  var aw = screen.availWidth - 10;
     str += ", Width=" + aw;
	  str += ", Height=" + ah;
	  str += ", innerHeight=" + ah;
	  str += ", innerWidth=" + aw;
	  str += ", scrollbars";
	  str += ", resizable=yes";

	} else {
	  str += ", resizable"; // so the user can resize the window manually
	  str += ", scrollbars=yes";
	}
	window.open('http://www.maporama.com/affiliates/casece/share/default.asp?language=en','LocateDealer', str);
	}
	else if (varRL == "NAS")
		window.open('http://dealerloc.cnh.com/case/ce/NAO.html','LocateDealer','width=600,height=450,scrollbars');
	else if (varRL == "EUE")
		window.open('http://dealerloc.cnh.com/case/ce/EUR.html','LocateDealer','width=675,height=450,scrollbars');	
	else if (varRL == "EUF")
		window.open('http://dealerloc.cnh.com/case/ce/europe/index_fr.html','LocateDealer','width=675,height=450,scrollbars');
	else if (varRL == "EUI")
		window.open('http://dealerloc.cnh.com/case/ce/europe/index_it.html','LocateDealer','width=675,height=450,scrollbars');
	else if (varRL == "EUG")
		window.open('http://dealerloc.cnh.com/case/ce/europe/index_de.html','LocateDealer','width=675,height=450,scrollbars');
	else if (varRL == "EUS")
		window.open('http://dealerloc.cnh.com/case/ce/europe/index_sp.html','LocateDealer','width=675,height=450,scrollbars');
	else if (varRL == "LAE")
			window.open('http://www.cnhadmin.com.br/concessionario/locator.asp?id=2&RL=LAE','LocateDealer','width=675,height=450,scrollbars');
		//	window.open('http://dealerloc.cnh.com/case/ce/LAR.html','LocateDealer','width=675,height=450,scrollbars');
	else if (varRL == "LAS")
		window.open('http://www.cnhadmin.com.br/concessionario/locator.asp?id=2&RL=LAS','LocateDealer','width=675,height=450,scrollbars');
	//	window.open('http://dealerloc.cnh.com/cgi-bin/websql/case/ce/LatinAm_sp.hts','LocateDealer','width=675,height=450,scrollbars');
	else if (varRL == "LAP")
	
		window.open('http://www.cnhadmin.com.br/concessionario/locator.asp?id=2&RL=LAP','LocateDealer','width=675,height=450,scrollbars');
	//	window.open('http://dealerloc.cnh.com/cgi-bin/websql/case/ce/LatinAm_pg.hts','LocateDealer','width=675,height=450,scrollbars');
	else if (varRL == "APM")
		window.open('http://dealerloc.cnh.com/case/ce/APAC.html','LocateDealer','width=675,height=450,scrollbars');
	else if (varRL == "APE")
		window.open('http://dealerloc.cnh.com/case/ce/APAC.html','LocateDealer','width=675,height=450,scrollbars');
		
	/*switch (varRL)
	{
		case "NAE":
			window.open('http://dealerloc.cnh.com/case/ce/NAO.html','LocateDealer','width=600,height=450,scrollbars');
			break;
		case "NAS":
			window.open('http://dealerloc.cnh.com/case/ce/NAO.html','LocateDealer','width=600,height=450,scrollbars');
			break;
		case "EUE":
			window.open('http://dealerloc.cnh.com/case/ce/EUR.html','LocateDealer','width=675,height=450,scrollbars');
			break;
		case "EUF":
			window.open('http://dealerloc.cnh.com/case/ce/europe/index_fr.html','LocateDealer','width=675,height=450,scrollbars');
			break;
		case "EUI":
			window.open('http://dealerloc.cnh.com/case/ce/europe/index_it.html','LocateDealer','width=675,height=450,scrollbars');
			break;
		case "EUG":
			window.open('http://dealerloc.cnh.com/case/ce/europe/index_de.html','LocateDealer','width=675,height=450,scrollbars');
			break;
		case "EUS":
			window.open('http://dealerloc.cnh.com/case/ce/europe/index_sp.html','LocateDealer','width=675,height=450,scrollbars');
			break;
		case "LAE":
			window.open('http://dealerloc.cnh.com/case/ce/LAR.html','LocateDealer','width=675,height=450,scrollbars');
			break;
		case "LAS":
			window.open('http://dealerloc.cnh.com/cgi-bin/websql/case/ce/LatinAm_sp.hts','LocateDealer','width=675,height=450,scrollbars');
			break;
		case "LAP":
			window.open('http://dealerloc.cnh.com/cgi-bin/websql/case/ce/LatinAm_pg.hts','LocateDealer','width=675,height=450,scrollbars');
			break;
		case "APM":
			window.open('http://dealerloc.cnh.com/case/ce/APAC.html','LocateDealer','width=675,height=450,scrollbars');
			break;
		case "APE":
			window.open('http://dealerloc.cnh.com/case/ce/APAC.html','LocateDealer','width=675,height=450,scrollbars');
			break;
	}*/
}

function detectAPM(){

	//strCookie = amt()

	window.focus()
	
	//if (strCookie == "1") {
		winProperties = 'width=350,height=190,scrollbars=yes,resizable=yes'
		window.open('BadBrowser.asp','detect',winProperties)
	//	}
	//else {
	//	if (strCookie != "0"){
	//		return true
	//		}
	//	}
	startMenus();
}

function detectUnicode(){

	//strCookie = amt()

	window.focus()
	
	//if (strCookie == "1") {
		winProperties = 'width=350,height=300,scrollbars=yes,resizable=yes'
		window.open('bug.asp','detect',winProperties)
	//	}
	//else {
	//	if (strCookie != "0"){
	//		return true
	//		}
	//	}
	startMenus();
}

function upclock(RL){
	var dte = new Date();
	var hrs = dte.getHours();
	var min = dte.getMinutes();
	var sec = dte.getSeconds();
	
	var col = ":";
	var spc = " ";
	var com = ",";
	
	var fulltransdate = writeDate(RL);
	
	if (hrs == 0) hrs=12;
	if (hrs<=9) hrs="0"+hrs;
	if (min<=9) min="0"+min;
	if (sec<=9) sec="0"+sec;
	
	if(navigator.appName == "Netscape") {
	document.clock.document.write(fulltransdate+spc+spc+hrs+col+min+col+sec);
	//document.clock.document.write(spc+spc+hrs+col+min+col+sec);
	document.clock.document.close();
	}
	
	if (navigator.appVersion.indexOf("MSIE") != -1){
	clock.innerHTML = fulltransdate+spc+spc+hrs+col+min+col+sec;
	//clock.innerHTML = spc+spc+hrs+col+min+col+sec;
	}
}

function openWin(url){
	
	window.open(url,'newwin','width=775,height=450,scrollbars,resizable=yes,toolbar=yes,location=yes');

}

//Cookie starts here
function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  

	while (i < clen) {
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg)      
		return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
		}  
	return null;
	}

function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  

	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
	}

function DeleteCookie (name) {  
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);   
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
	}

	var expDays = 0;
	var exp = new Date();
	//exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
	exp.setTime(exp.getTime() + (expDays*0*0*0*0));

function amt(){
	var count = GetCookie('count')
	if(count == null) {
		SetCookie('count','1')
		return 1
		}
	else {
		var newcount = parseInt(count) + 1;
		DeleteCookie('count')
		SetCookie('count',newcount,exp)
		return count
	   }
}

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
	}
//Cookie ends here

function BrowserAlert(){

	//strCookie = amt()

	window.focus()
	
	//if (strCookie == "1") {
		winProperties = 'width=350,height=210,scrollbars=yes,resizable=yes'
		window.open('bestviewed.asp','detect',winProperties)
	//	}
	//else {
	//	if (strCookie != "0"){
	//		return true
	//		}
	//	}
}
	

//-->