	var page_modified = false;
	var CHORME = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	var IE = navigator.appName.indexOf("Internet Explorer") > -1;
	
	var IE6 = false;
	if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){;
		var ieversion=new Number(RegExp.$1);
		if (ieversion==6) IE6 = true;
	}
	
function event_push(obj, event, handler) {
	if(obj.addEventListener) obj.addEventListener(event, handler, false);
	else if (obj.attachEvent) obj.attachEvent('on'+event, handler);
}
function doc_height() {
	return document.getElementById("doc_height").clientHeight + 285;
}
function doc_width() {
	return document.getElementById("all_doc").clientWidth +10;
}
function ends_with(str, suffix){ return str.indexOf(suffix, str.length - suffix.length) !== -1;}
	function moved_out_of(e, container){
		if (!e) var e = window.event;
		
		var tg = (window.event) ? e.srcElement : e.target;
		var rtg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
		
		if(!rtg || rtg == null) return false;
		
		var tg_in = false;
		while(tg != null && tg.tagName != 'BODY'){
			if(tg.id == container){
				tg_in = true;
				break;
			}
			tg = tg.parentNode;			
		}

		var rtg_in = false;
		while(rtg != null && rtg.tagName != 'BODY'){
			if(rtg.id == container){
				rtg_in = true;
				break;
			}
			rtg = rtg.parentNode;
		}

		return !rtg_in;
	}
	function inside_of(component, container){
		var rtg = component;
		
		var rtg_in = false;
		while(rtg.tagName != 'BODY'){
			if(rtg.id == container){
				rtg_in = true;
				break;
			}
			rtg = rtg.parentNode;
		}

		return rtg_in;
	}


	
	var comment_area_focus = null;
	var comment_area_focus_cuid = null;
	var comment_area_cuid = null;
	if(document.addEventListener) document.addEventListener( "click", on_document_click, true );
 	else document.attachEvent( "onclick", on_document_click );
	function on_document_click(e){
		var evt = e || window.event;
		var target = evt.target || evt.srcElement;
		if(comment_area_focus != null){
			if(target != comment_area_focus){
				hide_comment_area(comment_area_focus_cuid);
			}
		}		 
	}
	function comment_area_key(e){
		var evt = e || window.event;
		if(evt.keyCode == 27 && comment_area_cuid != null){
			hide_comment_area(comment_area_focus_cuid);
		}
	}
 	function hide_comment_area(cuid){
		document.getElementById('comment_area_' + cuid).style.display = "none";
		document.getElementById('vote_frame_' + cuid).style.height = 'auto';
		comment_area_focus = null;
		
		hide_comment_toolbar_body(cuid);
	}
 	function show_comment_toolbar(cuid){
 		var comment_area_toolbar = document.getElementById('vote_frame_' + cuid);
		comment_area_cuid = cuid;
		comment_area_toolbar.style.width = '100%';
 		comment_area_toolbar.style.display = "";
	}
 	function hide_comment_toolbar(cuid, e){
 		var evt = e || window.event;

 		if(comment_area_focus_cuid != cuid && moved_out_of(evt, 'vote_frame_' + cuid)){
 			hide_comment_toolbar_body(cuid);
 		}
	}
 	function hide_comment_toolbar_body(cuid){
 		var toolbar_image = document.getElementById('vote_frame_image_' + cuid);
 		
 		if(toolbar_image){ toolbar_image.style.display = "";
			var comment_area_toolbar = document.getElementById('vote_frame_' + cuid);
	 		comment_area_toolbar.style.display = "none";
 		}
 		
 		roll_out_comment_vote(cuid);
	}
	function submit_comment_form(cuid, root_ref, vote_target){
		var url = 
			"/apreciere.jsp?" + 
			document.getElementById("comment_area_comp_" + cuid).value +
			"&vote=" + document.getElementById('vote_' + cuid).value +
			"&comment=" + document.getElementById('comment_text_' + cuid).value;

		if(vote_target != null && vote_target != 'null') send_request_invoke(url, "window.location='" + vote_target + "';");
		else send_request(url, 'comment_async_container_' + root_ref);
	}
	function show_all_comments(root_ref, s_url){
		document.getElementById("comment_async_container_" + root_ref).innerHTML = '<img src="/img/ajax-loader-18x18.png">';
		send_request("/apreciere.jsp?" + s_url, "comment_async_container_" + root_ref);
	}
	function vote_comment(score, cuid, object_type, object_id, root_type, root_id, vote_target){
		if(__c_login != null){
			if(typeof document.getElementById('comment_area_' + cuid) == 'undefined' || document.getElementById('comment_area_' + cuid) == null){
				var root_ref = root_type + "_" + root_id;
		        var comment_div =
		            "<div id=\"comment_area_" + cuid + "\">" +
		            "    <input id=\"comment_area_comp_" + cuid + "\" type=\"hidden\" name=\"type\" value=\"type=" + object_type + "&id=" + object_id + "&vote_target="+vote_target+"&root_type="+root_type+"&root_id="+root_id+"\">" +
		            "    <input type=hidden name=\"type\" value=\"" + object_type + "\">" +
		            "    <input type=hidden name=\"id\" value=\"" + object_id + "\">" +
		            "    <input type=hidden name=\"vote_target\" value=\"" + vote_target + "\">" +
		            "    <input type=hidden name=\"root_type\" value=\"" + root_type + "\">" +
		            "    <input type=hidden name=\"root_id\" value=\"" + root_id + "\">" +
		            "    <input type=hidden id=\"root_referer_" + cuid + "\" value=\"" + root_ref + "\">" +
		            "    <input name=\"vote\" type=hidden id=\"vote_" + cuid + "\" value=\"0\">" +
		            "    <textarea name=\"comment\" id=\"comment_text_" + cuid + "\" style=\"width:99%; height:70px; border:1px solid #a2adb7; margin-bottom:5px;\" onkeypress=\"comment_area_key(event)\"></textarea>" +
		            "    <input type=\"button\" value=\"Trimite\" onclick=\"submit_comment_form('" + cuid + "', '" + root_ref + "', '" + vote_target + "')\">" +
		            "</div>";
				
		        document.getElementById('vote_frame_' + cuid).innerHTML += comment_div;
			}
			else document.getElementById('comment_area_' + cuid).style.display = "";
			
			var old_cuid = comment_area_focus_cuid;
			if(comment_area_focus != null && comment_area_focus_cuid != cuid) hide_comment_area(old_cuid);
			comment_area_focus_cuid = cuid;
			
			document.getElementById('vote_' + cuid).value = score;
	
			if(score == -1000) document.getElementById('comment_text_' + cuid).value = "Motivul ...";
			else if(score == -1) document.getElementById('comment_text_' + cuid).value = "Spune aici ...";
			else if(score == 0) document.getElementById('comment_text_' + cuid).value = "Acceptabil";
			else if(score == 1) document.getElementById('comment_text_' + cuid).value = "Bun";
			else if(score == 2) document.getElementById('comment_text_' + cuid).value = "Foarte Bun";
			else if(score == 3) document.getElementById('comment_text_' + cuid).value = "Lăudabil";
			else if(score == 4) document.getElementById('comment_text_' + cuid).value = "Exceptional";
			window.parent.document.getElementById('vote_frame_' + cuid).style.height = 'auto';

			comment_area_focus = document.getElementById('comment_text_' + cuid);
			
			document.getElementById('comment_text_' + cuid).focus();
			document.getElementById('comment_text_' + cuid).select();
		}
		else window.parent.location = "/autentificare";
	}
	function roll_over_comment_vote(score, cuid){
		for(var i = 0; i <= score; i++) document.getElementById('score_' + cuid + '_'+ i).src = '/img/star.png';
	}
	function roll_out_comment_vote(cuid){
		for(var i = 0; i < 5; i++) document.getElementById('score_' + cuid + '_'+ i).src = '/img/hollow_star.png';
	}

	
	
	function toggle(button){button.checked = !button.checked;} // login

	var open_menu = null;
	function popup_menu(div_name, menu_name, offset, offset_y){
		
	 	hide_popup();

	 	var div = document.getElementById(div_name);
		var src = document.getElementById(menu_name);

		var src_x = 0;
		var c_width = document.body.clientWidth;

		while(src != null && src != document.body){
			src_x += src.offsetLeft;
			src = src.offsetParent;
		}
		
		src = document.getElementById(menu_name);
		var src_y = -3;

		while(src){
			src_y+= src.offsetTop;
			src = src.offsetParent;
		}
		
		//div.style.opacity = 0;
		div.style.display = "";

		src_x -= 6;
		src_y += 3;

		div.style.left = src_x + (offset ? offset : 0) + "px";
		div.style.top = src_y + 15 + (offset_y ? offset_y : 0) + "px";

		open_menu = div.id;
		//fade_in(div_name, 1, 0.5);
	}

	function hide_popup(){
		if(open_menu != null) document.getElementById(open_menu).style.display="none";
	}

	function hide_popup_menu(e){
		if(moved_out_of(e, open_menu)) document.getElementById(open_menu).style.display="none";
	}
	
	
	function autosubmit(){}
	function multi_field_focus(){
		var mf = document.getElementById("multifield");
		if(mf.value == 'Caută ...    Postează ...    Propune Obiectiv Turistic ...'){mf.value = '';	mf.style.color = '#285485';}
	}
	function multi_filed_blur(){
		var mf = document.getElementById("multifield");
		if(mf.value == ''){mf.value = 'Caută ...    Postează ...    Propune Obiectiv Turistic ...';	mf.style.color = '#98a2a4';}
	}
	function cauta(){
		var mf = document.getElementById("multifield");
		if(mf.value != 'Caută ...    Postează ...    Propune Obiectiv Turistic ...'){window.location = "/cautare-generala?search_key=" + mf.value;}
	}
	function check_key(e){
		var evt = e || window.event; if(evt.keyCode == 13) cauta();
	}
	function spune(url){
		var mf = document.getElementById("multifield");
		if(mf.value != 'Caută ...    Postează ...    Propune Obiectiv Turistic ...'){window.location = url + "?posteaza=" + mf.value;}
	}
	function adauga(){
		var mf = document.getElementById("multifield");
		if(mf.value != 'Caută ...    Postează ...    Propune Obiectiv Turistic ...'){window.location = "/obiective-turistice/modifica?nume=" + mf.value;}
	}
	
	
	var late_show = null;
	var show_id = null;
	var show_index = null;
	var parent_url = null;
	var src_img = null;
	var target_image = null;
	var image_loaded = false;
	function clear_zoom(){
		var div = document.getElementById('zoom_div'); 
		div.style.display = "none";
	}
	function late_show_image(si){
		if(document.getElementById('preview_div_main') != null) scroll(0,0);
		show_id = si;
		
		for(var i = 0; i < slideshow_images.length; i++){
			if(slideshow_images[i][0] == show_id){
				index = i;
				break;
			}
		}
		
		show_index = index;
		parent_url = slideshow_images[show_index][1];

		var src = document.getElementById('img' + show_id);
		
		if(target_image == null){
			target_image = new Image();
			target_image.onload = function on_image_load(){
				image_loaded = true;
				show_image();
				show_controls();
			};
		}

		src_img = src;

		var target_src = slideshow_images[show_index][4];

		if(ends_with(target_image.src, target_src)){
			image_loaded = true;
		}
		else{
			image_loaded = false;
			target_image.src = target_src;
			fade_out('main_image', 10, 0.05);
		}
		
		late_show = setTimeout('show_image()', 0);
	}
	function show_controls(){
		var div = document.getElementById('preview_div');
		var imgv = document.getElementById('main_image');
		var ctl_div = document.getElementById('preview_div_controls');
		
		if(ctl_div.style.opacity >= 1 && ctl_div.style.display == "") return;
		
		ctl_div.style.width = IE || CHORME ? 375 : "auto"; 
		ctl_div.style.display = "";
		ctl_div.style.top = div.offsetTop + imgv.clientHeight - 90 + "px";
		ctl_div.style.left = (document.body.clientWidth - ctl_div.clientWidth)/2 + document.body.scrollLeft + "px";
	}
	function hide_controls(e){
		if(moved_out_of(e, 'preview_div') && moved_out_of(e, 'preview_div_controls')) document.getElementById('preview_div_controls').style.display = 'none';
	}
	function position_div(width_hint){
		var div = document.getElementById('preview_div');
		
		if(div != null){
			div.style.display = "";

			var img_width = document.getElementById('main_image').clientWidth;
			var img_height = document.getElementById('main_image').clientHeight;
			if(img_width < 600) img_width = 600;

			
			div.style.width = IE || CHORME ? img_width + 10 : "auto"; 
			
			var dt = (document.body.clientHeight - (div.clientHeight))/2 + document.body.scrollTop;
			if(dt < 0) dt = 0;

			div.style.width = (img_width + 10) + "px";
			div.style.top = dt + "px";
			div.style.left = (document.body.clientWidth - div.clientWidth)/2 + document.body.scrollLeft + "px";
		}
	}
	function show_zoom(id){
		var src = document.getElementById('img' + id);
		var div = document.getElementById('zoom_div'); 

		var src_x = 0;

		while(src != document.body){
			src_x += src.offsetLeft;
			src = src.offsetParent;
		}
		
		var src_y = 0;
		src = document.getElementById('img' + id);

		while(src){
			src_y+= src.offsetTop;
			src = src.offsetParent;
		}
					
		div.style.display = "";
	
		src_x += 0;
		src_y += 0;

		div.style.left = src_x + "px";
		div.style.top = src_y + "px";
	}
	function show_image(){
		if(show_index == -1) return;
		
		window.onresize = show_image;

		late_show = null;

		if(document.getElementById('main_image_link') != null) document.getElementById('main_image_link').href=parent_url;
		if(document.getElementById('preview_div_main') != null){
			document.getElementById('preview_div_main').style.display = ''; 
			document.getElementById('preview_div_main').style.height = doc_height() + "px";
			document.getElementById('preview_div_main').style.width = doc_width() + "px";
		}
		
		if(image_loaded){
			if(document.getElementById('wait_window') != null) document.getElementById('wait_window').style.display = "none";

			document.getElementById('main_image').style.opacity = 0;
			document.getElementById('main_image').src = target_image.src;
			document.getElementById('main_image').width = target_image.width;
			document.getElementById('main_image').height = target_image.height;
			position_div(document.getElementById('main_image').width);
			document.getElementById('image_details').innerHTML = "( " + (show_index + 1) + " / " + slideshow_images.length + " ) " + slideshow_images[show_index][2];
			if(document.getElementById("fav_td_" + !slideshow_images[show_index][3]) != null) document.getElementById("fav_td_" + !slideshow_images[show_index][3]).style.display = "";
			if(document.getElementById("fav_td_" + slideshow_images[show_index][3]) != null) document.getElementById("fav_td_" + slideshow_images[show_index][3]).style.display = "none";
			fade_in('main_image', 10, 0.05);

			if(document.getElementById("main_image_comments") != null){
				send_request("/apreciere.jsp?maxc=1&" + slideshow_images[show_index][6], 'image_comments');
			}
		}
		else if(document.getElementById('wait_window') != null){
			var div = document.getElementById('wait_window');
			
			div.style.display = "";
			div.style.width = IE || CHORME ? 64 : "auto"; 
			div.style.top = (document.body.clientHeight - div.clientHeight)/2 + document.body.scrollTop + "px";
			div.style.left = (document.body.clientWidth - div.clientWidth)/2 + document.body.scrollLeft + "px";
		}
	}
	var fadings = {};
	function Fading(tid, type){
		this.timeout_id = tid;
		this.timeout_type = type;
	}
	function roll_out(container, content){
		if(fadings[container] != null && fadings[container].timeout_type != 'out'){
			window.clearInterval(fadings[container].timeout_id);
			fadings[container] = null;
		}
		
		var ct = document.getElementById(container);
		var obj = document.getElementById(content);
		
		if(parseInt(ct.offsetHeight) < parseInt(obj.offsetHeight)){
			ct.style.height = parseInt(ct.offsetHeight) + 25 > parseInt(obj.offsetHeight) ? parseInt(obj.offsetHeight) : parseInt(ct.offsetHeight) + 25 + "px";
			if(!IE) ct.offsetHeight = ct.style.height;
			if(fadings[container] == null) fadings[container] = new Fading(window.setInterval("roll_out('" + container + "', '" + content + "')", 30), 'out');
		}
		else if(fadings[container] != null){
			window.clearInterval(fadings[container].timeout_id);
			fadings[container] = null;
		}
	}
	function roll_in(container, size, e){
		if(!moved_out_of(e, container)) return;
		roll_in_rr(container, size);
	}
	function roll_in_rr(container, size){
		
		if(fadings[container] != null && fadings[container].timeout_type != 'in'){
			window.clearInterval(fadings[container].timeout_id);
			fadings[container] = null;
		}
		
		var ct = document.getElementById(container);
		
		if(parseInt(ct.offsetHeight) > size){
			ct.style.height = (parseInt(ct.offsetHeight) -25 < size ? size : parseInt(ct.offsetHeight) - 25) + "px";
			if(!IE) ct.offsetHeight = ct.style.height;
			if(fadings[container] == null){
				fadings[container] = new Fading(window.setInterval("roll_in_rr('" + container + "', " + size + ")", 30), 'in');
			}
		}
		else if(fadings[container] != null){
			window.clearInterval(fadings[container].timeout_id);
			fadings[container] = null;
		}
	}
	function fade_in(object, timeout, step){
		if(fadings[object] != null) window.clearInterval(fadings[object].timeout_id);
		fadings[object] = new Fading(window.setInterval("fade_in_body('"+object+"', "+step+")", timeout), 'in');
	}
	function fade_in_body(object, step){
		var obj = document.getElementById(object);
		var num = new Number(parseFloat(obj.style.opacity) + step);
		obj.style.opacity = num.toFixed(2);
		if(IE) obj.style.filter = 'alpha(opacity=' + (num.toFixed(2)*100) + ')';
		if(obj.style.opacity >= 1){
			window.clearInterval(fadings[object].timeout_id);
		}
	}
	function fade_out(object, timeout, step){
		if(fadings[object] != null) window.clearInterval(fadings[object].timeout_id);
		fadings[object] = new Fading(window.setInterval("fade_out_body('"+object+"', "+step+")", timeout), 'out');
	}
	function fade_out_body(object, step){
		var obj = document.getElementById(object);
		var num = new Number(parseFloat(obj.style.opacity) - step);
		obj.style.opacity = num.toFixed(2);
		if(IE) obj.style.filter = 'alpha(opacity=' + (num.toFixed(2)*100) + ')';
		if(obj.style.opacity <= 0){
			window.clearInterval(fadings[object].timeout_id);
		}
	}
	function close_preview(){
		 if(document.getElementById('preview_div') != null) document.getElementById('preview_div').style.display = "none";
		 if(document.getElementById('preview_div_main') != null) document.getElementById('preview_div_main').style.display = "none";
		 document.getElementById('preview_div_controls').style.display = "none";
		 show_index = -1;
	}
	function max_rez(){window.location =slideshow_images[show_index][5];}
	function fav_img(){
		var url ="/favorite.jsp?action=" + (!slideshow_images[show_index][3] ? "add" : "delete") + "&login="+__c_login+"&object_type=image&object_id=" + show_id;
		send_request_invoke(url, "flip_fav_icon("+!slideshow_images[show_index][3]+")", null);
	}
	function flip_fav_icon(fav){
		slideshow_images[show_index][3] = fav;
		if(document.getElementById("fav_td_" + !fav) != null) document.getElementById("fav_td_" + !fav).style.display = "";
		if(document.getElementById("fav_td_" + fav) != null) document.getElementById("fav_td_" + fav).style.display = "none";
	}
	function to_img(dir){
		var x = show_index + dir;
		if(x > slideshow_images.length -1) x = 0;
		if(x < 0) x = slideshow_images.length -1;
		document.getElementById('preview_div_controls').style.opacity = 0.8;
		late_show_image(slideshow_images[x][0]);
	}
	document.onkeydown = function(e) {var evt = e || window.event;	if(evt.keyCode == 27){on_escape();}};
	function roll_over_ctl(index, img, text){
		document.getElementById('action_' + index).src = '/img/preview-' + img + '.png';
		document.getElementById('image_details').innerHTML = text;
	}
	function roll_out_ctl(index){
		document.getElementById('action_' + index).src = '/img/blank.gif';
		document.getElementById('image_details').innerHTML = "( " + (show_index + 1) + " / " + slideshow_images.length + " ) " + slideshow_images[show_index][2];
	}
	function on_escape(){
		if(typeof close_preview != 'undefined') try{ 
			close_preview();
		}
		catch(e){}
		
		if(typeof close_map_pick != 'undefined') try{ 
			close_map_pick();
		}
		catch(e){}
	}
	
	
	function create_request_object(){
		var returnObj = null;
	    if(window.XMLHttpRequest){returnObj = new XMLHttpRequest();} 
	    else if(window.ActiveXObject) {
			try{
				returnObj = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch(e){
			    try{returnObj = new ActiveXObject("Microsoft.XMLHTTP");}
				catch (e) {}
			}
	    }
		return returnObj;
	}
	function send_request(url, target_element){
		var http = create_request_object();
		var target = target_element;
		try{
			http.open('get', url, true);
		}
		catch (e){
			document.getElementById(target).innerHTML = e;
			return;
		}
		
		http.onreadystatechange = function(){	
				if(http.readyState == 4) {		
					try{
						var strResponse = http.responseText;
						document.getElementById(target).innerHTML = strResponse;
					} catch (e){
						document.getElementById(target).innerHTML = e;
					}
						
					advance_mainpage_load();
				}
			};
		http.send();	
	}
	function assign_request(url, target_element){
		var http = create_request_object();
		var target = target_element;
		try{
			http.open('get', url, true);
		}
		catch (e){
			document.getElementById(target).innerHTML = e;
			return;
		}
		
		http.onreadystatechange = function(){	
				if(http.readyState == 4) {		
					try{
						var strResponse = http.responseText;
						document.getElementById(target).value = strResponse;
					} catch (e){
					}
						
					advance_mainpage_load();
				}
			};
		http.send();	
	}
	function send_request_invoke(url, on_success, on_error){
		var http = create_request_object();
		try{
			http.open('get', url, true);
		}
		catch (e){
			document.getElementById(target).innerHTML = e;
			return;
		}
		
		http.onreadystatechange = function(){	
				if(http.readyState == 4) {
					try{
						window.setTimeout(on_success, 0);
					}
					catch(e){
						if(on_error != null) window.setTimeout(on_success, 0);
					}
				}
			};
		http.send();	
	}
	function transer_content(medium_if, form_container, wait_name){
		var idocu = document.getElementById(medium_if).contentDocument || document.getElementById(medium_if).contentWindow.document;
		var fm = document.getElementById(form_container);

		fm.innerHTML = idocu.body.innerHTML;
		
		var all_chk = document.getElementsByTagName('input');

		for(var i = 0; i < all_chk.length; i++) if(all_chk[i].type == 'checkbox' || all_chk[i].type == 'radio'){
			all_chk[i].checked = document.getElementById(all_chk[i].id).checked; 
		}			

		document.getElementById(wait_name).style.display = "none";
	}
	function async_submit(form_container, medium_if, form_name, wait_name, action){
		var idocu = document.getElementById(medium_if).contentDocument || document.getElementById(medium_if).contentWindow.document;
		while(idocu.body.firstChild ) idocu.body.removeChild(idocu.body.firstChild);

		var fm_container = document.getElementById(form_container);
		idocu.body.innerHTML = fm_container.innerHTML;

		var all_select = idocu.getElementsByTagName('select');
		for(var i = 0; i < all_select.length; i++) all_select[i].selectedIndex = document.getElementById(all_select[i].id).selectedIndex; 

		var all_chk = idocu.getElementsByTagName('input');
		for(var i = 0; i < all_chk.length; i++){
			if(all_chk[i].type == 'checkbox') all_chk[i].checked = document.getElementById(all_chk[i].id).checked; 
			else if(all_chk[i].type == 'radio') all_chk[i].checked = document.getElementById(all_chk[i].id).checked; 
			else if(all_chk[i].type == 'text'){
				all_chk[i].value = document.getElementById(all_chk[i].id).value;
			}
			else if(all_chk[i].type == 'password') all_chk[i].value = document.getElementById(all_chk[i].id).value; 
		}			

		var all_select = idocu.getElementsByTagName('textarea');
		for(var i = 0; i < all_select.length; i++) all_select[i].value = document.getElementById(all_select[i].id).value; 

		if(action) idocu.getElementById("action").value = action;
		document.getElementById(wait_name).style.display = "";
		idocu.getElementById(form_name).submit();
	}
	var post_load_queue = new Array();
	var post_load_index = 0;
	function load_mainpage_iframes(){
		advance_mainpage_load();
	}
	function set_img_src(img_id, src){
		document.getElementById(img_id).src = src;
		advance_mainpage_load();
	}
	function set_if_src(iframe_id, src){
		document.getElementById(iframe_id).contentWindow.location.replace(src);
		advance_mainpage_load();
	}
	function set_image_bg(object_id, img_src){
		document.getElementById(object_id).style.background = "url('" + img_src + "') no-repeat center";
		advance_mainpage_load();
	}
	function set_inner_html(object_id, innerhtml){
		document.getElementById(object_id).innerHTML = innerhtml;
		advance_mainpage_load();
	}
	function advance_mainpage_load(){
		if(post_load_index < post_load_queue.length){
			window.setTimeout(post_load_queue[post_load_index++], 0);
		}
	}
