	// This javascript function is for ajax star rating
function RatingRequest(data, target) {
	var url = 'app/views/ajaxProc.php';
	new Ajax.Updater(target, url, {method:'get', parameters: data });
}


	// This javascript function ia for ajax pagination
function PaginationRequest(data, target) {
	var url = 'app/views/ajaxProc.php';
	//var target = 'commentinfo';
	new Ajax.Updater(target, url, {method:'get', parameters: data});
}


	// This javascript function will show the hidden id
function ShowCommentForm(show) {
	$(show).show();
	new Effect.Highlight(show);
}


	// This javascript function will add comment on video in ajax form
function CommentRequest(form, action, target) {
	var url  = 'app/views/ajaxProc.php';
	var value = Form.serialize(form);
	var data  = action+'&'+value;
	new Ajax.Updater(target, url, {method:'get', parameters: data });
}


	// This javascript function will renew the verification code
function VerificationRequest(data, target) {
	var url = 'app/views/ajaxProc.php';
	new Ajax.Updater(target, url, {method:'get', parameters: data });
}


	// This javascript function hide and show the description on watch
function ShowDesc(val) {
	switch(val) {	
		case 'more':
			$(val).hide();
			$('less').show();
			$('desc').setStyle({height: 'auto'});
			new Effect.Highlight('desc');
		break;
		
		case 'less':
			$(val).hide();
			$('more').show();
			$('desc').setStyle({height: '50px'});
		break;
	}
}


	// This javascript function will hide and show the selected id
function ShowOrHide(type, proc, show, hide) {
	var procId = $(proc);
	if(procId.options[procId.selectedIndex].value == '1') {
		$(show).show();
		$(hide).hide();
		new Effect.Highlight(show);
	} else if(procId.options[procId.selectedIndex].value == '3') {
		$(show).show();
		$(hide).hide();
		new Effect.Highlight(show);
	} else {
		$(hide).show();
		$(show).hide();
		new Effect.Highlight(hide);
	}
}


	// This javascript function will prompt upon deletion
function ConfirmDelete(url) {
	var msg = confirm("Are You Sure? Click (OK) to Continue");
	if (msg == true) {
			window.location=url;
	}
}


	// This javascript fucntion check all checkbox field 
function CheckAll(field) {
	if (field.length > 0) {
		for (i = 0; i < field.length; i++) {	
			field[i].checked = true;
		}			
	} else {
		field.checked = true;
	}
}


	// This javascript fucntion uncheck all checkbox field
function UncheckAll(field) {
	if (field.length > 0) {
		for (i = 0; i < field.length; i++)
		field[i].checked = false;
	} else {
		field.checked = false;
	}
}


var Num=0;
var stopflag=0;
var status = sequence = new Array();

	// This javascript function is to start the rollover thumbs
function Start(str,div) {	
	status[div] = 1;
	newArray = str.split(',');
	cnt = newArray.length;
	var first = 1;
	
	for(var j=0;j<cnt;j++) { 
		sequence[j] = new Image();
		loadpic(newArray[j],j); 
	}
	slideshow(0,div,cnt);
}

	// For image roll over process
function loadpic(url,j) {
	if(status) {
		sequence[j].src = url;
	}
}

	// For image roll over process
function slideshow(i,div,cnt) {
	if(status[div]) {
		if(i == cnt) {
			i = 0;
		}
	document.getElementById(div).src=sequence[i].src;
	i++;
	setTimeout("slideshow("+i+",'"+div+"','"+cnt+"')",550);
	}
}


	// This javascript function is to stop the rollover thumbs
function Stop(div) {
	status[div]=0;
}

	// This javascript function will bookmark this url
function AddBookmark(title, url) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
	return true;
	}
}