/* Usuability */
/**************/

	/*----------------------------------------------------------------------
		Method:	getAvailableScreenSize
		Desc:	Gets the available screen size and returns it as an object
	----------------------------------------------------------------------*/
		function getAvailableScreenSize()
		{
			var myWidth = 0, myHeight = 0;
			if( typeof( window.innerWidth ) == 'number' )
			{
				//Non-IE
				myWidth = window.innerWidth;
				myHeight = window.innerHeight;
			}
			else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
			{
				//IE 6+ in 'standards compliant mode'
				myWidth = document.documentElement.clientWidth;
				myHeight = document.documentElement.clientHeight;
			}
			else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
			{
				//IE 4 compatible
				myWidth = document.body.clientWidth;
				myHeight = document.body.clientHeight;
			}
			
			size = new Object();
			size.width = myWidth;
			size.height = myHeight;
			
			return size;
		}
	
	/*----------------------------------------------------------------------
		Method:	imageRollOver
		Desc:	Rollover function, works only with images, which have '_over' images replicate
		Example: Rollover change: xxx.gif -> xxx_over.gif
	----------------------------------------------------------------------*/
		function imageRollOver(argSRC)	
		{
			aExtensions = new Array(".gif", ".jpg", ".png");
		
			for(i=0;i<aExtensions.length;i++)
			{
				argSRC.src = argSRC.src.replace(aExtensions[i], "_over" + aExtensions[i]);
			}
		}
		
	/*----------------------------------------------------------------------
		Method:	imageRollOver
		Desc:	Rollover function, works only with images, which have '_over' images replicate
		Example: Rollover change: xxx_over.gif -> xxx.gif
	----------------------------------------------------------------------*/
		function imageRollOut(argSRC)	
		{
			aExtensions = new Array(".gif", ".jpg", ".png");
		
			for(i=0;i<aExtensions.length;i++)
			{
				argSRC.src = argSRC.src.replace("_over", "");
			}
			
		}
		
	/*----------------------------------------------------------------------------------------
		Method:	setInnerHTMLOnElement
		Desc:	Function that sets the innerHTML attribute of an element
	----------------------------------------------------------------------------------------*/
		function setInnerHTMLOnElement(argElementID, argValue)
		{
			document.getElementById(argElementID).innerHTML = argValue;
		}		

	/*----------------------------------------------------------------------------------------
		Method:	setImageSource
		Desc:	Function that change an image container with a desired image
	----------------------------------------------------------------------------------------*/
		function setImageSource(argElementID, argImagePath)
		{
			document.getElementById(argElementID).src = argImagePath;
		}		
		
	/*----------------------------------------------------------------------------------------
		Method:	setCSSClassOnElement
		Desc:	Function that sets the class attribut of an element
	----------------------------------------------------------------------------------------*/
		function setCSSClassOnElement(argElementID, argClassName)
		{						
			document.getElementById(argElementID).className = argClassName;
		}
		
		
/**************************************************************************************************************/

/* Window functions */
/******************/
	/*----------------------------------------------------------------------
		Method:	openPopup
		Desc:	Opens up a popup
	----------------------------------------------------------------------*/
		function openPopup(argWindowName, argURL, w, h, argStatusbar, argResizable, argMenubar, argLocation, argHotkeys, argLeft, argTop, argScrollbars)
		{	
			var strProperties = "width=" + w + ",height=" + (h+1) + ",status=" + (argStatusbar) + ",resizable=" + (argResizable) + ",menubar=" + (argMenubar) + ",location=" + (argLocation) + ",hotkeys=" + (argHotkeys) + ",left=" + (argLeft) + ",top=" + (argTop) + "," + "scrollbars=" + argScrollbars;
			var vWindow = window.open(argURL,argWindowName,strProperties);		

			vWindow.focus();
		}
		
/**************************************************************************************************************/

/* Form functions */
/******************/

	/*----------------------------------------------------------------------
		Method:	getValuesOfCheckboxGroup
		Desc:	Gets all Values of all checked Checkboxes. Checkboxes are in agroup 	
				They all use the same 'name'-Attribute
	----------------------------------------------------------------------*/
		function getValuesOfCheckboxGroup(argFormName, argCheckboxGroupName)
		{
			oCheckBoxGroup = eval("document."+argFormName+"."+argCheckboxGroupName);
			
			aSelectedValues = new Array();
			
			if (typeof oCheckBoxGroup.length != 'undefined') 
			{
				for (var i=0; i < oCheckBoxGroup.length; i++) 
				{
					if (oCheckBoxGroup[i].checked) 
					{
						aSelectedValues.push(oCheckBoxGroup[i].value);
					}
				}
			} else {
				aSelectedValues.push(oCheckBoxGroup.value);
			}
				
			return aSelectedValues;	
		}
	
