function verMas(id)
{
	my_div = document.getElementById('noticia_short_'+id);
	my_div2 = document.getElementById('noticia_'+id);
	if(my_div.style.display!='none')
	{
		my_div.style.display='none';
		my_div2.style.display='';
	}
	else
	{
		my_div.style.display='';
		my_div2.style.display='none';
	}
}


 function cambiaListado(valor)
 {
 	document.listado.t.value = valor;
	document.listado.submit();
 }

function emailCheck (emailStr) {
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
	alert("Email incorrecto, corr&iacute;jalo e intentelo de nuevo")
	return false
}
var user=matchArray[1]
var domain=matchArray[2]
if (user.match(userPat)==null) {
    alert("The username doesn't seem to be valid.")
    return false
}
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert("Email incorrecto, corr&iacute;jalo e intentelo de nuevo")
		return false
	    }
    }
    return true
}
var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert("Email incorrecto, corr&iacute;jalo e intentelo de nuevo")
    return false
}
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   alert("Email incorrecto, corr&iacute;jalo e intentelo de nuevo")
   return false
}

if (len<2) {
   var errStr="Email incorrecto, corr&iacute;jalo e intentelo de nuevo"
   alert(errStr)
   return false
}
return true;
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=1,location=0,statusbar=1,status=1,menubar=0,resizable=1,width=540,height=390,left = 140,top = 25');");
}

function update_basket()
{
   document.data.update.value=1;
   document.data.submit();
}

function checkout()
{
   document.data.submit();
}
