currFeatureNum = 1;
rotDelay = 15000;
timestocycle = 6;
feature1times = timestocycle;

var strMyBrowser;
setMyBrowser();

var is = new Is()
var controls = new Array();
controls[1] = createMyObj("controlone");
controls[2] = createMyObj("controltwo");
controls[3] = createMyObj("controlthree");
controls[4] = createMyObj("controlfour");
controls[5] = createMyObj("controlfive");
controls[6] = createMyObj("controlsix");

var controlnumbers = new Array();
controlnumbers[1] = createMyObj("control1");
controlnumbers[2] = createMyObj("control2");
controlnumbers[3] = createMyObj("control3");
controlnumbers[4] = createMyObj("control4");
controlnumbers[5] = createMyObj("control5");
controlnumbers[6] = createMyObj("control6");

var features = new Array();
features[1] = createMyObj("main1");
features[2] = createMyObj("main2");
features[3] = createMyObj("main3");
features[4] = createMyObj("main4");
features[5] = createMyObj("main5");
features[6] = createMyObj("main6");

function nextFeature() {
     hideallfeatures();
     whiteoutallcontrols();
     replaceallunderlines();
     nextFeatureNum = currFeatureNum + 1;
     if ( nextFeatureNum == 7 ) nextFeatureNum = 1;
     showdiv(features[nextFeatureNum]);
     changecolor(controls[nextFeatureNum],"#DDDDDD");
     divunderline(controlnumbers[nextFeatureNum], "none");
     currFeatureNum = nextFeatureNum;
     clearTimeout(RotTimer);
     RotTimer = setInterval("nextFeature()", rotDelay);
     
     if ( currFeatureNum == 1 )
//          feature1times--;
     if (feature1times < 1 ) {
          clearTimeout(RotTimer);
     }
}

function lastFeature() {
     hideallfeatures();
     whiteoutallcontrols();
     replaceallunderlines();
     nextFeatureNum = currFeatureNum - 1;
     if ( nextFeatureNum == 0 ) nextFeatureNum = 6;
     showdiv(features[nextFeatureNum]);
     changecolor(controls[nextFeatureNum],"#DDDDDD");
     divunderline(controlnumbers[nextFeatureNum], "none");
     currFeatureNum = nextFeatureNum;
     clearTimeout(RotTimer);
     RotTimer = setInterval("nextFeature()", rotDelay);
}

function gotoFeature(featurenum) {
     hideallfeatures();
     whiteoutallcontrols();
     replaceallunderlines();
     nextFeatureNum = featurenum;
     showdiv(features[featurenum]);
     divunderline(controlnumbers[featurenum], "none");
     changecolor(controls[featurenum],"#DDDDDD");
     currFeatureNum = featurenum;
     clearTimeout(RotTimer);
     RotTimer = setInterval("nextFeature()", rotDelay);
}

function hideallfeatures() {
     hidediv(features[1]);
     hidediv(features[2]);
     hidediv(features[3]);
     hidediv(features[4]);
     hidediv(features[5]);
     hidediv(features[6]);
}

function whiteoutallcontrols() {
     changecolor(controls[1],"white");
     changecolor(controls[2],"white");
     changecolor(controls[3],"white");
     changecolor(controls[4],"white");
     changecolor(controls[5],"white");
     changecolor(controls[6],"white");
}
function replaceallunderlines() {
     divunderline(controlnumbers[1],"underline");
     divunderline(controlnumbers[2],"underline");
     divunderline(controlnumbers[3],"underline");
     divunderline(controlnumbers[4],"underline");
     divunderline(controlnumbers[5],"underline");
     divunderline(controlnumbers[6],"underline");
}

function divunderline(div, state) {
     if ( !is.ns4 ) div.textDecoration = state;
}

function pauseRotation()
{
     clearTimeout(RotTimer);
}

RotTimer = setInterval("nextFeature()", rotDelay);



function Is() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4 = (this.ns && (this.major == 4));
    this.ns5 = (this.ns && (this.major > 4));
     this.ns6	= (this.ns && (this.major == 6));
     this.ns7	= (this.ns && (agent.indexOf("netscape/7") !=-1));
     this.ns71	= (this.ns && (agent.indexOf('netscape/7.1')!=-1));
     this.ns72	= (this.ns && (agent.indexOf('netscape/7.2')!=-1));
     this.firefox	= (this.ns && (agent.indexOf('firefox')!=-1));
    this.ie = (agent.indexOf("msie") != -1);
    this.ie3 = (this.ie && (this.major == 2));
    this.ie4 = (this.ie && (this.major >= 4));
	this.ie55	= (this.ie && (this.major == 4) && (agent.indexOf("msie 5.5") != -1));
	this.ie6	= (this.ie && (agent.indexOf("msie 6.0")!=-1));
	this.cs6	= (agent.indexOf("2000 6")!=-1); // CompuServe 6.0
	this.cs7	= (agent.indexOf("cs 2000 7")!=-1); // CompuServe 7.0
    this.op3 = (agent.indexOf("opera") != -1);
    this.mac = (agent.indexOf("mac") != -1);
    this.client = ( (navigator.userAgent.indexOf('AOL')!=-1) || (navigator.userAgent.indexOf('CS 2000')!=-1) )? 1 : 0;
}


function setMyBrowser() {
   if (document.all) {
      strMyBrowser = "IE";
   } else {
      strMyBrowser = "Netscape";
   }
}

function createMyObj(divblock) {
    if (strMyBrowser == "IE") {
        return eval("document.all."+divblock+".style");
    } else if (is.ns5) {
        return document.getElementById(divblock).style;
    } else if (is.ns4) {
        return eval("document."+divblock);
    }
}

function changecolor(div,color) {
     if ( !is.ns4 ) div.background=color;         
}

function showdiv(div) {
     if (is.ns4)
        div.visibility="show";
     else 
        div.visibility="visible";
 
}
function hidediv(div) {
     if (is.ns4)
        div.visibility="hide";
     else 
        div.visibility="hidden";
 
}

