function browsercheck()
{
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent.toLowerCase()
	this.dom=document.getElementById?1:0
	this.ns4=(!this.dom && document.layers)?1:0;
	this.op=window.opera 
	this.moz=(this.agent.indexOf("gecko")>-1 || window.sidebar)
	this.ie=this.agent.indexOf("msie")>-1 && !this.op
	this.safari=(this.agent.indexOf("safari")>-1)
	if(this.op){
		this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1)
		this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1)
		this.op7=this.dom&&!this.op5&&!this.op6
	}else if(this.moz) this.ns6 = 1
	else if(this.ie){
		this.ie4 = !this.dom && document.all
  	this.ie5 = (this.agent.indexOf("msie 5")>-1)
  	this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1)
  	this.ie6 = this.dom && !this.ie4 && !this.ie5 && ! this.ie55
  	this.ie7 = document.all && !document.XMLHTTPObject
	}
	this.mac=(this.agent.indexOf("mac")>-1)
	this.bch=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6 || this.op7)
  this.usedom= this.ns6||this.op7
  this.reuse = this.ie||this.op7||this.usedom
  this.px=this.dom&&!this.op5?"px":""
	return this
}

var bch=new browsercheck();
// Anzeigestatus 0 = aus, 1 = an
var imageGalleryLayer = 1;

// Layer WIDTH
var imageGalleryLayerWidth = 790;

// Layer HEIGTH
var imageGalleryLayerHeight = 680;
var obj = null;
var currentPos 	= "";

function showGallery(newsid) {

		if (window.innerWidth) {
			width = window.innerWidth;
		} else if (bch.ie && !document.documentElement.clientWidth) {
			width = document.body.offsetWidth;
		} else if (bch.ie7) {
			width = document.documentElement.clientWidth;
		}
		
		if (window.innerHeight) {
			height = window.innerHeight;
		} else if (bch.ie && !document.documentElement.clientHeight) {
			height = document.body.offsetHeight;
		} else if (bch.ie7) {
			height = document.documentElement.clientHeight;
		} 

		pos_left = (width-imageGalleryLayerWidth)/2;
		pos_top	 = (height-imageGalleryLayerHeight)/2;
		pos_left 	= Math.ceil(pos_left);
		pos_top 	= Math.ceil(pos_top);

		unhideGallery();
		imageGalleryLayer = 1;
		
		if (bch.ie && !document.documentElement.clientWidth) {
			getScroll();
			prepareIE('100%', 'hidden');
			setScroll(0,0);
		}
		
		document.getElementById('skip_right').innerHTML = "<a href=\"#\" onclick=\"skip_" + newsid + "(1)\" onfocus=\"this.blur()\"></a>";
		document.getElementById('skip_left').innerHTML = "<a href=\"#\" onclick=\"skip_" + newsid + "(-1)\" onfocus=\"this.blur()\"></a>";

}

function hideGallery() {
	jQuery("select").css("display","");
	jQuery("#centerlayer1").fadeOut(500);
	jQuery("#mainlayer").fadeOut(500);
	jQuery("body").css("position", "");
	jQuery("body").css("height", "100%");
	jQuery("body").css("overflow","auto");
	imageGalleryLayer = 0;
	if (bch.ie && !document.documentElement.clientWidth) {
		setScroll(0,this.yPos);
		prepareIE("auto", "auto");
	}
}

function prepareIE(height, overflow){
	bod = document.getElementsByTagName('body')[0];
	bod.style.height = height;
	bod.style.overflow = overflow;
	htm = document.getElementsByTagName('html')[0];
	htm.style.height = height;
	htm.style.overflow = overflow; 
}

function unhideGallery(){
	jQuery("#mainlayer").css("height", height);
	jQuery("body").css("position", "relative");
	jQuery("body").css("overflow","hidden");
	jQuery("body").css("height", height);
	jQuery("#centerlayer1").fadeIn(800);
	jQuery("#mainlayer").css("display", "block");
	jQuery("#mainlayer").css("filter", "alpha(opacity=95)");
	jQuery("#centerlayer1").css("left", pos_left+"px");
	jQuery("#centerlayer1").css("top", pos_top+"px");
}




