var agt=navigator.userAgent.toLowerCase();var is_major = parseInt(navigator.appVersion);var is_minor = parseFloat(navigator.appVersion);var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));//var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );function viewport() {    this.windowX = (document.documentElement && document.documentElement.clientWidth) || window.innerWidth || self.innerWidth || document.body.clientWidth;    this.windowY = (document.documentElement && document.documentElement.clientHeight) || window.innerHeight || self.innerHeight || document.body.clientHeight;    this.scrollX = (document.documentElement && document.documentElement.scrollLeft) || window.pageXOffset || self.pageXOffset || document.body.scrollLeft;    this.scrollY = (document.documentElement && document.documentElement.scrollTop) || window.pageYOffset || self.pageYOffset || document.body.scrollTop;    this.pageX = (document.documentElement && document.documentElement.scrollWidth) ? document.documentElement.scrollWidth : (document.body.scrollWidth > document.body.offsetWidth) ? document.body.scrollWidth : document.body.offsetWidth;    this.pageY = (document.documentElement && document.documentElement.scrollHeight) ? document.documentElement.scrollHeight : (document.body.scrollHeight > document.body.offsetHeight) ? document.body.scrollHeight : document.body.offsetHeight;}function getWindowSize() {	var myWidth = 0, myHeight = 0;	if( typeof( window.innerWidth ) == 'number' ) {		//Non-IE		//myWidth = window.innerWidth;		myWidth = document.body.clientWidth;		myHeight = window.innerHeight;	} else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {		//IE 6+ in 'standards compliant mode'		myWidth = document.documentElement.clientWidth;		myHeight = document.documentElement.clientHeight;	} else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {		//IE 4 compatible		myWidth = document.body.clientWidth;		myHeight = document.body.clientHeight;	}		return {width: myWidth, height: myHeight};}function $(id) {    return document.getElementById(id);}var currentPhotoNR = 0;function showPhoto( pid ) {    currentPhotoNR = photoIDtoNR[pid];	var view = new viewport();	var win = getWindowSize();	if (is_ie) {		$('photo-layer').style.width = win.width+'px';	}	if (win.height > document.body.clientHeight) var layerHeight = win.height;	else var layerHeight = document.body.clientHeight;	$('photo-layer-bg').style.height = layerHeight+'px';	$('photo-layer-bg').style.display = '';	$('photo-image').src = photos[currentPhotoNR][1];		var preLoad = new Image();	preLoad.onload = function() { 		var top = Math.ceil((win.height - preLoad.height - 150)/2) + view.scrollY;		if (top < 0) top = 0;		$('photo-layer').style.top = top+'px';		$('photo-title').innerHTML = photos[currentPhotoNR][0];		$('photo-layer').style.display = '';		$('photo-navigation').style.display = '';	}	preLoad.src = photos[currentPhotoNR][1];}function nextPhoto( direction ) {       var newNR = currentPhotoNR + direction;    if (newNR < 1 || newNR > photoCount) return;	var win = getWindowSize();	var view = new viewport();		$('photo-image').src = photos[newNR][1];	var preLoad = new Image();	preLoad.onload = function() {		var top = Math.ceil((win.height - preLoad.height - 150)/2) + view.scrollY;		if (top < 0) top = 0;		$('photo-layer').style.top = top+'px';		$('photo-title').innerHTML = photos[newNR][0];		currentPhotoNR = newNR;		}	preLoad.src = photos[newNR][1];}function hidePhoto() {	$('photo-layer-bg').style.display = 'none';	$('photo-layer').style.display = 'none';}function hide( id ) {		if ($( id ).style.display != 'none') {		$( id ).style.display = 'none';	}	}function show( id ) {	//if ($( id ).style.display == 'none') {		$( id ).style.display = 'block';	//}}function showSinglePhoto( src, title, h1 ) {	var win = getWindowSize();	if (is_ie) {		$('photo-layer').style.width = win.width+'px';		//$('photo-layer-bg').style.width = win.width+'px';	}		if (win.height > document.body.clientHeight) var layerHeight = win.height;	else var layerHeight = document.body.clientHeight;		$('photo-layer-bg').style.height = layerHeight+'px';	//$('photo-layer-bg').style.height = win.height+'px';	//$('photo-layer-bg').style.width = win.width+'px';	$('photo-layer-bg').style.display = '';	$('photo-image').src = src;		var preLoad = new Image();	preLoad.onload = function() {		//$('photo-image').src = src;		$('photo-title').style.width = preLoad.width+'px';		var top = Math.ceil((win.height - preLoad.height - 150)/2);		if (top < 0) top = 0;		$('photo-layer').style.top = top+'px';		$('photo-title').innerHTML = title;				if (h1) {			$('photo-top-title').innerHTML = '<h2>'+h1+'</h2>';		}		$('photo-navigation').style.display = 'none';		$('photo-layer').style.display = '';	}	preLoad.src = src;}function reply( id ) {	$('reply_'+id).style.display = 'block';}function closeReply( id ) {	$('reply_'+id).style.display = 'none';}/* FLOAT SELECTION */var float_selection = "";var selection_id = 0;function get_selection(e, id, post_author) {		var str = "";	if (window.getSelection) {		str = window.getSelection();	} else if (document.getSelection) {		str = document.getSelection();	} else if (document.selection && document.selection.createRange) {		var range = document.selection.createRange();		str = range.text;	} else {		str = "Sorry, this is not possible with your browser.";	}		var float_paste = $("float-quote");		if (str != "") {		var coords = get_mouse_coords( e );        float_selection = "[quote="+post_author+"]"+str+"[/quote]\n";		selection_id = id;		coords[0]+=5; coords[1]+=5;		float_paste.style.left = coords[0]+"px";		float_paste.style.top = coords[1]+"px";		float_paste.style.display = "block";	} else {		float_paste.style.display = 'none';	}	}function paste_selection() {   if (float_selection != "") {    			//reply( selection_id );		$( 'reply_field' ).value += float_selection;		$( 'reply_field' ).focus();        var float_paste = $("float-quote");    	float_paste.style.display = 'none';    	float_selection = '';		    } 	}function get_mouse_coords(evt) {	posx = 0;	posy = 0;	if (evt.pageX) return [ evt.pageX, evt.pageY ];	else if (evt.clientX) {   	     posx = evt.clientX + (document.documentElement.scrollLeft ?   	     	  document.documentElement.scrollLeft :   	     	  document.body.scrollLeft);   	     posy = evt.clientY + (document.documentElement.scrollTop ?   	     	  document.documentElement.scrollTop :   	     	  document.body.scrollTop);   	     return [posx, posy ];	} 	else return null;}function page(show, hide) {		$('art-page-'+show).style.display = 'block';	$('art-page-'+hide).style.display = 'none';	window.scroll(0, 0);	}
