/**
 * ingeborg-zarnetzki.de: Global JavaScript functions
 * @copyright Bugfree Media GbR 2010
 * @author Thomas Jirasko http://www.bugfree-media.de
 * @license Alle Rechte vorbehalten 
 * @created 2010-05-05
 * @updated 2012-01-23 by Thomas Jirasko 
 */
(function($){
  $(function(){
  	
  	// home-content mouse hover
    $("#content_navi a.square").mouseover(function(){
      $(this).fadeTo("300", 0.7);
    });
    
    // home-content mouse out
    $("#content_navi a.square").mouseout(function(){
      $(this).fadeTo("200", 1);
    });
    
		// Navigation
    var naviCurr = '';
    // togle hover image of current navi item
    $(".custom ul li a img").mouseover(function(){
      if($.browser.msie && parseInt($.browser.version) < 7) return; // do not change image if IE < 7 is detected -> pnghack with transparent.gif
			naviCurr = $(this).attr("src");
			naviCurr.replace('undefined',''); // undefiniertes IE 8 Problem
      if(!naviCurr.match('_hover')){ // if "_hover" is detected -> do nothing
        if(typeof naviCurr != "undefined"){
          var aSrc = naviCurr.split('.');
          $(this).attr("src",aSrc[0]+'_hover.'+aSrc[1]);
        }
      }
    });
    
    // togle normal image of current navi item
    $(".custom ul li a img").mouseout(function(){
      if($.browser.msie && parseInt($.browser.version) < 7) return; // do not change image if IE < 7 is detected -> pnghack with transparent.gif
      if(!naviCurr.match('_hover')){ // if "_hover" is detected -> do nothing
        if(typeof $(this).attr("src") != "undefined"){
          var aSrc = $(this).attr("src").split('_hover');
          $(this).attr("src",aSrc[0]+aSrc[1]);
        }
      }
    });
    
  	// Scroll Pane
  	if($('#content_scroll .mod_article').length > 0){
  		$('#content_scroll .mod_article').jScrollPane();
  	}
  	if($('#content_scroll .mod_guestbooklist').length > 0){
  		$('#content_scroll .mod_guestbooklist').jScrollPane();
  	}
  	
  	// Nähkurs entweder die eine oder die andere Selectbox-Kursnummer - beide zusammen gehen nicht!
  	if($('#ctrl_9').length > 0 && $('#ctrl_16').length > 0 && $('#kurs_anmeldung').length > 0){
  		/*
			$('#ctrl_9').focus(function() {
				$('#ctrl_9').css('opacity','1');
				$('#ctrl_16').css('opacity','.4');
				$('#ctrl_16').find('option:first').attr('selected', 'selected').parent('select');
			});
			$('#ctrl_16').focus(function() {
				$('#ctrl_16').css('opacity','1');
				$('#ctrl_9').css('opacity','.4');
				$('#ctrl_9').find('option:first').attr('selected', 'selected').parent('select');
			});
			*/
			/*
			$('#kurs_anmeldung').submit(function() {
				if ($('#ctrl_9').find('option:selected').val() == '001') {
					$('#ctrl_9').attr('disabled','disabled');
				}
				if ($('#ctrl_16').find('option:selected').val() == '002') {
				  $('#ctrl_16').attr('disabled','disabled');
				}
			});
			*/		
  	}
  	
  });
})(jQuery);

