/* 5448 Bytes following*/
var NewsBoxSection = Class.create();
NewsBoxSection.prototype = {
	initialize: function(path_http){
		this.path_http = path_http;
	},
	toggle: function (iSection,iCatchline){
		$('nbsCatchline_' +iSection+ '_' + iCatchline + '_full').setStyle({display: 'block'});
		$('nbsCatchline_' +iSection+ '_' + iCatchline + '_short').setStyle({display: 'none'});
		var allElements = $$('#nbsContent_' +iSection+ ' .nbsCatchlines' );
		var elemLen = allElements.length;
		for (var j = 0; j < elemLen; j++ ) {
			if ( allElements[j].identify() != 'nbsCatchline_' +iSection+ '_' + iCatchline ) {
				$('nbsCatchline_' +iSection+ '_' + j + '_full').setStyle({display: 'none'});
				$('nbsCatchline_' +iSection+ '_' + j + '_short').setStyle({display: 'block'});
			}
		}
	}
}
var MostReadDay = Class.create();
MostReadDay.prototype = {
	initialize: function(path_http){
		this.path_http = path_http;
	},
	toggle: function (iSection,iCatchline){
		$('mrdCatchline_' +iSection+ '_' + iCatchline + '_full').setStyle({display: 'block'});
		$('mrdCatchline_' +iSection+ '_' + iCatchline + '_short').setStyle({display: 'none'});
		var allElements = $$('#mrdContent_' +iSection+ ' .mrdCatchlines' );
		var elemLen = allElements.length;
		for (var j = 0; j < elemLen; j++ ) {
			if ( allElements[j].identify() != 'mrdCatchline_' +iSection+ '_' + iCatchline ) {
				$('mrdCatchline_' +iSection+ '_' + j + '_full').setStyle({display: 'none'});
				$('mrdCatchline_' +iSection+ '_' + j + '_short').setStyle({display: 'block'});
			}
		}
	}
}
function favoriten() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel("ad-hoc-news.de","http://www.ad-hoc-news.de/",""); }
else { window.external.AddFavorite("http://www.ad-hoc-news.de/","ad-hoc-news.de"); } }

var homepage = "http://www.ad-hoc-news.de/";

function startseite (){    
    document.body.style.behavior='url(#default#homepage)';
    document.body.setHomePage( homepage );
}

var MostReadWeek = Class.create();
MostReadWeek.prototype = {
	initialize: function(path_http){
		this.path_http = path_http;
	},
	toggle: function (iSection,iCatchline){
		$('mrwCatchline_' +iSection+ '_' + iCatchline + '_full').setStyle({display: 'block'});
		$('mrwCatchline_' +iSection+ '_' + iCatchline + '_short').setStyle({display: 'none'});
		var allElements = $$('#mrwContent_' +iSection+ ' .mrwCatchlines' );
		var elemLen = allElements.length;
		for (var j = 0; j < elemLen; j++ ) {
			if ( allElements[j].identify() != 'mrwCatchline_' +iSection+ '_' + iCatchline ) {
				$('mrwCatchline_' +iSection+ '_' + j + '_full').setStyle({display: 'none'});
				$('mrwCatchline_' +iSection+ '_' + j + '_short').setStyle({display: 'block'});
			}
		}
	}
}
var Clock = Class.create();
Clock.prototype = {
    initialize: function( iTime,sElement ){
    	this.getTime(iTime);
    	this.sElement = sElement;
    	this.getClock();
    },
	getTime: function(iTime) {
		var oTime = new Date();
		oTime.setTime(iTime * 1000);
		this.iHours = oTime.getHours();
		this.iMinutes = oTime.getMinutes();
		this.iSeconds = oTime.getSeconds();
	},
	getClock: function (  ){
		var sTimeStr = null;
		setTimeout ('oClk.getClock()',1000);
		if (++this.iSeconds>59){
			this.iSeconds=0;
			if (++this.iMinutes>59){
				this.iMinutes=0;
				if (++this.iHours>23)this.iHours=0;
			}
		}
		sTimeStr = ((this.iHours < 10) ? '0' : '')+this.iHours;
		sTimeStr += ((this.iMinutes < 10) ? ':0' : ':') + this.iMinutes;
		sTimeStr += ((this.iSeconds < 10) ? ':0' : ':') + this.iSeconds;
		$(this.sElement).update( sTimeStr);
		return null;
	}
}
var BreadSearchHead = Class.create();
BreadSearchHead.prototype = {
    initialize: function(options){
        this.options = options ? options : {};

    },
    initInput: function (element) {
		$(this.options.form ).setAttribute('autocomplete','off');
		$(this.options.varname ).writeAttribute('autocomplete','off');
    },
    toggleSearch: function (element) {
		this.swapInputHint();
		if (element == 'web') {
			$('bsh_search_stock').setStyle({display:'none'});
			$('bsh_search_news').setStyle({display:'none'});
		} else
		if (element == 'stock'){
			$('bsh_search_stock').setStyle({display:'block'});
			$('bsh_search_news').setStyle({display:'none'});
		} else
		if (element == 'news'){
			$('bsh_search_stock').setStyle({display:'none'});
			$('bsh_search_news').setStyle({display:'block'});
		}
	},
	swapInputHint: function () {
    	if ($('ac_q')) {
    		$('ac_q').remove();
		}
		var temp = this;
		Event.observe(
			this.options.varname,
			'focus',
			function(event) {
				if ( $(temp.options.varname).value == temp.options.sHint) {
					$(temp.options.varname).value='';
				}
				$(temp.options.varname).addClassName('ac_field');
			}
		);
		Event.observe(
			this.options.varname,
			'blur',
			function(event) {
				if ( $(temp.options.varname).value == temp.options.sHint) {
					$(temp.options.varname).value=temp.options.sHint;
				}
				$(temp.options.varname).removeClassName('ac_field');
			}
		);
	},
	autoComplete: function (){
		this.swapInputHint();
		this.json = new AutoComplete(this.options.varname,this.options);

	} ,
	observeSubmit: function () {
		var temp = this;
		Event.observe(
			this.options.form,
			'submit',
			function(event) {
				$(temp.options.varname).submit();
			}
		);
	}
}
