/*
Beehive.js Version 0.1 July 11, 2006 Copyright Jackson Harvell where applicable.

references for this code include:

browser detection by the excellent website quirksmode.org http://www.quirksmode.org/js/

this website uses the prototype javascript library and the scriptaculous effects library, both of which are totally totally awesome:
http://prototype.conio.net/
and
http://script.aculo.us/






*/

var detect = navigator.userAgent.toLowerCase();

var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
browser = "Konqueror";
OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('firefox')) browser = "Firefox"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
browser = "Netscape";
version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
if (checkIt('linux')) OS = "Linux";
else if (checkIt('x11')) OS = "Unix";
else if (checkIt('mac')) OS = "Mac"
else if (checkIt('win')) OS = "Windows"
else OS = "an unknown operating system";
}

function checkIt(string)
{
place = detect.indexOf(string) + 1;
thestring = string;
return place;
}
if (browser == "Internet Explorer" && version<6)
{
  window.location.replace("http://beehive.tv/browsers.html");


}

if (browser == "Opera")
{
  window.location.replace("http://beehive.tv/browsers.html");


}
if (browser == "Netscape")
{
  window.location.replace("http://beehive.tv/browsers.html");


}






var activeID = null;


function highlightActive(id) {

resetHighlights();

$(id).addClassName('activeItem');
activeID = id; 

} 


function resetHighlights(){


if(activeID!=null){

$(activeID).removeClassName('activeItem');
}

if(currentItem!=null){
$(currentItem).src="images/"+currentItem+".gif";
currentItem=null;

}

}






var currentItem=null;

function itemSelector(nItem)
{


	resetHighlights();

	$(nItem).src="/images/"+nItem+"-sel.gif";

	currentItem=nItem;

}


function rOn(img_name) {

if(img_name!=currentItem){
$(img_name).src="/images/"+img_name+"-over.gif";
}}

function rOff(img_name) {
if(img_name!=currentItem){

$(img_name).src="/images/"+img_name+".gif";
}}

function initSliders(){




 var myScroll = new Control.Slider('scroller','scrollArea',{axis:'vertical',  onSlide:function(v){docH = $("menuList").offsetHeight; contH = $("menuView").offsetHeight; $("menuList").style.top = (v * (contH-docH)) +"px";}});
 var newsScroll = new Control.Slider('scroller2','scrollArea2',{axis:'vertical', onSlide:function(v){ docH = $("newsList").offsetHeight; contH = $("newsView").offsetHeight; $("newsList").style.top = (v * (contH-docH)) +"px";}});
 


}