/*


*/


/*CVS Add-ins*/
/*
$Revision: 1.9 $
$RCSfile: behaviour.js,v $
author: JDE
*/
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/*
    behaviour.js
    26.01.2009  JDE
*/
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */

/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/*Copyright (c) A&B FACE2NET GmbH*/

function check(){ alert("JS eingebunden"); }

var agt = navigator.userAgent.toLowerCase();
var mac_ff  = ( (agt.indexOf("firefox") != -1) && (agt.indexOf("macintosh") != -1) );
var i = 0;


function initiate_formbehaviour(){
	var inputtxt = ' Bitte Suchbegriff eingeben ';
	$("#search input.formElement")
		.focus(function(){ if(this.value == inputtxt)this.value = ''; })
		.blur(function(){ if(this.value == '')this.value = inputtxt; })  
}

/**
* insert print link 
*/
function write_printlink(){
	var linktxt = ' Drucken '; var linktitle = ' Diese Seite ausdrucken '; 
	$("#footer .inner").append('<span class="p_spacer">|</span><span  class="p_link"><a title="'+ linktitle +'" href="javascript:window.print()">'+ linktxt +'</a></span>');
}

function initiate_togglebox(){
	$("#context .togglebox form").addClass("hide");
	$("#context .togglebox .inner").addClass("closed")
	
	
	$("#context .togglebox h2").each(function (i) {
  	$(this).parent().addClass('toggle_'+i);
		$(this).wrapInner('<a href="javascript:switchbox('+i+')"></a>');
    });	
}

function switchbox(i){
	$("#context .togglebox .toggle_"+i+" form").slideToggle("fast",function(){
  	$("#context .togglebox .toggle_"+i).toggleClass("closed").toggleClass("opened");
	});
}

//addLoadEvent(check);
addLoadEvent(initiate_formbehaviour);
addLoadEvent(write_printlink);
addLoadEvent(initiate_togglebox);





/*CVS Add-ins*/
/*
$Revision: 1.7 $
$RCSfile: flashbehaviour.js,v $
author: JDE
*/

/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/*
    flashbehaviour.js (AJ)
    16.02.2009  JDE
*/
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */

/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/*Copyright (c) A&B FACE2NET GmbH*/

function check(){ alert("JS eingebunden"); }

if (typeof flashplayer == "undefined") { 
    var flashplayer = new Object(); 
}



flashplayer = function(swfUrlStr, widthStr, heightStr, reqVerStr) {
    
    this.pluginVer = swfobject.getFlashPlayerVersion();
    var requiredVer = new Array;
    this.requiredVer = reqVerStr.split(".");
    this.url = swfUrlStr; 
    this.width = widthStr;
    this.height = heightStr;
    		
		this.embed_video = function(video_url, containerID) {
      if(this.hasRequiredFlashVersion()) {
				  var flashparams = {};
				  flashparams.allowFullScreen="true";
					flashparams.bgcolor = "ffffff";
					flashparams.scale="noscale";
					flashparams.base="media";
				  flashparams.flashvars = "buffer=1&videoAutoPlay=false&viewBigMiddleButton=true&spaceKey=true&autoplay=false&videoURL="+video_url;
					swfobject.embedSWF(swfUrlStr, containerID, this.width, this.height, reqVerStr, false, false , flashparams, false);
        }else{
      	  this.writeErrorMessage();
        }
    }
		
		    
    this.hasRequiredFlashVersion = function() {
        this.requiredVer.major = this.requiredVer[0]!=null?parseInt(this.requiredVer[0]):0;
        if(this.pluginVer.major < this.requiredVer.major){ return false; }
        if(this.pluginVer.major > this.requiredVer.major){ return true;  }
        
        this.requiredVer.minor = this.requiredVer[1]!=null?parseInt(this.requiredVer[1]):0;
        if(this.pluginVer.minor < this.requiredVer.minor) { return false; }
        
        if(this.pluginVer.minor > this.requiredVer.minor) { return true;  }
        
        this.requiredVer.release = this.requiredVer[2]!=null?parseInt(this.requiredVer[2]):0;
        if(this.pluginVer.release < this.requiredVer.release) { return false; }
        return true;
        
    }
    
    this.writeErrorMessage = function() {
    	$(".basic_txt .nonscript").remove();
      if (this.pluginVer.major != 0 || this.pluginVer.minor != 0 || this.pluginVer.rev != 0) {
      	$(".videobox .errortxt").html('Sie haben den Adobe® Flashplayer in der Version ' + this.pluginVer.major + "." + this.pluginVer.minor + "." + this.pluginVer.release + '. Bitte aktualisieren Sie ihn. Die aktuelle Version ');
      }else{
      	$(".videobox .errortxt").html('Sie haben keinen Adobe® Flashplayer installiert oder er ist deaktiviert. Die aktuelle Version ');
      }
				
    }
   
}

var flashPlayer = new flashplayer("/media/videoplayer.swf","596","370","9.0.115");

