/// ******************************************************************************

function init() {
  if  (window.innerWidth<1000) {
    window.innerWidth = 1000;
  } // if  (window.innerHeight<1000)

  StartTicker();
} // function init()

// ******************************************************************************

var geladene_seite = null;

// ******************************************************************************

function load_content( parameter ) {
  window.location.hash = parameter;
} // function load_content( parameter )

// ******************************************************************************

function ladeInhaltAnhandHash() {
  var hash_str=window.location.hash;

  if (geladene_seite==hash_str) {
    return;
  } // if (geladene_seite==hash_str)

  if (hash_str=='') {
    window.location.hash = '#p=news';
    return;
  } // if (hash_str=='')

  geladene_seite = hash_str;

  if (hash_str.substr(0,1)!='#') {
    return;
  } // if (hash_str.length<=0)
  hash_str = hash_str.substr(1);

  var zielseite = 'index.php';
  ladegrade( 'an' ); // ladegrade aktivieren
  jQuery.get(zielseite,hash_str, function(data){  
    ladegrade( 'aus' ); // ladegrade deaktivieren
    jQuery("#content").html(data);  
  });  

} // function ladeInhaltAnhandHash()

// ******************************************************************************

function jQreadyFunction() {
  setInterval("ladeInhaltAnhandHash()", 300);
} // function jQreadyFunction()

jQuery(document).ready( jQreadyFunction );

// ******************************************************************************

function ladegrade( neuer_status ) {

  // document.automietform.elements['amf_0'].disabled = neuer_status=='an' ? true : false;
  // document.automietform.elements['amf_1'].disabled = neuer_status=='an' ? true : false;

  div_id = 'ladegrade';
  var obj = document.getElementById ? document.getElementById(div_id) :
  document.all ? document.all[div_id] : null;
  if(!obj || !obj.style) return;
/*
  ladegrade_width   = 500;
  ladegrade_height  = 300;

  obj.style.width   = ladegrade_width  + 'px';
  obj.style.height  = ladegrade_height + 'px';
  page_xy_offset    = getScrollXY();
  page_size         = getWinSize();
  // alert(page_xy_offset[0] + '|'+page_xy_offset[1]);

  // obj.style.left    = ((window.innerWidth  - ladegrade_width)  / 2+window.pageXOffset)+'px';
  // obj.style.top     = ((window.innerHeight - ladegrade_height) / 2+window.pageYOffset)+'px';
  obj.style.left    = ((page_size[0] - ladegrade_width)  / 2+page_xy_offset[0])+'px';
  obj.style.top     = ((page_size[1] - ladegrade_height) / 2+page_xy_offset[1])+'px';
*/
  // setzen der eigenschaften
  obj.style.display = neuer_status=='an'? 'block' : 'none';
} // function ladegrade( neuer_status ) {


function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


function getWinSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return [ myWidth, myHeight ];
}

// ******************************************************************************



function get_div( div_id ) {
 return document.getElementById( div_id );
}

function div_einblenden( div_id ) {
  mmc = get_div( div_id );
  if (!mmc) {
    return;
  } // if (!mmc)
  mmc.style.display='inline';
}

function div_ausblenden( div_id ) {
  mmc = get_div( div_id );
  if (!mmc) {
    return;
  } // if (!mmc)
  mmc.style.display='none';
}

function div_sichtbarkeit_umkehren( div_id ) {
// alert( document.getElementById( div_id ) );
  mmc = get_div( div_id );
  if (!mmc) {
    return;
  } // if (!mmc)
  if (mmc.style.display=='none') {
    mmc.style.display='inline';
  } else { // if (mmc.style.display=='none')
    mmc.style.display='none';
  } // if (mmc.style.display=='none')
} // function div_sichtbarkeit_umkehren( div_id )

