 
     function sndTableReq(){
        
       if(navigator.appName.search("Microsoft") > -1){
          resObjekt = new ActiveXObject("MSXML2.XMLHTTP");
       } else {
          resObjekt = new XMLHttpRequest();
       }
          
        resObjekt.open('get','/pages/cms_table_ajax.jsp',true);         
        resObjekt.onreadystatechange = handleTableResponse;
        resObjekt.send(null);      
    }
    
function handleTableResponse(){
     
     if(resObjekt.readyState != 4){
          setTimeout('handleTableResponse()','2');                    
      } else {
          if(resObjekt.readyState == 4){
            document.getElementById("CMS_TABLE").style.background='none';
            document.getElementById("CMS_TABLE").innerHTML = resObjekt.responseText;
          }
      }  
    }
        
    
     function showSubMenu(elem, view){
       
          var IE = document.all?true:false
          var _elem = null;
          if(IE && !elem.firstChild.id)
            return;
          if(!IE && !elem.firstChild.nextSibling.id)
            return;
          
          if(IE)
            _elem = elem.firstChild
          else
            _elem = elem.firstChild.nextSibling; // Mozilla
          
         _elem.style.display = view;
     
    }
    var win;
    function printPage(pageId){
     
       var w = 980;
       var h = 600;
       var leftVal = (screen.width - w) / 2;
       var topVal = (screen.height - h) / 2-30;
       //var win = window.open (CONTEXT + '/cms/printviewer.jsp?pageId='+pageId,'','toolbar=no,location=no,directories=no,status=no,menubar=no,resizeable=yes,scrollbars=yes,width='+w+',height='+h+',left='+leftVal+',top='+topVal);        
       win = window.open ('','','toolbar=no,location=no,directories=no,status=no,menubar=no,resizeable=yes,scrollbars=yes,width='+w+',height='+h+',left='+leftVal+',top='+topVal);
       
       var e;
       if(document.getElementById('webpage_content_print'))
         e = document.getElementById('webpage_content_print').cloneNode(true);
       else
         e = document.getElementById('webpage_content').cloneNode(true);
       var IE = document.all?true:false
       
       if(IE){
        if(e.firstChild.id == 'menu')
           e.removeChild(e.firstChild);
       } else {
        if(e.firstChild.nextSibling.id == 'menu')
            e.removeChild(e.firstChild.nextSibling);
       }
        
       win.document.open();   
       win.document.write('<html>');
       var head = document.getElementsByTagName("head")[0];     
       win.document.write('<head>'+head.innerHTML+'</head>');
       win.document.write('<body style="background:#ffffff;text-align:center;background-image:none">'); 
       win.document.write('<div id=page  style="background-image:none">');   
       win.document.write('<div id=webpage_content>');  
       win.document.write(e.innerHTML);
       win.document.write('</div>');
       win.document.write('</div>');       
       win.document.write('<div style="clear:both"><a href="javascript:window.print()">Seite drucken</a></div>');
       win.document.write('</body>'); 
       win.document.write('</html>'); 
       window.setTimeout("closeWinDoc()", 1000);
       //win.document.close();   
    }

    function closeWinDoc(){
        win.document.close();
    }     
     
      function changeFontSize(value)
      {
      	if (document.styleSheets && (document.styleSheets[0].rules || document.styleSheets[0].cssRules) )
      	{
      	   	
      		   var RulesLength = ( document.styleSheets[0].rules ) ? document.styleSheets[0].rules.length : document.styleSheets[0].cssRules.length;
      			for(i=0; i < RulesLength; i++)
      			{
      				curRule = ( document.styleSheets[0].rules ) ? document.styleSheets[0].rules[i] : document.styleSheets[0].cssRules[i];
      		 
      				if (curRule.style.fontSize != null) {
      					theSize = new String(curRule.style.fontSize);
      					 if(theSize.length > 0){
      					    newSize = parseInt(theSize.substring(0,theSize.indexOf("px")));
      					    newSize = newSize + value;
      					    curRule.style.fontSize = newSize+"px";
                 }					 
      				}
      			} 
      	}
      }
      
      function toFavorits() {
      	if (document.all) // IE
      	{
      		if (confirm('Möchten Sie die Webseite zu Ihren Favoriten hinzufügen?')) window.external.addFavorite('http://www.mk-webservices.de','Beschreibung der Webseite');
      	}
      	else if (document.layers) // NS 4
      	{
      		alert("Für PC's:\nDrücken Sie Strg + D\n\Für Macintosh:\nDrücken Sie Befehlstaste + D");
      	} else if (!document.all && document.getElementById) {
      		if(navigator.appName == "Netscape") { // NS > 6
      			alert("Für PC's:\nDrücken Sie Strg + G\n\nFür Macintosh:\nDrücken Sie Befehlstaste + G");
      		}
      	}
      }
      
      function openLink(link, target,width,height,name){
      
         if(target == 'swf'){
            width = 1024;
            height = 768;
         }
         
          var w = width ? width + 20 : 400;
          var h = height ? height + 65 : 300;
          
    			var l = (screen.availWidth - w) / 2;
    			var t = screen.availHeight /2 - (h / 2) + document.body.scrollTop;
           
    			var div = document.createElement("div");
    		  div.id='window';
    		  div.style.left = l;
    		  div.style.top = t;
    		  div.style.width = w;
    		 
    		  dh = document.createElement("div");
    		  dh.id='window_header_box';  
    		  dh.style.width = w; 
    		 
    		 	d = document.createElement("div");
    		  d.id='window_header';  		
          
          name = name ? name : "";
          width = width ? width : "";
          height = height ? height : "";
    		  t = document.createTextNode(name +" ("+width+" x "+height+")");
    		  d.appendChild(t);	 
          dh.appendChild(d);	 
          
          dc = document.createElement("div");
    		  dc.id='window_close'; 
          dc.onclick = function(){
                document.body.removeChild(div);
          };
    		   
          dh.appendChild(dc);	 
          
          div.appendChild(dh);
          
          divCon = document.createElement("div");
          divCon.id='window_container';
         
          if(target == 'image' || target == 'png' || target == 'jpg' || target == 'gif' || target == 'bmp'){             
              l = document.createElement("img");
              l.src = link;
              divCon.appendChild(l);	 
              d = document.createElement("div"); 
              d.id='window_print'; ;
              d.onclick = function(){
                var html = document.getElementById('window_container').innerHTML;
                document.body.removeChild(div);
              	var a = window.open('','','width='+w+',height='+h);
              	a.document.open("text/html");
              	a.document.write("<HTML><BODY><CENTER>"+html+"</CENTER></BODY></HTML>");
              	a.document.close();
              	a.moveTo(screen.width /2 - w / 2, screen.height /2  - h / 2);
              	a.print();
          };
              divCon.appendChild(d);            
          } else if(target == 'avi' || target == 'wav' ||target == 'mp3' || target == 'mpg' || target == 'wma' || target == 'mpeg'){
              divCon.innerHTML = '<OBJECT id="video" width="320" height="240px" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject">'+
                        				 '<param name="src" value="http://'+HOST+'/'+ CONTEXT +link+'">'+
                        				 '<param name="autostart" value="1">'+
                        				 '<param name="showcontrols" value="1">'+
                        				 '<param name="loop" value="0">'+
                        				 '<EMBED type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" id="video" showcontrols="1" width="320px" height="240px" src="http://'+HOST+'/' + CONTEXT +link+'" autostart="1" loop="0">'+
                        				 '</EMBED>'+
                        				 '</OBJECT>';
          } else if(target == 'swf'){                           
             var win = window.open ('','','toolbar=no,location=no,directories=no,status=no,menubar=no,resizeable=yes,scrollbars=no,width='+(w-20)+',height='+(h-235)+',left='+l+',top=200');
             win.document.write('<div style="position:absolute; top:-110px; left:-5px; clip:rect(60px, 1020px, 700px, 5px)">'+
                                '<p></p><object id="flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+width+'" height="'+height+'">' +
                                '<param name="movie" value="http://'+HOST+'/'+ CONTEXT + link + '">'+
                                '<param name="AllowScriptAccess" value="always">'+
                                '<param name="loop" value="false">'+
                                '<param name="wmode" value="transparent">'+
                                '<embed src="http://'+HOST+'/'+ CONTEXT + link +'" menu="false" loop="false" wmode="transparent" quality="high" width="'+width+'" height="'+height+'" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
                                '</object></div>');
              win.document.close();   
              return;
             
          }
          div.appendChild(divCon);	
    		 	document.body.appendChild(div);
    		  
      }
      
      
    // WEBPAGE Funktions Ende
