
	window.XLNT_intervals=new Array();
	window.clearInterval_counter=0;

	function XLNT_setInterval(str_function, int_interval){
		if (!str_function) return;
		if (!int_interval) return;
		try{
			index=window.XLNT_intervals.length;
			window.XLNT_intervals[index]=new Array();
			window.XLNT_intervals[index]["function"]=str_function
			window.XLNT_intervals[index]["interval"]=int_interval;
			window.XLNT_intervals[index]["counter"]=0
			window.XLNT_intervals[index]["arguments"]=new Array();
			for (i=2 ; i < arguments.length ; i++){
				window.XLNT_intervals[index]["arguments"][i-2]=arguments[i];
			}
			return index;
		} catch(e) {}
	}

	function XLNT_clearInterval(index){
		try {
			window.XLNT_intervals[index]["function"]='';
			window.XLNT_intervals[index]["interval"]='';
			window.XLNT_intervals[index]["counter"]=0;
			window.XLNT_intervals[index]["arguments"]='';
		} catch(e) {}
	}


	function XLNT_doInterval(){
		try {
			var nr_of_functions=window.XLNT_intervals.length;
			if (nr_of_functions==0) {
				clearInterval_counter++;
				if (clearInterval_counter>1000){
					window.clearInterval(window.XLNT_interval_handle);
				}
			}

			for (var index=0 ; index< nr_of_functions ;  index++){

				// increase counters
				window.XLNT_intervals[index]["counter"]++;

				// check if function exists
				var code="bln_isFunction = (typeof window." +window.XLNT_intervals[index]["function"] + "=='function')?1:0;";
				eval(code);	code="";

				if (bln_isFunction) {
					var tmp_interval=window.XLNT_intervals[index]["interval"];
					var tmp_counter	=window.XLNT_intervals[index]["counter"];

					// if we need to run the code
					if ((tmp_counter - tmp_interval) >= 0 ){
						window.XLNT_intervals[index]["counter"]=0;
						var args="";
						var array=window.XLNT_intervals[index]["arguments"];
						for (var arg in array){
							args=(args=="")?"":",";
							args+="'" + array[arg] + "'";
						}
						code=(window.XLNT_intervals[index]["function"]+"(" + args + ");");
						eval(code);	code="";
					}
				}
			}
		} catch(e) {}
	}

	window.XLNT_interval_handle=window.setInterval("XLNT_doInterval()",1);

	// - - - - - - - - - - - - - - - - - - - - - - - - - -
	 
	 
	XLNT_isNS4 = (document.layers) ? true : false;
	XLNT_isIE4 = (document.all && !document.getElementById) ? true : false;
	XLNT_isIE5 = (document.all && document.getElementById) ? true : false;
	XLNT_isNS6 = (!document.all && document.getElementById) ? true : false;
	function XLNT_getElementById(id) {
		if (!id) return;
		if (XLNT_isNS4){
		   	return document.layers[id];
		} else if( XLNT_isIE4) {
		   	return document.all[id];
		} else {
	    	return document.getElementById(id);
		}
	}


	function XLNT_findInChilds(window_name,current_window){
		var window_name=window_name;
		try {
			var frame_count=current_window.frames.length;
			for (var i=0; i < frame_count; i++){
				//alert(current_window.frames[i].name + ", " + i + ", " + window_name);
				if 	(current_window.frames[i].name == window_name) return current_window.frames[i];
				var the_window=XLNT_findInChilds(window_name,current_window.frames[i]);
				if (the_window) return the_window;
			}
		} catch(e) {
			//window.status="XLNT_findInChilds:"+ e.message;
		}
		return null;
	}

	function XLNT_findInOpeners(window_name,current_window){
		var window_name=window_name;
		try {
			if (current_window.opener && current_window.opener.closed==false){
				var the_window = XLNT_findInChilds(window_name,current_window.opener.top);
				if (the_window) return the_window;
				var the_window = XLNT_findInOpeners(window_name,current_window.opener);
				if (the_window) return the_window;
			}
		} catch (e) {
		  //window.status="XLNT_findInOpeners:"+e.message;
		}
		return null;
	}

	function XLNT_findWindow(window_name,current_window) {
		var window_name=window_name;
		try {
			// find in childs recursivly
			var the_window = XLNT_findInChilds(window_name,current_window.top);
			if (the_window) return the_window;

			// Find in the openers
			var the_window = XLNT_findInOpeners(window_name,current_window);
			if (the_window) return the_window;
		} catch(e) {
			//window.status="XLNT_findWindow:"+e.message;
		}
		return null;
	}

	window.objPageExplorer=null;
	window.objPageExplorer_url='';
	function XLNT_findPageExplorer() {
		if (window.objPageExplorer!=null){
			window.objPageExplorer.location.href = window.objPageExplorer_url;
		}
		try {
			window.document.onclick=XLNT_findPageExplorer;
			window.objPageExplorer=XLNT_findWindow('frame_pageexplorer',window);
			if (objPageExplorer && window.xlnt_page_id) {
				// get the current page
				var search=window.objPageExplorer.location.search.substr(1);
				var ar_search=search.split("&");
				for ( var i = 0 ; i < ar_search.length ; i++){
					var ar_pair=ar_search[i].split("=");
					if  (ar_pair[0]=="page_id"){
						if (ar_pair[1]==window.xlnt_page_id) return;
						break;
					}
				}
				if (window.objPageExplorer.location!=""){
					window.objPageExplorer_url = window.objPageExplorer.location.protocol + "/";
					window.objPageExplorer_url+= "/" + window.objPageExplorer.location.hostname;
					window.objPageExplorer_url+= window.objPageExplorer.location.pathname;
					window.objPageExplorer_url+= "?page_id=" + window.xlnt_page_id;
					window.objPageExplorer.location.href = window.objPageExplorer_url;
					return true;
				}
			}
		} catch(e) {

		}
		return false;
	}


	// found explorer, load extra javascript for context menu etc..
	if (XLNT_findPageExplorer()) {
		//alert('<scr'+'ipt type="text/javascript" src="'+window.xlnt_URL_BASE+'system/scripts/xlntcms_edittime.js"></scr'+'ipt>');
		//document.write('<scr'+'ipt type="text/javascript" src="'+window.xlnt_URL_BASE+'system/scripts/xlntcms_edittime.js"></scr'+'ipt>');
	} else {
		window.document.onclick='';
	};

