	// 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;
	}
}