var is = new ClientSnifferJr();
var its = new its();
var styleSheet;

if (document.location.href.indexOf("ddasolutions.com") > 0)
{	// use testing domain here
	baseURL = 'http://clients.ddasolutions.com/centennial/princegeorge/alpha/';
}
else
{	// use live domain here
	// that way you can ftp anytime without having to update the file
	baseURL = 'http://www.cambridgesuitessydney.com/';
}

if(is.mac)
{
	if(is.ie) styleSheet = 'style/style.css';
	else if(is.safari) styleSheet = "style/safari.css";
	else styleSheet = 'style/style.css';
}
else //windows
{
	if(is.ie) styleSheet = 'style/style.css'; //most used
	else if(is.nav4) styleSheet = 'style/netscape4.css'; //special sheet for Netscape 4
	else styleSheet = 'style/netscape5up.css'; //special shett for netscape 5+
}
//document.write('<base href="' + baseURL + '">');
document.write('<link href="' + baseURL + 'favicon.ico" rel="SHORTCUT ICON">');
document.write('<link href="' + baseURL + styleSheet + '" rel="styleSheet" type="text/css" media="screen">');
document.write('<link href="' + baseURL + styleSheet + '" rel="styleSheet" type="text/css" media="print">');

function ClientSnifferJr()
{
  this.ua = navigator.userAgent.toLowerCase();
  this.major = parseInt(navigator.appVersion);
  this.minor = parseFloat(navigator.appVersion);
  this.nav   = (
    (this.ua.indexOf('mozilla')!=-1)
    && ((this.ua.indexOf('spoofer')==-1)
    && (this.ua.indexOf('compatible') == -1))
  );
  this.nav4  = (this.nav && (this.major == 4));
  this.nav4up= (this.nav && (this.major >= 4));
  this.nav5up= (this.nav && (this.major >= 5));
  this.gecko = (this.ua.indexOf('gecko') != -1); 
  this.ie    = (this.ua.indexOf("msie") != -1);
  this.ie3   = (this.ie && (this.major == 2));
  this.ie4   = (
    this.ie && (this.major == 4)
    && (this.ua.indexOf("msie 5.0")==-1)
  );
  this.ie4up = (this.ie  && (this.major >= 4));
  this.ie5up = (this.ie && !this.ie3 && !this.ie4);
  this.opera = (this.ua.indexOf("opera") != -1);
	this.safari = (this.ua.indexOf("safari") != -1);
  this.hotjava = (this.ua.indexOf("hotjava") != -1); 
  this.webtv = (this.ua.indexOf("webtv") != -1);
  this.aol   = (this.ua.indexOf("aol") != -1); 
	this.mac = (this.ua.indexOf("mac") != -1); 
	this.win = 	(this.ua.indexOf("win") != -1); 
}

function its() {
	var n = navigator;
	// string comparisons are much easier if we lowercase everything now.
	// to make indexOf() tests more compact/readable, we prepend a space 
	// to the userAgent string (to get around '-1' indexOf() comparison)
	var ua = ' ' + n.userAgent.toLowerCase();

	this.nn = ua.indexOf('mozilla') > 0;
	// 'compatible' versions of mozilla aren't navigator
	if(ua.indexOf('compatible') > 0) {
		this.nn = false;
	}
	this.ie = ua.indexOf('msie') > 0;
	this.mac = ua.indexOf('mac') > 0;
	this.win = ua.indexOf('win') > 0;

	return this;
}
