// Go to
function gt(lnk) {
	if (!$('content'))
		return true;
	try {
		if (Bko.Forms.profileModified && !confirm(Bko.Forms.profileLeaveMsg+Bko.Forms.profileLeaveMsg2))
			return false;
		else {
			Bko.Forms.profileModified=false;
		}
		if ($('tail_content')) $('tail_content').id = 'old_tail';
	}
	catch(e){} 
	Seam.Remoting.displayLoadingMessage();
	var myAjax = new Ajax.Updater (
		'content',
		lnk.href,
		{
			method: 'get',
			evalScripts: true,
			onSuccess: function(){window.scroll(0,0);},
			onComplete: function(){
				try{$('old_tail').remove();}catch(e){}
				Seam.Remoting.hideLoadingMessage();
			},
			parameters: 'ajaxrender=y'
		}
	);
	return false;
}

// Send form
function sf(frm) {
	if (!$('content'))
		return true;
	if ($('tail_content')) $('tail_content').id = 'old_tail';
	var fParams = Element.extend(frm).serialize();
	Seam.Remoting.displayLoadingMessage();
	var myAjax = new Ajax.Updater (
		'content',
		frm.action,
		{
			method: 'post',
			evalScripts: true,
			onSuccess: function(){window.scroll(0,0);},
			onComplete: function(){
				try{$('old_tail').remove();}catch(e){}
				Seam.Remoting.hideLoadingMessage();
			},
			parameters: fParams+'&ajaxrender=y'
		}
	);
	return false;
	
}

// History Change listener
function hc(newLocation, historyData) {
	if (newLocation.substring(0,1)!='/')
		return false;
	if (!$('content'))
		return true;
	var myAjax = new Ajax.Updater (
		'content',
		newLocation,
		{
			method: 'get',
			evalScripts: true,
			parameters: 'ajaxrender=y&fromhistory=y'
		}
	);
}

