function goTo_results_IRAK4() { window.location = "results_IRAK4.html"; }
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}


function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}


function ViewAnno() {

    help_window3 = window.open("/include/help/hAnno.htm", "help_window3", getWinProps("Anno"));

	help_window3.focus();

}

function ViewDBSearchRules() {

	help_window9 = window.open("/include/help/hDBSearchRules.htm", "help_window9", getWinProps("DBSearchRules"));

	help_window9.focus();

}

function ViewOrthologs() {

    help_window1 = window.open("/gbrowse/include/help/hOrthologs.htm", "help_window1", getWinProps("Orthologs"));

	help_window1.focus();

}

function ViewDLSearchResults() {

    help_window5 = window.open("/include/help/hDLSearchResults.htm", "help_window5", getWinProps("DLSearchResults"));

	help_window5.focus();

}

function ViewFuncClass() {

    help_window2 = window.open("/include/help/hFuncClass.htm", "help_window2", getWinProps("FuncClass"));

	help_window2.focus();

}

function ViewBlastHelp() {

    help_window2 = window.open("/include/help/hBlast.htm", "help_window2", getWinProps("BlastHelp"));

	help_window2.focus();

}

function ViewFilterHelp() {

    help_window2 = window.open("/include/help/hBlastFilter.htm", "help_window2", getWinProps("FilterHelp"));

	help_window2.focus();

}

function ViewFastaHelp() {

    help_window2 = window.open("/include/help/hFasta.htm", "help_window2", getWinProps("Fasta"));

	help_window2.focus();

}

function ViewFuncClassU() {

	help_window2_1 = window.open("/include/help/hFuncClassU.htm", "help_window2_1", getWinProps("FuncClassU"));

	help_window2_1.focus();

}

function ViewLocalizationClasses() {

	help_window2_1 = window.open("/include/help/hLocalizationClass.htm", "help_window2_1", getWinProps("LocalizationClass"));

	help_window2_1.focus();

}



function ViewExact() {

    help_window4 = window.open("./include/help/hExact.html", "help_window4", getWinProps("Exact"));

	help_window4.focus();

}



function ViewBlastCompare() {

    help_window4 = window.open("/include/help/hBlastCompare.htm", "help_window4", getWinProps("BlastCompare"));

	help_window4.focus();

}



function ViewOperonFindingSoftware() {

	help_window4 = window.open("/include/help/hOperonFindingSoftware.htm", "help_window4", getWinProps("OperonFindingSoftware"));

	help_window4.focus();

}

function ViewCOG() {

	help_window2_1 = window.open("/include/help/hCOG.htm", "help_window2_1", getWinProps("COG"));

	help_window2_1.focus();

}

function ViewPFAM() {

	help_window2_1 = window.open("/include/help/hPFAM.htm", "help_window2_1", getWinProps("PFAM"));

	help_window2_1.focus();

}



function ViewTIGRFAM() {

	help_window2_1 = window.open("/include/help/hTIGRFAM.htm", "help_window2_1", getWinProps("TIGRFAM"));

	help_window2_1.focus();

}



function ViewAlignment() {

	help_window2_1 = window.open("/include/help/hAlignment.htm", "help_window2_1", getWinProps("Alignment"));

	help_window2_1.focus();

}



function ViewGO() {

	help_window2_1 = window.open("/include/help/hGO.htm", "help_window2_1", getWinProps("GO"));

	help_window2_1.focus();

}



function ViewLocRating() {

    help_window4 = window.open("/include/help/hLocRating.htm", "help_window4", getWinProps("LocRating"));

	help_window4.focus();

}

function ViewProtNameRating() {

    help_window1 = window.open("/include/help/hProtNameRating.htm", "help_window1", getWinProps("ProtNameRating"));

	help_window1.focus();

}

function ViewCompareAnnotations() {

    help_window1 = window.open("/include/help/hCompareAnnotations.htm", "help_window1", getWinProps("CompareAnnotations"));

	help_window1.focus();

}

function ViewPA() {

    help_window1 = window.open("/include/help/hPA.htm", "help_window1", getWinProps("PA"));

	help_window1.focus();

}

