function popup(url,windowname,width,height,scrollbars,features) {
	width=(width)?width:screen.width/2;
	height=(height)?height:screen.height/2;
	scrollbars=(scrollbars)?scrollbars:'no';
	var screenX = (screen.width/2 - width/2);
	var screenY = (screen.height/2 - height/2);
	var features= "width=" + width + ",height=" + height +",scrollbars=" + scrollbars + ",status=no";
	features += ",screenX=" + screenX + ",left=" + screenX;
	features += ",screenY=" + screenY + ",top=" + screenY;
	
	var mywin=window.open(url, windowname, features);
	if (mywin)
	mywin.focus();
	return mywin;
}

function confirmaEliminar(missatge,adreca){
var m = window.confirm(missatge)
	if (m==true){
	window.location = adreca
	}
}

function confirmaEliminar_submit(missatge,form){
var m = window.confirm(missatge)
	if (m==true){
	document.getElementById(form).submit();
	}
}
function comprova(){
	
	millas_nom = document.getElementById("millas_nom").value;
	millas_mail = document.getElementById("millas_mail").value;
	millas_cognoms = document.getElementById("millas_cognoms").value;
	millas_mobil = document.getElementById("millas_mobil").value;
		
	if (millas_nom!="" && millas_nom!="" && millas_cognoms!="" && millas_mobil!=""){		
		
		acepto = document.getElementById("acepto_p").checked;		
		document.frm_registro.submit();	
		
		
	}else{
			
		alert("tienes que rellenar todos los campos");
		return false;
	}
	
	
}
function comprova_video(){
	
	
	v_nom = document.getElementById("v_nom").value;
	v_cognoms = document.getElementById("v_cognoms").value;
	v_email = document.getElementById("v_email").value;
	
	
	v_ciutat = document.getElementById("v_ciutat").value;
	codi = document.getElementById("codi").value;
	acepto = document.getElementById("acepto-bases").checked;
	i_privacidad = document.getElementById("i_privacidad").checked;
	
	
	v_usuari = document.getElementById("v_usuari1").value;
	
	
	v_titol = document.getElementById("v_titol1").value;
	
	
	
	v_subtitol = document.getElementById("v_subtitol1").value;
	v_vincle = document.getElementById("v_vincle1").value;
	
	
	
	if (v_nom!="" && v_cognoms!="" && v_email!="" && v_ciutat!="" && codi!="" && v_usuari!="" && v_titol!="" && v_subtitol!="" && v_vincle!="" && acepto==true && i_privacidad==true){		
			
		document.contacte.submit();	
		
	}else{
			
		alert("Tienes que rellenar:\n\nDatos personales: nombre, apellidos, email, ciudad\n\nDatos del vídeo: nombre de usuario, título, texto, vinculo\n\nel código, aceptar las bases del concurso y aceptar la política de privacidad\n");
		return false;
	}
	
	
}