
function insertTitle(title)
{

    var toptitle;

    toptitle = "<div class='toptitle'>";
    toptitle += "<table bgcolor='##9c0000' align='center' width='100%'";
    toptitle += " cellspacing='0' border='0'>";
    toptitle += "<tr>";
    toptitle += "<td width='20' align='center' valign='middle'>";
    toptitle += "<div align='center'><a href='/default.aspx'><img src='/images/home01c.gif'";
    toptitle += "width='16' height='16' border='0' alt='Home Page and Main Menu'></a></div>";
    toptitle += "</td>";
    toptitle += "<td>";
    toptitle += "<font face='' color='#FFFFFF'>";
    toptitle += "<div align='center'>" + title + "</div>";
    toptitle += "</font></td></tr></table></div>";
    //toptitle += "<font size='-1'>";

    document.write(toptitle);

    document.write("<span class='gentext'>");
}

function insertTitleTop(title)
{

    var toptitle;

    toptitle = "<div class='toptitle'>";
    toptitle += "<table bgcolor='##9c0000' align='center' width='100%'";
    toptitle += " cellspacing='0' border='0'>";
    toptitle += "<tr>";
    toptitle += "<td width='20' align='center' valign='middle'>";
    toptitle += "<div align='center'><a href='/default.aspx' target='_top'><img src='/images/home01c.gif'";
    toptitle += "width='16' height='16' border='0' alt='Home Page and Main Menu'></a></div>";
    toptitle += "</td>";
    toptitle += "<td>";
    toptitle += "<font face='' color='#FFFFFF'>";
    toptitle += "<div align='center'>" + title + "</div>";
    toptitle += "</font></td></tr></table></div>";
    //toptitle += "<font size='-1'>";

    document.write(toptitle);

    document.write("<span class='gentext'>");
}

function insertHomeButton()
{
     document.write("<a href='/default.aspx'><img src='/images/home01c.gif' width='16' height='16' border='0' alt='Home Page and Main Menu'></a><br>");
}

function insertBottomSection(lines)
{
    var str;

    str = "";
    for (i=0;i<lines;i++)
        str += "<p>&nbsp;</p>";

    str += "<p><hr>";
    str += "<center>";
    str += "| ";
    str += "<A HREF='/default.aspx'>&nbsp;Home Page&nbsp;</A> |";
    str += "<A HREF='/ofiles/alife.aspx'>&nbsp;Artificial Life&nbsp;</A> |";
    str += "<A HREF='/ofiles/dolls_page.aspx'>&nbsp;Dolls Gallery&nbsp;</A> |";
    str += "<A HREF='/ofiles/bi.aspx'>&nbsp;Bioinformatics&nbsp;</A> |";
    str += "<A HREF='/ofiles/experiments.aspx'>&nbsp;Experiments&nbsp;</A> |";
    str += "<A HREF='/ofiles/photos.aspx'>&nbsp;Photos&nbsp;</A> |";
    str += "<A HREF='/ofiles/misc.aspx'>&nbsp;Miscellaneous&nbsp;</A> |";
    str += "</center>";
    str += "<hr>";
    str += "<Address><B> Ariel Dolan</B><br>";
    str += "<A href='mailto:aridolan@netvision.net.il'> aridolan@netvision.net.il</A><br>";

    document.write("<font size='-1'>" + str + "</font>");
}


function insertBottomSection_ml(lines)
{
    var str;

    str = "";
    for (i=0;i<lines;i++)
        str += "<p>&nbsp;</p>";

    str += "<p><hr>";
    str += "<center>";
    str += "| ";
    str += "<A HREF='/index.html'>&nbsp;Home Page&nbsp;</A> |";
    str += "<A HREF='/ofiles/alife_ml.html'>&nbsp;Artificial Life&nbsp;</A> |";
    str += "<A HREF='/ofiles/dolls_ml.html'>&nbsp;Dolls Gallery&nbsp;</A> |";
    str += "<A HREF='/ofiles/bi.aspx'>&nbsp;Bioinformatics&nbsp;</A> |";
    str += "<A HREF='/ofiles/experiments_ml.html'>&nbsp;Experiments&nbsp;</A> |";
    str += "<A HREF='/ofiles/misc_ml.html'>&nbsp;Miscellaneous&nbsp;</A> |";
    str += "</center>";

    str += "<hr>";
    str += "<Address><B> Ariel Dolan</B><br>";
    str += "<A href='mailto:aridolan@netvision.net.il'> aridolan@netvision.net.il</A><br>";

    document.write("<font size='-1'>" + str + "</font>");
}

