function toggle(item) {
var obj=document.getElementById(item);
var visible=(obj.style.display!="none");
var grape="x"+item
if (visible) {
obj.style.display="none";
var strawberry=document.createTextNode("[+]");
var shortcake=document.getElementById(grape).firstChild;
document.getElementById(grape).replaceChild(strawberry,shortcake);
}
else {
obj.style.display="block";
var strawberry=document.createTextNode("[-]");
var shortcake=document.getElementById(grape).firstChild;
document.getElementById(grape).replaceChild(strawberry,shortcake);
}
}
function expand() {
divs=document.getElementsByTagName("div");
for (i=0;i<divs.length;i++) {
divs[i].style.display="block";
var grape="x"+(divs[i].id);
var strawberry=document.createTextNode("[-]");
var shortcake=document.getElementById(grape).firstChild;
document.getElementById(grape).replaceChild(strawberry,shortcake);
}
}
function close() {
divs=document.getElementsByTagName("div");
for (i=0;i<divs.length;i++) {
divs[i].style.display="none";
var grape="x"+(divs[i].id);
var strawberry=document.createTextNode("[+]");
var shortcake=document.getElementById(grape).firstChild;
document.getElementById(grape).replaceChild(strawberry,shortcake);
}
}
function numberoflinks() {
var strawberry=document.getElementsByTagName("li");
var shortcake=strawberry.length-20;
newtext="There are " + shortcake + " Sun related links on this page."
newnode=document.createTextNode(newtext);
oldnode=document.getElementById("numberlinks").firstChild;
document.getElementById("numberlinks").replaceChild(newnode,oldnode);
}
function numberofcategories() {
var strawberry=document.getElementsByTagName("ul");
var shortcake=strawberry.length-3;
newtext="There are " + shortcake + " different Sun related categories on this page."
newnode=document.createTextNode(newtext);
oldnode=document.getElementById("categories").firstChild;
document.getElementById("categories").replaceChild(newnode,oldnode);
}
function search(text) {
var searchtext=text.toLowerCase();
var resultsHref = new Array();
var resultsText = new Array();
var outputHref = new Array ();
var outputText = new Array ();
for (var a=5; a<document.links.length; a++) {
if (document.links[a].className == "paragraph") {
resultsHref[a]=document.links[a];
resultsText[a]=document.links[a].firstChild.nodeValue;
}
else {
resultsHref[a]="";
resultsText[a]="";
}
}
for (var a=5; a<document.links.length;a++) {
test1=resultsHref[a];
test2=test1.toString();
test3=test2.toLowerCase();
answer=test3.indexOf(searchtext);
if (answer != -1) {
outputHref[a]=document.links[a];
outputText[a]=document.links[a].firstChild.nodeValue;
}
else {
outputHref[a]="";
}
}
for (var a=5; a<document.links.length;a++) {
test1=resultsText[a];
test2=test1.toString();
test3=test2.toLowerCase();
answer=test3.indexOf(searchtext);
if (answer != -1) {
outputHref[a]=document.links[a];
outputText[a]=document.links[a].firstChild.nodeValue;
}
}
var resultsWindow=window.open("","","toolbar=yes, menubar=yes, location=yes, resizable=yes, scrollbars=yes, status=yes", "true");
var xhtml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
xhtml += "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
xhtml += "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">";
xhtml += "<head>";
xhtml += "<meta http-equiv=\"content-Type\" content=\"text/html; charset=UTF-8\" />";
xhtml += "<title>Sun Country Search Results</title>";
xhtml += "<link rel=\"stylesheet\" href=\"stylesheet.css\" type=\"text/css\" />";
xhtml += "<meta name=\"description\" content=\"Sun Microsystem\'s Related Links\" />";
xhtml += "<meta name=\"keywords\" content=\"Sun Microsystems Solaris Sparc Ultra Blade x86 Links\" />";
xhtml += "</head>";
xhtml += "<body>";
xhtml += "<p>";
xhtml += "Your search for " + text + " resulted in the following matches:";
xhtml += "</p>";
xhtml += "<p><br /></p>"
xhtml += "<blockquote>";
xhtml += "<ul>";
resultsWindow.document.write(xhtml);
xhtml = "";
for (a=5;a<document.links.length;a++) {
if (outputHref[a] != "") {
resultsWindow.document.write("<li><a class=\"paragraph\" href=\"" + resultsHref[a] + "\"" + ">" + resultsText[a] + "</a></li>");
}
}
xhtml  = "</ul>";
xhtml += "</blockquote>";
xhtml += "<hr />";
xhtml += "<address>This <a class=\"footerlink\" href=\"http://www.ilkda.com/\">Web Site </a> Copyright &copy; 2011<br />";
xhtml += "by <a class=\"footerlink\" href=\"mailto:webmaster@ilkda.com\">Alan Pae</a> - All Rights Reserved";
xhtml += "</address>";
xhtml += "</body>";
xhtml += "</html>";
resultsWindow.document.write(xhtml);
resultsWindow.document.close();
resultsWindow.moveTo(0,0);
resultsWindow.resizeTo(screen.width, screen.height);
resultsWindow.focus();
}

