var openNewspaper = function(slug,magUrl) {

	if ( typeof(magUrl) != 'undefined' && magUrl != '' ) {
		var urlToOpen = magUrl;
	} else {
		var urlToOpen = 'http://188.40.87.86/golfavisen/wp-includes/flippingbook/';
	}
	
	var wn = window.open(urlToOpen,
			"mywindow","status=0,toolbar=0,width=800,height=600"); 
	
	return false;

}

$(document).ready(function() {

	$('#log_u').bind('focus',function() {
		var val = $(this).val();
		if ( val == 'Brugernavn' ) {
			$(this).val('');
		}
	});
	$('#log_u').bind('focusout',function() {
		var val = $(this).val();
		if ( val == '' ) $(this).val('Brugernavn');
	});

	var bindFocusPassOut = function() {
		var val = $(this).val();
		if ( val == '' ) {
			var html = '<input type="text" value="Kode" class="inp_txt" name="pwd" id="log_p" />';
			$(this).after(html).remove();
			$('#log_p').bind('focus',bindFocusPass);
		}
	}
	var bindFocusPass = function() {
		var val = $(this).val();
		if ( val == 'Kode' ) {
			var html = '<input type="password" value="" class="inp_txt" name="pwd" id="log_p" />';
			$(this).after(html).remove();
			$('#log_p').bind('focusout',bindFocusPassOut);
			$('#log_p').focus();
		}
	}
	
	$('#log_p').bind('focus',bindFocusPass);
});
