
$('.twocolumnlist h3').click(function () {
    if (!$('#profile').hasClass('open')) {
        $('#profile').slideDown(400).addClass('open');
    }
    return false;
});

$('.search input[type=text]').focus(function(){
	var self = $(this);
	if (self.val() == searchLabel){
		self.addClass('focus');
		self.val('');
	}
});
$('.search input[type=text]').blur(function(){
	var self = $(this);
	if(self.val() == ''){
		self.removeClass('focus');
		self.val(searchLabel);
	}
});

$('.showmore').click(function(){
	$(this).hide().next().slideDown(200);
	return false;
});

$('.close').live('click',function(){
	$(this).parent().slideUp(400).removeClass('open');
});

$('#pagefooter li').hover(function(){
	$(this).find('.resource').fadeIn(200);
},function(){
	$(this).find('.resource').fadeOut(200);
});

var fakeoptions = $('.fakeoptions');
$('.fakeselect').click(function(){
	if (fakeoptions.hasClass('open')){
		fakeoptions.removeClass('open').slideUp(400);
	} else {
		fakeoptions.addClass('open').slideDown(400);
	}
});

function initializeMap() {
    var myOptions = {
        zoom: 16,
        center: new google.maps.LatLng(59.307179, 18.075518),
        mapTypeControl: false,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById("googlemap"),
	myOptions);

    var image = 'lib/images/_DEV/icon24.png';
    var myLatLng = new google.maps.LatLng(59.307179, 18.075518);
    var beachMarker = new google.maps.Marker({
        position: myLatLng,
        map: map,
        icon: image
    });
}

/*
var contactbutton = $('.vcard .touchanchor');
contactbutton.bind('touchstart',function(){$(this).addClass('interact')});
contactbutton.bind('touchend',function(){$(this).removeClass('interact')});

var menuanchor = $('#mainmenu .touchanchor');
menuanchor.bind('touchstart',function(){menuIntent($(this));return false;});
menuanchor.bind('touchend',function(){menuAction($(this));return false;});
menuanchor.bind('click',function(){menuAction($(this));return false;}); //for desktop

$('#mainmenu .active').next().addClass('open');

$('#mainmenu ul').each(function(){
	var self = $(this);
	if (self.siblings().hasClass('open'))
		self.css('margin-top',0);
	else
		self.css('margin-top',(self.height()*-1+'px'));
});
$('#mainmenu ul:first').css('margin-top',($(this).height()*-1+'px'));

function menuAction(menuanchor){
	var height = menuanchor.next().height();
	menuanchor.removeClass('interact');
	if(menuanchor.hasClass('open')){
		menuanchor.removeClass('open');
		menuanchor.next().css('margin-top',(height*-1+'px'));
	} else {
		menuanchor.addClass('open');
		menuanchor.next().css('margin-top',0);
	}
}

function menuIntent(menuanchor){
	menuanchor.addClass('interact');
}
*/
