<!--
//<![CDATA[

var linkClicked = 0;

function getBrowserType(){
    var agt = navigator.userAgent.toLowerCase();
    var isIE = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var isFF = (agt.indexOf("firefox") != -1);
    
    if(isIE) return "msie";
    else if(isFF) return "FF";
    else return "";
}

function setFocused(elem){
    if(getBrowserType() == "FF") {
        elem.focused = true;
    }
}

function setBlured(elem){
    if(getBrowserType() == "FF") {
        elem.focused = false;
    }
}


function gotoLink(url) {
    if (!linkClicked) {
        document.location.href=url;
        linkClicked = 1;
    }
}

function gotoLinkBlank(url) {
    window.open(url);
}

function checkKey(){
    var keycode;
    if (window.event) {
        keycode = window.event.keyCode;
        if (keycode == 13) {
            document.small_login_form.submit();
            event.returnValue=false;
        }
    }
}


// Search Functions
function qEnter() {
    q = document.forms['search_form']['q'];
    if (q && q.value == "Topic search...") {
        q.value = '';
    }
    q.style.color = '#000000';
}
    
function qExit() {
    q = document.forms['search_form']['q'];
    if (q && q.value == '') {
        q.value = "Topic search...";
        q.style.color = '#999999';
    }
}
        
function prepareSearch() {
    q = document.forms['search_form']['q'];
    if (q && q.value == "Topic search...") {
        q.value = '';
    }
}


// Login - Fade In Functions
function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;
	var object = document.getElementById(id).style;
    //Fade Out
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        } 
		setTimeout("setDisplay('" + id + "','none')",150);
	//Fade In
    } else if(opacStart < opacEnd) {
		object.display = 'block';
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
     var object = document.getElementById(id).style;
     object.opacity = (opacity / 100);
     object.MozOpacity = (opacity / 100);
     object.KhtmlOpacity = (opacity / 100);
     object.filter = "alpha(opacity=" + opacity + ")";
} 

function setDisplay(id,display){
    if ((getBrowserType() == "msie") && (display == "table")) display = "block"
    var object = document.getElementById(id).style;
    object.display = display;
}

function writeToDiv(divID,text){
    document.getElementById(divID).innerHTML = text;
}
// Limit Charachters in Text Input Area


function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
        alert("You have reached the maximum number of characters allowed.");
	} else {
        writeToDiv(limitCount,limitNum - limitField.value.length);
	}
}

// Open Window
var URL,width,height,scroll,menubar,toolbar,loc,resize,xPos,yPos,newWin,winName,center,alignRight;
function openWin(URL,width,height,scroll,menubar,loc,toolbar,resize,xPos,yPos,winName,center,alignRight,fullscreen){
	var focusFail = false;
	if (width == "") width = screen.availWidth;
	if (height == "") height = screen.availHeight;
	if (loc == "") loc = "no";
	if (scroll == "") scroll = "auto";
	if (menubar =="") menubar = "no";
	if (toolbar == "") toolbar = "no";
	if (resize == "") resize = "yes";
	if (xPos == "") xPos = "5";
	if (yPos == "") yPos = "5";
	if (winName == "") winName = "win";
	if (center == 'yes'){
		var centerWidth = screen.availWidth/2;
		var centerHeight = screen.availHeight/2;
		tempW = width/2;
		tempH = height/2;
		xPos = centerWidth - tempW;
		yPos = centerHeight - tempH;
	}
	if (alignRight == "yes") xPos = screen.availWidth - width - 7;
	if (fullscreen == "yes"){
		xPos = 0;
		yPos = 0;
		if (navigator.appVersion.indexOf("mac") == 1){
			width = screen.availWidth;
			height = screen.availHeight;
		} else {
			width = screen.availWidth - 7;
			height = screen.availHeight - 20;
		}
	}
	var features ="width=" +width+ ",height=" +height+ ",loc=" +loc+ ",scrollbars=" +scroll+ ",menubar=" +menubar+ ",toolbar=" +toolbar+ ",resizable=" +resize+ ",left=" +xPos+ ",top=" +yPos;
 	newWin = window.open(URL,winName,features);
	if (navigator.appVersion.indexOf("NT")!= -1){
		if (navigator.appVersion.indexOf("NT 5")!= -1){
			focusFail = false;
		} else if (ie4 == true)	focusFail = true;
	}
	if (focusFail == false){
		if (window.focus) newWin.focus();
	}
}

//]]>
-->