/* clear default value in input */
clearInput = function(t){
	if(t.defaultValue==t.value){
		t.value = '';
	}
}
resetInput = function(t){
	if(t.value == ''){
		t.value = t.defaultValue;
	}
}
/* fade function*/
_in = function(){
	var i = Math.ceil((this.tarOpac-(this.objct.style.opacity*100))/this.speed)+(this.objct.style.opacity*100);
	this.objct.style.opacity = i/100;
	this.objct.style.filter = 'alpha(opacity='+i+')';
	if(i >= this.tarOpac){
		clearInterval(this.fadeIn_int);
	}
}
_out = function(){
	var i = Math.floor((0 - (this.objct.style.opacity*100))/this.speed)+(this.objct.style.opacity*100);
	this.objct.style.opacity = i/100;
	this.objct.style.filter = 'alpha(opacity='+i+')';
	if(i<= 0){
		clearInterval(this.fadeOut_int);
		if(this.remove){
			this.objct.parentNode.removeChild(this.objct);	
		}
	}
}
fadeIn = function(objct, tarOpac){
	this.objct = objct;
	this.speed = 5;
	this.tarOpac = tarOpac;	
	this.objct.style.opacity = 0;
	this.objct.style.visibility = 'visible';
	this.objct.style.filter = "alpha(opacity=0)";	
	tf = this;
	this.fadeIn_int = setInterval("tf._in()", 20);
}
fadeOut = function(objct, remove){
	if(this.fadeIn_int){ clearInterval(this.fadeIn_int);}
	this.objct;
	this.speed = 3;
	tf = this;
	this.remove = remove;
	this.fadeOut_int = setInterval("tf._out()", 20);
}
/* grow */
_expand = function(){
	var i = Math.ceil((this.obj['scroll'+this.dimCap] - (parseInt(this.obj.style[this.dim])))/this.speed) + (parseInt(this.obj.style[this.dim]));
	this.obj.style[this.dim] = i+'px';
	if(i >= this.obj['scroll'+this.dimCap]){
		clearInterval(this._int);	
	}
}
_shrink = function(){
	var i = Math.floor((0 - (parseInt(this.obj.style[this.dim])))/this.speed) + (parseInt(this.obj.style[this.dim]));
	this.obj.style[this.dim] = i+'px';
	if(i <= 0){
		clearInterval(this._int);	
	}	
}
expand = function(obj, dim){
	this.obj = obj;
	this.speed = 3;
	if(!this.obj.style[dim]){
		this.obj.style[dim] = 0;
	}
	this.obj.style.display = 'block';
	this.dim = dim;
	this.dimCap = dim.charAt(0).toUpperCase() + dim.substr(1).toLowerCase();
	me = this;
	if(parseInt(this.obj.style[dim]) < 1){
		this._int = setInterval('me._expand()', 20);
	}else{
		this._int = setInterval('me._shrink()', 20);
	}
}

/*rate */
function rate(num){	
	for(i=1; i<=num; i++){
		//alert(i+'s');
		document.getElementById('rate_'+i).className = 'select';		
	}
	for(i=num+1; i<=5; i++){
		//alert(i);
		document.getElementById('rate_'+i).className = '';	
	}
}







