function ShootingStar() {
	var starattributes = {
		opacity: {from: 1, to: 0},
		points: { from: [5,5], to: [765, 260]}
	};

    document.getElementById('shootingstar').style.visibility = 'visible';
	var anim = new YAHOO.util.Motion('shootingstar', starattributes);
    anim.animate();    
}

function openAddDiv(addId,starId){
  ContentObj = document.getElementById(addId);

  if (ContentObj.style.display == 'none') {
    YAHOO.util.Dom.setStyle(ContentObj, 'height', 0);
	YAHOO.util.Dom.setStyle(ContentObj, 'display', 'block'); 
    var animator = new YAHOO.util.Anim(ContentObj,{opacity:{to:1},height:{to:460}});
	animator.animate();
	showStar(starId);
  }	
}

function closeAddDiv(addId,starId){
  ContentObj = document.getElementById(addId);
  if (ContentObj.style.display != 'none') {
    var animator = new YAHOO.util.Anim(ContentObj,{opacity:{to:0},height:{to:0}});
    animator.onComplete.subscribe(function(){YAHOO.util.Dom.setStyle(addId, 'display', 'none');});
	animator.animate();	
	hideStar(starId);
  }
}

function openPayDiv(divId){
  ContentObj = document.getElementById(divId);

  if (ContentObj.style.display == 'none') {
    YAHOO.util.Dom.setStyle(ContentObj, 'height', 0);
	YAHOO.util.Dom.setStyle(ContentObj, 'display', 'block'); 
    var animator = new YAHOO.util.Anim(ContentObj,{opacity:{to:1},height:{to:300}});
	animator.animate();	
  }	
}

function closePayDiv(divId){
  ContentObj = document.getElementById(divId);
  if (ContentObj.style.display != 'none') {
    var animator = new YAHOO.util.Anim(ContentObj,{opacity:{to:0},height:{to:0}});
    animator.onComplete.subscribe(function(){YAHOO.util.Dom.setStyle(divId, 'display', 'none');});
	animator.animate();	
  }
}

grow = function(divId) 
{
    ContentObj = document.getElementById(divId);
    YAHOO.util.Dom.setStyle(ContentObj, 'width', 0);
    //YAHOO.util.Dom.setStyle(ContentObj, 'height', 0);
	YAHOO.util.Dom.setStyle(ContentObj, 'display', 'block'); 

    var growattributes = {
    	width: {from: 0, to: 100 },
    //	height: {from: 0, to: 100 },
    	opacity: { from: 0, to: 1 }
	};

//    var growImage = new YAHOO.util.Anim(ContentObj, growattributes,.5, YAHOO.util.Easing.easeIn);
    var growImage = new YAHOO.util.Anim(ContentObj, growattributes,.5);
	growImage.animate();
}


remove = function(divId) 
{
     ContentObj = document.getElementById(divId);
    var removeattributes = {
    	width: { from: 100, to: 0 },
    	opacity: { from: 1, to: 0 }
    };
    var removeImage = new YAHOO.util.Anim(divId, removeattributes,.5);
	removeImage.animate();
    removeImage.onComplete.subscribe(function(){YAHOO.util.Dom.setStyle(ContentObj, 'display', 'none');});
}

function openUpdateDiv(divId){
  ContentObj = document.getElementById(divId);
  if (ContentObj.style.display == 'none') {
    YAHOO.util.Dom.setStyle(ContentObj, 'height', 0);
	YAHOO.util.Dom.setStyle(ContentObj, 'display', 'block'); 
    var animator = new YAHOO.util.Anim(ContentObj,{opacity:{to:1},height:{to:40}});
	animator.animate();	
  }	
}

function closeUpdateDiv(divId){
  ContentObj = document.getElementById(divId);
  if (ContentObj.style.display != 'none') {
    var animator = new YAHOO.util.Anim(ContentObj,{opacity:{to:0},height:{to:0}});
    animator.onComplete.subscribe(function(){YAHOO.util.Dom.setStyle(divId, 'display', 'none');});
	animator.animate();	
  }
}

function limitText(limitField, limitCount, limitNum) {

	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}
