
var open_content_node;
var open_content_item;
function open_content_media ( open_content_node , open_content_item ) {
	media_window=window.open("media.php?node="+open_content_node+"&item="+open_content_item,"media_window","width=720px,height=520,0,0");
	media_window.focus();
}

var media_large_key;
function media_large_previous ( ) {
	media_large(pictures_step-1);
}
function media_large_next ( ) {
	media_large(pictures_step+1);
}

function media_large ( media_large_key ) {

	pictures_step=media_large_key;
	if ( pictures_step < 0 ) { pictures_step=0; }
	if ( pictures_step > pictures_max ) { pictures_step=pictures_max; }
		
	var media_large_handler;
	if ( media_large_handler=document.getElementById('media_large_picture') ) {
		media_large_handler.src=pictures[pictures_step][0];
	}

	var media_title_handler;
	if ( media_title_handler=document.getElementById('media_title_paragraph') ) {
		media_title_handler.firstChild.nodeValue=pictures[pictures_step][1];
	}

	var media_control_previous_handler;
	var media_control_right_handler;
	
	if ( media_control_previous_handler=document.getElementById('media_control_previous') ) {
	if ( pictures_step >0 ) {
				media_control_previous_handler.style.display="block";
	} else {
		media_control_previous_handler.style.display="none";
	}
	}

	if ( media_control_next_handler=document.getElementById('media_control_next') ) {
	if ( pictures_step < pictures_max ) {
		media_control_next_handler.style.display="block";
	} else {
		media_control_next_handler.style.display="none";
	}
	}
}
