// 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);
	}
}


$(document).ready(function() {
// Tooltips
    $("input.cart_button_checkout").parent().css({'width': '125px', 'padding':'10px 0px 10px 10px', 'float':'right'});
    $("input.cart_button_checkout").parent().after("<div class='tooltip'><img style='border:0px; margin: 3px 0px 6px 0px;' src='http://src.annaburg-porzellan.de/assets/gfx/layout/tradoria_icon.gif' /><br/>Die sichere Abwicklung der Bezahlung läuft über die Webseite der Tradoria GmbH.</div></div><br /><br />").tooltip({effect: 'slide',offset: [25, 0]});


    $("#infoBox1 a, #infoBox2 a, #footerBox1 a, #footerBox2 a, #footerBox3 a, .index_cat_img").tooltip({ 
                    effect: 'slide',
                    offset: [25, 0]
                    });
                    

// Kontakt - Hacks:

    $("#pageContent").find('div:contains("Ansprechpartner ist Herr Michael Ploss")').remove();

    $("#pageContent > form[name^=contact] > table").addClass('contactForm');
    $("#pageContent > form[name^=contact] > table > tbody > tr > td > textarea").removeAttr('style');
    $("#pageContent").find('h3:contains("Schreiben Sie uns eine Nachricht:")').css({'color':'#d30101','font-size':'14px'}).next().remove();

// Fancy Box


	$("a#single_image").fancybox();
	
	$("a#inline800").fancybox({
		'hideOnContentClick': true,
		'frameWidth': 800,
		'frameHeight': 600
	}); 
	
	$("a.group").fancybox({
		'zoomOpacity' : true,
		'zoomSpeedIn': 400,
		'zoomSpeedOut': 400,
		'overlayShow': true
	}); 



// Cart Icon "HACK"
    $('img[src*=cart_remove]').replaceWith('<img style="border: 0px;" src="http://src.annaburg-porzellan.de/assets/gfx/icons/cart_remove.gif" title="Artikel löschen" />');
	
}); // end document ready

