// IE6 bottom navigation a:hover emulation
	
function domLoaded() {
	// unbind the initial listener
	document.stopObserving('dom:loaded');
		
	// Detect browser version
	Prototype.Browser.IE6 =
		Prototype.Browser.IE &&
		parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6;
		
	if (Prototype.Browser.IE6) {
		$$('.bottom-left-bottom-nav').each(function (element) {
			element.observe(
				'mouseover',
				iHateIEOver.bindAsEventListener(element)
			);
			
			element.observe(
				'mouseout',
				iHateIEOut.bindAsEventListener(element)
			);
		});
	}
}

function iHateIEOver (e) {
	element = Event.element(e);
	
	element.up().style.backgroundColor = '#043f88';
	
	element.up().childElements().each(function (child) {
		if (child.className == 'bottom-left-bottom-nav')
			child.style.backgroundColor = '#043f88';
		else if (child.className == 'bottom-left-bottom-nav-fauxborder')
			child.style.backgroundColor = '#0a2c63';
	});
}

function iHateIEOut (e) {
	element = Event.element(e);
	
	element.up().style.backgroundColor = 'transparent';
	
	element.up().childElements().each(function (child) {
		child.style.backgroundColor = 'transparent';
	});
}

// End IE6 bottom navigation a:hover emulation

function gotoURL(v)
{
        //draft
	//window.location = "/meetingsinarabella/"+v


        //live
        window.location = "/tagungshotels/"+v

}

function realgotoURL(v) {
        //window.location = v;
        if(v!='#') {
            window.open(v,'');
        }
}

function photoPopup(url) {
	window.open(url,'photosPopUp','width=600,height=416,resizable=no,scrollbars=no,status=no');
}



function getDestinations(countryid, language) {

    if(countryid != "" ) {

        //draft:
        //var url = 'http://'+window.location.hostname+'/meetingsinarabella/'+language+'/options_destinations';

       var url = 'http://'+window.location.hostname+'/tagungshotels/'+language+'/options_destinations';


        new Ajax.Updater('dest_id', url,
        {

            method: 'post',
            parameters: {countryid:countryid},
            onSuccess: function(transport) {
                $('dest_id').innerHTML = transport.responseText;
            },
            onFailure: function() {
                $('dest_id').innerHTML = 'Error!';
            }
        }
        );
    }
} //end function getDestinations


function expandingSpecial(id, showtext, hidetext)
{
	var e = $('specialoffer_'+id);
	Prototype.Browser.IE6 = Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6;
	Prototype.Browser.IE7 = Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==7;



	if(e.style.display=="none")
	{
		//$('sop_link_'+id).style.color = '#d7d7d7';
                $('sop_linkwrap_'+id).innerHTML = "<a id=\"sop_link_"+id+"\" href=\"javascript:closeSpecial('"+id+"', '" + showtext + "', '" + hidetext + "')\" class='specialoffer_show'>" + hidetext + "</a>";
		//$(id).writeAttribute('src','assets/images/star_grey.png');


		if(Prototype.Browser.IE6)
		{
			$('specialoffer_'+id).style.display = 'block';
		}
		else
		if(Prototype.Browser.IE7)
		{
			$('specialoffer_'+id).style.display = 'block';
		}
		else
		{
			$('specialoffer_'+id).style.display = 'table-row';
		}

	}
}

function closeSpecial(id, showtext, hidetext)
{
	$('sop_linkwrap_'+id).innerHTML = "<a id=\"sop_link_"+id+"\" href=\"javascript:expandingSpecial('"+id+"', '" + showtext + "', '" + hidetext + "')\" class='specialoffer_show'>" + showtext + "</a>";
        $('specialoffer_'+id).style.display = 'none';
	//$('link_'+id).style.color = '#6B6880';
	//$(id).writeAttribute('src','assets/images/star_darkgrey.png');
}

