
/* Popup Login Box from Troozers.com (http://www.troozers.com/mambo_development/how_did_you_do_that/popup_login_box.html)

*/
function toggleBox(szDivID, iState) // 1 visible, 0 hidden 
{ 
  if(document.layers)  // NN4 
  { 
    document.layers[szDivID].visibility = iState ? "show" : "hide"; 
  } 
  else if(document.getElementById) // gecko(NN6) + IE5+ 
  { 
    var obj = document.getElementById(szDivID); 
    obj.style.visibility = iState ? "visible" : "hidden"; 
  } 
  else if(document.all) //IE 4 
  { 
    document.all[szDivID].style.visibility = iState ? "visible" : "hidden"; 
  } 
}  
////////////////////////////////////////////////////////////////////////////

/*This Script allows people to enter by using a form that asks for a UserID and Password*/
function pasuser(form) 
	{
	if (form.id.value=="geoff") 
		{ 
		if (form.pass.value=="readman") 
			{              
			location="http://www.geoffreadman.co.uk/personalpages.htm" 
			} else {
					alert("Invalid Password")
			}
		} else {  alert("Invalid UserID")
	}
}

//////////////////////////////////////////////////////////////
/* Explorer PNG Fix from Troozers.com (http://www.troozers.com/mambo_development/how_did_you_do_that/explorer_png_fix.html)
When I was starting to add content to the andy-stewart.com website, I decided to change some of the standard 
Mambo icons and images with my own - to give it a more personal touch.  I had recently purchased a heap of 
icon images in PNG format, and decided to use these.

Another reason for using the PNG format, was that I was having issues with the transparencies of GIF images 
especially when I had defined them with a drop shadow.  I would get little white areas around the shadows 
which looked rubbish when placing them over coloured backgrounds etc.  PNG promised to do away with these 
issues - and certainly within Opera and FireFox it did.  Unfortunately Microsoft in all it's wisdom had not 
implemented the PNG transparencies format properly and I was left with a grey/blue background behing all my 
PNG images.

A quick trawl via Google found me various solutions to fixing the issue under Internet Explorer, and the 
code snippet below was the most elegant I found.  Elegant in the fact that if you are not running IE, your 
browser will completely ignore this code snippet;
<!--[if gte IE 5.5000]> 
<script language="JavaScript"> ***SCRIPT*** </script> 
<![endif]-->
*/

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
	{
	for(var i=0; i<document.images.length; i++)
	    {
        	var img = document.images[i]
	        var imgName = img.src.toUpperCase()
        	if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	            {
        	        var imgID = (img.id) ? "id='" + img.id + "' " : ""
                	var imgClass = (img.className) ? "class='" + img.className + "' " : ""
	                var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
        	        var imgStyle = "display:inline-block;" + img.style.cssText 
                	if (img.align == "left") imgStyle = "float:left;" + imgStyle
	                if (img.align == "right") imgStyle = "float:right;" + imgStyle
        	        if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle               
                	var strNewHTML = "<span " + imgID + imgClass + imgTitle
	                + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
        	    + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                	+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
	                img.outerHTML = strNewHTML
        	        i = i-1
	            }
	    }
	}
///////////////////////////////////////////////////////////////
