var popUpWin = null;
function isBlank(q) {
    var whitespace = new String(" \t\n\r");

    for (var i = 0; i<q.length; i++) {
        if (whitespace.indexOf(q.charAt(i)) == -1) {
            return false;
        } 
    }
    
    return true;
}
function ask(question){
	if (question==null) {
		if (document.layers){
			question=document.topform.document.questionForm.question.value;
		}
		else {
			 question=document.questionForm.question.value;
		}
	}	
	
	if (isBlank(question))
		return;		
				
	popUpWin = window.open('http://206.47.130.232/popup/frameset.jsp?question='+escape(question)+'&interfaceID=1','pop','width=530,height=400,screenX=125,screenY=90,left=250,top=150,scrollbars=no,resize=no');
	popUpWin.focus();
}
function submitForm(thisForm){

	if (isBlank(thisForm.question.value))
		return false;
		
	ask(thisForm.question.value);
	return false;
}
function topQuestions(){
	popUpWin = window.open('http://206.47.130.232/popup/frameset.jsp?mode=topQ&interfaceID=1','pop','width=530,height=400,screenX=125,screenY=90,left=250,top=150,scrollbars=no,resize=no');
	popUpWin.focus();	
}
