/**
 * LazyLoad - jQuery plugin
 */




var iUniqueDomIdCnt = 1000;
jQuery.fn.getUniqueDomId = jQuery.getUniqueDomId = function(oElement) {
	if(typeof oElement != 'undefined') {
		var me = $(oElement);
	}
	else {
		var me = $(this);
	}
	if(isNaN(parseInt(me.data('iUniqueDomId')))) {
		me.data('iUniqueDomId', iUniqueDomIdCnt++);
	}
	return parseInt(me.data('iUniqueDomId'));
};

$();//.ready(function(){});




if(typeof oSystem != 'object') {
	var oSystem = {
		sName:			'totoya'
		,iVersion:		3
		,iSubversion:	1
		,fVersion:		3.1
	};
}





var lazyModules = {
			  "dummy":""
//hook lazyModules {,ACTION}




















































































































































































// --- HOOK BEGIN ---
,
"user-editor" : {
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/admin/user-editor/js/user-editor.js"]
            	   		,"css":		["/totoya/cache/core/clib/admin/user-editor/css/user-editor.css"]
               		}
               		,"dependencies": []
            	          		 
               }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
"sysinfo" : {
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/admin/sysinfo/js/sysinfo.js"]
            	   		,"css":		["/totoya/cache/core/clib/admin/sysinfo/css/sysinfo.css"]
               		}
               		,"dependencies": []
            	          		 
               }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
