$(document).ready(
	function(){
		$('form.homelogin .input-text').blur(function()
			{
				if ($(this).val() == '')
				{
				$(this).val($(this).attr("title"));
				}
			}
		);
		$('form.homelogin .input-text').focus(function()
			{
				if ($(this).val())
				{
				$(this).val('');
				}
			}
		);



$("#homelogin").submit(function()
{
        //remove all the class add the messagebox classes and start fading
		var backup = $("#login").html();
		var username = $('#username').val();
		var password = $('#password').val();
        $("#login").text('Validating....').fadeIn(1000);
        //check the username exists or not from ajax
        $.post("/member/ajax/login",{ username: username, password: password,rand:Math.random() } ,function(xml)
        {
          if($("status",xml).text() == "1") //if correct login detail
          {
                $("#login").fadeTo(200,0.1,function()  //start fading the messagebox
                {
                  //add message and change the class of the box and start fading
                  $(this).html( $("message", xml).text()).addClass('messageboxok').fadeTo(900,1);
                });
          }
          else
          {
                $("#login").fadeTo(200,0.1,function() //start fading the messagebox
                {
                  $(this).html(backup).addClass('messageboxerror').fadeTo(900,1);
				  $("p.notice").text($("message", xml).text());
                });
          }
       });
       return false;//not to post the  form physically
});		


		
		window.setInterval(
			function()
			{
			$('#playing-content').slideUp("slow");
			$('#playing-content').slideDown("slow").load('/radio/ajax/playing');
			$('#queue').load('/radio/ajax/queue').fadeIn("slow");
			}
		,120000);
	}
);

/*
player popup to be changed 
*/
function lancerpopup( ) {var lalargeur =  380 ; // ici la largeur du popup
var lahauteur = 190;  // ici la hauteur du popup
var yes = 1;var no = 0;var menubar = no; //  Fichier, Editiion, Affichage...
var scrollbars = no; // scrollbarre horizontale & verticale 
var locationbar = no; // Barre d'adresse
var directories = no; // Barre de liens
var resizable = no; // Permettre la fenetre d'être redimensionné 
var statusbar = no; // Status bar (with "Document: Done")
var toolbar = no; // retour, Home, Stop bar d'outil
var t = (screen.height-lahauteur)/2;  // pour centre selon la hauteur de l'écran
var l = (screen.width-lalargeur)/2; // pour centrer selon la largeur de l'écran
propriete = "width=" + (lalargeur) + ",height=" + (lahauteur) +  ",top=" + t +",left=" + l;
propriete += (menubar ? ",menubars" : "") + (scrollbars ? ",scrollbars" : "") + (locationbar ? ",location" : "") + (directories ? ",directories" : "") + (resizable ? ",resizable" : "") + (statusbar ? ",status" : "") + (toolbar ? ",toolbar" : ""); 

popup = window.open('http://www.radiovazogasy.com/media/player/rvg1/rvg.swf', 'Player Flash',propriete); }

	 
