

/**
 * Initialize the Logger
 */
// DEBUG LEVEL
var LOG = 0;
var DEBUG = 1;
var INFO = 2;
var ERROR = 3;

// Wrapper around Firebug Console, so we output just in case of console
// NOTE: i.e. IE does not have a Console
FB = function () { }


if(location.hostname == 'localhost') {
	FB.o = true;
	FB.l = 0; // add log level ID for console output
} else {
	FB.o = false;
	//FB.o = false; //globally disable debugging output
	FB.l = 3; // add log level ID for console output
}

FB.log = function (msg, level, x) {

	if (!FB.o) return true;

	if (!window.console) {
		return true;
	} else {
		switch(level) {
			case(DEBUG):
			    if (FB.l <= 1 ) {
					window.console.log('DEBUG: '+msg);
					//window.console.debug(msg); // won't work on Safari
				}
				break;
			case(INFO):
				if (FB.l <= 2 ) {
					window.console.log('INFO: '+msg);
					//window.console.info(msg); // won't work on Safari
				}
				break;
			case(ERROR):
			    if (FB.l <= 3 ) {
					window.console.log('ERROR: '+msg);
					//window.console.error(msg); // won't work on Safari
				}
				break;
			default:
			    if (FB.l <= 1 ) {
					window.console.log('LOG: '+msg);
				}
				break;
		}
	}
}

/**
 * aukat package
 *
 * This package contains initialization functions.
 *
 * @author <a href="mailto:info@cappuccinonet.com.com">Bernhard Woehrlin, IT.CappuccinoNet.com</a>
 */
if (typeof aukat == 'undefined') {
  aukat = function () { }
}

aukat.init = function () { }


/**
 * initializes the page's JavaScript

 * @package aukat.init
 */
aukat.init.initialize = function () {

	$(document).ready( function() {

      // accordion
			$('.entry').hide();
      $('.slider>h3').click(function()
      {
        $(this).next('.entry').slideToggle().parent().siblings('div').find('.entry:visible').slideUp();
				// Austausch der Bilder initieren
      });
      FB.log('initialized accordion', FB.INFO);

      var doctitle = $('#container').attr('title');
      FB.log('title: '+$('#container').attr('title'), FB.DEBUG);
      
			//var subdoctitle = doctitle.substring(0, 4);
			//FB.log('title.substring(0, 4): '+subdoctitle, FB.DEBUG);
			
      var xmldata = (window.location.hostname == 'localhost') ? 'http://localhost/clients/aumann-katzsch/www/joomla' :'http://au-kat.de/www';
			
			xmldata += '/templates/aukat/flash/bilder.php?title='+doctitle;
			FB.log('open xmldata file: '+xmldata, FB.INFO);
			
			//if (subdoctitle == '4.1.') {
			
				$('#galery').flash({
					swf: 'http://au-kat.de/www/templates/aukat/flash/galerie_alpha.swf',
					width: '960',
					height: '390',
					hasVersion: 9,
					expressInstaller: 'http://au-kat.de/www/templates/aukat/scripts/swfobject/expressInstall.swf',
					flashvars: {
						path: encodeURI(xmldata)
					}
				});
				
				FB.log('initialized flash', FB.INFO);
			//}
			
  		
	});
	
}



aukat.init.initialize();


