function bindscript(){ 
   document.write('<script type="text\/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/jquery-1.4.2.js"><\/script>'); 
   document.write('<script type="text/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/ui.core.js"><\/script>');
   document.write('<script type="text\/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/ui.dialog.js"><\/script> ');
   document.write('<script type="text\/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/ui.resizable.js"><\/script>');  
   document.write('<script type="text\/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/ui.draggable.js"><\/script>');
   document.write('<script type="text\/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/jquery.dimensions.js"><\/script>');
   document.write('<script type="text\/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/jquery.accordion.js"><\/script>');    
   document.write('<script type="text\/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/jquery.chili-1.7.pack.js"><\/script>');
   document.write('<script type="text\/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/jquery.cycle.all.2.72.js"><\/script>');
   document.write('<script type="text\/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/jquery.easing.1.3.js"><\/script>');
   document.write('<script type="text\/javascript" src="fileadmin\/config\/_its7\/js\/jquery\/jquery.kwicks-1.5.1.pack.js"><\/script>');
}

function hoverout(el,txtclassnormal) {
   el.className=txtclassnormal;
}

function hoveron(el,txtclasshover) {
        el.className=txtclasshover;
}

function ready_jquery(){ 
  jQuery(document).ready(function() {  
         jQuery('.topnavkwicks').kwicks({
    	       max: 150,
         	   spacing:0,
    	       duration: 900,   
             easing: 'easeOutBounce'
	       }); 
	       
	        facebookcomment = '<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=177940488912681&amp;amp;xfbml=1"></script><fb:comments numposts="2" width="425" publish_feed="true"></fb:comments>';
          //jQuery('#its7-facebookcomment').html(facebookcomment);
          
          // FACEBOOK IFRAME .. VALIDATION
          jQuery('#its7-facebook').html('<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2Fits7de%2F133894229989856&amp;layout=button_count&amp;show_faces=false&amp;width=150&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:21px;" allowTransparency="true"></iframe>');

  });     
  
  
  
  
	
  // News-Latest-Ticker  BEGIN	   	
   interval = setInterval("removeFirst('news-latest-ul-tips')", pause);      
  // News-Latest-Ticker END
}

 // News-Latest-Ticker  BEGIN
var first = 0;
var speed = 3000;
var pause = 5500;
function removeFirst(id){               
	first = jQuery('ul#' + id + ' li:first').html();
       jQuery('ul#' + id + ' li:first').addClass('li-first-tracker news-latest-item-tips'); 	
	jQuery('ul#' + id + ' li:first')
	.animate({opacity: 0.1}, speed/2)   	
	.fadeOut(1, function() {jQuery(this).remove();}) ;
	 addLast(first,id);
}
		
function addLast(first, id){
	last = '<li class="news-latest-item news-latest-item-tips" style="display:none">'+first+'</li>';
	jQuery('ul#' + id).append(last)   ;
	jQuery('ul#' + id + ' li:last')
  .fadeIn('slow') 
	.animate({opacity: 0.9}, speed/2);
}

  // News-Latest-Ticker END
                                  //.animate({opacity: 1}, speed,'easeOutBounce')





function initlayer() {   
   var maxHeight  = 0 ;
   
   var divleft = new getObj('navleft');   
   var divcontent = new getObj('content');
  
   
   if(typeof divleft == 'object' || typeof divleft == 'function') {
     if(divleft.obj.offsetHeight>maxHeight) {
        maxHeight = divleft.obj.offsetHeight;
     }    
   }
   
   if(typeof divcontent == 'object' || typeof divcontent == 'function') {
      if(divcontent.obj.offsetHeight>maxHeight) {
        maxHeight = divcontent.obj.offsetHeight ;
     }
    }
   
   if(maxHeight > 0 ) {
      if(typeof divleft == 'object' || typeof divleft == 'function') {
        divcontent.style.height = maxHeight +  50 + 'px';
      }
      if(typeof divcontent == 'object' || typeof divcontent == 'function') {
        divleft.style.height = maxHeight + 50 + 'px';
      }
   }   
}

function initlayernews() {   
   var maxHeight  = 0 ;
  
   var divleft = new getObj('navleft');
   var divcenternews = new getObj('content-news');
   var divnews = new getObj('news-latest');
      
   if(typeof divleft == 'object' || typeof divleft == 'function') {
     if(divleft.obj.offsetHeight>maxHeight) {
        maxHeight = divleft.obj.offsetHeight;
     }
   }   
   
   if(typeof divcenternews == 'object' || typeof divcenternews == 'function') {
     if(divcenternews.obj.offsetHeight>maxHeight) {
        maxHeight = divcenternews.obj.offsetHeight;
     }    
   }  
   
   if(typeof divnews == 'object' || typeof divnews == 'function') {
     if(divnews.obj.offsetHeight>maxHeight) {
        maxHeight = divnews.obj.offsetHeight;
     }
   }
   if(maxHeight > 0 ) {
     if(typeof divleft == 'object' || typeof divleft == 'function') {
       divleft.style.height= maxHeight + 50 + 'px';
     }
     if(typeof divcenternews == 'object' || typeof divcenternews == 'function') {
       divcenternews.style.height= maxHeight + 50 + 'px';
     }
     if(typeof divnews == 'object' || typeof divnews == 'function') {
       divnews.style.height= maxHeight + 50 + 'px';
     }
   }
}

function showhover(element) {
   var imgHover = new getObj('h'+element.id);
   ind = element.style.top.indexOf('px');
   var imgtop = element.style.top.substring(0,ind);
   ind = element.style.left.indexOf('px');
   var imgleft = element.style.left.substring(0,ind);
   
   if(imgtop.substring(1,1)=='-') {
	imgtop = -1 * parseInt(imgtop);	
   }
   else {
	imgtop =  parseInt(imgtop);
   }
   
   imgHover.style.top= imgtop - 200 + 'px';
   imgHover.style.left=imgleft + 'px';
   imgHover.style.display='block';
}

function hidehover(element) {
  var imgHover = new getObj('h'+element.id);
  imgHover.style.display="none";
}

function getObj(name){
      if (document.getElementById)
      {
        this.obj = document.getElementById(name);        
        this.style = document.getElementById(name).style;
      }
      else if (document.all)
      {
        this.obj = document.all[name];
        this.style = document.all[name].style;
      }
      else if (document.layers)
      {
        this.obj = document.layers[name];
        this.style = document.layers[name];
      }
 }
 
 function showfbdialog(){
  FB.ui(
   {
     method: 'feed',
     name: 'Facebook Dialogs',
     link: 'http://www.facebook.com/dialog/',
     picture: 'http://fbrell.com/f8.jpg',
     caption: 'Reference Documentation',
     description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
     message: 'Facebook Dialogs are easy!',
     redirect_uri: 'http://its7.de/'
   },
   function(response) {
     if (response && response.post_id) {
       alert('Post was published.');
     } else {
       alert('Post was not published.');
     }
   }
 ); 
 
 }
