

function clickIE4(){
	if (event.button==2){
		return false;
	}
}

function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			return false;
		}
	}
}

if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
}else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function('return false');


String.prototype.htmlEntities = function () { 
	return this
		.replace(/&/g,'&amp;')
		.replace(/</g,'&lt;')
		.replace(/>/g,'&gt;')
		.replace(/á/g,'&aacute;')
		.replace(/é/g,'&eacute;')
		.replace(/í/g,'&iacute;')
		.replace(/ó/g,'&oacute;')
		.replace(/ú/g,'&uacute;')
		.replace(/Á/g,'&Aacute;')
		.replace(/É/g,'&Eacute;')
		.replace(/Í/g,'&Iacute;')
		.replace(/Ó/g,'&Oacute;')
		.replace(/Ú/g,'&Uacute;')
		.replace(/ñ/g,'&ntilde;')
		.replace(/Ñ/g,'&Ntilde;')
		.replace(/à/g,'&aacute;')
		.replace(/è/g,'&eacute;')
		.replace(/ì/g,'&iacute;')
		.replace(/ò/g,'&oacute;')
		.replace(/ù/g,'&uacute;')
		.replace(/À/g,'&Aacute;')
		.replace(/È/g,'&Eacute;')
		.replace(/Ì/g,'&Iacute;')
		.replace(/Ò/g,'&Oacute;')
		.replace(/Ù/g,'&Uacute;')
		.replace(/°/g,'&deg;')
		.replace(/¡/g,'&iexcl;')
		.replace(/¿/g,'&iquest;')
		.replace(/´/g,'&acute')
		.replace(/¨/g,'&uml;')
		.replace(/Â/g,'&Acirc;')
		.replace(/Ã/g,'&Atilde;')
		.replace(/Ä/g,'&Auml;')
		.replace(/Ê/g,'&Ecirc;')
		.replace(/Ë/g,'&Euml;')
		.replace(/Î/g,'&Icirc;')
		.replace(/Ï/g,'&Iuml;')
		.replace(/Ô/g,'&Ocirc;')
		.replace(/Õ/g,'&Otilde;')
		.replace(/Ö/g,'&Ouml;')
		.replace(/Û/g,'&Ucirc;')
		.replace(/Ü/g,'&Uuml;')
		.replace(/â/g,'&acirc;')
		.replace(/ã/g,'&atilde;')
		.replace(/ä/g,'&auml;')
		.replace(/ê/g,'&ecirc;')
		.replace(/ë/g,'&euml;')
		.replace(/î/g,'&icirc;')
		.replace(/ï/g,'&iuml;')
		.replace(/ô/g,'&ocirc;')
		.replace(/õ/g,'&otilde;')
		.replace(/ö/g,'&ouml;')
		.replace(/û/g,'&ucirc;')
		.replace(/ü/g,'&uuml;');
}; 

function echeck(str){
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1){ alert("Correo no valido"); return false; }
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ alert("Correo no valido"); return false; }
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ alert("Correo no valido"); return false; }
	if (str.indexOf(at,(lat+1))!=-1){ alert("Correo no valido"); return false; }
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ alert("Correo no valido"); return false; }
	if (str.indexOf(dot,(lat+2))==-1){ alert("Correo no valido"); return false; }
	if (str.indexOf(" ")!=-1){ alert("Correo no valido"); return false; }
	 return true;			
}

