// You need to include this source file last on your HTML Page.
function showEditor(pageName){
	document.getElementById('content_'+pageName).style.display='none';
	document.getElementById('edit_'+pageName).style.display='none';
	document.getElementById('editor_'+pageName).style.display='block';
	var oEditor = FCKeditorAPI.GetInstance('editorcontent_'+pageName);
	callServerSync('/cms/ajax_editor_control.html','PageName='+escape(pageName)+'&replace=0','tempDataContainer');
	oEditor.SetHTML(document.getElementById('tempDataContainer').innerHTML);
	return false;
}
function updatePageInfo(pageName){
	var oEditor = FCKeditorAPI.GetInstance('editorcontent_'+pageName);
	var val = oEditor.GetHTML(true);
	document.getElementById('content_'+pageName).style.display='block';
	callServerSync('/cms/ajax_editor_control.html','PageContents='+escape(val)+'&PageName='+escape(pageName)+'&whattodo=save&replace=1','content_'+pageName);
	document.getElementById('edit_'+pageName).style.display='inline';
	document.getElementById('editor_'+pageName).style.display='none';
	return false;
}
function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
	 {
	 blnResult = false;
	 }
      }
	  //if(strString.charAt(0)=='-') return true;
   return blnResult;
}
function isFutureDate( str1 ){
	// Parse the string in DD/MM/YYYY format
	re = /(\d{1,2})\/(\d{1,2})\/(\d{4})/
	var arr = re.exec( str1 );
	var dt1 = new Date( parseInt(arr[3]), parseInt(arr[2], 10) - 1, parseInt(arr[1], 10) );

	return dt1 > new Date();
}

