doStuff = function() {	
//if (document.getElementById("scrollcontent")){
//	startScroll();
//}

// Reads cookie and sets the font size ::


// start of the drop down script
// this is a modified version of the Suckerfish Dropdown by Patrick Griffiths and Dan Webb
// The other half of this is happening in the stylesheet
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {

// creating and adding the menu arrows

//toggleImage = document.createElement("img");
//toggleImage.setAttribute("class", "navicon");
//toggleImage.setAttribute("alt", "");
//toggleImage.src = "/images/close.gif";
//node.insertBefore(toggleImage, node.firstChild);

// this adds the .over class to menus for browsers that don't get the CSS
if (document.all&&document.getElementById) {
node.onmouseover=function() {
this.className+=" over";
}

node.onmouseout=function() {
this.className=this.className.replace(" over", "");

}
}
}
}
}



// adds the class attribute to the body tag
function setSize(){
var theBody = document.body;
var theClass;
theClass = ReadCookie('setfontsize');
// this is for the difference between IE and other browsers
if (theBody.hasAttribute){
theBody.setAttribute("class", theClass);
}
else {
theBody.setAttribute("className", theClass);
}
}

// reads the cookie
function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

// sets the cookie
function setCookie(size){
expireDate = new Date;
var cookiename = "setfontsize";
var expires = expireDate.setTime(expireDate.getTime() + 24 * 60 * 60 * 1000);
var path = "/";
var domain;// = ".qld.gov.au";
var secure;
var theCookie = cookiename + "=" + escape(size) +
 ((expires) ? "; expires=" + expireDate.toGMTString() : "") +
 ((path) ? "; path=" + path : "") +
 ((domain) ? "; domain=" + domain : "") + 
 ((secure) ? "; secure" : "");
document.cookie = theCookie;
setSize();
}


//////////////////////////
// scroller script //

var speed = "2";

var divHeight;

function startScroll(){


scrollerDiv = document.getElementById("scrollcontent");
featureDiv = document.getElementById("newscolumn");

divHeight = parseInt(scrollerDiv.offsetHeight);
scrollerDiv.style.top = (50 + "px");

setTimeout("scrollMe()",1500);


}


function scrollMe(){

divHeight = parseInt(scrollerDiv.offsetHeight);

scrollerDiv.onmouseover = function () {speed = "0"}
scrollerDiv.onmouseout = function () {speed = "2"}

if (featureDiv.style.overflow != "scroll"){
scrollerDiv.style.top = (parseInt(scrollerDiv.style.top)-speed) + "px";
}

if (parseInt(scrollerDiv.style.top)<divHeight*(-1)){
scrollerDiv.style.top = 100 + "px";
}

setTimeout("scrollMe()",80)
}



//////////////////////////


window.onload=doStuff;

