
// init loader
var loader = new Loader();
loader.setScriptPath("/static/js/");
loader.addFile("lib/prototype.js");

loader.addFile("src/scriptaculous.js");
loader.addFile("src/effects.js");
loader.addFile("lib/lightbox.js");

loader.addFile("lib/animator.js");
loader.addFile("lib/swfobject.js");

loader.addClass("at.elements.calendar.init");




if(language == "de") {
	loader.addClass("at.elements.calendar.de");
}
else if(language == "it") {
	loader.addClass("at.elements.calendar.it");
}
else {
	loader.addClass("at.elements.calendar.en");
}

loader.addClass("at.elements.textreplace.image");
loader.addClass("at.elements.languageDropdown.LanguageDropdown");


loader.load();
//loader.loadProxy("http://www.mavida.at/tools/scriptproxy/loader.php");

function onDocumentLoad ()
{
	
	
	
	
	// standard calender initialisation
	/*new at.elements.calendar.init({
		button : 'calendar',
		output : "text",
		textfield : "calender_output",
		updateFieldOnStartup : true
	});*/
/*	
	new at.elements.calendar.init({
		button : 'startCal',
		output : "input",
		dayInput: 'enquiry.arrival.day',
		monthInput: 'enquiry.arrival.month',
		yearInput: 'enquiry.arrival.year',
		updateFieldOnStartup : true
	});
	new at.elements.calendar.init({
		button : 'endCal',
		output : "input",
		dayInput: 'enquiry.departure.day',
		monthInput: 'enquiry.departure.month',
		yearInput: 'enquiry.departure.year',
		updateFieldOnStartup : true
	});
	
*/	
	
	
	initLightbox();
	
	
	
	if($('languages') != null)
	{
		var languages = new at.elements.languageDropdown.LanguageDropdown($('languages'));
	}

	if(language != "ru" ) {
		// replace text to images
		var imageReplacer = new at.elements.textreplace.image("/cache/headlines/",{appendFilename: true});
		//var imageReplacer = new at.elements.textreplace.image("http://www.mavida.at/tools/text2image/output.php",{appendFilename:false});
		
		
		imageReplacer.add({
			elements: $$('h1'),
			options: {
			font: 'HelveticaNeue-Condensed.ttf',
			width: '600',
			height: '45',
			color: '716d63',
			size: '26',
			positionx: 0,
			positiony: 35,
			replaceElement: {
				tagName: "span",
				className: "h1"
			}
		}});
		
		
		imageReplacer.add({
			elements: $$('.menu h2'),
			options: {
			font: 'HelveticaNeue-Condensed.ttf',
			width: '200',
			height: '',
			color: 'EE9F1C',
			size: '16',
			positionx: 0,
			positiony: 20,
			replaceElement: {
				tagName: "span",
				className: "h2"
			}
		}});
		
		imageReplacer.add({
			elements: $$('h2'),
			options: {
			font: 'HelveticaNeue-Condensed.ttf',
			width: '642',
			height: '30',
			color: '716d63',
			size: '16',
			positionx: 0,
			positiony: 20,
			replaceElement: {
				tagName: "span",
				className: "h2"
			}
		}});
		
		imageReplacer.add({
			elements: $$('h3'),
			options: {
			font: 'HelveticaNeue-Condensed.ttf',
			width: '642',
			height: '25',
			color: '716d63',
			size: '12',
			positionx: 0,
			positiony: 20,
			replaceElement: {
				tagName: "span",
				className: "h2"
			}
		}});

		imageReplacer.add({
			elements: $$('#topNav .active .menuEntry'),
			options: {
			font: 'corpsr.ttf',
			width: '',
			height: '',
			color: 'EE9F1C',
			size: '10',
			positionx: 0,
			positiony: 13,
			replaceElement: {
				tagName: "span",
				className: "activeMenuEntry"
			},
			modifyValue : function (vari)
			{
				return vari.toUpperCase();
			}
		}});
		
		
		imageReplacer.add({
			elements: $$('#topNav .inactive .menuEntry'),
			options: {
			font: 'corpsr.ttf',
			width: '',
			height: '',
			color: '58554d',
			size: '10',
			positionx: 0,
			positiony: 13,
			replaceElement: {
				tagName: "span",
				className: "inactiveMenuEntry"
			},
			modifyValue : function (vari)
			{
				return vari.toUpperCase();
			}
		}});
		
		imageReplacer.add({
			elements: $$('#quickInquiry h3'),
			options: {
			font: 'corpsr.ttf',
			width: '',
			height: '',
			color: '58554d',
			size: '12',
			positionx: 0,
			positiony: 12,
			replaceElement: {
				tagName: "span",
				className: "h3"
			},
			modifyValue : function (vari)
			{
				return vari.toUpperCase();
			}
		}});
		imageReplacer.add({
			elements: $$('h4'),
			options: {
			font: 'corpsr.ttf',
			width: '',
			height: '20',
			color: '58554d',
			size: '12',
			positionx: 0,
			positiony: 15,
			replaceElement: {
				tagName: "div",
				className: "h4"
			},
			modifyValue : function (vari)
			{
				return vari.toUpperCase();
			}
		}});
		imageReplacer.start();
	}
	
	
	

	//var elementhover = new classSwitcher( [ $$('#metanav li'), $$('#metanav li ul li'), $$('#metanav li ul li ul li') ] );
	//console.log( $$('#infoicons img'));
	//var tooltips = new toolTip( [ $$('#infoicons img') ] );
	

	

	
}