function insertBottomSection_nu(lines)
{
    var str;

    str = "";
    for (i=0;i<lines;i++)
        str += "<p>&nbsp;</p>";

    str += "<p><hr>";
    str += "<center>";
    str += "| ";
    str += "<A HREF='/default.aspx'>&nbsp;Home Page&nbsp;</A> |";
    str += "<A HREF='/ofiles/alife.aspx'>&nbsp;Artificial Life&nbsp;</A> |";
    str += "<A HREF='/ofiles/dolls_page.aspx'>&nbsp;Dolls Gallery&nbsp;</A> |";
    str += "<A HREF='/ofiles/bi.aspx'>&nbsp;Bioinformatics&nbsp;</A> |";
    str += "<A HREF='/ofiles/experiments.aspx'>&nbsp;Experiments&nbsp;</A> |";
    str += "<A HREF='/ofiles/photos.aspx'>&nbsp;Photos&nbsp;</A> |";
    str += "<A HREF='/ofiles/misc.aspx'>&nbsp;Miscellaneous&nbsp;</A> |";
    str += "</center>";

    str += "<hr>";
    str += "<Address><B> Ariel Dolan</B><br>";
    str += "<A href='mailto:aridolan@netvision.net.il'> aridolan@netvision.net.il</A><br>";

    document.write("<font size='-1'>" + str + "</font>");
}

