(function(){

// Check for jQuery
if (typeof $ == 'undefined') {
	alert('jQuery is required!');
}

var baseUrl = '';

// get  baseUrl
$('script').filter(function() {
	return (this.src && this.src.match(/pro\.js(\?.*)?$/));;
}).each(function() {
	baseUrl = this.src.replace(/\/[^\/]+\/pro\.js(\?.*)?$/, '').replace(/^[a-z]*:\/\/[^/]+/, '');
	
	// only for first element for now :)
	return false;
});

var Pro = window.Pro = {

	// define later
	lightBoxStdOptions: {},
		
	baseUrl: function(path) {
		if (path) {
			path = path.replace(/^\/+|\/+$/g, '');
		}
		return baseUrl + (path ? '/'+path : '');
	}
};

Pro.lightBoxStdOptions = {
	imageBlank: Pro.baseUrl('images/lightbox-blank.gif'),
	imageLoading: Pro.baseUrl('images/lightbox-ico-loading.gif'),
	imageBtnClose: Pro.baseUrl('images/lightbox-btn-close.gif'),
	imageBtnPrev: Pro.baseUrl('images/lightbox-btn-prev.gif'),
	imageBtnNext: Pro.baseUrl('images/lightbox-btn-next.gif'),
	txtImage: 'Bild',
	txtOf: 'von'
};

$('a.lightbox').live('click', function(){
	$(this).lightBox(Pro.lightBoxStdOptions).click();
	return false;
});
$('a').live('click', function(){
	this.blur();
});

})();

$(document).ready(function() {
    $("#topHiddenBar").css("position", "absolute");
});

$(window).scroll(function() {
    $("#topHiddenBar").css("top", $(window).scrollTop() + "px");
    if ($(window).scrollTop() >= 160) {
    	$("#topHiddenBar").css("visibility", "visible"); 
    } else {
    	$("#topHiddenBar").css("visibility", "hidden"); 
    }
});



function openZeitung(ziel) {
	  var h = screen.availHeight - 20;
	  var w = screen.availWidth - 20;
	  var x=0, y=0, parameter="";
	  if (w < screen.availWidth || h < screen.availHeight) {
	    x = (screen.availWidth - w - 20) / 2;
	    y = (screen.availHeight - h - 20) / 2;
	    if (window.opera) y = 0; // Opera positioniert unter den Symbolleisten
	    if (x<0 || y<0) { x=0; y=0; }
	    else parameter = "width=" + w + ",height=" + h + ",";
	  }
	  parameter += "left=" + x + ",top=" + y;
	  parameter += ",menubar=no,location=no,toolbar=no,status=no";
	  parameter += ",resizable=no,scrollbars=no";
	  var Fenster = window.open(ziel,"Zeitung_Tips",parameter);
	  if (Fenster) Fenster.focus();
	  return !Fenster;
}

function printDiv(grafik) {
	var win1 = window.open('', 'printdiv', 'width=840,height=500,scrollbars=yes');
	win1.document.open();
	win1.document.write('<img src='+grafik+' >');
	win1.document.close();
}



