/*
// ####################################################################################################
// # Datei spielplan.js V 2.6
// ####################################################################################################
// # Copyright © 22011 ISS-Oberlausitz
// # Author: T.Hojenski
// # Email: info@iss-ol.de
// # URL:   http://www.bluepage-cms.com
// # Diese Datei gehört zu dem kommerziellen bluepage - CMS der ISS-Oberlausitz
// # Bitte beachten Sie die Lizenzbedingungen.
// # Unberechtigte Nutzung, Änderung oder Weitergabe über die Lizenzbedingungen hinaus
// # sind strafbar.
// # Eine unberechtigte Verwendung auch von Teilen des CMS-Systems kann zu Schadensersatz-
// # und/oder Unterlassungsansprüchen führen.
// # Das Entfernen der Copyrighthinweise ist untersagt.
// ####################################################################################################
*/

function vkThea(lnr) {
   /*
   var _param = {   
      document : 'infovst',
      ausgobj  : 'v'+lnr
   }
   $.ajax({
      type:       "POST",
      url:        "http://mail.theater-goerlitz.de/cbn/cbn.php", 
      data: _param,
      success:    function(response){
         var r_html = response.getElementsByTagName('htmlcode').item(0).firstChild.data;
         $('div#bluepageThea').html(r_html);
      }
   });
   */                                                 

   //var html = '<div id="bluepageWinTheaHead"><a href="javascript:closeTheaWindow();" title=\'\'><span>&nbsp;</span></a></div><div id="theaContent"><iframe id="theaFrame" name="theaFrame" src="about:blank" marginWidth="0" marginHeight="0" frameBorder="0" width="100%" scrolling="auto" height="100%"></iframe></div>';
   var html = '<div id="bluepageWinTheaHead"><a href="javascript:closeTheaWindow();" title=\'\'><span>&nbsp;</span></a></div><div id="theaContent"><iframe id="theaFrame" name="theaFrame" src="'+wwwUrl+'incl/winthea/twroot.php?document=TICK&vstnr='+lnr+'" marginWidth="0" marginHeight="0" frameBorder="0" width="100%" scrolling="auto" height="100%"></iframe></div>';
//   var html = '<div id="bluepageWinTheaHead"><a href="javascript:closeTheaWindow();" title=\'\'><span>&nbsp;</span></a></div><div id="theaContent"><iframe id="theaFrame" name="theaFrame" src="http://217.91.38.84/THEAweb.k19/ind/twroot.php?document=TICK&vstnr='+lnr+'" marginWidth="0" marginHeight="0" frameBorder="0" width="100%" scrolling="auto" height="100%"></iframe></div>';
   //var html = '<div id="bluepageWinTheaHead"><a href="javascript:closeTheaWindow();" title=\'\'><span>&nbsp;</span></a></div><div id="theaContent"><iframe id="theaFrame" name="theaFrame" src="http://mail.theater-goerlitz.de/cbn/cbn.php?document=infovst&ausgobj=v'+lnr+'" marginWidth="0" marginHeight="0" frameBorder="0" width="100%" scrolling="auto" height="100%"></iframe></div>';
   $('div#bluepageThea').html(html);
   
   if ((document.getElementById && !document.all) || (navigator.userAgent.indexOf('Opera') > -1)) {
      //$('div#bluepageThea').css({'top':(window.pageXOffset + (window.innerHeight/2)),'position':'fixed'});
      $('div#bluepageThea').css({'top':(document.getElementById('bluepageBody').scrollTop +  + (window.innerHeight/2)),'position':'absolute'});
   } else {                                                   
      $('div#bluepageThea').css({'top':(document.body.scrollTop + ((document.body.clientHeight)/2))});
   }   
   if ($('div#bluepageThea').css('display') == 'none')    $('div#bluepageThea').animate({ height: 'show' }, 'fast');
   if ($('div#popup_background').css('display') == 'none') $('#popup_background').animate({ opacity: 'show' }, 'fast');
   /*
   if (parent.theaFrame.document.onload) {
      if(document.all&&!window.opera) {
        var a=document.all.theaFrame;
        theaFrame.document.body.scroll='no';
      } else {
        var a=document.getElementsByName('theaFrame')[0];
        a.scrolling='no';
      }
      var a=document.getElementsByName('theaFrame')[0];
      theaFrame.document.getElementsByTagName('body')[0].style.overflow='hidden';
      var b=theaFrame.document.body;
      if(a.style.height != eval(b.offsetHeight+35)+'px') {
         a.style.height=eval(b.offsetHeight+35)+'px';
      }
   }
   */
}

