// JavaScript Document

//check browser type and set necessary variables.
if(navigator.appName == "Netscape"){
	displayValue = "table-row";
} else {
	displayValue = "inline";
}
function checkFrame() {
	if(window.self != window.top){
		top.location.href = 'index.asp';
	}
}

//script to change top window location.
function goTo(location) {
	window.parent.location.href = location;
}

//function to expand/collapse rows
function expandThis(rowCount) {
	row2change = document.getElementById('row'+rowCount)
	btn2change = document.getElementById("expandbtn"+rowCount);
	if(btn2change.value == "+"){
		row2change.style.display = displayValue;
		btn2change.value = "-";
	} else {
		row2change.style.display = "none";
		btn2change.value = "+";
	}
}

//function to expand/collapse ALL rows
function expandAll(totalRows){
	expallbtn = document.getElementById('expandallbtn');
	expallbtn2 = document.getElementById('expandallbtn2');
	if(expallbtn.value == "+"){
		displayStyle = displayValue;
		btnStyle = "-";
		expallbtn.value = "-";
		expallbtn2.value = "-";
	} else {
		displayStyle = "none";
		btnStyle = "+";
		expallbtn.value = "+";
		expallbtn2.value = "+";
	}
	i = 0
	while(document.getElementById('row'+i) != null){
	//for(i = 0; i <= totalRows; i++){
		btn2expand = document.getElementById('row'+i);
		btn2change = document.getElementById("expandbtn"+i);
		btn2expand.style.display = displayStyle;
		btn2change.value = btnStyle;
		i++;
	}
}
/*
	Lorenzo Sotelo				Date:07/24/2007
	DESC:	Added filterGroup in the paramaters
*/
function showResponseWindow(SurveyID,QuestionID,AnswerID,Total,PercentTotal,q_type,filterGroup,source) {
	/*************************************************************************************
	   TEST CODE
	//window.showModalDialog("show_filters.asp","","dialogTop:15px;dialogLeft:15px;dialogHeight:450px;dialogWidth:450px;center:no;help:no;edge:raised;");
	//alert("Show_Ordinal_Others.asp?SurveyID=" + SurveyID + "&QuestionID=" + QuestionID + "&AnswerID=" + AnswerID + "&Total=" + Total  + "&PercentTotal=") // & "&Total=" + Total + "&PercentTotal=" + PercentTotal);
	//var ResponseWindow = window.open("test4.asp","myName");
	//	ResponseWindow.focus();
	**************************************************************************************/
	
//	var ResponseWindow = window.open("Show_Ordinal_Others.asp?SurveyID=" + SurveyID + "&QuestionID=" + QuestionID + "&AnswerID=" + AnswerID + "&Total=" + Total + "&PercentTotal=" + PercentTotal + "&q_type=" + q_type,"_ordinalOthers","top=15 left=15 width=550 height=500 scrollbars=yes location=no menubar=no");
	var ResponseWindow = window.open("Show_Ordinal_Others.asp?SurveyID=" + SurveyID + "&QuestionID=" + QuestionID + "&AnswerID=" + AnswerID + "&Total=" + Total + "&PercentTotal=" + PercentTotal + "&q_type=" + q_type + "&filterGroup=" + filterGroup + "&Source=" + source,"_ordinalOthers","top=15 left=15 width=550 height=500 scrollbars=yes location=no menubar=no");
	return false;
}
/*************************************************************************************
'  Used in Export Feature(export-xls.asp and export-ppt.asp)
**************************************************************************************/
function breakProcess() {
	window.history.go(-1);
}



