// 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 #########################################################################

$(document).ready(function() {

    // JQuery TOOLS ###############################################################
	
	
	// Display
	if($("#display_tabs").length){
		var js_display = $("#display_tabs").tabs("#display_slide > div", { 
	 
			// enable "cross-fading" effect 
			effect: 'fade', 
			fadeInSpeed: 800,
			fadeOutSpeed: 800, 
	 
			// start from the beginning after the last tab 
			rotate: true 
	 
		// use the slideshow plugin. It accepts its own configuration 
		});
	
		var js_slideshow = $("#display_tabs").slideshow({ 
				autoplay: false,
				interval: 3000,
				onPlay: onPlayFunc,
				onBeforePause: onPauseFunc
			 });
		
		
		function onPlayFunc(){
			$("#display_pp").css("background-color","red");
		}
		function onPauseFunc(){
			$("#display_pp").css("background-color","white");
		}
		function toggleplay(){
			$("#display_tabs").tabs().play();	
		}
	}
	
	
	// LightBox
	
	$(function() {
		$("a[rel]").overlay({
			effect: 'apple',
			expose: { 
				color: '#0e2101', 
				loadSpeed: 0,
				closeSpeed: 0,
				opacity: 0.70 
			}
										
										
										
		});
	});

	
});
