/* ==UserScript======================== */
/* @author          James S. de Aguiar  */
/* @provided by     http://kicell.com   */
/* ==================================== */

var hj = new Date();
var dm = hj.getDate();
var dy = hj.getDay();
var hr = hj.getHours();

var pt_tx = 'Mensagens e Imagens!';
var es_tx = 'Mensajes y Imágenes!';
var en_tx = 'Messages and Images!';
var pt_im = 'http://pt.kicell.com/';
var es_im = 'http://es.kicell.com/';
var en_im = 'http://en.kicell.com/';

if(dy == 0) {
   pt_dy = 'domingo';
   es_dy = 'domingo';
   en_dy = 'sunday';
}else if(dy == 1) {
   pt_dy = 'segunda-feira';
   es_dy = 'lunes';
   en_dy = 'monday';
}else if(dy == 2) {
   pt_dy = 'terca-feira';
   es_dy = 'martes';
   en_dy = 'tuesday';
}else if(dy == 3) {
   pt_dy = 'quarta-feira';
   es_dy = 'miercoles';
   en_dy = 'wednesday';
}else if(dy == 4) {
   pt_dy = 'quinta-feira';
   es_dy = 'jueves';
   en_dy = 'thursday';
}else if(dy == 5) {
   pt_dy = 'sexta-feira';
   es_dy = 'viernes';
   en_dy = 'friday';
}else if(dy == 6) {
   pt_dy = 'sabado';
   es_dy = 'sabado';
   en_dy = 'saturday';
}

if (hr  <= 23) { pt_hr = 'boa-noite'; es_hr = 'buenas-noches'; en_hr = 'good-night';     }
if (hr  <= 18) { pt_hr = 'boa-tarde'; es_hr = 'buenas-tardes'; en_hr = 'good-afternoon'; }
if (hr  <= 12) { pt_hr = 'bom-dia';   es_hr = 'buenos-dias';   en_hr = 'good-morning';   }
if (hr  <= 6)  { pt_hr = 'boa-noite'; es_hr = 'buenas-noches'; en_hr = 'good-night';     }

document.write("<table align='center'><tr>");
document.write("<td><a href='/pt/bebes/'><img src='http://kicell.com/img/bebe.jpg' width='111px' height='99px'><BR>Bebês</a></td>");
document.write("<td><a href='/pt/fim-de-semana/'><img src='http://kicell.com/img/fim.gif' width='111px' height='99px'><BR>Fim de semana</a></td>");
document.write("<td><a href='/pt/caezinhos/'><img src='http://kicell.com/img/cao.gif' width='111px' height='99px'><BR>Caezinhos</a></td>");
document.write("<td><a href='/pt/boa-noite/'><img src='http://kicell.com/img/noite.gif' width='111px' height='99px'><BR>Boa noite</a></td>");
document.write("<td><a href='/pt/te-amo/'><img src='http://kicell.com/img/te-amo.gif' width='111px' height='99px'><BR>Te Amo</a></td>");
document.write("<td><a href='/pt/para-ti/'><img src='http://kicell.com/img/para-ti.gif' width='111px' height='99px'><BR>Para ti</a></td>");
document.write("</tr><tr>");
document.write("<td><a href='/en/fairy/'><img src='http://kicell.com/img/fairy.gif' width='111px' height='99px'><BR>Fairy</a></td>");
document.write("<td><a href='/en/i-love-you/'><img src='http://kicell.com/img/love.gif' width='111px' height='99px'><BR>I love you</a></td>");
document.write("<td><a href='/en/good-night/'><img src='http://kicell.com/img/good-night.gif' width='111px' height='99px'><BR>Good Night</a></td>");
document.write("<td><a href='/en/emo/'><img src='http://kicell.com/img/emo.gif' width='111px' height='99px'><BR>Emo</a></td>");
document.write("<td><a href='/en/happy-birthday/'><img src='http://kicell.com/img/happy.gif' width='111px' height='99px'><BR>Happy birthday</a></td>");
document.write("<td><a href='/en/hello/'><img src='http://kicell.com/img/hello.gif' width='111px' height='99px'><BR>Hello</a></td>");
document.write("</tr><tr>");
document.write("<td><a href='/es/abrazos/'><img src='http://kicell.com/img/abrazos.gif' width='111px' height='99px'><BR>Abrazos</a></td>");
document.write("<td><a href='/es/besos/'><img src='http://kicell.com/img/besos.gif' width='111px' height='99px'><BR>Besos</a></td>");
document.write("<td><a href='/es/felicidades/'><img src='http://kicell.com/img/felicidades.gif' width='111px' height='99px'><BR>Felicidades</a></td>");
document.write("<td><a href='/es/espana/'><img src='http://kicell.com/img/espanhol.gif' width='111px' height='99px'><BR>España</a></td>");
document.write("<td><a href='/es/flores/'><img src='http://kicell.com/img/flores.gif' width='111px' height='99px'><BR>Flores</a></td>");
document.write("<td><a href='/es/gracias/'><img src='http://kicell.com/img/gracias.gif' width='111px' height='99px'><BR>Gracias</a></td>");
document.write("</tr></table><br><br>");

function ir(lig,url) { window.open('/'+lig+'/email.php?im='+url,'email','width=430,height=330'); }
function imgWrite(url_img,lig,ctg,txt) { var tmp  = ctg.substring(0,1); var link = 'http://'+location.hostname+'/'; var gif  = Math.floor(Math.random()*50+1)+".gif"; if (lig == 'pt') { var criar = 'criar'; }else if(lig == 'es'){ var criar = 'crear'; }else{ var criar = 'create'; } document.write("<br><img src='"+url_img+""+ctg+"/"+gif+"'><br><br><div id='tx-en'><textarea onClick='focus();select();'><br><a href='"+link+""+lig+"/"+ctg+"/'><img src='"+url_img+""+ctg+"/"+gif+"' border=0><br><br><img src='"+link+""+lig+".gif' border=0><br><b>"+ctg.replace(tmp, tmp.toUpperCase())+" - "+txt+"</b></a><br><br></textarea><div id='acao'><img onclick=\"ir('"+lig+"','"+ctg+"/"+gif+"');\" src='/css/email.gif'><a href='/"+lig+"/"+criar+"/?img="+ctg+"/"+gif+"'><img src='/css/edit.gif'></a></div></div>"); }

imgWrite(pt_im,'pt',pt_dy,pt_tx);
imgWrite(es_im,'es',es_dy,es_tx);
imgWrite(en_im,'en',en_dy,en_tx);

imgWrite(pt_im,'pt',pt_hr,pt_tx);
imgWrite(es_im,'es',es_hr,es_tx);
imgWrite(en_im,'en',en_hr,en_tx);

imgWrite(pt_im,'pt','boa-semana',pt_tx);
imgWrite(es_im,'es','gracias',es_tx);
imgWrite(en_im,'en','hey-hi',en_tx);
