﻿function reporte(pag,xmg){
    document.write('<br/><br/><b>Publica tu foto en facebook y twitter </b><br>');
    document.write('<a href=\'http://www.facebook.com/share.php?u=' + xmg + '&title=Edita tu imagen en http://metroxmetro.net\'><img src=\'http://metroxmetro.net/img/compartir-facebook.png\' alt=\'Compartir en facebook\' style=\'display:inline-block; margin:0px 14px 0px 0px;\' /></a>');
    document.write('<a href=\'http://twitter.com/home?status=mi foto ' + xmg + ' editada en http://metroxmetro.net\'><img src=\'http://metroxmetro.net/img/compartir-twitter.png\' alt=\'Compartir en twitter\' style=\'display:inline-block;\' /></a>');
  document.write('<p>Para firmas en los foros</p><textarea name="f" style="width:350px; height:81px;" readonly="readonly"  onclick="javascript:document.fr.f.focus();document.fr.f.select();" >[url=http://metroxmetro.net][img]'+xmg+'[/img][/url]</textarea>');
document.write('<p>Para usar como comentarios</p> <textarea name="h1" style="width:350px; height:81px;" readonly="readonly"  onclick="javascript:document.fr.h1.focus();document.fr.h1.select();" ><a href="http://metroxmetro.net"><img src="'+xmg+'" border="0" title="Imagenes para hi5"></a></textarea>');
     document.write('<p>Para decorar tu perfil</p> <textarea name="h2" style="width:350px; height:81px;" readonly="readonly"  onclick="javascript:document.fr.h2.focus();document.fr.h2.select();" ><a href="http://metroxmetro.net"><img src="'+xmg+'" border=0 title="Imagenes para hi5" /></a></textarea>');
    document.write('<p>Para fondo de tu perfil</p><textarea name="h3" style="width:350px; height:121px;" readonly="readonly"  onclick="javascript:document.fr.h3.focus();document.fr.h3.select();" ><style type="text/css">.bg_content{background-image:url('+xmg+');}.bg_content{background-repeat:repeat;}</STYLE></textarea>');
document.write('<p>Para <strong>guardar la imagen</strong> solo haz click en la imagen con el botón derecho y selecciona<br /> <em>Guardar imagen como</em> </p></form>');
}
function sendCorreo(){
buf=true;
fors=document.getElementById("fr");
buf=er_email.test(fors.correo.value);
buf=er_email.test(fors.amigo1.value);
if(fors.amigo2.value.length!=0)
buf=er_email.test(fors.amigo2.value);
buf=fors.nombre.value.length<=2?false:buf;
if(fors.amigo3.value.length!=0)
buf=er_email.test(fors.amigo3.value);
    if(!buf)
    alert("Tu nombre y tu correo son necesarios ademas revisa que por lo menos tengas el correo de un amigo y que los correos esten bien escritos");
    return buf;


}

 var er_email = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/


function correo(pag,xmg){
document.write('<form name="fr" id="fr" method="post" action="sendBas.aspx?ids='+pag+'" onsubmit="return sendCorreo();"><p>Envia esta foto a tus amigos<br/><br/><span>Tu Nombre: </span><input type="text"  name="nombre"   style="width:250px;" /><br/><span>Tu Correo: </span><input type="text" name="correo"   style="width:250px;" /><br/><span style="vertical-align:top;">Comentario: </span><textarea name="comentario" style="width:250px; height:81px;" ></textarea><br/><span>El correo de un Amigo: </span><input type="text" name="amigo1"   style="width:250px;" /><br/><span>El correo de un Amigo: </span><input type="text" name="amigo2"   style="width:250px;" /><br/><span>El correo de un Amigo: </span><input type="text" name="amigo3"   style="width:250px;" /><br/><input type="submit" value="Envia Correo"/>');}
