<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <meta name="description" content="<?php echo SHORTNAME; ?> Alfa" />
    <meta name="keywords" content="<?php echo SHORTNAME; ?>" />
    
    <!-- FB -->
    
    <meta property="og:title" content="<?php echo SHORTNAME; ?>" />
    <meta property="og:description" content="<?php echo SHORTNAME; ?> Alfa" />
    <meta property="og:image" content="/static/images/logo-small-white.png" />
	
	<script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/1136/web-gallery/static/js/libs2.js" type="text/javascript"></script>
	<script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/1136/web-gallery/static/js/landing.js" type="text/javascript"></script>
    
    
    <meta name="viewport" content="initial-scale=1" />
    
    <title><?php echo SHORTNAME; ?></title>
    
    <!-- favicon apple touch icon -->
    <link rel="shortcut icon" href="/static/images/favicon.gif" />
    <link rel="apple-touch-icon" href="/static/images/logo-small-white.png" />
    
    <!-- Web fonts -->
    <link href='http://fonts.googleapis.com/css?family=Ubuntu:400,700' rel='stylesheet' type='text/css'>
    
    <!-- styles -->
    <link rel="stylesheet" href="/static/css/style.css" type="text/css" />
    
    <!-- javascript -->
	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script type="text/javascript">
    jQuery(document).ajaxSend(function(event, xhr, settings) {
        function getCookie(name) {
            var cookieValue = null;
            if (document.cookie && document.cookie != '') {
                var cookies = document.cookie.split(';');
                for (var i = 0; i < cookies.length; i++) {
                    var cookie = jQuery.trim(cookies[i]);
                    // Does this cookie string begin with the name we want?
                    if (cookie.substring(0, name.length + 1) == (name + '=')) {
                        cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                        break;
                    }
                }
            }
            return cookieValue;
        }
        function sameOrigin(url) {
            // url could be relative or scheme relative or absolute
            var host = document.location.host; // host + port
            var protocol = document.location.protocol;
            var sr_origin = '//' + host;
            var origin = protocol + sr_origin;
            // Allow absolute or scheme relative URLs to same origin
            return (url == origin || url.slice(0, origin.length + 1) == origin + '/') ||
                (url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') ||
                // or any other URL that isn't scheme relative or absolute i.e relative.
                !(/^(\/\/|http:|https:).*/.test(url));
        }
        function safeMethod(method) {
            return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
        }
    
        if (!safeMethod(settings.type) && sameOrigin(settings.url)) {
            xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
        }
    });
    </script>
    
    <script type="text/javascript" src="/static/js/jquery-ui-1.8.20.custom.min.js"></script>
    <script type="text/javascript" src="/static/js/jquery.countdown.pack.js"></script>
    <script type="text/javascript" src="/static/js/habbo.js"></script>
    <script src="/static/js/habbo_facebook.js" type="text/javascript"></script>
    
<!--[if lt IE 9]>
    <style type="text/css">
    .fb-reg-bottom {
       border-bottom: 1px solid black;
       bottom: 0;
    }
    input.text{
        margin-top: 4px;
        margin-bottom: 2px;
    }
    </style>
<![endif]-->
<script type="text/javascript" src="/static/js/jquery.countdown.pack.js"></script>
<?php if(PAGE_NAME == "indexregister" || PAGE_NAME == 'index'){ ?>
<script type="text/javascript">
$(document).ready(function(){
    

    // Terms Dialog

	$('#terms-dialog').dialog({

		autoOpen: false,

		width: 420,
		modal: true,
		dialogClass: 'terms-dialog',
		open: function(event, ui) {
            _gaq.push(['_trackEvent', 'Dialog', 'Terms']);
		}

	});

	// terms Link

	$('.terms_link').click(function(){

		$('#terms-dialog').dialog('open');

		return false;

	});

	// Privacy Dialog

	$('#privacy-dialog').dialog({

		autoOpen: false,

		width: 420,
		modal: true,
		dialogClass: 'terms-dialog',
		open: function(event, ui) {
            _gaq.push(['_trackEvent', 'Dialog', 'Privacy policy']);
		}

	});

	// privacy Link

	$('.privacy_link').click(function(){

		$('#privacy-dialog').dialog('open');

		return false;

	});

	// Underage Dialog

	$('#underage-dialog').dialog({

		autoOpen: false,

		width: 329,
		modal: true,
		dialogClass: 'terms-dialog underage-dialog'

	});

	$('#close-underage-dialog').click(function(event){
	    event.preventDefault();

		$('#underage-dialog').dialog('close');

	});


	/* default register */
    $('#submit_signup').click(function(event) {
        event.preventDefault();

        regManager.register('default');
    });

    /* hande agree checkbox */
    var checkboxes = $('.checkbox');

    for(var i=0;i<checkboxes.length;i++){
        if ($(checkboxes[i]).children("input").is(':checked')){
            $(checkboxes[i]).addClass("checked");
        }
    }

    $(".checkbox").click(function(){
		if($(this).children("input").is(':checked')){
			// uncheck
			$(this).children("input").removeAttr('checked');
			$(this).removeClass("checked");
		}else{
			// check
			$(this).children("input").attr('checked','checked');
			$(this).addClass("checked");
		}
	});

	/* initial input texts */
	emailInitialTxt = 'Por favor, introduzca su direccion de e-mail aqui';
	usernameInitialTxt = 'Por favor, introduzca su nombre de usuario aqui';
	contraInitialTxt = 'Contraseña';
	birthdayInitialDay = 'Dia';
	birthdayInitialMonth = 'Mes';
	birthdayInitialYear = 'Año';
	UsernameTxt = 'Coloca tu nombre de usuario';
	PasswordTxt = 'Password';
	/* input texts */
	$("#bday_day").click(function() {
        if($(this).val() == birthdayInitialDay) {
            $(this).val('');
        }
        $(this).removeClass('input-error');
    });
    $('#bday_day').blur(function() {
        if($(this).val() == ''){
            $(this).val(birthdayInitialDay);
        }
    });

    $("#bday_month").click(function() {
        if($(this).val() == birthdayInitialMonth) {
            $(this).val('');
        }
        $(this).removeClass('input-error');
    });
    $('#bday_month').blur(function() {
        if($(this).val() == ''){
            $(this).val(birthdayInitialMonth);
        }
    });

    $("#bday_year").click(function() {
        if($(this).val() == birthdayInitialYear) {
            $(this).val('');
        }
        $(this).removeClass('input-error');
    });
    $('#bday_year').blur(function() {
        if($(this).val() == ''){
            $(this).val(birthdayInitialYear);
        }
    });
});
</script>
<?php } else if(PAGE_NAME == "avatarregister") { ?>
<script type="text/javascript" src="/static/js/jquery.scrollTo-1.4.2-min.js"></script>
<script type="text/javascript" >
    UPDATE_FIGURE_URL = '/ajax/figure/update.php';
    ASSETS_URL = '/ajax/assets';

    REQUIRED_PARTS = ['ch', 'hd', 'lg'];
    
     $(document).ready(function(){
        /* avatar tab navigations */
        $(".editor-navi-item").click(function(event) {
            event.preventDefault();
    
            avatarManager.tab(this);
        });
    
        $(".editor-group-navi-item").click(function(event) {
            event.preventDefault();
    
            avatarManager.subTab(this);
        });
    
        /* rotate avatar */
        $("#rotate-cw").click(function(event) {
            event.preventDefault();
    
            avatarManager.rotateFigure(+1);
        });
    
        $("#rotate-ccw").click(function(event) {
            event.preventDefault();
    
            avatarManager.rotateFigure(-1);
        });
        
        /* change gender */
        $("#set-male").click(function(event) {
            event.preventDefault();
    
            $('.gender-link').removeClass('active');
            $('#set-male').addClass('active');
    
            avatarManager.setGender('M');
        });
        $("#set-female").click(function(event) {
            event.preventDefault();
    
            $('.gender-link').removeClass('active');
            $('#set-female').addClass('active');
    
            avatarManager.setGender('F');
        });
    
        /* select asset */
        $(".handle-asset").live('click', function(event) {
            event.preventDefault();
    
            avatarManager.handleAsset(this);
        });
    
        /* change asset color */
        $(".handle-colour").live('click', function(event) {
            event.preventDefault();
    
            avatarManager.handleColour(this);
        });
    
        /* empty asset */
        $(".fake-asset").live('click', function(event) {
            event.preventDefault();
        });
        
        /* submit avatar */
        $("#submit_avatar").click(function(event) {
            event.preventDefault();
    
            $('#avatar_form').submit();
        });
        
        var defaultState = {'hr': '3163-39', 'lg': '285-77', 'ch': '3111-63-62', 'hd': '3103-1', 'sh': '305-78'};
        defaultState['gender'] = 'M';
        avatarManager.init(defaultState);
    });
</script>
<?php
} 
else if(PAGE_NAME == "index"){ ?>
	
<?php
}
if(PAGE_NAME == "captcharegister"){ ?>
<script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
<script src="<?php echo PATH; ?>/web-gallery/static/js/landing.js" type="text/javascript"></script>

<?php } else {?>
    
    <script type="text/javascript" >
        ASSET_URL = '/static/assets';
        staticUrl = '/static/';
        
        defaultError = 'Algo salio mal, por favor vuelve a intentarlo.';
        
        $(document).ready(function() {
        	/* input info texts */
        
        	$("#id_email, .email_invitation").click(function() {
                if($(this).val() == emailInitialTxt) {
                    $(this).val('');
                }
                $(this).removeClass('input-error');
            });
            $('#id_email, .email_invitation').blur(function() {
                if($(this).val() == ''){
                    $(this).val(emailInitialTxt);
                }
            });
			$("#id_username").click(function() {
                if($(this).val() == usernameInitialTxt) {
                    $(this).val('');
                }
                $(this).removeClass('input-error');
            });
            $('#id_username').blur(function() {
                if($(this).val() == ''){
                    $(this).val(usernameInitialTxt);
                }
            });
			$("#id_password").click(function() {
                if($(this).val() == contraInitialTxt) {
                    $(this).val('');
                }
                $(this).removeClass('input-error');
            });
            $('#id_password').blur(function() {
                if($(this).val() == ''){
                    $(this).val(contraInitialTxt);
                }
            });
			$("#user_username").click(function() {
                if($(this).val() == UsernameTxt) {
                    $(this).val('');
                }
            });
            $('#user_username').blur(function() {
                if($(this).val() == ''){
                    $(this).val(UsernameTxt);
                }
            });
			
			$("#user_password").click(function() {
                if($(this).val() == PasswordTxt) {
                    $(this).val('');
                }
            });
            $('#user_password').blur(function() {
                if($(this).val() == ''){
                    $(this).val(PasswordTxt);
                }
            });
            /* fade errors */
            $('.error-container').live("hover", function(){
                $(this).fadeOut();
            });
        
        });
    </script>
<?php } ?>
    <!-- GOOGLE ANALYTCS -->
    <script type="text/javascript">

	  var _gaq = _gaq || [];
	  _gaq.push(['_setAccount', 'UA-32843253-1']);
	  _gaq.push(['_trackPageview']);

	  (function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	  })();

	</script>
</head>