function change_current(type){

if(type == 'plus')
{
   current = current + 1;
   if(current > 4)
   current = 0;
   }
   else 
   {
   current = current - 1;
   if(current <0)
   current = 4;
   }


get_child('quote_text',sitelink+'/quotes/authors/'+catelGigel[current].firstname+'/'+catelGigel[current].lastname,catelGigel[current].quote);
get_child('quote_author',sitelink+'/quotes/authors/'+catelGigel[current].firstname+'/'+catelGigel[current].lastname,catelGigel[current].author);

catelGigel[current].outStars(catelGigel[current].var1, catelGigel[current].var2);
}



function get_child(elid,link,variable)
{
//alert(variable);
var parent = document.getElementById(elid);

while(parent.hasChildNodes() == true)
{
parent.removeChild(parent.childNodes[0]);
}



if(variable instanceof Array){

	for(i = 0; i < variable.length; i++){
		var aul = document.createElement('a');
		var newText = document.createTextNode(variable[i]);
		if(link !=0)
  			aul.href = link[i];
		aul.appendChild(newText);

		parent.appendChild(aul);
		if(i != variable.length - 1){
			aul.appendChild(document.createElement('br'));
		}
	}
 }else {
	var aul = document.createElement('a');
	var newText = document.createTextNode(variable);
	if(link !=0)
  		aul.href = link;
	aul.appendChild(newText);

	parent.appendChild(aul);

  }
}





function visitlink(location)
{
	document.location.href = location;
	}

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  // document.Show.MouseX.value = tempX
  // document.Show.MouseY.value = tempY
  return true
}


function showauthor(display){
	if(display == 'block'){//show it
	tooltipvalues()	;
	if(timerId){//clear timer; important if we don't move
			clearTimeout(timerId);
			//timerId= 0;
			
		}
		if(document.getElementById('tooltip').style.display != 'block'){//if it is hiddden
			document.getElementById('tooltip').style.top = tempY - 230 ;
			document.getElementById('tooltip').style.left = tempX - 230 ;
			document.getElementById('tooltip').style.display=display;
			
		}
		timerId = setTimeout("hideSmartLayer()",100);
		
	} else {//hide it = > from hideSmartLayer()
	//plan to hide it in 1 second
		if(document.getElementById('tooltip').style.display != 'none'){
		if(timerId){//clear timer
			clearTimeout(timerId);
			//timerId= 0;
		}//new plan
		timerId = setTimeout("hideSmartLayer()",100);
		}
	}

}

function tooltipvalues(){
var proflink = new Array;
get_child('dateofdeath',sitelink+'/events/'+catelGigel[current].dodlink,catelGigel[current].dod);
get_child('dateofbirth',sitelink+'/events/'+catelGigel[current].doblink,catelGigel[current].dob);
get_child('country',sitelink+'/quotes/country/'+catelGigel[current].country,catelGigel[current].country);
get_child('tooltip_author',sitelink+'/quotes/authors/'+catelGigel[current].firstname+'/'+catelGigel[current].lastname,catelGigel[current].author);
for(i = 0; i< catelGigel[current].profession.length;i++)
	proflink[i] = sitelink+'/quotes/profession/'+catelGigel[current].profession[i];
	
get_child('profession',proflink,catelGigel[current].profession);




}

function hideSmartLayer(){
document.getElementById('tooltip').style.display='none';
}

