﻿/*CVS Add-ins*/
/*
$Revision: 1.5 $
$RCSfile: behaviour.js,v $
author: JDE
*/

/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/*
    behaviour.js (BF)
    21.11.2008  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) );

/**
* preloading background images
*/
var a = new Array("icons_list.gif","bg_nav_icons.gif", "bg_greyshadows.gif","bg_redshadows.gif","bg_header.gif",
"bg_alt_start.gif","bg_alt_start_hover.gif", "boxnavigation_arrow.gif","boxnavigation_arrow_active.gif",
"boxnavigation_arrow_hover.gif");
var b = new Array();
var i;
for (i = 0; i < a.length; i++) {
  b[i] = new Image();
  b[i].src = '/start/_system/css/styleimages/' + a[i];
}

/**
* show or hide value in formelements 
*/
function initiate_formbehaviour(){
  if($("html").attr("lang")=="de") var inputtxt = ' Suchbegriff ';
	else var inputtxt = ' search term ';
	$("#header input.formElement")
		.focus(function(){ if(this.value == inputtxt)this.value = ''; })
    .blur(function(){ if(this.value == '')this.value = inputtxt; })  
}

/**
* insert link to ajax version 
*/
function insert_ajaxlink(){
	$("#quicksearch form")
		.after('<div class="alternative"><h3 class="out">Animierte Ansicht</h3><p class="out">Die SPD-Startseite ist in zwei Varianten verfügbar, die sich optisch und in der Benutzerführung unterscheiden, inhaltlich aber identisch sind. Die animierte Variante ist mit Ajax realisiert und benötigt zur Nutzung JavaScript sowie einen aktuellen Browser. Die alternative Startseite ist barrierefrei und macht die Inhalte über eine konventionelle Navigation zugänglich. Sie können zwischen beiden Varianten wechseln.</p><a tabindex="4" href="/start/portal/start.html">Animierte Startseite</a></div>');
}



//addLoadEvent(check);

addLoadEvent(initiate_formbehaviour);
addLoadEvent(insert_ajaxlink);