/**
// Copyright (C) 2009 - 2011 Mike Feng Jinglong
//
// This program is a commercial software; you cannot redistribute it
// and/or modify it without the explicit consent from the author.
//
// All title and copyright in and to the Product is owned by Mike Feng
// and is protected by international copyright laws and treaty provisions.
// Mike Feng retains all ownership rights in the Product.
// The copyright notice must be reproduced and included on any copy
// that is expressly permitted under this Agreement.
**/

function changeDashboardAnswers(type, page) {
	var output = $('dashboard-answers-output');
	var url = saurlraw+"&view=dashboard&task=changedashboardanswers&uid="+$('dashboard-uid').value+"&page="+page;
	var myReq = new Request({
		'url': url,
		'method': 'get',
		onRequest: function(){
			$('ajax-loading-'+type).setStyle('visibility','visible');
			output.fade('out');
		},
		onSuccess: function(responseText) {
			output.fade('hide');
			$('ajax-loading-'+type).setStyle('visibility','hidden');
			output.innerHTML = responseText;
			output.fade('in');
		},
		onFailure: function(){
			Sexy.error("<strong>"+SG_AJAX_ERROR+"</strong>");
		}
	}).send();
}

function changeDashboardQuestions(type, page) {
	var output = $('dashboard-questions-output');
	var url = saurlraw+"&view=dashboard&task=changedashboardquestions&uid="+$('dashboard-uid').value+"&page="+page;
	var myReq = new Request({
		'url': url,
		'method': 'get',
		onRequest: function(){
			$('ajax-loading-'+type).setStyle('visibility','visible');
			output.fade('out');
		},
		onSuccess: function(responseText) {
			output.fade('hide');
			$('ajax-loading-'+type).setStyle('visibility','hidden');
			output.innerHTML = responseText;
			output.fade('in');
		},
		onFailure: function(){
			Sexy.error("<strong>"+SG_AJAX_ERROR+"</strong>");
		}
	}).send();
}

function changeDashboardStarred(type, page) {
	var output = $('dashboard-starred-output');
	var url = saurlraw+"&view=dashboard&task=changedashboardstarred&uid="+$('dashboard-uid').value+"&page="+page;
	var myReq = new Request({
		'url': url,
		'method': 'get',
		onRequest: function(){
			$('ajax-loading-'+type).setStyle('visibility','visible');
			output.fade('out');
		},
		onSuccess: function(responseText) {
			output.fade('hide');
			$('ajax-loading-'+type).setStyle('visibility','hidden');
			output.innerHTML = responseText;
			output.fade('in');
		},
		onFailure: function(){
			Sexy.error("<strong>"+SG_AJAX_ERROR+"</strong>");
		}
	}).send();
}

function changeDashboardWatchlist(type, page) {
	var output = $('dashboard-watchlist-output');
	var url = saurlraw+"&view=dashboard&task=changedashboardwatchlist&uid="+$('dashboard-uid').value+"&page="+page;
	var myReq = new Request({
		'url': url,
		'method': 'get',
		onRequest: function(){
			$('ajax-loading-'+type).setStyle('visibility','visible');
			output.fade('out');
		},
		onSuccess: function(responseText) {
			output.fade('hide');
			$('ajax-loading-'+type).setStyle('visibility','hidden');
			output.innerHTML = responseText;
			output.fade('in');
		},
		onFailure: function(){
			Sexy.error("<strong>"+SG_AJAX_ERROR+"</strong>");
		}
	}).send();
}
