	// Link to the passed parameter
	function LinkIt(PageID){
		window.location.href ="Index.asp?PageID=" + PageID;
	}

	//Search the Yahoo directory
	function SearchYahoo(){
		var SearchTerm = document.SearchForm.p.value;
		URL = "http://search.yahoo.com/bin/search?p="+SearchTerm;	
		window.open(URL);
	}
	// 
	function ShowDefaultText(){
		var SearchText = document.SearchForm.p.value;
		if(SearchText == ''){
			document.SearchForm.p.value = 'Enter Keyword(s)';
		}
	}

	// Open a new window with the passed parameters
	function NewWindow(URL,Name,Width,Height) {
		LeftPos = (screen.availWidth-10 - Width) / 2;
		TopPos = (screen.availHeight-20 - Height) / 2; 
		Features= "width="+Width+",height="+Height+",left="+LeftPos +",top="+TopPos ;
		Features+= ",screenX="+LeftPos +",screenY="+TopPos; 
		Features+= ",scrollbars=0,resizable=0,location=0"; 
		Features+= ",menubar=0,toolbar=0,status=0";
		window.open(URL,Name,Features);
	 } 

	// Show arrow positon
	function FlipArrow(ArrowID){
		var TheArrow = eval("document.all." + ArrowID);
		if(TheArrow.innerHTML == 6) {
			//alert(TheArrow);
			TheArrow.innerHTML = 4;
		}else {
			//alert(TheArrow);
			TheArrow.innerHTML = 6;
		}			
	}
	// Determine whether to show or hide modules
	function ExpandCollapse(ID){
		var TheID = eval("document.all."+ID);
		if(TheID.style.display=='none'){
			TheID.style.display = 'inline';
		}else{
			TheID.style.display = 'none';
		}			
	}
	// Determine whether to show submenus on the Sidebar menu
	function ShowHideEntity(TheEntity,ArrowID) {
		TheTable = eval("document.all.Table_" + TheEntity + ".style");
		if(TheTable.display == "none") {
			TheTable.display = "block";
		}
		else {
			TheTable.display = "none";
		}
		FlipArrow(ArrowID);
	}
	// OLD - Determine whether to show submenus on the Sidebar menu
	function ShowSubMenu(ID,ArrowID){
		for (i=1;i<document.all.length;i++) {
			var TheID = eval("document.all."+ID + i);
			//alert(TheID.style);
			if(TheID){
				//alert();
				if(TheID.style.display=='none'){
					TheID.style.display = 'inline';
				}else{
					TheID.style.display = 'none';
				}					
			}
		}
	  	if(ArrowID != ''){
			FlipArrow(ArrowID);
		}
	}
	// Highlight rows
	function HighlightRow(RowID){
		var TheElement = "document.all."+ RowID;
		var TheElement2 = eval(TheElement);
		//alert(TheElement2);
		TheElement2.style.backgroundColor = '#FFFFFF';
		TheElement2.style.fontWeight = 'bold';
	}
	// Remove Highlighted rows
	function RemoveHighlight(RowID){
		var TheElement = "document.all."+ RowID;
		var TheElement2 = eval(TheElement);
		//alert(TheElement2);{
		TheElement2.style.backgroundColor = '#ececec';
		TheElement2.style.fontWeight = 'normal';
	}
	
	function isEmailAddr(email){
	  var result = false
	  var theStr = new String(email)
	  var index = theStr.indexOf("@");
	  if (index > 0) {
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1))
		result = true;
	  }
	  return result;
	}

	function EmailAddressValidator(theForm){
	
	  if (theForm.EmailAddress.value == ""){
		alert("Please enter a value for the \"email address\" field.");
		theForm.EmailAddress.focus();
		return (false);
	  }
	
	  if (!isEmailAddr(theForm.EmailAddress.value)){
		alert("Please enter a complete email address in the form: yourname@yourdomain.com");
		theForm.EmailAddress.focus();
		return (false);
	  }
	   
	  if (theForm.EmailAddress.value.length < 3){
		alert("Please enter at least 3 characters in the \"email address\" field.");
		theForm.EmailAddress.focus();
		return (false);
	  }
	  return (true);
	}
	
 	function SubTotal(ThisForm){	
		var TheForm = ThisForm;
		if(ThisForm.SubTotalTest.value != ""){
			var sum = ThisForm.SubTotalTest.value;
		}else{
			var sum = "";
		}
		
		for (i=0; i<TheForm.elements.length; i++){
			if ((TheForm.elements[i].name != "GoToSection") && (TheForm.elements[i].name != "SubTotalTest") && (TheForm.elements[i].name != "Reset") && (TheForm.elements[i].name != "TestFormSubmit")){				
				if(TheForm.elements[i].type == "radio" && TheForm.elements[i].value != "0"){
					//var TheRadioFormElement = TheForm.elements[i].name;
					//var TheRadioFormElementLength = eval("document.PartAForm." + TheRadioFormElement + ".length");
					//for(j=0; j < TheRadioFormElementLength; j++){
						if(TheForm.elements[i].checked == true){
							// add radio box values
							sum += TheForm.elements[i].value;													
						}
					//}							
				}else if(TheForm.elements[i].type == "checkbox" && TheForm.elements[i].value != "0"){
					if (TheForm.elements[i].checked){
						// add checkbox values	
						sum += TheForm.elements[i].value;	
					}
				// Form element type is a checkbox
				}else if(TheForm.elements[i].type.substr(0,6) == "select" && TheForm.elements[i].value != "0"){
					// add select box values
					sum += TheForm.elements[i].value;
				}			
			}		
		}
		//alert("Subtotal: " + eval(sum));
		TheForm.SubTotalTest.value = eval(sum);
		//alert(eval(sum));
		//alert("ThisForm.SubTotalTest.value: " + ThisForm.SubTotalTest.value);
	}	
	
