function $(e) {if(typeof e=='string')return document.getElementById(e);else return e;}
function getCookie(n) {
	var ck=document.cookie;
	var start=ck.indexOf(n+'=');
	var len=start+n.length+1;
	if((!start && n!=ck.substring(0,n.length)) || start<0) return null;
	var end = ck.indexOf(';',len);
	if(end<0) end=ck.length;
	return unescape(ck.substring(len,end));
}
function setCookie(n,v,e,p,d,s) {
	var t=new Date();t.setTime(t.getTime());
	if(e) e=e*1000*60*60*24;
	var ed=new Date(t.getTime()+e);
	document.cookie=n+'='+escape(v)+(e?';expires='+ed.toGMTString():'')+(p?';path='+p:'')+(d?';domain='+d:'')+(s?';secure':'');
}
function nextNumber(max) {
	var next = getCookie('num');
	if (!next) next=0;
	next++;
	if (next>=max) next=0;
	setCookie('num', next);
	return next;
}
function zoom(pic) {
	unzoom();
	var s=pic.href;
	var b=document.body;
	var m=document.createElement('div');
	m.id='modalbg';
	m.style.position='absolute';
	m.style.left='0';
	m.style.top='0';
	m.style.width='100%';
	m.style.height=b.scrollHeight+'px';
	m.style.opacity='.75';
	m.style.filter='Alpha(opacity=75)';
	m.style.background='#776';
	m.innerHTML='<div style="width:100%;height:100%" onclick="unzoom()"></div>';
	b.appendChild(m);
	var z=document.createElement('span');
	z.id='piczoom';
	z.style.position='absolute';
	z.style.left='50%';
	z.style.top=(b.scrollTop+(b.clientHeight-440)/2)+'px';
	z.style.width='1px';
	z.style.height='1px';
	z.innerHTML='<div style="width:600px;border:1px dotted #575;background:#fff;padding:20px;text-align:center;position:absolute;left:-320px;xtop:160px;cursor:pointer" onclick="unzoom()"><img src="'+s+'" border="0"></div>';
	b.appendChild(z);
	return false;
}
function unzoom() {
	try{document.body.removeChild($('modalbg'));}catch(e){}
	try{document.body.removeChild($('piczoom'));}catch(e){}
}
DOMAIN = 'yahoo.com';
MAIL = 'bonitokun';
MAILTO = 'mail' + 'to:';
AT = '@';
function composeMail(e) {
	if (!e) return MAILTO + MAIL + AT + DOMAIN;
	var m = e.getAttribute('mail','false');
	var d = e.getAttribute('domain','false');
	if (!!m && m!='') e.setAttribute('href', MAILTO + m + AT + d, 'false');
	return true;
}