ns = (document.layers)? true:false
ie = (document.all)? true:false
quizBarON = false;

var BAR_SIZE;
var QUIZ_ICON_SIZE;
var SCREEN_WIDTH;
var BAR_LIMIT;
var DELAY = 1;
var INCREMENT = 20;

function init() {
	BAR_SIZE = 300; //bar size
	QUIZ_ICON_SIZE = 406 //where to start the slider
	BAR_LIMIT =  644 //where to end the slider
    if (ns) {
		sliddingBarProperties = document.sliddingBarPropertiesDiv;
    }
    if (ie) {
        sliddingBarProperties = sliddingBarPropertiesDiv.style;
    }
    if (ns || ie) {
		sliddingBarProperties.left = QUIZ_ICON_SIZE - BAR_SIZE ;
    }
}

function slide() {
	if( quizBarON ) {
		slideBarIn();
		quizBarON = false;
	}
	else {
		slideBarOut();
		quizBarON = true;
	}
}

function slideBarOut() {
	temp = parseInt(sliddingBarProperties.left);
    if (temp < (BAR_LIMIT - BAR_SIZE)) {
		temp += INCREMENT;
        sliddingBarProperties.left = temp; 
        setTimeout("slideBarOut()", DELAY)
    }
}

function slideBarIn() {
	temp = parseInt(sliddingBarProperties.left);
    if (temp > QUIZ_ICON_SIZE - BAR_SIZE ) {
		temp -= INCREMENT;
        sliddingBarProperties.left = temp; 
        setTimeout("slideBarIn()", DELAY)
    }
}