function closeTheaWindow() {
   $('div#bluepageThea').animate({ height: 'hide' }, 'fast');
   $('div#bluepageThea').html('');
   $('#popup_background').animate({ opacity: 'hide' }, 'fast');
}

function viewVKZusatz() {
   $('#spielplan_detail_content').find('.vksubtext').animate({ height: 'toggle' }, 'fast');
   $('#spielplan_detail_content').find('.vksubtext_link').animate({ height: 'toggle' }, 'fast');
}



$('.kommentarForm_Wertung').live('click', function(e) {
   var frml = $(this).parents('FORM');
   var id = $(this).parents('FORM').find('[name=templId]').val();
   // Select Box Auf/ZU Funktion
   if($(this).children('.select').is(":visible")){                                                           
      if (ie) $(this).children('.select').animate({ height: 'hide', opacity: 'hide'}, 'fast', function() { $(this).children('.select').hide(); });
      else    $(this).children('.select').animate({ height: 'hide', opacity: 'hide'}, 'fast');
   } else {
      $('.select').css({display:'none'});
      if (ie) $(this).children('.select').animate({ height: 'show'}, 'fast', function() { $(this).children('.select').css({overflow:'visible'});});
      else    
      $(this).children('.select').animate({ height: 'show', opacity: 'toggle'}, 'fast'); 
   }
   // Select Box Wertauswahl
   if ($(e.target).attr('name') != '') {
      var wertung = $(e.target);
   } else if ($(e.target).parents('SPAN').attr('name') != '') {    
      var wertung = $(e.target).parents('SPAN');
   }  
   if (wertung.attr('name')) {  
         $(this).find('INPUT').val(wertung.attr('name'));
         if ($(this).find('.dbnone').html()) {
            $(this).find('.selectbox_head').html(wertung.attr('name'));
            $(this).find('.dbnone').css({display:'block'});
         } else {
            $(this).find('.selectbox_head').html('<span>'+wertung.html()+'</span>');
         }
      } else {
         $(this).find('INPUT').val('');
         $(this).find('.selectbox_head').html($(this).find('.selectbox_head').attr('name'));
         $(this).find('.dbnone').css({display:'none'});
      }
      if($('#requestList_'+id).is(":visible")){ 
         if (ie) $('#requestList_'+id).animate({ height: 'hide'}, 'fast');
         else    $('#requestList_'+id).animate({ height: 'hide', opacity: 'hide'}, 'fast');
      } 
   //}    
});

$('#vkComment').live('click', function(e) {
   var ierror = 0;
   if ($("#vkcom0").val() == $('#label_vkcom0').html() || $("#vkcom0").val() == '') {
      $("#vkcom0").css({'borderColor':'#cc0000'}); ierror++;      
   } else {
      $("#vkcom0").css({'borderColor':'#d2d0ca'});
   }
   if ($("#vkcom1").val() == '') {
      $('#commform').find('.kommentarForm_Wertung').css({'borderColor':'#cc0000'}); ierror++;      
   } else {
      $('#commform').find('.kommentarForm_Wertung').css({'borderColor':'#d2d0ca'});
   }                          
   if (ierror == 0) {
      $('#commform').find('input[name="eintrag_id"]').val($('#commform').find('input[name="fdatum"]').val());      
      $('#commform').submit();
   }
});