//	var initialOpacity = 0.3;
//    var opacity = initialOpacity;
//    var maxOpacity = 1;
//    var fadeInCounter;
//    var fadeOutCounter;
//    var interval = 30;
//    var fadeIncrement = 0.05;
//    var fixedDigits = 2;
//    
//    window.onload = function setOpacity() {
//        var imageArray = document.getElementsByTagID("img");
//        var i = 0;
//        while (imageArray.length > i) {
//            imageArray[i].setAttribute("onmouseover","lighten(this);");
//            imageArray[i].setAttribute("onmouseout","darken(this);");
//            imageArray[i].style.opacity = initialOpacity;
//            ++i;
//        }
//    }
//    
//    function lighten(object) {
//        window.clearInterval(fadeOutCounter);
//        fadeInCounter = window.setInterval(fadeIn,interval);
//        
//        function fadeIn() {
//            opacity = (parseFloat(opacity) + fadeIncrement).toFixed(fixedDigits);
//            object.style.opacity = opacity;
//            
//            if (opacity >= maxOpacity) {
//            clearInterval(fadeInCounter);
//            }
//        }
//    }
//    
//    function darken(object) {
//        window.clearInterval(fadeInCounter);
//        fadeOutCounter = window.setInterval(fadeOut,interval);
//        
//        function fadeOut() {
//            opacity = (parseFloat(opacity) - fadeIncrement).toFixed(fixedDigits);
//            object.style.opacity = opacity;
//             
//            if (opacity <= initialOpacity) {
//                clearInterval(fadeOutCounter);
//            }
//        }
//    }

//################## Begin Popup Image Logic ######################################################

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}                

if (parent.document.innerWidth){
    //alert("1");
    frameWidth = parent.document.innerWidth;
    frameHeight = parent.document.innerHeight;
}
else if (parent.document.documentElement && parent.document.documentElement.clientWidth){
    //alert("2");
    frameWidth = parent.document.documentElement.clientWidth;
    frameHeight = parent.document.documentElement.clientHeight;
}
else if (parent.document.body){
    //alert("3");
    frameWidth = parent.document.body.clientWidth;
    frameHeight = parent.document.body.clientHeight;
}
//alert("4");
LeftX = (frameWidth - 100) / 2;
TopY = (frameHeight - 100) / 2;

//alert(LeftX + " " + TopY);
var optNN='scrollbars=no,titlebar=no,status=no,location=no,directories=no,menubar=0,width='+defaultWidth+',height='+defaultHeight+',left=' + LeftX + ',top=' + TopY;
var optIE='scrollbars=no,titlebar=no,status=no,location=no,directories=no,menubar=0,width=100,height=100,left=' + LeftX + ',top=' + TopY;

function popImage(imageURL,imageTitle){

    var arrFile = imageURL.split("Thumbs/");
    var NewImagePath = arrFile[0] + arrFile[1];
    //alert(NewFilePath);
     
    if (isNN){
        imgWin=window.open('about:blank','win',optNN);
    }
    if (isIE){
        imgWin=window.open('about:blank','win',optIE);
    }
    
    with (imgWin.document){
    
        writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
        writeln('<sc'+'ript>');
        writeln('   var isNN,isIE;');
        writeln('   if (parseInt(navigator.appVersion.charAt(0))>=4){');
        writeln('       isNN=(navigator.appName=="Netscape")?1:0;');
        writeln('       isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
        writeln('   function reSizeToImage(){');
        writeln('       if (isIE){');
        //writeln('           window.resizeTo(100,100);');
        writeln('           width = document.images[0].width + 10;');
        writeln('           height = document.images[0].height + 75;')
        writeln('           window.resizeTo(width,height);');
        writeln('           window.moveBy(((width / 2) * -1) + 10,((height / 2) * -1) + 150);}');
        writeln('       if (isNN){');       
        writeln('           window.innerWidth=document.images["Photo"].width + 10;');
        writeln('           window.innerHeight=document.images["Photo"].height + 10;}}');
        writeln('   function doTitle(){document.title="'+imageTitle+'";}');
        writeln('</sc'+'ript>');
        
       
       
        if (!AutoClose){
            writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
        }else{ 
            writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
        }
        
        writeln('<img name="Photo" src="' + NewImagePath + '" style="display:block"></body></html>');
        close();		
    }
}