"newsletter" : {
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/admin/newsletter/js/newsletteradmin.js"
            	   			,"/totoya/cache/core/clib/admin/newsletter/js/newslettertree.js"
            	   			,"/totoya/cache/core/clib/admin/newsletter/js/newsletteradmin.class.js"
            	   			]
            	   		,"css":		["/totoya/cache/core/clib/admin/newsletter/css/newsletteradmin.css"]
               		}
               		,"dependencies": []
            	          		 
               }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
			"cStatsAdmin" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/admin/stats/js/cstatsadmin.class.js"]
          	   		//,"css":		["/totoya/cache/core/clib/admin/framework/css/panel.css"]
             		}
             		,"dependencies": []          	          		 
             }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
			"cWebsitePanel" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/admin/panel-website/js/cwebsitepanel.class.js"]
          	   		,"css":		["/totoya/cache/core/clib/admin/framework/css/panel.css"]
             		}
             		,"dependencies": []          	          		 
             }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
			"cModulePanel" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/admin/panel-module/js/cmodulepanel.class.js"]
          	   		,"css":		["/totoya/cache/core/clib/admin/framework/css/panel.css"]
             		}
             		,"dependencies": []
             }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
              "codeMirror" : {
          		"files": {
          	   		"scripts":	[
          	   			"/totoya/cache/core/clib/lib/codemirror/js/codemirror.js"
          	   			,"/totoya/cache/core/clib/lib/jquery/jquery.codemirror.js"
          	   		]
          	   		,"css":		["/totoya/cache/core/clib/lib/jquery/codemirror/jquery.codemirror.css"]
             		}
             		,"dependencies": []
             }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
			"cAdmin" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/admin/framework/js/cadmin.class.js"]
          	   		,"css":		[]
             		}
             		,"dependencies": []          	          		 
             }
			,"cFramework" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/admin/framework/js/cframework.class.js"]
          	   		,"css":		[]
             		}
             		,"dependencies": []          	          		 
             }
			,"cMainToolbar" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/admin/framework/js/cmaintoolbar.class.js"]
          	   		,"css":		[]
             		}
             		,"dependencies": []          	          		 
             }
			,"standard" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/admin/framework/skin/default/js/standard.js"]
          	   		,"css":		[]
             		}
             		,"dependencies": []
             }
            ,"cTemplate" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/admin/framework/skin/default/js/ctemplate.js"]
          	   		,"css":		[]
             		}
             		,"dependencies": []
             }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
			"cSystemPanel" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/admin/panel-system/js/csystempanel.class.js"]
          	   		,"css":		["/totoya/cache/core/clib/admin/framework/css/panel.css"]
             		}
             		,"dependencies": []          	          		 
             }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
        	"jqueryJson" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/lib/jquery/jquery.json-2.2.min.js"]
          	   		,"css":		[]
           		}
           		,"dependencies": []          	          		 
			}
			,"jqueryColorpicker" : {
				"files": {
					"scripts":	["/totoya/cache/core/clib/lib/jquery/jquery.colorpicker.js"]
					,"css":		["/totoya/cache/core/clib/lib/jquery/colorpicker/colorpicker.css"]
				}
				,"dependencies": []          	          		 
			}
			,"jqueryComplete" : {
				"files": {
					"scripts":	["/totoya/cache/core/clib/lib/jquery/jquery.fcbkcomplete.js"]
					,"css":		["/totoya/cache/core/clib/lib/jquery/fcbkcomplete/style.css"]
				}
				,"dependencies": []          	          		 
			}
              ,"cForm" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/lib/jquery/jquery.cform.js", "/totoya/cache/core/clib/lib/jquery/cform/fields.js"]
          	   		,"css":		["/totoya/cache/core/clib/lib/jquery/cform/jquery.cform.css"]
             		}
             		,"dependencies": []
             }
              ,"cList" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/lib/jquery/jquery.clist.js"]
          	   		,"css":		["/totoya/cache/core/clib/lib/jquery/clist/jquery.clist.css"]
             		}
             		,"dependencies": []
             }
              ,"cGraph" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/lib/jquery/jquery.cgraph.js","/totoya/cache/core/clib/lib/jquery/jquery.flot.js"]
          	   		,"css":		[]
             		}
             		,"dependencies": []
             }
              ,"cDialog" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/lib/jquery/jquery.cdialog.js"]
          	   		,"css":		["/totoya/cache/core/clib/lib/jquery/cdialog/jquery.cdialog.css"]
             		}
             		,"dependencies": []
             }
			  ,"ui" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/lib/jquery/jquery.ui.js"]
          	   		,"css":		["/totoya/cache/core/clib/lib/jquery/ui/jquery.ui.css"]
             		}
             		,"dependencies": []
             }
			,"jqueryDatePicker" : {
				"files": {
					"scripts":	["/totoya/cache/core/clib/lib/jquery/datepicker/date.js", "/totoya/cache/core/clib/lib/jquery/datepicker/date_de.js", "/totoya/cache/core/clib/lib/jquery/jquery.datepicker-2.1.2.js"]
					,"css":		["/totoya/cache/core/clib/lib/jquery/datepicker/datepicker.css"]
				}
				,"dependencies": []          	          		 
			}
			,"jqueryCookie" : {
				"files": {
					"scripts":	["/totoya/cache/core/clib/lib/jquery/jquery.cookie.js"]
					,"css":		[]
				}
				,"dependencies": []          	          		 
			}
            ,"jqueryHistory" : {
          		"files": {
          	   		"scripts":	[
          	   			"/totoya/cache/core/clib/lib/jquery/jquery.history.js"
          	   		]
          	   		,"css":		[]
             		}
             		,"dependencies": []
             }
			,"jqueryColorbox" : {
				"files": {
					"scripts":	["/totoya/cache/core/clib/lib/jquery/jquery.colorbox.debug.js"]
					,"css":		["/totoya/cache/core/clib/lib/jquery/colorbox/colorbox.css"]
				}
				,"dependencies": []          	          		 
			}
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
				"badjie-ibe" : {
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/badjie/ibe/js/cibeadmin.class.js"
            	   			]
            	   		,"css":		[
            	   			"/totoya/cache/core/clib/badjie/ibe/media/ibe_styles.css"
            	   		]
               		}
               		,"dependencies": []
            	          		 
				}
				,"badjie-ibe-search" : {
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/badjie/ibe/js/cibetabsearch.class.js"
            	   			, "/totoya/cache/core/clib/badjie/ibe/js/cibetabofferdetails.class.js"
            	   			, "/totoya/cache/core/clib/badjie/ibe/js/cibetabcart.class.js"
            	   			, "/totoya/cache/core/clib/badjie/ibe/js/cibetabpolicies.class.js"
            	   			, "/totoya/cache/core/clib/badjie/ibe/js/cibetaballdata.class.js"
            	   			, "/totoya/cache/core/clib/badjie/ibe/js/cibetabs.class.js"
            	   			, "/totoya/cache/core/clib/badjie/ibe/js/cibesearch.class.js"
           	   			]
            	   		,"css":		[
            	   			"/totoya/cache/core/clib/badjie/ibe/media/ibe_styles.css"
            	   		]
               		}
               		,"dependencies": []
				}
				,"badjie-ibe-mask" : {
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/badjie/ibe/js/cibemask.class.js"
           	   			]
            	   		,"css":		[
            	   			"/totoya/cache/core/clib/badjie/ibe/media/ibe_styles.css"
            	   		]
               		}
               		,"dependencies": []
				}
				,"badjie-ibe-flight-mask" : {
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/badjie/ibe/js/cibeflightmask.class.js"
           	   			]
            	   		,"css":		[
            	   			"/totoya/cache/core/clib/badjie/ibe/media/ibe_styles.css"
            	   		]
               		}
               		,"dependencies": []
				}
				,"badjie-ibe-dev" : {
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/badjie/ibe/js/cibesearchparameters.class.js"
            	   			, "/totoya/cache/core/clib/badjie/ibe/js/cibesearchdev.class.js"
            	   			, "/totoya/cache/core/clib/badjie/ibe/js/cibesearchresults.class.js"
            	   			, "/totoya/cache/core/clib/badjie/ibe/js/cibeflightmask.class.js"
            	   		]
            	   		,"css":		[
            	   			"/totoya/cache/core/clib/badjie/ibe/media/ibe_dev.css"
            	   		]
               		}
               		,"dependencies": []
				}
				,"badjie-ibe-details" : {
            		"files": {
            	   		"scripts":	[]
            	   		,"css":		[
            	   			"/totoya/cache/core/clib/badjie/ibe/media/ibe_details.css"
            	   		]
               		}
               		,"dependencies": []
				}
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
	"mawWebsiteAdmin" : {
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/myafricanworld/js/maw-website-admin.class.js"]
            	   		,"css":		[]
               		}
               		,"dependencies": []
            	          		 
               }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
