var myVcard=null;
var carousel={
txt:"",
current:-1,
currentWrite:0,
objId:"subHeader",
getTitle:function(){
try{
	var obj=document.getElementById(this.objId);
	objTxt=obj.firstChild.nodeValue; //testo
	return objTxt.split("-");
	alert();
	}
catch(e){
	return e.description.split();// null;
	}
},
//data:new Array("TEAM LEADING","WEB DEVELOPMENT","WEB SERVICES","GRAPHICS","CONSULTING"),
data:new Array(),
active:null,
activeWrite:null,
cInterv:null
}
function writeWord(){
	carousel.currentWrite +=1;
	var obj=document.getElementById(carousel.objId);
	if(carousel.currentWrite>carousel.txt.length){
		carousel.currentWrite=0;
		window.clearTimeout(carousel.activeWrite);
//		obj.firstChild.nodeValue=carousel.data.join();
		carousel.cInterv=window.setInterval("carouselGo()",1000);		
	}
	else {		
		var cTxt=carousel.txt.substring(0,carousel.currentWrite);
		if(obj!=null) obj.firstChild.nodeValue=cTxt;
		if(carousel.currentWrite<carousel.txt.length) obj.firstChild.nodeValue += "_";
		carousel.activeWrite=window.setTimeout("writeWord()",500);
	}	
}
function carouselGo(){
carousel.current +=1; if(carousel.current>(carousel.data.length-1))carousel.current=0;
carousel.txt=carousel.data[carousel.current];
if(carousel.cInterv!=null)window.clearInterval(carousel.cInterv);
//if(obj!=null) obj.firstChild.nodeValue=txt;
writeWord();
}
/*
function isHere(){
var resp="In questo momento sono"
var p= document.getElementById("locatorPanel");
if(!p) return;
var stNodes=xmlDoc.getElementsByTagName("state");
var stNode=stNodes[0];
var st=stNode.text;
if(st=="on") {
	var stInfo=xmlDoc.getElementsByTagName("on")[0];
	resp += " <br><strong>in ufficio</strong>";
	}
else {
	var stInfo=xmlDoc.getElementsByTagName("off")[0];
	resp += " <br> <strong>fuori ufficio</strong>";
}
p.insertAdjacentHTML("afterBegin",resp);
resp = "<br>Mi potete trovare a:<br>"
p.insertAdjacentHTML("beforeEnd",resp);
resp = "";
for(i=0;i<stInfo.childNodes.length;i++){
	ndinfo=stInfo.childNodes[i];
	var newLi=document.createElement("div");
	newLi.innerText = ndinfo.getAttribute("name") +
	" "  + ndinfo.getAttribute("value"); 
	p.appendChild(newLi);	
}

//p.appendChild(document.createTextNode(resp));
}
*/

window.onload=function(){
/*carousel.data=carousel.getTitle();
carouselGo();*/
//if(top.frames.length>0) top.location=window.location.href;
if(typeof(card)!="undefined") {
	myVcard=new vCard(card,"bottomRight")
	myVcard.initialize();
	myVcard.setPosition();
}
if(typeof(activeLinker)=="function") activeLinker();

}
window.onresize= function (){
if(myVcard==null) return(0);
myVcard.setPosition();
}

window.onscroll = function (){
if(myVcard==null) return(0);myVcard.setPosition()
}

