function showAnimated(layerID,src){
   var me = this ;
   this.layerID = layerID;
   this.img     = document.getElementById('imggif_'+layerID);
   this.gifDiv  = document.getElementById('Layer1_'+layerID);
		
   if(me.img.src != src){
	 me.img.src = src;
   }else{
	 me.gifDiv.style.visibility='visible';		
   }
		 	
	me.img.onload = function(){
		me.img.alt="Avatar";
		me.gifDiv.style.visibility='visible';
	}
}

function hideMe(layerID){
   	var me = document.getElementById("Layer1_"+layerID);
   	me.style.visibility = 'hidden';
}

function stopLoad(layerID){
   var img = document.getElementById('imggif_'+layerID);
   	if ( img.alt != "Avatar" ){
   		img.src="";
   	}
}

function writeStars(currentRating, sendto)
{
	var rating = (currentRating);

	if (isNaN(rating) ) {
		rating = 0;
	}

	rating = parseInt(rating*10,10);

	completeout = '';
	for( var i=10; i<60;i= i+10 ) {
		var imgName = 'star_sm_01.gif';
		var imgUrl = "";
	
		if( i <= rating ) {
			imgName = 'star_sm_07.gif';
		} else if( (i-1) <= rating ) {
			imgName = 'star_sm_06.gif';
		} else if( (i-3) <= rating ) {
			imgName = 'star_sm_05.gif';
		} else if( (i-5) <= rating ) {
			imgName = 'star_sm_04.gif';
		} else if( (i-7) <= rating ) {
			imgName = 'star_sm_03.gif';
		} else if( (i-9) <= rating ) {
			imgName = 'star_sm_02.gif';
		} else {
			imgName = 'star_sm_01.gif';
		}
		if (document.URL.indexOf('http://dev.') != -1) {
			imgUrl = 'http://images.stage.meez.com/static/icons/vbimages/meez/' + imgName;
		} else if (document.URL.indexOf('http://qa01.') != -1) {
			imgUrl = 'http://content.meez.com/static/vbimages/meez/' + imgName;
		} else if (document.URL.indexOf('http://qa02.') != -1) {
			imgUrl = 'http://content.meez.com/static/vbimages/meez/' + imgName;
		} else {
			imgUrl = 'http://content.meez.com/static/vbimages/meez/' + imgName;
		}
		// document.write('<img src="' + imgUrl + '" alt="X" />');
		completeout = completeout + '<img src="' + imgUrl + '">';
	  }
  document.getElementById(sendto).innerHTML = completeout;
}

