function setEnglish()
{		
	// Desc
	$.ajax({
		type: 'POST',
		url : 'translate.php',
		data: 's=desc',
		success : function (data) {$('#contest-desc').html(data);}
	});					
	
	// Jury
	$.ajax({
		type: 'POST',
		url : 'translate.php',
		data: 's=jury',
		success : function (data) {$('#contest-jury').html(data);}
	});
	
	// Rules
	$.ajax({
		type: 'POST',
		url : 'translate.php',
		data: 's=rules',
		success : function (data) {$('#contest-rules').html(data);}
	});
	
	// Prices
	$.ajax({
		type: 'POST',
		url : 'translate.php',
		data: 's=prices',
		success : function (data) {$('#contest-prices').html(data);}
	});	
	
	$.ajax({
		type: 'POST',
		url : 'translate.php',
		data: 's=prices-1',
		success : function (data) {$('#contest-prices-1').html(data);}
	});		
	$.ajax({
		type: 'POST',
		url : 'translate.php',
		data: 's=prices-2',
		success : function (data) {$('#contest-prices-2').html(data);}
	});		
	$.ajax({
		type: 'POST',
		url : 'translate.php',
		data: 's=prices-3',
		success : function (data) {$('#contest-prices-3').html(data);}
	});			
	$.ajax({
		type: 'POST',
		url : 'translate.php',
		data: 's=prices-ship',
		success : function (data) {$('#contest-prices-ship').html(data);}
	});				
	
	// Examples
	$.ajax({
		type: 'POST',
		url : 'translate.php',
		data: 's=examples',
		success : function (data) {$('#contest-examples').html(data);}
	});					
	
	// Bandera
	$.ajax({
		type: 'POST',
		url : 'translate.php',
		data: 's=flag',
		success : function (data) { $('#contest-flag').html(data); }
	});
	
}

function joinContest()
{	
	$("#dvJoinContest").show('slow');
}

function closeJoinContest()
{	
	$("#dvJoinContest").hide('slow');
}

function DoJoinContest()
{

	var tTitulo 			= encodeURIComponent($("#tTitulo").val());
	var tNombre 			= encodeURIComponent($("#tNombre").val());
	var tCiudad 			= encodeURIComponent($("#tCiudad").val());
	var tPais 				= encodeURIComponent($("#tPais").val());
	var tEmail 				= encodeURIComponent($("#tEmail").val());	
	var tWeb 				= encodeURIComponent($("#tWeb").val());
	var tDescripcion 		= encodeURIComponent($("#tTexto").val());	
	
	redStyle= {'border':'2px solid red'};	
	
	// check
	if (tTitulo == '') 		{ $('#tTitulo').css(redStyle); return false; }
	if (tNombre == '') 		{ $('#tNombre').css(redStyle); return false; }
	if (tCiudad == '') 		{ $('#tCiudad').css(redStyle); return false; }
	if (tPais == '') 		{ $('#tPais').css(redStyle); return false; }
	if (tEmail == '') 		{ $('#tEmail').css(redStyle); return false; }
	if (tWeb == '') 		{ $('#tWeb').css(redStyle); return false; }
	if (tDescripcion == '')	{ $('#tTexto').css(redStyle); return false; }

	$.ajax({
		type: 'POST',
		url : 'djoincontest.php',
		data: 's=flag&tTitulo='+tTitulo+'&tNombre='+tNombre+'&tCiudad='+tCiudad+'&tPais='+tPais+'&tEmail='+tEmail+'&tWeb='+tWeb+'&tDescripcion='+tDescripcion,
		success : function (data) 
		{	
			$('#dvJoinContest').html(data);
			
			$(document).ready(function() {						
			
				$("#fileUpload").fileUpload({
						'uploader': 'http://www.bricogeek.com/contest/let-arduino-play/uploader.swf',
						'cancelImg': 'cancel.png',
						'folder': 'http://www.bricogeek.com/contest/let-arduino-play/uploads/',
						'buttonText': 'Select...',
						'checkScript': 'check.php',
						'script': 'upload.php',
						'multi': false,
						'auto':false,
						'simUploadLimit': 1,
						'onComplete': function(event, queueID, fileObj, reposnse, data)
							{							
								$('#dvPrjFiles').append('<font color=\"red\">'+fileObj.name+' ('+ Math.round(fileObj.size/1000) +' Kb)</font><br>');
								$("#btAceptar").attr("disabled",false);							
								$('#dvUploadButtons').html('');							
							},
						'onError': function(event, queueID, fileObj) 
							{								
								alert(errorObj.text);
							}
					});			
			});
		}
	});	
}

