/**
* Futureweb Javascript include File (c)2007 futureweb.at
**/


/**
* Function to open window correct and still be xhtml strict conform. area doesn't allow rel, so used class.
**/

$(document).ready(function(){
	$('a[@rel$="external"]').attr("target","_blank");						   
	$('area[@class$="external"]').attr("target","_blank");			   
	
});

$(document).ready(function(){
	$('a[@rel$="top"]').attr("target","_top");						   
	$('area[@class$="top"]').attr("target","_top");
});

/**
* Function to track clicks or downloads with google, always _blank. google code needed and title within a for naming
**/

$(document).ready(function(){ 
	$('a[@rel$="download"]').attr("target","_blank");
	$('a[@rel$="download"]').click(function() { urchinTracker(this.title); });
	$('area[@class$="download"]').click(function() { urchinTracker(this.title); });
	$('area[@class$="download"]').attr("target","_blank");
});



/**
* Function to center content and background correctly caused by negativ margin if window is resized. pnfw130907
**/

$(document).ready(function(){
	resize();						   
});

$(window).resize( function(){
	resize();							 
});

function resize() {
	
	width = $(window).width();
	
	if(width <= 990) {
		$("#container").css({ "margin-left": "0px" });
		$("#container").css({ left: "0px" });
		/*$("body").css({ "background-position": "-1005px top" });*/
		$("body").css({ "background-position": "-350px top" });
		$("#rezeptbuch").css({ "left": "500px" });
		$("#kontakt").css({ "left": "500px" });
	} else {
		$("#container").css({ "margin-left": "-495px" });
		$("#container").css({ left: "50%" });
		$("body").css({ "background-position": "center top" });
		$("#rezeptbuch").css({ "left": "" });
		$("#kontakt").css({ "left": "" });
	}
}