
//function fillCategory(){ 
 // this function is used to fill the category list on load
//addOption(document.transpogene_form.Category, "Fruits", "Fruits", "");
//addOption(document.transpogene_form.Category, "Games", "Games", "");
//addOption(document.transpogene_form.Category, "Scripts", "Scripts", "");
//}

function Selectchr(){
// ON selection of category this function will work

removeAllOptions(document.transpogene_form.chr);
addOption(document.transpogene_form.chr, "choose", "Select chromosome", "");

if(document.transpogene_form.organism.value == 'human'){
addOption(document.transpogene_form.chr,"chr1", "chr1");
addOption(document.transpogene_form.chr,"chr2", "chr2");
addOption(document.transpogene_form.chr,"chr3", "chr3");
addOption(document.transpogene_form.chr,"chr4", "chr4");
addOption(document.transpogene_form.chr,"chr5", "chr5");
addOption(document.transpogene_form.chr,"chr6", "chr6");
addOption(document.transpogene_form.chr,"chr7", "chr7");
addOption(document.transpogene_form.chr,"chr8", "chr8");
addOption(document.transpogene_form.chr,"chr9", "chr9");
addOption(document.transpogene_form.chr,"chr10", "chr10");
addOption(document.transpogene_form.chr,"chr11", "chr11");
addOption(document.transpogene_form.chr,"chr12", "chr12");
addOption(document.transpogene_form.chr,"chr13", "chr13");
addOption(document.transpogene_form.chr,"chr14", "chr14");
addOption(document.transpogene_form.chr,"chr15", "chr15");
addOption(document.transpogene_form.chr,"chr16", "chr16");
addOption(document.transpogene_form.chr,"chr17", "chr17");
addOption(document.transpogene_form.chr,"chr18", "chr18");
addOption(document.transpogene_form.chr,"chr19", "chr19");
addOption(document.transpogene_form.chr,"chr20", "chr20");
addOption(document.transpogene_form.chr,"chr21", "chr21");
addOption(document.transpogene_form.chr,"chr22", "chr22");
addOption(document.transpogene_form.chr,"chrX", "chrX");
addOption(document.transpogene_form.chr,"chrY", "chrY");
}
if(document.transpogene_form.organism.value == 'mouse'){
addOption(document.transpogene_form.chr,"chr1", "chr1");
addOption(document.transpogene_form.chr,"chr2", "chr2");
addOption(document.transpogene_form.chr,"chr3", "chr3");
addOption(document.transpogene_form.chr,"chr4", "chr4");
addOption(document.transpogene_form.chr,"chr5", "chr5");
addOption(document.transpogene_form.chr,"chr6", "chr6");
addOption(document.transpogene_form.chr,"chr7", "chr7");
addOption(document.transpogene_form.chr,"chr8", "chr8");
addOption(document.transpogene_form.chr,"chr9", "chr9");
addOption(document.transpogene_form.chr,"chr10", "chr10");
addOption(document.transpogene_form.chr,"chr11", "chr11");
addOption(document.transpogene_form.chr,"chr12", "chr12");
addOption(document.transpogene_form.chr,"chr13", "chr13");
addOption(document.transpogene_form.chr,"chr14", "chr14");
addOption(document.transpogene_form.chr,"chr15", "chr15");
addOption(document.transpogene_form.chr,"chr16", "chr16");
addOption(document.transpogene_form.chr,"chr17", "chr17");
addOption(document.transpogene_form.chr,"chr18", "chr18");
addOption(document.transpogene_form.chr,"chr19", "chr19");
addOption(document.transpogene_form.chr,"chrX", "chrX");
addOption(document.transpogene_form.chr,"chrY", "chrY");
}
if(document.transpogene_form.organism.value == 'zebrafish'){
addOption(document.transpogene_form.chr,"chr1", "chr1");
addOption(document.transpogene_form.chr,"chr2", "chr2");
addOption(document.transpogene_form.chr,"chr3", "chr3");
addOption(document.transpogene_form.chr,"chr4", "chr4");
addOption(document.transpogene_form.chr,"chr5", "chr5");
addOption(document.transpogene_form.chr,"chr6", "chr6");
addOption(document.transpogene_form.chr,"chr7", "chr7");
addOption(document.transpogene_form.chr,"chr8", "chr8");
addOption(document.transpogene_form.chr,"chr9", "chr9");
addOption(document.transpogene_form.chr,"chr10", "chr10");
addOption(document.transpogene_form.chr,"chr11", "chr11");
addOption(document.transpogene_form.chr,"chr12", "chr12");
addOption(document.transpogene_form.chr,"chr13", "chr13");
addOption(document.transpogene_form.chr,"chr14", "chr14");
addOption(document.transpogene_form.chr,"chr15", "chr15");
addOption(document.transpogene_form.chr,"chr16", "chr16");
addOption(document.transpogene_form.chr,"chr17", "chr17");
addOption(document.transpogene_form.chr,"chr18", "chr18");
addOption(document.transpogene_form.chr,"chr19", "chr19");
addOption(document.transpogene_form.chr,"chr20", "chr20");
addOption(document.transpogene_form.chr,"chr21", "chr21");
addOption(document.transpogene_form.chr,"chr22", "chr22");
addOption(document.transpogene_form.chr,"chr23", "chr23");
addOption(document.transpogene_form.chr,"chr24", "chr24");
addOption(document.transpogene_form.chr,"chr25", "chr25");
}
if(document.transpogene_form.organism.value == 'chicken'){
addOption(document.transpogene_form.chr,"chr1", "chr1");
addOption(document.transpogene_form.chr,"chr2", "chr2");
addOption(document.transpogene_form.chr,"chr3", "chr3");
addOption(document.transpogene_form.chr,"chr4", "chr4");
addOption(document.transpogene_form.chr,"chr5", "chr5");
addOption(document.transpogene_form.chr,"chr6", "chr6");
addOption(document.transpogene_form.chr,"chr7", "chr7");
addOption(document.transpogene_form.chr,"chr8", "chr8");
addOption(document.transpogene_form.chr,"chr9", "chr9");
addOption(document.transpogene_form.chr,"chr10", "chr10");
addOption(document.transpogene_form.chr,"chr11", "chr11");
addOption(document.transpogene_form.chr,"chr12", "chr12");
addOption(document.transpogene_form.chr,"chr13", "chr13");
addOption(document.transpogene_form.chr,"chr14", "chr14");
addOption(document.transpogene_form.chr,"chr15", "chr15");
addOption(document.transpogene_form.chr,"chr16", "chr16");
addOption(document.transpogene_form.chr,"chr17", "chr17");
addOption(document.transpogene_form.chr,"chr18", "chr18");
addOption(document.transpogene_form.chr,"chr19", "chr19");
addOption(document.transpogene_form.chr,"chr20", "chr20");
addOption(document.transpogene_form.chr,"chr21", "chr21");
addOption(document.transpogene_form.chr,"chr22", "chr22");
addOption(document.transpogene_form.chr,"chr23", "chr23");
addOption(document.transpogene_form.chr,"chr24", "chr24");
addOption(document.transpogene_form.chr,"chr25", "chr25");
addOption(document.transpogene_form.chr,"chr26", "chr26");
addOption(document.transpogene_form.chr,"chr27", "chr27");
addOption(document.transpogene_form.chr,"chr28", "chr28");
addOption(document.transpogene_form.chr,"chrZ", "chrZ");
addOption(document.transpogene_form.chr,"chrW", "chrW");
addOption(document.transpogene_form.chr,"chrE64", "chrE64");
addOption(document.transpogene_form.chr,"chrE22C19W28_E50C23", "chrE22C19W28_E50C23");
}
if(document.transpogene_form.organism.value == 'fruit_fly'){
addOption(document.transpogene_form.chr,"chr2L", "chr2L");
addOption(document.transpogene_form.chr,"chr2R", "chr2R");
addOption(document.transpogene_form.chr,"chr2LHet", "chr2LHet");
addOption(document.transpogene_form.chr,"chr2RHet", "chr2RHet");
addOption(document.transpogene_form.chr,"chr3L", "chr3L");
addOption(document.transpogene_form.chr,"chr3R", "chr3R");
addOption(document.transpogene_form.chr,"chr3LHet", "chr3LHet");
addOption(document.transpogene_form.chr,"chr3RHet", "chr3RHet");
addOption(document.transpogene_form.chr,"chr4", "chr4");
addOption(document.transpogene_form.chr,"chrX", "chrX");
addOption(document.transpogene_form.chr,"chrXHet", "chrXHet");
addOption(document.transpogene_form.chr,"chrYHet", "chrYHet");
addOption(document.transpogene_form.chr,"chrU", "chrU");
addOption(document.transpogene_form.chr,"chrUextra", "chrUextra");
}
if(document.transpogene_form.organism.value == 'nematode'){
addOption(document.transpogene_form.chr,"chrI", "chrI");
addOption(document.transpogene_form.chr,"chrII", "chrII");
addOption(document.transpogene_form.chr,"chrIII", "chrIII");
addOption(document.transpogene_form.chr,"chrIV", "chrIV");
addOption(document.transpogene_form.chr,"chrV", "chrV");
addOption(document.transpogene_form.chr,"chrX", "chrX");
 }
if(document.transpogene_form.organism.value == 'sea_squirt'){
addOption(document.transpogene_form.chr,"chr01p", "chr01p");
addOption(document.transpogene_form.chr,"chr01q", "chr01q");
addOption(document.transpogene_form.chr,"chr02q", "chr02q");
addOption(document.transpogene_form.chr,"chr03p", "chr03p");
addOption(document.transpogene_form.chr,"chr03q", "chr03q");
addOption(document.transpogene_form.chr,"chr04q", "chr04q");
addOption(document.transpogene_form.chr,"chr05q", "chr05q");
addOption(document.transpogene_form.chr,"chr06q", "chr06q");
addOption(document.transpogene_form.chr,"chr07q", "chr07q");
addOption(document.transpogene_form.chr,"chr08q", "chr08q");
addOption(document.transpogene_form.chr,"chr09p", "chr09p");
addOption(document.transpogene_form.chr,"chr09q", "chr09q");
addOption(document.transpogene_form.chr,"chr10p", "chr10p");
addOption(document.transpogene_form.chr,"chr10q", "chr10q");
addOption(document.transpogene_form.chr,"chr12p", "chr12p");
addOption(document.transpogene_form.chr,"chr12q", "chr12q");
addOption(document.transpogene_form.chr,"chr13q", "chr13q");
addOption(document.transpogene_form.chr,"chr14p", "chr14p");
addOption(document.transpogene_form.chr,"chr14q", "chr14q");
 }
}
////////////////// 

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}