"badjie-ibe-general" : {
            		"files": {
            	   		"scripts":	[]
            	   		,"css":		["/totoya/cache/core/clib/badjie/hoteladmin/media/ibe-admin.css"]
               		}
               		,"dependencies": []
            	          		 
               }
,"badjie-legencie-hoteladmin" : {
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/badjie/hoteladmin/js/hoteladmin.js"
            	   			,"/totoya/cache/core/clib/badjie/hoteladmin/js/hotelddgallery.js"
            	   			,"/totoya/cache/core/clib/badjie/hoteladmin/js/hoteltree.js"
            	   			]
            	   		,"css":		[]
               		}
               		,"dependencies": []
            	          		 
               }
,"badjie-hoteladmin" : {
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/hoteladmin/js/cbadjiehoteladmin.class.js"]
               		}
               		,"dependencies": []
            	          		 
               }
,"badjie-agecyadmin"	:{
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/hoteladmin/js/cbadjieagencyadmin.class.js"]
            	   		,"css":		[]
               		}
               		,"dependencies": []
}
,"badjie-flightadmin"	:{
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/hoteladmin/js/cbadjieflightadmin.class.js"]
            	   		,"css":		[]
               		}
               		,"dependencies": []
}
,"badjie-transferadmin"	:{
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/hoteladmin/js/cbadjietransferadmin.class.js"]
            	   		,"css":		[]
               		}
               		,"dependencies": []
}
,"badjie-tools-settings"	:{
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/hoteladmin/js/cbadjietoolssettings.class.js"]
            	   		,"css":		[]
               		}
               		,"dependencies": []
}
,"badjie-bookingadmin"	:{
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/hoteladmin/js/cbadjiebookingadmin.class.js"]
            	   		,"css":		[]
               		}
               		,"dependencies": []
}
,"badjie-paxadmin"	:{
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/hoteladmin/js/cbadjiepaxadmin.class.js"]
            	   		,"css":		[]
               		}
               		,"dependencies": []
}
,"badjie-customeradmin"	:{
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/hoteladmin/js/cbadjiecustomeradmin.class.js"]
            	   		,"css":		[]
               		}
               		,"dependencies": []
}
,"cBasicAWTCountries"	:{
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/badjie/hoteladmin/js/cbasicawtcountries.class.js"
            	   			]
            	   		,"css":		[]
               		}
               		,"dependencies": []
            	          		 
}
,"badjie-contractform" : {
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/badjie/hoteladmin/js/chotelcontractform.class.js"
            	   		]
            	   		,"css":		["/totoya/cache/core/clib/badjie/hoteladmin/media/contract.css"]
               		}
               		,"dependencies": []
            	          		 
               }
,"badjie-contractform-formfields" : {
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/hoteladmin/js/formfields.js"]
						,"css": ["/totoya/cache/core/clib/badjie/hoteladmin/media/contract_form.css"]
               		}       		 
					,"dependencies": []
               }
,"badjie-contingentslist" : {
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/badjie/hoteladmin/js/chotelcontingentslist.class.js"
            	   		]
            	   		,"css":		["/totoya/cache/core/clib/badjie/hoteladmin/media/contract_form.css"]
               		}
               		,"dependencies": []
            	          		 
               }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
			"cIbePanels" : {
          		"files": {
          	   		"scripts":	["/totoya/cache/core/clib/badjie/panel-ibe/js/cibepanel.class.js"]
          	   		,"css":		["/totoya/cache/core/clib/admin/framework/css/panel.css"]
             		}
             		,"dependencies": []
             }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
