document.observe('dom:loaded', function() {
	/* change dropdown title */
	$('quicklink-dropdown').down('option',0).innerHTML = 'Quick Links';
	/* show headline only in non-script */
	$('quicklink-dropdown').down('h3',0).style.display = 'none';

	init_guiSelect();
	rerenderSifr();
	
	if (Info.browser.isIEpre7)
	{
		$$('.teaser-headline li object').each(function(item){
			item.setStyle({
				'width': '265px'
			});
		})
	}
	
	displayPressFeed();
	
	//ignore IE
	if(!Info.browser.isIE) {
		//set quicklinks dropdown select to default to first item DP 19.10.2009
		// (otherwise HTML fall back fails on browser back)
		var sel_search = $$('select.search-options');
		//console.log('sel_search: '+sel_search);
		
		if(sel_search != undefined) {
			sel_search[0].selectedIndex = 0;
		}
	}
	
});

function rerenderSifr() {
	sIFR.replaceElement(named({sSelector:"div.sifr-h2-home h2",sFlashSrc:SIFR_SLAB_PATH,sColor:"#3366aa",sWmode:"transparent"}));
	sIFR.replaceElement(named({sSelector:"div#content-zone div.right-content div.teaser div.teaser-headline li",sFlashSrc:SIFR_SLAB_PATH,sColor:"#333333",sHoverColor:"#990000",sWmode:"transparent"}));
	sIFR.replaceElement(named({sSelector:"div#content-zone div.right-content div.teaser div.teaser-headline p",sFlashSrc:SIFR_SLAB_PATH,sColor:"#333333",sWmode:"transparent"}));
}

function displayPressFeed()
{
	$('pressfeedresult').update();
	
	var url = ROOT_PATH+'apps/PageRss/xmlfeed.php?lang='+PAGE_LANG;
	new Ajax.Request(url, {
		method: 'get',
		onSuccess: function(xhr) {
			var feed = new Element('div').update(xhr.responseText);
			$('pressfeedresult').appendChild(feed);
		},
		onFailure: function(xhr) {
			console.log(xhr);
		}
	});	
}