function ViewReorder() {

	help_window6 = window.open("/include/help/hReorder.htm", "help_window6", getWinProps("DBSearchRules"));

	help_window6.focus();

}

function ViewUpdatesRules() {

	help_window7 = window.open("/include/help/hUpdatesRules.htm", "help_window7", getWinProps("UpdatesRules"));

	help_window7.focus();

}

function checkUncheckAll(theElement) {
     var theForm = theElement.form, z = 0;
	 for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
	  theForm[z].checked = theElement.checked;
	  }
     }
}

function getWinProps(param) {

        var width = screen.width;

        var height = screen.height;

        var posX = (width / 2) - 175;

        var posY = (height / 2) - 220;

		var winprop;

		switch (param) 

		{	case "Anno":

				winprop = "width=450,height=150,scrollbars=0";

				break; 

			case "DBSearchRules":

				winprop = "width=500,height=440,scrollbars=1";

				break;

			case "DLSearchResults":

				winprop = "width=450,height=150,scrollbars=0";

				break;

			case "FuncClass":

				winprop = "width=450,height=500,scrollbars=1";

				break; 

			case "FuncClassU":

				winprop = "width=450,height=500,scrollbars=1";

				break;
	
			case "Orthologs":

				winprop = "width=500,height=600,scrollbars=1";

				break; 
	
			case "LocalizationClass":

				winprop = "width=500,height=600,scrollbars=1";

				break;

			case "LocRating":

				winprop = "width=500,height=600,scrollbars=1";

				break; 

			case "ProtNameRating":

				winprop = "width=500,height=400,scrollbars=0";

				break; 

			case "Alignment":

				winprop = "width=500,height=350,scrollbars=0";

				break; 

			case "PA":

				winprop = "width=400,height=200,scrollbars=0";

				break; 

			case "COG":

				winprop = "width=500,height=250,scrollbars=0";

				break; 

			case "Fasta":

				winprop = "width=600,height=300,scrollbars=0";

				break; 

			case "GO":

				winprop = "width=500,height=300,scrollbars=0";

				break; 

			case "Exact":

				winprop = "width=400,height=200,scrollbars=0";

				break; 

			case "BlastCompare":

				winprop = "width=400,height=400,scrollbars=0";

				break; 

			case "OperonFindingSoftware":

				winprop = "width=400,height=200,scrollbars=0";

				break; 

			case "BlastHelp":

				winprop = "width=400,height=425,scrollbars=0";

				break; 

			case "FilterHelp":

				winprop = "width=500,height=450,scrollbars=1";

				break; 				

			case "PFAM":

				winprop = "width=500,height=300,scrollbars=0";

				break; 

			case "TIGRFAM":

				winprop = "width=500,height=300,scrollbars=0";

				break; 

			case "CompareAnnotations":

				winprop = "width=500,height=300,scrollbars=1";

				break;

			case "Reorder":

				winprop = "width=450,height=300";

				break;

			case "UpdatesRules":

				winprop = "width=500,height=440,scrollbars=1";

				break;

			default:

				// Error occured, do nothing

				break; 

		}	

		winprop += ",top=" + posY + ",left=" + posX + ";resizable=1"

        return winprop;

}
//JS for horizontal top scroll for results page
var doScroll = false;
var direction;
var div;
function startScrolling(dir, divName)
{
  doScroll = true;
  ScrollBy(dir, divName);
}
function stopScrolling()
{
  doScroll = false;
}
function ScrollBy(dir, divName){
		var obj = document.getElementById(divName);
        var left = obj.scrollLeft;
		direction = dir;
		div = divName;
        if (dir =='left')
           obj.scrollLeft = left - 30;
        else
           obj.scrollLeft = left + 30; 
		if (doScroll)
		    setTimeout('ScrollBy(direction,div)', 100);   
}
function displayScrollOption(divName){
	var obj = document.getElementById(divName);
	if(obj.scrollWidth > obj.clientWidth){
		document.getElementById('scrollOption').style.display = "block";
	}
}
