jQuery.each(jQuery.browser, function(i, val) {
	if ((i=="opera") || (i=="webkit")) {
		$(document).ready(function() {
			document.getElementById('content_sidebar_content').style.height=(document.getElementById('content_sidebar').offsetHeight-1)+'px';
		});
		$(window).load(function() {
			document.getElementById('content_sidebar_content').style.height=(document.getElementById('content_sidebar').offsetHeight-1)+'px';
		});
	}
});

function set_item_id(id_s) {
	var element_o = document.getElementById(id_s);
	element_o.style.display = element_o.style.display ? '' : 'none';
}

function scr_onload() {
	if (document.location.search.substring(1,3) == 'r=') {
		var id_s = document.location.search.substring(3,document.location.search.length);
		if (id_s) {
			window.scrollTo(0,177 + document.getElementById('ref_top').offsetTop + document.getElementById('ref_top_'+id_s).offsetTop);
		}
	}
}

function new_window(url) {
	window.open(url,'','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
}

function popup_wysiwyg(url) {
	var w = 640;
	var h = 480;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	window.open(url,'wysiwyg_popup','top='+TopPosition+',left='+LeftPosition+',toolbar=no,menubar=no,scrollbars=yes,status=no,location=no,directories=no,width='+w+',height='+h+',resizable="1",resizable=yes');
}

function popup_img(url) {
	var w = 0;
	var h = 0;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	LeftPosition = 0;
	TopPosition = 0;
	img_popup = window.open('/image_popup.html?'+url,'img','top='+TopPosition+',left='+LeftPosition+',toolbar=no,menubar=no,scrollbars=auto,status=no,location=no,directories=no,width='+w+',height='+h+',resizable="1",resizable=yes');
	img_popup.blur()
	window.focus()
}