"badjie-catalog" : {
            		"files": {
            	   		"scripts":	["/totoya/cache/core/clib/badjie/catalog/js/travelcatalog.js"]
            	   		,"css":		["/totoya/cache/core/clib/badjie/catalog/css/travelcatalog.css"]
               		}
               		,"dependencies": []
            	          		 
               }
         // --- HOOK END ---
// --- HOOK BEGIN ---
,
				"session-store" : {
            		"files": {
            	   		"scripts":	[
            	   			"/totoya/cache/core/clib/core/ajax/js/csessionstore.class.js"
            	   			]
            	   		,"css":		[]
               		}
               		,"dependencies": []
				}
         // --- HOOK END ---
};





(function($) {
	var bLoading = false;	
	var bAsyncLoadingRequired = false;
		$(document).ready(
		function() {
			window.setTimeout(
				function() {
					// 1000ms after document ready we check if there were async requests
					if(bAsyncLoadingRequired) {
						// if true than preloading failed
						
						// now we check if an area code was set (which happens usually on preloading)
						if(typeof sPreloadingArea == 'string' && sPreloadingArea.length>0) {
							// ok so there is a preloader which failed
							// so we tell him, what he shold have loaded
							var oToLoad = {
								"sArea":			sPreloadingArea
							    ,"aCss":			[]
								,"aScripts" :	[]
								,"aModules":		[]
							};
							for(i in lazyModules) {
								if(lazyModules[i].loaded == true) {
									oToLoad.aModules.push(i);
									if(typeof lazyModules[i].files.scripts == 'object') {
										for(j in lazyModules[i].files.scripts) {
											oToLoad.aScripts.push(lazyModules[i].files.scripts[j]);
										}
									}
									if(typeof lazyModules[i].files.css == 'object') {
										for(j in lazyModules[i].files.css) {
											oToLoad.aCss.push(lazyModules[i].files.css[j]);
										}
									}
									
								}
							}
							$.post('/ajax/cControlCoreMediainclude/ajaxStorePreload', convert2PostData(oToLoad));
						}
					}
				}
				, 1000
			);
		}
	);
    $.fn.lazyLoad = function(aModules, fCallback, mParams) {
		// if a lazy load is in progress -> wait until finish!
		if(bLoading) {
			window.setTimeout(
				function() {
					$.lazyLoad(aModules, fCallback, mParams);
				}
				,30
			);
			return;
		}
		bLoading = true;
    	// init all local storages
    	var oTarget = this;
    	var aScripts = new Array();
    	var aCss = new Array();
    	// collect all files to load
    	// TODO: dependencies are not handeled jet!
    	for(var i in aModules) {
    		var sModule = aModules[i];
    		if(typeof lazyModules[sModule] != 'object' || lazyModules[sModule] == null) {
			  log("module " + sModule+ " is not prperly configured!");
			  continue;
			}
			if(lazyModules[sModule].loaded == true) {
    			continue;
    		}
			bAsyncLoadingRequired = true;
    		// set loaded to true to avoid duplicate loading
    		// TODO: exemine, if bad timing could result in unloaded modules because setting to loaded to early
    		lazyModules[sModule].loaded = true;
    		for(var j in lazyModules[sModule].files.scripts) {
    			aScripts.push(lazyModules[sModule].files.scripts[j]);
    		}
    		for(var j in lazyModules[sModule].files.css) {
    			aCss.push(lazyModules[sModule].files.css[j]);
    		}
    	}
    	// examine how many files are to be loaded
    	var iLoadCount = aScripts.length + aCss.length;
    	var iLoadedCount = -1;
    	//define a function for loaded scripts
    	var fCheckLoaded = function() {
    		iLoadedCount ++;
    		if(iLoadedCount == iLoadCount) {
				// tell everybody that we are ready with lazy loading			
				bLoading = false;
    			//execute callback
    			//timeout for Safari2 compatibility
    			window.setTimeout(function(){fCallback.call(oTarget, mParams);},10);
    		}
    	};
    	// load all scripts
    	for(var i in aScripts) {
        	$.getScript(aScripts[i], function() {
        		fCheckLoaded();
        	});
    	}
    	// load all css
    	for(var i in aCss) {
        	$.get(aCss[i], function(sCss) {
        		$("head").append("<style type='text/css'>"+sCss+"</style>");
        		fCheckLoaded();
        	});
    	}
    	fCheckLoaded();
    };
    // make it global accessible
    $.lazyLoad = $.fn.lazyLoad;
})(jQuery);
