function mylo (to, islink)
{
	serv = "sterntravel.de";
	if (islink)
		window.location = "mailto:" + to + "@" + serv;
	else
		document.write (to + "@" + serv);
}

if (typeof $ != 'undefined') { //не все подгружают JQUERY
$(document).ready(function() {
//When you click on a link with class of poplight and the href starts with a # 
$('.poplight').click(function() {
    var popWidth = $(this).attr('sourceWidth');
	popupImg = $('<img>').attr('src', $(this).attr('sourceName')).attr('width', $(this).attr('sourceWidth')).attr('height', $(this).attr('sourceHeight'));
	popupWnd = $('<div class="popup_block" />').append(popupImg).append($(this).attr('alt'));
	$('body').append(popupWnd);
	
    //Fade in the Popup and add close button
    popupWnd.fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="/images/icons/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');

    //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
	if (popupWnd.height() + 80 > $(window).height()) {
		var popMargTop = $(window).height() / 2 - 15;
	} else {
		var popMargTop = (popupWnd.height() + 80) / 2;
	}
    var popMargLeft = (popupWnd.width() + 80) / 2;

    //Apply Margin to Popup
    popupWnd.css({
        'margin-top' : -popMargTop,
        'margin-left' : -popMargLeft
    });

    //Fade in Background
    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 

    return false;
});

//Close Popups and Fade Layer
$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
    $('#fade , .popup_block').fadeOut(function() {
        $('#fade, a.close').remove();  //fade them both out
    });
    return false;
});
});
}


