// JavaScript Document

<!--
function include(lyr, url)
{
	if(document.all)
	{
		// IE version
		try
		{
			var xml = new ActiveXObject("Microsoft.XMLHTTP");
			xml.open("GET", url, false);
			xml.send();
			document.getElementById(lyr).innerHTML = xml.responseText;
		}
		catch(e)
		{
			var xml = new ActiveXObject("MSXML2.XMLHTTP.4.0");
			xml.open("GET", url, false);
			xml.send();
			document.getElementById(lyr).innerHTML = xml.responseText;
		}
	}
	else
	{
		// Mozilla/Netscape 6+ version
		var xml = new XMLHttpRequest();
		xml.open("GET", url, false);
		xml.send(null);
		document.getElementById(lyr).innerHTML = xml.responseText;
	}
}

function checkAll(form)
{
	for(var i = 0; i < document.forms[0].elements.length; i++)
	{
		var str = document.forms[0].elements[i].name;
		if(str.indexOf(form) != -1)
		{
			if(document.forms[0].elements[i].checked == false)
			{
				document.forms[0].elements[i].checked = true;
			}
		}
	}
}

function unCheckAll(form)
{
	for(var i = 0; i < document.forms[0].elements.length; i++)
	{
		var str = document.forms[0].elements[i].name;
		if(str.indexOf(form) != -1)
		{
			if(document.forms[0].elements[i].checked == true)
			{
				document.forms[0].elements[i].checked = false;
			}
		}
	}
}

function popup(mylink, windowname)
{
	if (! window.focus) return true;
	var href;
	if (typeof(mylink) =='string')
		href = mylink;
	else
		href=mylink.href;
	window.open(href, windowname, 'width=550,height=400,status=yes,scrollbars=no');
	return false;
}

