//
//



//<![CDATA[
var Content = [];
function isIE(){
  return navigator.userAgent.indexOf('MSIE') != -1;
}
if(navigator.userAgent.indexOf('MSIE')!=-1 || typeof document.observe != 'function') {
	Event.observe(window, "load", jsLaunch);
} else {
	document.observe("dom:loaded", jsLaunch);
}
function jsLaunch(){
  var onloadTime = new Date();
	//var t = new Tracker();
  //var startTime = new Date();
  if(typeof $!='function') return;
	
	
  var s,q={};
    window.location.search.replace(new RegExp("([^?=&]+)(=([^&]*))?", "g"),
		                           function( $0, $1, $2, $3 ){
									   q[ $1 ] = $3;
								   }
			);
	for(var i in q)if(i=='tab')s=true;
	if(s)SwitchTabs(q.tab.charAt(0),5,q.tab.charAt(2));
    
	
	setJumpTo();
	
	$('SiteWrapper').title = '';
	//stripTitles();
	
	setTabPointer();

	
	/*if($('SiteWrapper').className.indexOf('withPageBanner')!=-1){
		setTimeout("fadeIn($('PageBanner'));",400);
		setInterval( 'updatePageBanner()', 3 );
    }*/
	if(document.all){
		var h = document.body.clientHeight, ch = $('container').getHeight();
	    if(h>ch) $('container').style.height = h-20+'px';
	}
	

};



function getBrowserLevel(){
   return window.XMLHttpRequest;
}

function setTabPointer(){
	$A($('Content').getElementsByClassName('TabbedContentHeader')).each(function(el){
			  Event.observe(el,'mouseover',el.onclick);
			  el.observe('mouseover',function(){ $(el.id).style.cursor='pointer'; });
		});

};

function setJumpTo(){
    var els = $A(document.getElementsByClassName('JumpTo'));
	if(els){
		els.each(function(el){
		    el.cleanWhitespace();
			var icon = el.down(), ancr = el.down().next().down();
			if(ancr){
				if(icon.className=='JumpToIcon'&&ancr.href){
			    icon.onmouseover = function(){this.style.cursor='pointer';}
				icon.onclick = function(){window.location=ancr.href;}	
			}
			}
		});
	}
};

function stripTitles(){
    var els = $('SiteWrapper').descendants();
	$('SiteWrapper').title="";
	els = els.findAll(function(el){ return el.title; });
	els.each(function(el){ if(el.className != 'withTitle') { el.title=""; } });
};


function SwitchTabs(id,total,num){
    if(parseInt(id)>0){
	    id=parseInt(id)-1;
	    var element, els = $('Content').getElementsByTagName('li');
        if(els[id]){
		    $(els[id].id).cleanWhitespace();
		    id=els[id].firstChild.id;
		}
	}
	for( var i = 0; i < total; i++ ) {
		var pos = i + 1;
		var currentId = id.slice(0,id.length-1)+(pos);
		var tabId = "tabHeader_"+id.slice(0,(id.length-4))+ "_" + pos;
		var oldTabId = "tabHeader_"+id.slice(0,(id.length-7))+ "_" + pos; // for backwards compatability
		if( num == pos ){
			if($(tabId)){
				$(tabId).addClassName( 'Selected' );
			} else if($(oldTabId)) {
				$(oldTabId).addClassName( 'Selected' );
			}
			if($(currentId)){
			  $(currentId).style.display='block';
			}
		} else {
			if($(tabId)){
				$(tabId).removeClassName( 'Selected' );
			} else if($(oldTabId)) {
    			$(oldTabId).removeClassName( 'Selected' );	
			}
			if($(currentId)){
			  $(currentId).style.display = 'none';
			}
		}
	}
};



/*
var pics = {
  init: function(){
    pics.img1 = $('main-slide');
		pics.img2 = $('back-slide');
		pics.fade = true;
    setTimeout("pics.launch();",300);
	  pics.pos = 1;
		pics.total = this.getPicsLength();
		this.refreshInterval();
  },
  
  launch: function(){
		pics.showing = pics.img1;
		if(!pics.showing) return;
		var src = pics.showing.src.split('/images/');
		pics.notShowing = pics.img2;
  },
	
	getPicsLength: function(){
		return 5;		
	},
	
	refreshInterval: function(){
	  clearInterval(pics.interval);
		pics.interval = setInterval(pics.nextImage, 3200);
	},
	
	nextImage: function(){
	  pics.pos++;
		if(pics.pos > pics.total) pics.pos = 1;
		var path = pics.pos.toString();
		path = (path.length == 1)? '00' + path + '.jpg' : '0' + path + '.jpg';
		var src = pics.notShowing.src.split('/slides/');
		var s = src[0] + '/slides/';
		s += path;
		pics.notShowing.src = s;
		if(pics.showing == pics.img1){
			new Effect.Opacity('main-slide', { from: 1, to: 0, duration: 0.8 });
		} else {
			new Effect.Opacity('main-slide', { from: 0, to: 1, duration: 0.8 });
		}
		pics.swapShowing();
	},
  
  swapShowing: function(){
    if(pics.showing == pics.img1){
			pics.showing = pics.img2;
			pics.notShowing = pics.img1;
		} else {
			pics.showing = pics.img1;
			pics.notShowing = pics.img2;
		}
  }
};

//if(window.location.toString().indexOf('home') ==-1){
  Event.observe(window, "load", pics.init.bindAsEventListener(pics));
//}
*/
//]]>