// CSS Browser Selector   v0.2.5
// Documentation:         http://rafael.adm.br/css_browser_selector
// License:               http://creativecommons.org/licenses/by/2.5/
// Author:                Rafael Lima (http://rafael.adm.br)
// Contributors:          http://rafael.adm.br/css_browser_selector#contributors
var css_browser_selector = function() {
	var 
		ua=navigator.userAgent.toLowerCase(),
		is=function(t){ return ua.indexOf(t) != -1; },
		h=document.getElementsByTagName('html')[0],
		b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('gecko/')? 'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',
		os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';
	var c=b+os+' js';
	h.className += h.className?' '+c:c;
}();

function addbookmark()
{ 
	general="First click OK and then hit CTRL+D to bookmark this page.";
	opera="First click OK and then hit CTRL+T to bookmark this page.";
	if ((navigator.userAgent).indexOf("Opera")!=-1)
		alert(opera); 
	else
		alert(general); 
}

function popup(w, h, url) {
	window.open(url,"_blank",'width='+w+',height='+h+',scrollbars=yes,status=no,menubar=no,location=no,resizable=no');
}


startList = function()
{

	if (document.all&&document.getElementById) 
	{
		hoverItem = document.getElementById("officelocator");

		hoverItem.onmouseover=function()
		{
			this.className+=" hover";
		}
				
		hoverItem.onmouseout=function() {
			this.className=this.className.replace(" hover", "");
		}
		
	}

	
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }

 startPage();
 
}
window.onload=startList;

// this array consists of the id attributes of the divs we wish to alternate between
var divs_to_fade = new Array('box-1', 'box-2', 'box-3', 'box-4');
		
// the starting index in the above array.  It should be set to the value of the div which doesn't have the CSS Display property set to "none"
var i = 0;
			
// the number of milliseconds between swaps.  Default is five seconds.
var wait = 6000;

// the function that performs the fade
function swapFade() {
	if(!document.getElementById(divs_to_fade[i])) return;
	Effect.Fade(divs_to_fade[i], { duration:2, from:1.0, to:0.0 });
	i++;
	if (i == 4) i = 0;
	Effect.Appear(divs_to_fade[i], { duration:2, from:0.0, to:1.0 });
}
			
// the onload event handler that starts the fading.
function startPage() {
	if(document.getElementById('box-1'))
		setInterval('swapFade()',wait);
}


// Ripped from old site

function requestinfo(url) {
msg=open(url,'NewWindow','width=516,height=600,toolbar=no,copyhistory=no,scrollbars=yes,resizable=yes,directories=no,menubar=no,status=no,location=no');
}


if (document.images) {

	nameA = new Image
	nameB = new Image
	nameC =  new Image
	nameD =  new Image
	nameE =  new Image
	nameF =  new Image
	nameG =  new Image
	nameH =  new Image
	nameI =  new Image
	nameJ =  new Image
	comMent = new Image
	blank = new Image
	
	nameA.src = "../i/int_msg_ant.gif"
	nameB.src = "../i/int_msg_chi.gif"
	nameC.src = "../i/int_msg_la.gif"
	nameD.src = "../i/int_msg_mex.gif"
	nameE.src = "../i/int_msg_mia.gif"
	nameF.src = "../i/int_msg_ny.gif"
	nameG.src = "../i/int_msg_phoenix.gif"
	nameH.src = "../i/int_msg_toron.gif"
	nameI.src = "../i/int_msg_van.gif"
	nameJ.src = "../i/int_msg_tor.gif"
	comMent.src = "../i/int_map_msg.gif"
	blank.src = "../i/int_map_msg.gif"
}

else {

	nameA = ""
	nameB = ""
	nameC = ""
	nameD = ""
	nameE = ""
	nameF = ""
	nameG = ""
	nameH = ""
	nameI = ""
	nameJ = ""
	comMent = ""
	blank = ""
	document.comMent = ""
}