// JavaScript Document
var submenu=new Array()

//Set submenu contents. Expand as needed. For each content, make sure everything exists on ONE LINE. Otherwise, there will be JS errors.
 
submenu[0]='<font size="2" face="Verdana"><b><a href="http://www.javascriptkit.com/cutpastejava.shtml">Scripts</a> | <a href="http://www.javascriptkit.com/javaindex.shtml">JS tutorials</a> | <a href="http://www.javascriptkit.com/javatutors/index.shtml">Advanced JS tutorials</a> | <a href="http://www.javascriptkit.com/java/">Applets</a> | <a href="http://www.javascriptkit.com/howto/">Web Tutorials</a></b></font>'

submenu[1]='<font size="2" face="Verdana"><b><a href="http://freewarejava.com/applets/index.shtml">Applets</a> | <a href="http://freewarejava.com/tutorials/index.shtml">Tutorials</a> | <a href="http://freewarejava.com/javasites/index.shtml">Sites and Zines</a> | <a href="http://freewarejava.com/jsp/index.shtml">JSP</a></b></font>'

//Set delay before submenu disappears after mouse moves out of it (in milliseconds)
var delay_hide=500

/////No need to edit beyond here

var menuobj=document.getElementById("p7TPcontent");

function msg(str){
	//alert(str);
	menuobj.innerHTML=p7tpc1_1;
}

function showit(which){
	clear_delayhide()
	thecontent=(which==-1)? "" : submenu[which]
	if (document.getElementById||document.all)
		menuobj.innerHTML=thecontent
	else if (document.layers){
		menuobj.document.write(thecontent)
		menuobj.document.close()
	}
}

function resetit(e){
	if (document.all&&!menuobj.contains(e.toElement))
		delayhide=setTimeout("showit(-1)",delay_hide)
	else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		delayhide=setTimeout("showit(-1)",delay_hide)
}

function clear_delayhide(){
	if (window.delayhide)
		clearTimeout(delayhide)
}

function contains_ns6(a, b) {
	while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
	return false;
}

function toggleLayer(id){
	if (document.getElementById){
		obj = document.getElementById(id);
		if (obj.style.display == "none"){
			obj.style.display = "block";
		} else {
			obj.style.display = "none";
		}
	}
}

function toggle_visibility(tabId1, tabId2, tabId3, id, hideId1,hideId2) { /**/
 var tId1 = document.getElementById(tabId1); 
 var tId2 = document.getElementById(tabId2); 
 var tId3 = document.getElementById(tabId3); 
 var e = document.getElementById(id); 
 var e1 = document.getElementById(hideId1); 
 var e2 = document.getElementById(hideId2); 

 tid2.style.visibility = 'hidden'; 
 tId2.style.display = "none";
 tid3.style.visibility = 'hidden'; 
 tId4.style.display = "none";
 e1.style.visibility = 'hidden'; 
 e1.style.display = "none";
 e2.style.visibility = 'hidden'; 
 e2.style.display = "none";


 if(tId1.style.visibility == 'visible') 
 {
  tId1.style.visibility = 'hidden'; 
	tId1.style.display = "none";
 }
 else 
 {
  tId1.style.visibility = 'visible'; 
	tId1.style.display = "block";
 }


 if(e.style.visibility == 'visible') 
 {
  e.style.visibility = 'hidden'; 
	e.style.display = "none";
 }
 else 
 {
  e.style.visibility = 'visible'; 
	e.style.display = "block";
 }
} 

/*Change the text of a DIV element*/
function changeText(classdesc, str){
	document.getElementById(classdesc).innerHTML = str;
}

function validateEmail(form_id,email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.forms[form_id].elements[email].value;
   if(reg.test(address) == false) {
      alert('Invalid Email Address');
      return false;
   }
}


/*Change the image of a DIV element*/
function changeMinMaxImg(id, img){
	obj = document.getElementById(id);
	if (obj.style.display == "none")
	{
		document.getElementById(img).src='../images/menuplus.png';
	} 
	else
	{
		document.getElementById(img).src='../images/menuminus.png';
	}
}

/*Using javascript to scroll to an ancor on a page*/
function jumpToAnchor(a) {
	// 'a' is the anchor you want to scroll to 
   window.location = String(window.location).replace(/\#.*$/, "") + a;
}
