// This function toggles all the checkboxes for a form with a given name
  	function toggleCheckboxes (formName, checkboxName)
     	{ 	theForm = document.forms[formName];
	      	for ( index = 0; index < theForm.elements.length; index++ )
	         	{ child = theForm.elements[index];
	           		if ( child.name == checkboxName )
	             		{ child.checked = !child.checked;
	             		};
	         	};
     	} // function toggleCheckboxes (formName, checkboxName)

  	function toggleContent (name)
     	{ 	object = document.getElementById(name);
       		object.style.display = object.style.display == "none" ? "block" : "none";
     	};

	function popupWindow(url, winname) 		 
		{	var theOptions = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=600,height=420,screenX=150,screenY=150,top=150,left=150";
			return popupWindowX(url, winname, theOptions);
		};
		
	function bookmarkSite(title, url)
		{
			if (document.all)
				window.external.AddFavorite(url, title);
			else if (window.sidebar)
				window.sidebar.addPanel(title, url, "")
		}

	function popupWindowX(url, winname, theOptions) 
		{	window.open(url,winname,theOptions);
			return false;
		}; 
				
	function checkIfEqual( idOne, idTwo, resultWords )
	    {
			checkFrom 	= document.getElementById( idOne );
			checkTo 	= document.getElementById( idTwo );
			resultMatch = document.getElementById( resultWords );

			if( checkFrom.value.length == 0 || checkTo.value.length == 0 )
				{
				    return false;
				}

			if( checkFrom.value == checkTo.value )
			    {
					checkFrom.style.border 		= "2px solid #00821C";
					checkTo.style.border 		= "2px solid #00821C";
					resultMatch.style.display 	= "inline";
			    }
			else
			    {
			    	checkFrom.style.border 		= "2px solid #820000";
					checkTo.style.border 		= "2px solid #820000";
					resultMatch.style.display 	= "none";
			    }
	    }
	    
	function resizeImagesDynamicly(imageID)
	{
		imageElement = document.getElementById(imageID);

		width = imageElement.width;
		height = imageElement.height;
				
		if( imageElement.height > 188 ) 
		{	imageElement.height = 188;
			
			ratio = width / height;
			imageElement.width = width * ratio;	
		}
	}
	
	if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
	window.attachEvent("onload", fnLoadPngs);
}
function fnLoadPngs() {
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);

	for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {
		if (itsAllGood && img.src.match(/\.png$/i) != null) {
			var src = img.src;
			img.style.width = img.width + "px";
			img.style.height = img.height + "px";
			img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='crop')"
			img.src = "images/global/head/spacer.gif";
		}
	}
}
