  var contentImg = '.content_img img';
  var contentImgBorder = 'content_img_border';

  function load_functions(){
  
	babyinfo_load();  
  
    //imgBorder(contentImg,contentImgBorder);
	//imgBorder('.csc-textpic-border img',contentImgBorder);
	
    
	moobox_load();
	video_link_load();
    
    //slimbox_load();
	if($('content_menu_elements')){
		if($('content_menu_elements').hasChildNodes()){
			contentMenu()
			closeContentMenu(false);
			//$('content').setProperty('onclick', "closeContentMenu(true);")
		}else{
			if($chk($('content_menu'))) $('content_menu').style.display = "none";
		}
	}else{
		if($chk($('content_menu'))) $('content_menu').style.display = "none";
	}
  }

  function moobox_load(){
    var listing = $$('.moobox_link a, .video_link a');
    listing.each(  function(element) {
      var url = element.getProperty('href');       
      var newurl = "moobox_open('"+url+"&ajax=true');";
      element.setProperty('href','javascript:'+newurl);
    });
  }
  
  function video_link_load(){
    /*var listing = $$('.video_link a');
    	listing.each(  function(element) {
      var url = element.getProperty('href');       
      var newurl = "video_open('"+url+"&ajax=true');";
      element.setProperty('href','javascript:'+newurl);
    });*/
  }  

	function babyinfo_load(){
		var listing = $$('.news-baby-link a');
		    listing.each(  function(element) {
		    var url = element.getProperty('href');
			var title = element.getProperty('title');
		    var newurl = "babyinfo_open('"+url+"&ajax=true','"+title+"');";
		    element.setProperty('href','javascript:'+newurl);
			//element.setProperty('onmouseover','javascript:'+newurl);
			//element.setProperty('onmouseout','javascript:closeBorder(\'.news-babyinfo\');');
		});
	}

  
  function slimbox_load(){
    var listing = $$('.slimbox_link a');
    listing.each(  function(element) {
      element.setProperty('rel',"lightbox[sb2]");
    });
  }
  
var status;
var statusCounter = 0;
var statusCend = 10;
function contentImgStatus() {
  if(($('endOfAjax')) || (statusCounter == statusCend)){
    //imgBorder(contentImg,contentImgBorder);
	//alert(status);
    window.clearInterval(status);
    statusCounter = 0;
    if($('newsFlash_inline') && $('newsflash_js_movie')){
		var FO = {
			movie:$('newsflash_js_movie').value,
			width:$('newsflash_js_width').value,
			height:$('newsflash_js_height').value,
			majorversion:$('newsflash_js_majorversion').value,
			build:$('newsflash_js_build').value,
			bgcolor:$('newsflash_js_bgcolor').value,
			flashvars:$('newsflash_js_flashvars').value
		}; 
		UFO.create(FO, "newsFlash_inline");
		if($('news-single-flash-layer')) $('news-single-flash-layer').style.display = "block";
    }
  }
  statusCounter++;
}
  
  var moourl;
  var mootitle = "";  
  function moobox_open(moourl,mootitle) {
    MOOdalBox.open( // case matters
      moourl, // the link URL
      mootitle, // the caption (link's title) - can be blank
      "800 600", // width and height of the box - can be left blank
      {
        evalScripts: status = window.setInterval("contentImgStatus()", 450)
      }
    ); 
  }

  function video_open(url,title) {
    VideoBox.open( // case matters
      url, // the link URL
      title, // the caption (link's title) - can be blank
      "260 220", // width and height of the box - can be left blank
      {
        evalScripts: status = window.setInterval("contentImgStatus()", 200)
      }
    ); 
  }  

  function moobox_close() {
    MOOdalBox.close( // case matters
      moourl, // the link URL
      mootitle, // the caption (link's title) - can be blank
      "800 600" // width and height of the box - can be left blank
    ); 
  }

	function jobcontrol_open(url) {
	    MOOdalBox.open( // case matters
	      url, // the link URL
	      "", // the caption (link's title) - can be blank
	      "800 300", // width and height of the box - can be left blank
	      {
			pdf:true,
	        evalScripts: status = window.setInterval("contentImgStatus()", 450)
	      }
	    ); 		
	}  
  
	function babyinfo_open(babyUrl,babyTitle) {
	    MOOdalBox.open( // case matters
	      babyUrl, // the link URL
	      babyTitle, // the caption (link's title) - can be blank
	      "550 300", // width and height of the box - can be left blank
	      {
	        evalScripts: status = window.setInterval("contentImgStatus()", 450)
	      }
	    ); 		
	}

	function openLightbox(srcimg,title){
		Lightbox.show(srcimg,title);
	}

	// Erstellt einen Rahmen innerhalb eines Bildes
	function imgBorder(imgcontainer,borderclass){
	  var img;
	  var border;
	  var imgLink = "";
	  
	  $$(imgcontainer).each(  function(imgelement){
	  	if (self.innerHeight) {	// all except Explorer
	      var borderheight = imgelement.offsetHeight - 10;
	      var borderwidth = imgelement.offsetWidth - 10;
	  	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
	      var borderheight = imgelement.offsetHeight - 10;
	      var borderwidth = imgelement.offsetWidth - 10;
	  	} else if (document.body) { // other Explorers
	      var borderheight = imgelement.offsetHeight;
	      var borderwidth = imgelement.offsetWidth;
	  	}	
	    
	    border = new Element('a', {
	        'styles': {
	            'left': imgelement.offsetLeft,
	            'top': imgelement.offsetTop,
	            'height': borderheight,
	            'width': borderwidth,
	            'borderWidth': "5px",
	            'display': 'block'            
	        },
	        'class': borderclass
	    });
	    
	    border.injectAfter(imgelement);
	  });
	}

	var menu,oldmenu,contentMenuTimer;
	function contentMenu(){
		//$('debug').style.display = "block";
		$('debug').value = $('debug').value + "\n-->" + document.getElementById('content_menu_elements').style.display;
		menu = true;
		if(oldmenu){
			document.getElementById('content_menu_elements').style.display='none';
			if(contentMenuTimer) contentMenuTimer = $clear(contentMenuTimer);
		}
		if( (oldmenu != menu) && (menu) ){
			document.getElementById('content_menu_elements').style.display='block';
			if(contentMenuTimer) contentMenuTimer = $clear(contentMenuTimer);
			oldmenu=menu;
		}else{
			oldmenu="";
		}
	}

	function closeContentMenu(now){
		$('debug').value = $('debug').value + "\n-->close: "+now;
		if(now == true){
			contentMenuTimer = $clear(contentMenuTimer);
			contentMenu();
		}else{
			contentMenuTimer = contentMenu.delay(3500);
		}
	}

	function clearContentMenuDelay(){
		contentMenuTimer = $clear(contentMenuTimer);
	}
	
function searching(sword) {
  var url = httproot+"index.php?id=25&no_cache=1";
  var posting = "tx_indexedsearch[sword]="+sword;
  
  return(false);
}
	