function writeDiv(divID,msg)	{	document.getElementById(divID).innerHTML	= msg;	}
function emptyDiv(divID)		{	document.getElementById(divID).innerHTML	= '';	}
function ajaxError()			{	alert(req.responseText);							}
function show(divID)			{	new Element.show( divID );							}
function hide(divID)			{	new Element.hide( divID );							}

function pUpdater(theUrl,divID,freq)	{
	freq	= (freq)	? freq : 1;
	var options =
				{
					evalScripts:		true,
					asynchronous:		true,
					method:				'post',
					frequency:			freq
				};
	var pUpd	= new Ajax.PeriodicalUpdater(divID, theUrl, options);
}
function ajaxUpdater(fullUrl,divID)	{
	var options =
			{
				//evalScripts:		true,
				asynchronous:		true,
				method:				'get',
				onFailure:			ajaxError,
				onComplete:			function(req)	{
										req.responseText.evalScripts()
										var myResponse	= trim(req.responseText);
										writeDiv(divID,myResponse)
									}
			};
	var response	= new Ajax.Updater
		(
			'', 					//	div where to write some content
			fullUrl, 				//	url where submi the form
			options					//	options
		);
}
function ajaxUpdaterPost(fullUrl,divID,formID)	{
	var options =
			{
				//evalScripts:		true,
				asynchronous:		true,
				method:				'post',
				parameters:			Form.serialize(formID),
				onFailure:			ajaxError,
				onComplete:			function(req)	{
										req.responseText.evalScripts()
										//alert(Form.serialize(formID))
										var myResponse	= trim(req.responseText);
										writeDiv(divID,myResponse)
									}
			};
	var response	= new Ajax.Updater
		(
			'', 					//	div where to write some content
			fullUrl, 				//	url where submi the form
			options					//	options
		);
}

/**
	FOR COUNTDOWN
**/
var time	= "0";
timera		= new Array();
timerb		= new Array();
function ajaxUpdaterCountDown(fullUrl,divID)	{

	var options =
			{
				//evalScripts:		true,
				asynchronous:		true,
				method:				'get',
				onFailure:			ajaxError,
				onComplete:			function(req)	{
										req.responseText.evalScripts()
										var myResponse	= trim(req.responseText);
										//writeDiv(divID,myResponse)
										returnThis	= myResponse;
										addTimer(returnThis, divID);
										//alert(returnThis)
									}
			};
	var response	= new Ajax.Updater
		(
			'', 					//	div where to write some content
			fullUrl, 				//	url where submi the form
			options					//	options
		);
}
function showHide(divID,show)	{
	if (show)	{
		new Element.show(divID)
	} else {
		new Element.hide(divID)
	}
}

function sortableCreate(divID)	{
	Sortable.create
	(
		divID,
		{
			tag:			'div',
			//ghosting:		true,
			constraint:		'vertical',
			//overlap:		'vertical',
			dropOnEmpty:	true,
			onUpdate:		updateOrder
		}
	);
}
function sortableDestroy(divID)	{
	Sortable.destroy(divID);
	return false;
}
