/* 
 * Some functions
 */
   $(function(){

      $("#produkt_description").empty();
      $(".containerPlus").buildContainers({
        containment:"document",
        elementsPath:"elements/"
      });



    });
    function mouseoverLink (containerId) {
    	$(containerId).attr('ontouch','true');
    		window.setTimeout('mouseoverDisplayContainer ("'+containerId+'")',500);
    }
    function mouseoverDisplayContainer (containerId){
    	if ($(containerId).mb_getState('ontouch')== true){
		$(containerId).mb_centerOnWindow(true);
		$(containerId).mb_open();
    	}
    }

    function mouseoutLink (containerId, time) {
    	//alert ($(containerId).mb_getState('ontouch'));
    	if (time > 0) window.setTimeout('mouseoutLink ("'+containerId+'", 0)',time);
	else {
		if ($(containerId).mb_getState('ontouch')== false){
			$(containerId).mb_close();
		}
	}
    }
    function checkAjaxContent (containerId,content_html) {
    	//alert($(containerId).attr('content'));
	if ($(containerId).attr('content') == content_html) return true;
	else return false;

    }
    function startDelay(containerId) {
    	if($(containerId).attr('closed')) _timer = window.setInterval("mouseoverLink('"+containerId+"')",500);
    }
    function stopDelay() {
    	window.clearInterval(_timer);
    }
     // Timer-Startwert setzen oder erneuern und Timer ggf. starten
      function timerStart() {

        timer=2*1000;
        if(status==0) {
          status=1;
          timerCheck();
        }
      }


      // Bildschirmschoner starten, wenn Timer bei 0
      function timerCheck() {
        if(status==1) {
          timer-=1000;
          if(timer>0){ setTimeout('timerCheck()',1000);
          }
          else {$('#welcomeContainer').mb_open();
          }

        }
      }
      // timer starten
      var timer, status=0;
      timerStart();