function annotation_select(type) {
	if (type == "human") {
		document.getElementById('anno_sel').innerHTML=
					'<input name="annotations_accession" type="checkbox">' + 
                    ' Accession<br>' + 
                    '<input name="annotations_image" type="checkbox">' +
                    ' Image ID<br>' +
                    '<input name="annotations_chromosome" type="checkbox">' +
                    ' Chromosome<br>' +
                    '<input name="annotations_unigene" type="checkbox">' +
                    ' Unigene<br>' +
                    '<input name="annotations_geneid" type="checkbox">' +
                    ' NCBI geneid<br>' +
                    '<input name="annotations_genesymbol" type="checkbox">' +
                    ' Gene Symbol<br>' +
                    '<input name="annotations_desc" type="checkbox">' +
                    ' Description<br>' +
                    '<input name="annotations_cytoband" type="checkbox">' +
                    ' CytoBand<br>' +
                    '<input name="annotations_refseq" type="checkbox">' +
                    ' RefseqID<br>' +
                    '<input name="annotations_swissprot" type="checkbox">' +
                    ' Swissprot ID<br>' +
                    '<input name="annotations_protrefseq" type="checkbox">' +
                    ' RefSeq Protein<br>' +
                    '<input name="annotations_omim" type="checkbox">' +
                    ' Omim ID<br>' +
                    '<input name="annotations_goid" type="checkbox">' +
                    ' GOID<br>' +
                    '<input name="annotations_pubmed" type="checkbox">' +
                    ' Pubmed ID<br>' +
                    '<input name="annotations_percentage" type="checkbox">' +
                    ' Repeats<br>';
	} 
	else if (type == "mouse") {
		document.getElementById('anno_sel').innerHTML=
					'<input name="annotations_accession" type="checkbox">' + 
                    ' Accession<br>' + 
                    '<input name="annotations_image" type="checkbox">' +
                    ' Image ID<br>' +
                    '<input name="annotations_chromosome" type="checkbox">' +
                    ' Chromosome<br>' +
                    '<input name="annotations_unigene" type="checkbox">' +
                    ' Unigene<br>' +
                    '<input name="annotations_geneid" type="checkbox">' +
                    ' NCBI geneid<br>' +
                    '<input name="annotations_genesymbol" type="checkbox">' +
                    ' Gene Symbol<br>' +
                    '<input name="annotations_mgi" type="checkbox">' +
                    ' MGI ID<br>' +
                    '<input name="annotations_desc" type="checkbox">' +
                    ' Description<br>' +
                    '<input name="annotations_cytoband" type="checkbox">' +
                    ' CytoBand<br>' +
                    '<input name="annotations_refseq" type="checkbox">' +
                    ' RefseqID<br>' +
                    '<input name="annotations_swissprot" type="checkbox">' +
                    ' Swissprot ID<br>' +
                    '<input name="annotations_protrefseq" type="checkbox">' +
                    ' RefSeq Protein<br>' +
                    '<input name="annotations_goid" type="checkbox">' +
                    ' GOID<br>' +
                    '<input name="annotations_pubmed" type="checkbox">' +
                    ' Pubmed ID<br>' +
                    '<input name="annotations_percentage" type="checkbox">' +
                    'Percent coverage of repetitive elements<br>';
	}
	else if (type == "yeast") {
		document.getElementById('anno_sel').innerHTML=
					'<input name="annotations_feature" type="checkbox">' + 
                    ' Feature<br>' + 
                    '<input name="annotations_type" type="checkbox">' +
                    ' Type<br>' +
                    '<input name="annotations_genome" type="checkbox">' +
                    ' Genomic Location<br>' +
                    '<input name="annotations_geneid" type="checkbox">' +
                    ' NCBI geneid<br>' +
                    '<input name="annotations_genesymbol" type="checkbox">' +
                    ' Gene Symbol<br>' +
                    '<input name="annotations_alias" type="checkbox">' +
                    ' Alias<br>' +
                    '<input name="annotations_accession" type="checkbox">' +
                    ' Accession<br>' +
                    '<input name="annotations_accession_pro" type="checkbox">' +
                    ' Accession Protein<br>' +
                    '<input name="annotations_swissprot" type="checkbox">' +
                    ' Swissprot ID<br>' +
                    '<input name="annotations_refseq" type="checkbox">' +
                    ' RefseqID<br>' +
                    '<input name="annotations_protrefseq" type="checkbox">' +
                    ' RefSeq Protein<br>' +
                    '<input name="annotations_goid" type="checkbox">' +
                    ' GOID<br>' +
                    '<input name="annotations_pubmed" type="checkbox">' +
                    ' Pubmed ID<br>';
	}
}

function acc_select(type) {
	head = '<label>Search by:</label> <select name="accid">';
	tail = '</select> <input name="accession" type="text"> <input type="submit"	value="Search">';
	if (type == "human") {
		options =
				  head +
				  '<option>Accession ID</option>'+
                  '<option>Unigene ID</option>'+
                  '<option>Swissprot ID</option>'+
                  '<option>Refseq ID</option>'+
                  '<option>Omim ID</option>'+
                  '<option>GO ID</option>'+
				  '<option>GO Name</option>'+
				  '<option>Gene</option>'+
				  '<option>Gene Description</option>'+
				  tail;
	} 
	else if (type == "mouse") {
		options = 
				  head +
				  '<option>Accession ID</option>'+
                  '<option>Unigene ID</option>'+
                  '<option>Swissprot ID</option>'+
                  '<option>Refseq ID</option>'+
                  '<option>GO ID</option>'+
				  '<option>GO Name</option>'+
				  '<option>Gene</option>'+
				  '<option>Gene Description</option>'+
				  tail;
	}
	
	else if (type == "yeast") {
		options = 
				  head +
				  '<option>Feature</option>'+
                  '<option>Accession ID</option>'+
                  '<option>Swissprot ID</option>'+
                  '<option>Refseq ID</option>'+
                  '<option>GO ID</option>'+
				  '<option>GO Name</option>'+
				  '<option>Gene</option>'+
				  '<option>Gene Description</option>'+
				  tail;
	}
	
	document.getElementById('ad_search_options').innerHTML= options;
}

//-->