






// Copyright VIEWSION.net Matthias Weiss
//
// bookmark ---------------------------------------------------------------------
function bookmarkPage(URL,Text,lang){
	if (window.sidebar){
		// firefox
		window.sidebar.addPanel(Text,URL, "");
	}else if(window.opera && window.print){
		// opera
		var elem = document.createElement('a');
		elem.setAttribute('href',URL);
		elem.setAttribute('title',Text);
		elem.setAttribute('rel','sidebar');
		elem.click();
	}else if(document.all){
		// ie
		window.external.AddFavorite(URL,Text);
	}else{
		if(lang){
			alert("Sorry - this feature is not supportet. Please use your browser capabilities.");
		}else{
			alert("Leider wird diese Funktion nicht direkt unterstützt. Benutzen Sie die Möglichkeiten Ihres browsers");
		}
	}
}

// Print ---------------------------------------------------------------------
function printPage(lang) {
	if (window.print){
		window.print();
	}else{
		if(lang){
			alert("Sorry - this feature is not supportet. Please use your browser for printing.");
		}else{
			alert("Leider wird diese Funktion nicht direkt unterstützt. Benutzen Sie die Druckfunktion Ihres Browsers.");
		}
	}
}

// AutoWipe Input ---------------------------------------------------------------------
function clearField(obj,def_str){
	if(obj.value == def_str){
	  obj.value = "";
	}
}
function showDefault(obj,def_str){
	if(obj.value == ""){
	  obj.value = def_str;
	}
}

// Protect E-Mail ---------------------------------------------------------------------


function protMail(addr_str,dom_str,islink){
	if(islink){
	  document.write('<a href=\"mailto:' + addr_str + '@' + dom_str + '\">' + addr_str + '@' + dom_str + '</a>');
	}else{
	  document.write(addr_str + '@' + dom_str);
	}
}






// JQuery #########################################################################

// Jump to Anker ---------------------------------------------------------------------

function goToByScroll(id){
     	$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}

$(document).ready(function() {
	$(".slidetabs").tabs(".images > div", {
	
		// enable "cross-fading" effect
		effect: 'fade',
		fadeOutSpeed: "slow",
	
		// start from the beginning after the last tab
		rotate: true
	
	// use the slideshow plugin. It accepts its own configuration
	}).slideshow({
		autoplay: true
	 });
	 
	 $("#service_slides").tabs("#service_slides > div", {
	
		// enable "cross-fading" effect
		effect: 'fade',
		fadeOutSpeed: "slow",
		initialIndex: Math.floor(Math.random()*3),
	
		// start from the beginning after the last tab
		rotate: true,
		event: 'mouseover'
	
	// use the slideshow plugin. It accepts its own configuration
	}).slideshow({
		autoplay: true,
		interval: 4000
	 });
	 
	 
	 $(".cont_slides .tabs").tabs(".cont_slides .slides > div", {
	
		// enable "cross-fading" effect
		effect: 'fade',
		fadeOutSpeed: "slow",
		initialIndex: Math.floor(Math.random()*3),
	
		// start from the beginning after the last tab
		rotate: true,
		event: 'click'
	
	// use the slideshow plugin. It accepts its own configuration
	}).slideshow({
		autoplay: true,
		interval: 4000,
		clickable: false,
		autopause : true
	 });
	 
	 
	 // Hacks
	var text = $("#module_new_products").html();
	text = text.replace(/Libbey \/ Royal Leerdam /g,'');
	text = text.replace(/Rona /g,'RONA ');
	$("#module_new_products").html(text);
	
	var text = $("#module_rand_products").html();
	text = text.replace(/Libbey \/ Royal Leerdam /g,'');
	text = text.replace(/Rona /g,'RONA ');
	$("#module_rand_products").html(text);
	 
	 
	 //$("#body_left").find('.menu_level_1:contains("Geschenkideen")').addClass('menu_sep');
	 $('img[src*=cart_remove]').replaceWith('<img style="border: 0px;" src="http://src.annaburg-porzellan.de/assets/gfx/icons/cart_remove.gif" title="Artikel l&ouml;schen" />');
	 //$("#body_cont").find(':contains("Tradoria GmbH, Geisfelder Str. 16, 96050 Bamberg")').replaceWith('Tradoria GmbH, Geisfelder Str. 16, 96050 Bamberg <br /><br /><h2>Umsetzung:</h2> <strong>Umsetzung / Administration / SEO / SEM :</strong> <br /><a href="http://viewsion.net">VIEWSION.net</a> <br /><br /> <strong>Layout / Grafik / Pflege / Content :</strong> <br />Kathrin S&ouml;lch');
});

function openPopup(){ 
	 $("#lb_intro").overlay().load();	 
}
function closePopup(){ 
	$("#lb_intro").overlay().close();
}
