
	//utils
	function switchImage(imgName, imgSrc) {
	  if (document.images) {
		if (imgSrc != "none"){
		  document.images[imgName].src = imgSrc;
		}
	  }
	}


	//embed flash header & do initing stuff
	$(function() {

		//alert('an flash-film übergeben: pageID='+dbtal_pageID);
	
		//alert($('#keller_swf_header').attr('rel'));
	
		//
		// embed flash (see http://jquery.thewikies.com/swfobject/examples)
		//
		$('#header').flash({
				// test_flashvars.swf is the flash document
				swf: 'header_de.swf'
				//swf: 'bdata/files/templateAdditional_files_bdataFileExtZIP/10000/keller_navi.swf'
				,width: 967
				,height: 210
				,play: true
				,allowscriptaccess:'always'
				,allowScriptAccess:'always'

				// these arguments will be passed into the flash document
				,flashvars: {
					pageID: $('#keller_swf_header').attr('rel')//dbtal_pageID
				}
				/*,params: {
					allowscriptaccess:"always"	
				}*/
				
		});
		
		
		//
		// add icon to search field
		//
		$('.dbtal_search_field').append('<input class="searchgo" type="submit" value="" />');
		
		
		//
		// random image for chapter start pages
		//
		function GetRandom( min, max ) {
			if( min > max ) {
				return( -1 );
			}
			if( min == max ) {
				return( min );
			}
		 
			return( min + parseInt( Math.random() * ( max-min+1 ) ) );
		}
		if (dbtal_inAdministration!=1) {//random image only on website not in admin mode
			var nrOfImgs = $('.chapterstart_1col img').length;
			if (typeof(nrOfImgs)!=='undefined' && nrOfImgs>0) {
				//alert(nrOfImgs);
				var imgIndRand = GetRandom( 0 , nrOfImgs-1 );
				//alert(imgIndRand);
				
				var src_rand = $($('.chapterstart_1col img')[imgIndRand]).attr('src');
				//alert(src_rand);
				$($('.chapterstart_1col img')[0]).attr('src',src_rand);
			}
		}
		
		
	});
