// JavaScript Document

// Anti-Spam Email Displayer- By JavaScriptKit.com
// Visit JavaScript Kit (http://javascriptkit.com) for this script and more.
// This notice must stay intact for use

var contacts=new Array()
//Specify text and corresponding email address.
//Use [at] and [dot] in place of "@" and "." for anti spam purpose:
contacts[0]=["reykjavik [at] nordic-lifestyle [punkt] de", "reykjavik[at]nordic-lifestyle[dot]de"];

function displaycontact(emailarray, cssclass, displaymethod, extrainfo){
	if (displaymethod=="text")
			document.write('<a href="mailto:' + modifyemail(emailarray[1])+ '">'+ emailarray[0] + '</a>')
}

function modifyemail(emailitem){
	var modified=emailitem.replace(/\[at]/gi, "@")
	modified=modified.replace(/\[dot]/gi, ".")
	return modified
}

//Target _blank Ersatz
function targetBlank (url) {
	blankWin = window.open(url,'_blank','menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes');
}



function wechselBild(bildId) {
	var neu = '', teil = '';
	var bild = document.getElementById(bildId);
	teil = bild.src.split('.jpg');
	neu = teil[0] + '-a.jpg';
	bild.src = neu;
}

function wechselBildZurueck(bildId) {
	var neu = '', teil = '';
	var bild = document.getElementById(bildId);
	teil = bild.src.split('-a.jpg');
	neu = teil[0] + '.jpg';
	bild.src = neu;
}


function seiteVor(id) {
		teil = id.split('galerie');
		inkrement = parseInt(teil[1]) + 1;
		neu =  'galerie' + inkrement;
		document.getElementById(id).style.display = 'none';
		document.getElementById(neu).style.display = 'block';
}

function seiteRueck(id) {
		teil = id.split('galerie');
		inkrement = parseInt(teil[1]) - 1;
		neu =  'galerie' + inkrement;
		document.getElementById(id).style.display = 'none';
		document.getElementById(neu).style.display = 'block';
}

function seiteVorher(id) {
		document.getElementById('galerie1').style.display = 'none';
		document.getElementById(id).style.display = 'block';
}


window.addEvent('domready', function(){
	// Second Example
	if ($('subnaviaktiv')) {
		$('subnaviaktiv').set('tween', {
			duration: 500,
			transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
		}).tween('height', '211px');
	}

	for (var i = 1; i < 7; i++) {
		if ($('subnavi'+i)) {

		// The same as before: adding events
			$('subnavi'+i).addEvents({
				'mouseenter': function(){
					// Always sets the duration of the tween to 1000 ms and a bouncing transition
					// And then tweens the height of the element
					this.set('tween', {
						duration: 500,
						transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
					}).tween('height', h + 'px');
				},
				'mouseleave': function(){
					// Resets the tween and changes the element back to its original size
					this.set('tween', {}).tween('height', '117px');
				}
			});
		}
	}
});