function openWin(fileName, width, height)
{

DispWin=window.open(fileName,"DispWin", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=auto, resizable=no, dependent, height=" + height + ",width=" + width + ", left=100, top=100") 

}

function hoverin(id)
{
    document[id].src="/images/ballred.gif";
}

function hoverout(id)
{
    document[id].src="/images/ballgray.gif";
}

function gap(num)
{
    for (i=0;i<num;i++)
        document.write("&#160;");
}

function setSimpleCookie(value)
{
    document.cookie = value;
}

function getSimpleCookie()
{
    return(document.cookie);
}

function reloadMap_Old(name)
{
    name = "Static" + name + ".xml";
    window.location.href = name;
}

function reloadMap_ns()
{
    alert("XML feature, not active in this Html version");
}

function onLoadMap1()
{

    if (navigator.appName == "Microsoft Internet Explorer" &&             navigator.appVersion.indexOf("5") != -1) 
        document.location.href = "/xml/Static_map1.xml"; 
    else   
    {
        alert("This page can be loaded into MSIE5 Only");
        document.location.href = "/xml/xml.html";
    }
    
}


function onLoadMap2()
{

    if (navigator.appName == "Microsoft Internet Explorer" &&             navigator.appVersion.indexOf("5") != -1) 
    {
    master = new ActiveXObject("Microsoft.XMLDOM");
    master.async = false;
    master.load("Static.xml");
    if (master.parseError != 0) alert(master.parseError.reason);

    main = new ActiveXObject("Microsoft.XMLDOM");
    main.async = false;
    main.load("map2_main.xsl");
    if (main.parseError != 0) alert(main.parseError.reason);

    subs = new ActiveXObject("Microsoft.XMLDOM");
    subs.async = false;
    subs.load("map2_subs.xsl");
    if (subs.parseError != 0) alert(subs.parseError.reason);

    desc = new ActiveXObject("Microsoft.XMLDOM");
    desc.async = false;
    desc.load("map2_desc.xsl");
    if (desc.parseError != 0) alert(desc.parseError.reason);

    document.all.item("mainsections").innerHTML = master.transformNode(main);
    document.all.item("subsections").innerHTML = master.transformNode(subs);
    document.all.item("sectiondesc").innerHTML = master.transformNode(desc);

    testsubs = subs.selectSingleNode("//@test");
    testdesc = desc.selectSingleNode("//@test");
    }
    else
    {
        alert("This page can be loaded into MSIE5 Only");
        document.location.href = "/xml/xml.html";
    }

}

  function reloadMap(Code)
  {

    if (Code == "0") {
        testsubs.value = ".[Code $ge$ '0' $and$ Code $lt$ '10']";
        testdesc.value = "Code[. $eq$ '0']"
    }
    else
    if (Code == "1") {
        testsubs.value = ".[Code $ge$ '1' $and$ Code $lt$ '20']";
        testdesc.value = "Code[. $eq$ '1']"
    }
    else
    if (Code == "2") {
        testsubs.value = ".[Code $ge$ '2' $and$ Code $lt$ '30']";
        testdesc.value = "Code[. $eq$ '2']"
    }
    else
    if (Code == "3") {
        testsubs.value = ".[Code $ge$ '3' $and$ Code $lt$ '40']";
        testdesc.value = "Code[. $eq$ '3']"
    }
    else
    if (Code == "4") {
        testsubs.value = ".[Code $ge$ '4' $and$ Code $lt$ '50']";
        testdesc.value = "Code[. $eq$ '4']"
    }
    else
    if (Code == "5") {
        testsubs.value = ".[Code $ge$ '5' $and$ Code $lt$ '60']";
        testdesc.value = "Code[. $eq$ '5']"
    }
    else
    if (Code == "6") {
        testsubs.value = ".[Code $ge$ '6' $and$ Code $lt$ '70']";
        testdesc.value = "Code[. $eq$ '6']"
    }

    document.all.item("subsections").innerHTML = master.transformNode(subs);
    document.all.item("sectiondesc").innerHTML = master.transformNode(desc);

  }

function updateDescription(provider,desc) {

    document.all.item('descid').innerHTML = 
"<div align='center' class='desctitle'>" + provider + "</div>" 
+ "<p>" + "<b>" + desc + "</b>";

}


function EscapeFrames() {
    if (window != top) top.location.href = location.href;
}

function IsMsie4() {
    var isIe4;

    isIe4 = false;
    if (parseInt(navigator.appVersion) >= 4) {
        if (navigator.appName == "Microsoft Internet Explorer") {
            isIe4 = true;
        }
    }
    
    return isIe4;
}


function setFrames() {

    txt = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>";
    txt += "<html><head>";
    txt += "<title>Mailing Lists Searchable Database - Main Page</title>";
    txt += "<frameset ID='fset' frameborder='1' border='1' rows='65%,*'>";
    txt += "<frame name='top' src='/maillists/mlform.asp' scrolling='auto'  border='1'>";
    txt += "<frame name='bottom' src='/maillists/mlbody.html' scrolling='auto'  border='1'>";
    txt += "</frameset></head><body></body></html>";

    document.write(txt);
}

function GoMlframes() {

    if (IsMsie4()) {
        window.location.href = "/maillists/mlframes.html";
    }
    else {
        window.location.href = "/maillists/mlframes_ns.html";
    }
 
}

function putPre(txt) {

	txt = txt.replace(/</g,"&lt;"); 
	txt = txt.replace(/>/g,"&gt;<br>");
	txt = "<pre>" + txt + "</pre>";
	
	return txt;

}


function getSmxml() {
var txt, inner;

	//if (document.all) {
	//	txt = "<iframe id='iframe_xml' width='95%' height='70%'  frameborder=2 scrolling=yes src='sm.xml'></iframe>"
	//	document.all.item("smxml").innerHTML = txt;
	//}
	//else
	//{
		txt = "<iframe id='iframe_xml' width='95%' height='70%' src='sm.txt'></iframe>"
		document.getElementById("smxml").innerHTML = txt;  
	//}
	
}


function getSmhlp() {
var txt, inner;

	//if (document.all) {
	//	txt = "<iframe id='iframe_xml' width='95%' height='70%' src='smhlp.html'></iframe>"
	//	document.all.item("smxml").innerHTML = txt;
	//}
	//else
	//{
		txt = "<iframe id='iframe_xml' width='95%' height='70%' src='smhlp.html'></iframe>"
		document.getElementById("smxml").innerHTML = txt;  
	//}
	
}

function ToggleTree() {
	
	txt1 = "<cc1:TreeLink id='TreeLink1' runat='server' QueryID='xml' TemplatePath='~/SmartLinks/esTree.ascx' XmlDataSource='~/tree.xml'></cc1:TreeLink></div>";
	txt2 = "1234";
	
	//document.all.item("leftpanel").innerHTML = txt1;
	TreeLink1.Visible = !TreeLink1.Visible;
	
}

function UpdateHeaderTitle(txt) {
	//document.all.item("PageTitle").innerHTML = txt;
	
	d = document.getElementById("PageTitle");
	d.innerHTML = txt;
}

	
function testJavaVersion() {

	var jv = "";
	jv = document.getjv.jv;

	var txt;
	if (jv.indexOf("1.4") >= 0) 
	{
		txt = "Your current Java version is: " + jv;
		txt += "\n\nThe examples of GA Playground function properly";
		txt += "\nonly with Java versions prior to 1.4, sorry";
		txt += "\n\nYou can still run the examples in Application mode";
		txt += "\nwith an older Java version (downloadable from Sun archive)";		
		alert(txt);
	}
	
}

function UpdateBottomSection(lines)
{
    var str;

    str = "";
    for (i=0;i<lines;i++)
        str += "<p>&nbsp;</p>";

    str += "<p><hr>";
    str += "<div align='center'>";
    str += "| ";
    str += "<A HREF='/default.aspx'>&nbsp;Home Page&nbsp;</A> |";
    str += "<A HREF='/ofiles/alife.aspx'>&nbsp;Artificial Life&nbsp;</A> |";
    str += "<A HREF='/ofiles/dolls_page.aspx'>&nbsp;Dolls Gallery&nbsp;</A> |";
    str += "<A HREF='/ofiles/bi.aspx'>&nbsp;Bioinformatics&nbsp;</A> |";
    str += "<A HREF='/ofiles/experiments.aspx'>&nbsp;Experiments&nbsp;</A> |";
    str += "<A HREF='/ofiles/photos.aspx'>&nbsp;Photos&nbsp;</A> |";
    str += "<A HREF='/ofiles/misc.aspx'>&nbsp;Miscellaneous&nbsp;</A> |";
    str += "</div>";

	str += "<div align='left'>";
    str += "<hr>";
    str += "<Address><B> Ariel Dolan</B><br>";
    str += "<A href='mailto:aridolan@netvision.net.il'> aridolan@netvision.net.il</A><br>";
    str += "</div>";

    if (document.all)
    	document.write("<font size='-1'>" + str + "</font>");
    
}

function openFileWindow(filename) {
	var x = window.open(filename,'Help','height=400,width=700,left=20,top=20,scrollbars=yes');
	x.focus();
}
