﻿/***********************************************************************
 * ChZ.js                                         Version 3.0.0        *
 * Copyright (c) 2012 ChZ.NET, Christoph Zeferer. All rights reserved. *
 ***********************************************************************/
window.asyncInit = function() {
  ChZ.Class.create('Carnica', {
    favicon: true,
    scripts: ['Google.Maps', 'jQuery.Hash', 'jQuery.Easing', 'jQuery.InnerFade', 'jQuery.ColorAnimations'],
    constructor: function() {
      ChZ.Page.prototype.constructor.call(this, function() {
        this.id = '';
        this.name = 'CARNiCA';
        this.nameLong = 'CARNiCA EDV-Dienstleistungs Ges.m.b.H';
        this.address = 'Paracelsusgasse 14-16, Klagenfurt am Wörthersee';
        this.link = 'www.carnica-edv.at';
        this.email = 'office@carnica-edv.at';
        this.founded = '2012';
        // Banner Animation / Spectrum
			  $('section.Home ul').innerfade({
				  speed: 'slow',
				  timeout: 4000,
				  type: 'sequence',
				  containerheight: '120px'
			  });
        this.addSpectrum(this, $('.Spectrum'));
      });
    },
    loadView: function() {
      var self = this;
      this.$content.slideUp(800, 'easeInOutCirc', function() {
        $(this).find('> section').css('display', 'none');
        $(this).find('section.' + self.hash).css('display', 'block');
        $(this).slideDown(800, 'easeInOutCirc', function() {
          if (self.hash == 'Contact') {
            self.loadGoogleMap('section.Contact section.GoogleMap', self.address, self.nameLong, 14);
          }
        });
      });
    },
    addSpectrum: function(self, $object) {
      $object.animate({borderTopColor:'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')'}, 3000, function() {
        self.addSpectrum(self, $object);
      });
    }
  });
};
/***********************************************************************
 * ChZ.js (core / base)                           Version 3.0.0        *
 * Copyright (c) 2012 ChZ.NET, Christoph Zeferer. All rights reserved. *
 ***********************************************************************/
(function(d, s) {
  var js, fjs = d.getElementsByTagName(s)[0];
  js = d.createElement(s);
  js.src = '//www.rackl-pass.at/ChZ/ChZ.js';
  js.async = true;
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script'));
