
	function displayWindow(url, width, height) {
		var winname, date, time;
		var startx = Math.round((screen.width-width)/2);
		var starty = Math.round((screen.height-height)/2) - 20;

		date = new Date;
	  	time = date.getTime();
	  			
		winname = window.open(url,"Window" + time,"width=" + width + ",height=" + height + ",status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,screenX=" + startx + ",left=" + startx + ",screenY=" + starty + ",top=" + starty + " "); 
		return (winname);
			
	}    

	function editWindow(url) {
		return ! displayWindow(url.attr('href'), 470,510);
	}

	function reSizeToHeight(){
		
		var doc_body = $('body');
		var height = $('#heightdiv').innerHeight() + 25;

		var cur_width = doc_body.innerWidth();
		var cur_height = doc_body.innerHeight();



		// wenn Fenster hoeher als 600, dann auf 600 setzen, sonst scrollbars ausschalten
		if (height > 600)
			height = 600;
		else {
			doc_body.attr('scroll', 'no');
			doc_body.css('overflowY', 'hidden');
		}


 		window.moveTo((screen.width-cur_width) / 2,((screen.height-30-height) / 2) - 35)
//		window.moveBy(0, (((height - cur_height) / 2))* -1);

		if (! window.resizeBy(0, (height - cur_height)))
			window.innerHeight = height;

	}

	
	function load_content(url, content_div) {

		if (! content_div)
			content_div = 'body';

		if (typeof url == 'object')
			url = url.attr('href');

		$.get(url, {ajax_load: 1}, function(data) { $(content_div).html(data); });
		
//		$("#content").load(url.attr('href'), {ajax_load: 1});
		return false;
	}


	function load_content_confirm(url, question, content_div) {

		if (! content_div)
			content_div = 'body';
			
		var box=window.confirm(question);
		
		if (box==true) {

			if (typeof url == 'object') {
//				$(url).closest('.entry_wrapper').slideUp('slow', function() {
					$.get(url.attr('href'), {ajax_load: 1}, function(data) { $(content_div).html(data); });
//				});
			}
			else
				$.get(url, {ajax_load: 1}, function(data) { $(content_div).html(data); });					
		}
		return false;		
	}
	