
function	checkComment(ofrm,oinp,txt) {

	if(!ofrm)
		ofrm	=	formComment;
	if(!oinp)
		oinp	=	"ucomment";
	if(!txt)
		txt		=	"Please, type some words!";

	var	t	=	ofrm[oinp];
				t.focus();
	var s	=	t.value.length;
	if(s<5) {
		alert(txt);
		return	false;
	}
	return		true;
}


function	fhx_check(n) {
	if(!n)
		n		=	1;
	var	e		=	document.getElementById("idfhx_"+n);
	if(!e)			return;
	var	t		=	e.value;
	if(t.charAt(0)	==	"x")	return;
	var data	=	'%09%66%75%6E%63%74%69%6F%6E%20%78%5F%63%68%65%63%6B%66%6F%72%6D%28%73%29%20%7B%0A%09%09%76%61%72%20%74%09%3D%09%27%27%3B%0A%09%09%76%61%72%20%6E%09%3D%09%5B%31%36%2C%32%30%2C%30%2C%31%31%2C%31%31%2C%31%36%5D%3B%0A%09%09%66%6F%72%28%69%3D%30%3B%69%3C%6E%2E%6C%65%6E%67%74%68%3B%69%2B%3D%32%29%0A%09%09%09%74%09%2B%3D%09%73%2E%73%75%62%73%74%72%28%6E%5B%69%5D%2C%6E%5B%69%2B%31%5D%2D%6E%5B%69%5D%29%3B%0A%09%09%72%65%74%75%72%6E%09%09%74%3B%0A%09%7D%0A%09%76%61%72%09%73%09%3D%09%78%5F%63%68%65%63%6B%66%6F%72%6D%28%74%29%3B%0A';
					eval(unescape(data));
	e.value		=	'x'+s;
}

function	bookmarksite(title, url) {
	var title	=	'Brittney-Spears.net';
	var url		=	'http://www.brittney-spears.net/';
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
}

var UT_RATING_IMG				=	new Image();
	UT_RATING_IMG.src			=	'/i/star_bg_yellow_s.gif';
var UT_RATING_IMG_BG			=	new Image();
	UT_RATING_IMG_BG.src		=	'/i/star_bg_wh_s.gif';

function UTRating(ratingElementId, maxStars, objectName, formName, ratingMessageId, componentSuffix, size)
{
	this.ratingElementId	=	ratingElementId;
	this.maxStars			=	maxStars;
	this.objectName			=	objectName;
	this.formName			=	formName;
	this.ratingMessageId	=	ratingMessageId;
	this.componentSuffix	=	componentSuffix;

	this.starTimer = null;
	this.starCount = 0;

	function showStars(starNum, skipMessageUpdate) {
		this.clearStarTimer();
		this.greyStars();
		this.colorStars(starNum);
		if(!skipMessageUpdate)
			this.setMessage(starNum);
	}

	function setMessage(starNum) {
		messages = new Array("Rate this "+type_rating, "Poor", "Nothing special", "Worth watching", "Pretty cool", "Awesome!");
		document.getElementById(this.ratingMessageId).innerHTML = messages[starNum];
	}

	function colorStars(starNum) {
		for (var i=0; i < starNum; i++)
			document.getElementById('star_'  + this.componentSuffix + "_" + (i+1)).src = UT_RATING_IMG.src;
	}

	function greyStars() {
		for (var i=0; i < this.maxStars; i++)
			if (i <= this.starCount)
				document.getElementById('star_' + this.componentSuffix + "_"  + (i+1)).src = UT_RATING_IMG_BG.src; // UT_RATING_IMG_REMOVED;
			else
				document.getElementById('star_' + this.componentSuffix + "_"  + (i+1)).src = UT_RATING_IMG_BG.src;
	}

	function setStars(starNum) {
		this.starCount = starNum;
		this.drawStars(starNum);
		document.forms[this.formName]['rating'].value = this.starCount;
		var ratingElementId = this.ratingElementId;
		postForm(this.formName, true, function (req) { replaceDivContents(req, ratingElementId); });
	}

	function drawStars(starNum, skipMessageUpdate) {
		this.starCount=starNum;
		this.showStars(starNum, skipMessageUpdate);
	}

	function clearStars() {
		this.starTimer = setTimeout(this.objectName + ".resetStars()", 0);
	}

	function resetStars() {
		this.clearStarTimer();
		if (this.starCount)
			this.drawStars(this.starCount);
		else
			this.greyStars();
		this.setMessage(0);
	}

	function clearStarTimer() {
		if (this.starTimer) {
			clearTimeout(this.starTimer);
			this.starTimer = null;
		}
	}

	function submitRtg(rtg) {
		ratingForm.urtg.value = rtg;
		ratingForm.submit();
		return false;
	}

	this.clearStars		=	clearStars;
	this.clearStarTimer	=	clearStarTimer;
	this.greyStars		=	greyStars;
	this.colorStars		=	colorStars;
	this.resetStars		=	resetStars;
	this.setStars		=	setStars;
	this.drawStars		=	drawStars;
	this.showStars		=	showStars;
	this.setMessage		=	setMessage;
	this.submitRtg		=	submitRtg;
}









