//CS1.1  Sniffer 
var exclude=1;
var agt=navigator.userAgent.toLowerCase();
var win=0;var mac=0;var lin=1;
if(agt.indexOf('win')!=-1){win=1;lin=0;}
if(agt.indexOf('mac')!=-1){mac=1;lin=0;}
var lnx=0;if(lin){lnx=1;}
var ice=0;
var ie=0;var ie4=0;var ie5=0;var ie6=0;var ie7=0;var com=0;var dcm;
var op5=0;var op6=0;var op7=0;
var ns4=0;var ns6=0;var ns7=0;var mz7=0;var kde=0;var saf=0;
if(typeof navigator.vendor!="undefined" && navigator.vendor=="KDE"){
	var thisKDE=agt;
	var splitKDE=thisKDE.split("konqueror/");
	var aKDE=splitKDE[1].split("; ");
	var KDEn=parseFloat(aKDE[0]);
	if(KDEn>=2.2){
		kde=1;
		ns6=1;
		exclude=0;
		}
	}
else if(agt.indexOf('webtv')!=-1){exclude=1;}
else if(typeof window.opera!="undefined"){
	exclude=0;
	if(/opera[\/ ][5]/.test(agt)){op5=1;}
	if(/opera[\/ ][6]/.test(agt)){op6=1;}
	if(/opera[\/ ][7-9]/.test(agt)){op7=1;}
	}
else if(typeof document.all!="undefined"&&!kde){
	exclude=0;
	ie=1;
	//if(window.XMLHttpRequest && document.all){
	if(document.documentElement && typeof document.documentElement.style.maxHeight!="undefined") {
		ie7=1;
	}	
	else if(typeof document.getElementById!="undefined"){
		ie5=1;
		if(agt.indexOf("msie 6")!=-1){
			ie6=1;
			dcm=document.compatMode;
			if(dcm!="BackCompat"){com=1;}
			}
		}
	else{ie4=1;}
	}
else if(typeof document.getElementById!="undefined"){
	exclude=0;
	if(agt.indexOf("netscape/6")!=-1||agt.indexOf("netscape6")!=-1){ns6=1;}
	else if(agt.indexOf("netscape/7")!=-1||agt.indexOf("netscape7")!=-1){ns6=1;ns7=1;}
	else if(agt.indexOf("gecko")!=-1){ns6=1;mz7=1;}
	if(agt.indexOf("safari")!=-1 || (typeof document.childNodes!="undefined" && typeof document.all=="undefined" && typeof navigator.taintEnabled=="undefined")){mz7=0;ns6=1;saf=1;}
	}
else if((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)){
	exclude=0;
	ns4=1;
	if(typeof navigator.mimeTypes['*']=="undefined"){
		exclude=1;
		ns4=0;
		}
	}
if(agt.indexOf('escape')!=-1){exclude=1;ns4=0;}
if(typeof navigator.__ice_version!="undefined"){exclude=1;ie4=0;}

//alert('IE6:' + ie6)
//alert('IE7:' + ie7)


//GLOBALS
var myWidth = 0, myHeight = 0;
var last_el;

function GetSize() {  
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  if (myWidth <= 10) {myWidth = 300;}
  
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
}


function SetContentWidth() {
//add rule to set width of content div in IE6 (not neeeded IE7 or FF) 
//this permits overflow to operate properly and prevents content div from beign forced to bottom with oversized images 
	if (ie6){
		GetSize();
		if (myWidth > 400) {
			myWidth = myWidth-400; //for sides 
		}
		else {
			myWidth = 300;
		}		
			
		if (last_el != '') {
			document.styleSheets[0].removeRule ("#content", last_el, 0); 
		}	
		el= 'width:' + myWidth + 'px;' 
		last_el = el 
		document.styleSheets[0].addRule("#content", el, 0); 
		//alert(el);
	}	
}

function openWin(URL,Name,butt) 
{
  window.open(URL,Name,butt);
}

function toggleVis(divname)
{
	var x=MM_findObj(divname), a=toggleVis.arguments;
	
	if (x!=null) {
		if (document.all || document.getElementById) {	// IE & Gecko & Opera
			if ((x.style.display=="none" && a.length == 1) || (a.length > 1 && a[1] == "show")) // none means show, "" means hide
				x.style.display=""; // hide
			else
				x.style.display="none"; // show
		}
		else {	// Netscape 4
			if ((x.display=="show" && a.length == 1) || (a.length > 1 && a[1] == "show"))
				x.display="hide";
			else
				x.display="show";
		}
	}
} // end of the 'toggleVis()' function

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
