// ===================================================================
// Author: Elmar Rückert <info@landhaus-waldfrieden.at> 	2007
//
//	public: often used javascript methods!
//
//	IncludeJavaScript(jsFile)
//
// ===================================================================
function IncludeJavaScript(jsFile)
{
  document.write('<script type="text/javascript" src="'
    + jsFile + '"></script>'); 
}
function IncludeCSS(cssFile)
{
  document.write('<link href="' + cssFile + '" rel="stylesheet" type="text/css" />'); 
}

function getElement(elementId)
{
	retObj = new Object();
	if(typeof(document.getElementById) == 'function' ||
	   typeof(document.getElementById) == 'object')
		retObj = document.getElementById(elementId);
	else if(typeof(document.all) == 'object')
		retObj = document.all.elementId;
	return retObj;
}
function isArray(obj) {
   if (obj.constructor.toString().indexOf("Array") == -1)
      return false;
   else
      return true;
}

function displayObject(obj){
	var objMsg = "";
	if(isArray(obj) == true){
		for(var i=0;i<obj.length;i++)
			objMsg += displayObject(obj[i]);
	} else if(typeof(obj)=="object"){
		if(obj && obj != null){
			for(var prop in obj)
				objMsg += "\n\r<br>" + prop + " : " + obj[prop];
		} else
			objMsg += '\n\r<br>object is null or undefined';
	} else {
		try {
			objMsg += '\n\r<br>' + typeof(obj) + ' = ' + obj;
		} catch(e) {}
	}
	return objMsg;
}

function wait(millis)
{
	var date = new Date();
	var curDate = null;

	do { 
		curDate = new Date(); 
	} while(curDate-date < millis);
} 