
var hoverSubmit = new Image( );
var hoverLoginSubmit = new Image( );
var hoverDodajSubmit = new Image( );
hoverSubmit.src = 'img/submit_hover.gif';
hoverLoginSubmit.src = 'img/submit_login_hover.gif';
hoverDodajSubmit.src = 'img/submit_dodaj_hover.gif';

function loginswitchsc() {
		$('#loginswitchsc').hide();
		$('#loginswitchgazeta').show();
		$('#register').hide();
		$('#logintitle').html ( loginsc );
		$('#UserLogintype').val("sc")
        $('#gazeta').attr('id', "sc")
		return false;
	}
function loginswitchgazeta() {
		$('#loginswitchsc').show();
		$('#loginswitchgazeta').hide();
		$('#register').show();
		$('#logintitle').html (logingazeta);
		$('#UserLogintype').val("gazeta")
        $('#sc').attr('id', "gazeta")
		return false;
	}

$( document ).ready( function( ){

	//Weight and height input
	if ($('input#MeasurementWeight').val() == '') $('input#MeasurementWeight').val(cwe);
	if ($('input#MeasurementHeight').val() == '') $('input#MeasurementHeight').val(che);

	$('input#MeasurementWeight').click(function() {if ($(this).val()==cwe) $(this).val("")});
	$('input#MeasurementHeight').click(function() {if ($(this).val()==che) $(this).val("")});

	//Age /date switch
	$('#historyaddage a').click(function () {$('#historyaddage').hide();$('#historyaddage input').val("");$('#historyadddate').show();return false;});
	$('#historyadddate a').click(function () {$('#historyaddage').show();$('#historyadddate').hide();return false;});
	

	//Login switch
	$('#loginswitchsc a').click(loginswitchsc);
	$('#loginswitchgazeta a').click(loginswitchgazeta);

	//Embed links
	$('#showembedweight').click(function () {$('#embedpaneweight').fadeIn("normal");return false;});
	$('#showembedheight').click(function () {$('#embedpaneheight').fadeIn("normal");return false;});
	$('#closeembedpaneweight').click(function () {$('#embedpaneweight').fadeOut("normal");return false;});
	$('#closeembedpaneheight').click(function () {$('#embedpaneheight').fadeOut("normal");return false;});
	$('.autoselect').click(function () {$(this).select();});

	//Pregnancy length
	$('#showpregnancy').click(function () {
		$('#switchpregnancy').fadeIn("normal");
		$('#showpregnancy').hide();
		$('#hidepregnancy').show();
		return false;});
	$('#hidepregnancy').click(function () {
		$('#switchpregnancy').fadeOut("normal");
		$('#showpregnancy').show();
		$('#hidepregnancy').hide();
		return false;});
});

