//Show Hide Objects
//-----------------------
function Show_Hide(ThisObj){
	var nav = document.getElementById(ThisObj).style
	if(nav.display=="none"){
		nav.display='block';
	}else{
		nav.display='none';
	}
}
// Create Popup Window
//-----------------------
function popup(width_, height_, url_) {
  var parameter='height='+height_+',width='+width_+',toolbar=no,menubar=no,location=no,scrollbars=no,statusbar=no';
  if (popup_x_y.arguments) {
    parameter+=((popup.arguments.length>=4)&&(typeof(popup.arguments[3])!='undefined')) ? ','+popup.arguments[3] : '';
  }
    window.open(url_,'',parameter);
}
// Anti-Spam Mail-Link
//-----------------------
function MakeMailLink(element,user,domain,mail_subject,mail_body) {
	mail_subject = (mail_subject) ? mail_subject : " ";
	mail_body = (mail_body) ? mail_body : " ";
	element.href = "mailto:" + user + "@" + domain + "?subject=" + mail_subject + "&body=" + mail_body;
}

/* Funktion für linear slideshow  / benötigt jQuery UI Plugin
	Beispiel:----->
	 div id="slider" class="slider_box">
		<img src="slide1.jpg" width="500" height="90" />
		<img src="slide2.jpg" width="500" height="90" />
		.......
	 </div>
	 Stylesheet:
	 <style>
		.slider_box {
			position: relative;
			overflow: hidden;
			padding: 0px;
		}
		.slider_box img {
			border: 0px;
			margin: 0px;
			position: absolute;
			display: none;
		}
	</style>
	 */
function startLinearSlider(str_id,interval,type){
	var sliderimgs = $(str_id + ' img');
	var cnt = sliderimgs.length;
	sliderimgs.load(function(){
		if(!--cnt) {
       		/* all images loaded */
			var items_count = $(str_id + ' img').length;
			var image_width = $(str_id + ' img').first().width();
			//Bilder horizontal anordnen
			for (i=1;i<=items_count-1;i++){
				$(str_id + ' img:eq('+ i +')').css('left',(i*image_width)+"px");
			}
			$(str_id + ' img').fadeIn(1000);
			//Bildintervall starten
			window.setInterval(function(){
				var ani_length = 500;
				var ani_type = type;
				var ani_items = $(str_id + ' img');
				var image_width = ani_items.first().width();
				//Das erste Bild nach dem verschieben ans Ende setzen und im DOM ganz unten anfügen
				ani_items.first().animate({left: '-='+image_width},{easing:ani_type,duration:ani_length,complete: function(){
							ani_items.first().css('left',(ani_items.length - 1)*image_width+"px");
							ani_items.first().appendTo($(str_id));
						}
					});
				// Die Verschiebe-Animation für die anderen Bilder
				$(str_id+' img:gt(0)').animate({left: '-='+image_width},{easing:ani_type,duration:ani_length});
			},interval);
      	}	
	});
}


function flashCheck(){
	var installed = false;
	if(typeof(navigator.plugins["Shockwave Flash"]) == "object"){
		installed = true;
	}else if (typeof(ActiveXObject) == "function"){
		installed = true;
	}else{
		installed = false;
	}
	return installed;
}
