// JavaScript Document

//workitem
function pickcolor(i){
   		var colors = new Array("8e288e","ed287a","bdd63a","f9eb32","57b7dd");
		
		var a = (i - 1)/5;
		var aS = (a.toString()).split(".");
		var aN = parseFloat(aS[1])/2;
		
		if(aN) c = colors[aN];
		else c = colors[0];
		
		return c;
   }
   
   
function workItemOver(id){
	var color = pickcolor(id);
	
	var el = document.getElementById('workitem_'+id);
	el.style.background = "#"+color+" url(img/wibg_"+color+".gif) top center no-repeat";


	var el_title = document.getElementById('workitemtitle_'+id);
	el_title.style.color = "#"+color;
	el_title.style.display="block";
	
	el.style.overflowY = "auto";
}
function workItemOut(id, img){
	var el = document.getElementById('workitem_'+id);
	el.style.background="#f3f1f1 url('"+img+"') center center no-repeat";
	
	var el_title = document.getElementById('workitemtitle_'+id);
	el_title.style.display="none";
	
	el.style.overflow = "hidden";
}
   
//form focus
var colors = new Array("#ed287a","#bdd63a","#f9eb32");
var values = new Array("say something!","who are u?","your email");

function inputfocus(ref, val){
//		alert(colors[val]+" - " + values[val]);
		ref.style.backgroundColor = colors[val];
		ref.style.color = "#ffffff";
		ref.style.fontStyle = "italic";
		if (ref.value == values[val]){
			ref.value = "";
		}
	}
function inputblur(ref, val){
//	alert(values[val]);
	ref.style.backgroundColor = "#ffffff";
	ref.style.color = "#000000";
	ref.style.fontStyle = "normal";
	if(ref.value == ""){
		ref.value = values[val];
	}
}

//twitter
 getTwitters('tweet', { 
                id: 'miseixas', 
                count: 1, 
                enableLinks: true, 
                ignoreReplies: true, 
                clearContents: true,
                template: '<p>"%text%"</p> <br/><a href="http://twitter.com/%user_screen_name%/statuses/%id%/" target="_blank"><small style="font-style:normal;">%time%</small></a>'
            });