/***************************************************
 * SQH JS CORE Functions
 **************************************************/		

/**
 * Core Functions
 */ 
	/**
	 * 	Public Function isUndefined
	 *	checks if a var is undefined
	 */
	function isUndefined(v){var undef;return v===undef;}

	/**
	 *	Debug Object
	 *	@param obj
	 */
	function alertObject(ob){var s = '';for(var p in ob){	s += p + ': ' + ob[p] + '\n\t';	}document.write(s);	}
	
	/**
	 * Browser check
	 */
	var agt=navigator.userAgent.toLowerCase();
	var is_gecko = (agt.indexOf('gecko') != -1);


	/**
	 * Dateiname mit Js ermitteln
	 */
	function basename (path) { return path.replace( /.*\//, "" ); }
	
	/**
	*   public function isArray (ueberprueft ob parameter ein Array Objekt ist)
	*   @Param array (zu ueberpruefender Array)
	*   @return bool
	*/
	function isArray (array)
	{   return ((array != null) && (typeof array == "object") && (array.constructor == Array));
	}

	function AremoveItems(array, item)
	{	var i = 0;
		while (i < array.length)
		{	if (array[i] == item)
			{	array.splice(i, 1);
			}
			else
			{	i++;
			}
		}
	return array;
	}

	
	/**
	 * public function gEBI (Shortage for getElementById) 
	 */
	function gEBI(x){return document.getElementById(x);}

	
/**
 * Eventhandlers
 */	
	/**
	 * Onload Eventhandler Funktion
	 */	
	function addLoadEvent(func)
	{	var oldonload = window.onload;
  		if (typeof window.onload != 'function')
  		{	window.onload = func;
  		} else {
    		window.onload = function()
    		{	if (oldonload)
    			{	oldonload();
      			}
      			func();
    		}
  		}
	}	
	
	
	/**
	 * Resize Eventhandler
	 */
	function addResizeEvent(func)
	{	var oldonresize = window.onresize;
  		if (typeof window.onresize != 'function')
  		{	window.onresize = func;
  		} else {
    		window.onresize = function()
    		{	if (oldonresize)
    			{	oldonresize();
      			}
      			func();
    		}
  		}
	}	
	
	
	
	var pop = null;

	function popdown()
	{	if (pop && !pop.closed) pop.close();
	}

	function popup(url,w,h)
	{	if (!url) return true;
	  	w = (w) ? w : 150;  // 150px*150px is the default size
	  	h = (h) ? h : 150;
	  	var args = 'scrollbars=yes,width='+w+',height='+h+'';
	  	pop = window.open(url,'Dialog',args);
	  	return (pop) ? false : true;
	}

	window.onunload = popdown;

	/**
	 * Fuegt in den Sitebody container elemente die gewuenschten Inhalte hinzu
	 */
	function appendtobody(str,container)
	{	if (container)
		{	var cbox = document.getElementById(container);
			if (cbox)
			{	var temp = cbox.innerHTML;
				cbox.innerHTML = temp + str;
			}	
		}	
	}