/*#############################################################*/
/*Prüft ob das Objekt ein Array ist*/
function isArray(obj) {
	if(obj.constructor.toString().indexOf("Array") == -1 )
		return false;
	else
		return true;
}
/*#############################################################*/
/*Loads a script and checks wether, it is already loaded*/
function LoadScript(strScript, fnCallBack){
	var strScriptURL = '';
	
	if (strScript.indexOf('/') >= 0 ){
		strScriptURL = strScript;
	} else {
		strScriptURL = app.swd+'/'+strScript;
	}
	
	var jqSearchScript = $('[src="'+strScriptURL+'"]');
	
	if (jqSearchScript.length){
		//alert('Script '+strScriptURL+ ' already loaded.');
		if (typeof fnCallBack=='function') {
			fnCallBack();
		}
	}else{
		$.getScript(strScriptURL, fnCallBack);
	}
}
/*#############################################################*/
function GetCurrentDate(){
	var cTime = new Date(); //current Date / Time
	return cTime.getDate()+'.'+cTime.getMonth()+'.'+cTime.getFullYear();
}

/*#############################################################*/
function GetCurrentDateTime(){
	var cTime = new Date(); //current Date / Time
	return cTime.getDate()+'.'+cTime.getMonth()+'.'+cTime.getFullYear()+' '+cTime.getHours()+':'+cTime.getMinutes()+':'+cTime.getSeconds();
}

/*#############################################################*/
//URL-Parameter auslesen
function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

/*#############################################################*/
function getFlashVersion(){
	  // ie
   try {
	    try {
	      // avoid fp6 minor version lookup issues
	      // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
	      var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
	      try { axo.AllowScriptAccess = 'always'; }
	      catch(e) { return '6,0,0'; }
	    } catch(e) {}
	    return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
	  // other browsers
	  } catch(e) {
	    try {
	      if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
	        return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
	      }
	    } catch(e) {}
	  }
	  return '0,0,0';
         }
/*#############################################################*/
function ErrorHandling(strModul, err){
        txt = "Leider gibt es einen Fehler auf der Seite.\n\n";
        txt += "JS-Modul:" + strModul + "\n";
        txt += "Beschreibung: " + err.description + "\n";
        txt += "Nummer: " + err.number + "\n";
        txt += "Meldung: " + err.message + "\n";
        txt += "\nWeiter mit ok.\n\n";
        alert(txt);
 };
 /*#############################################################*/
