

//--------------------------------------------------------------------------------------------------------------
		
function Logout(){
	window.location.href = window.location +"?Logout=true";
}

//--------------------------------------------------------------------------------------------------------------
		
function SetEditMode(iEditMode){
	var sUrl = new String(window.location);
	sUrl = sUrl.replace(/\#.*$/, "")
	window.location.href = sUrl +"?EditMode=" + iEditMode;
}

//--------------------------------------------------------------------------------------------------------------

function CloseForm(){
	$("#dialog").jqmHide(); 
}
	
//--------------------------------------------------------------------------------------------------------------

function DownloadFile(iFileVersionID){
	frDownload.location="shared/DownloadFile.aspx?FileVersionID=" + iFileVersionID;
	
}

//--------------------------------------------------------------------------------------------------------------

function ViewSpreadsheet(sFileURL){
	var sURL = "http://sheet.zoho.com/view.do?url=" + sFileURL
	window.open(sURL,"XLS_Viewer","width=800,height=600,left=100,top=20");
	
}

//--------------------------------------------------------------------------------------------------------------

function SetCalendarView(sID){
		var arrID = sID.split('_');
		if(arrID[0] == "la"){
			var oFrame = document.getElementById("cf_" + arrID[1]);
			oFrame.style.display = "none";
			var oAnchor = document.getElementById("ca_" + arrID[1]);
			oAnchor.className = "";
			oFrame = document.getElementById("lf_" + arrID[1]);
			oFrame.style.display = "block";
			oAnchor = document.getElementById("la_" + arrID[1]);
			oAnchor.className = "selected";
		}
		else {
			var oFrame = document.getElementById("lf_" + arrID[1]);
			oFrame.style.display = "none";
			var oAnchor = document.getElementById("la_" + arrID[1]);
			oAnchor.className = "";
			oFrame = document.getElementById("cf_" + arrID[1]);
			oFrame.style.display = "block";
			oAnchor = document.getElementById("ca_" + arrID[1]);
			oAnchor.className = "selected";
		}
	}
//------------------------------------------------------------------------------------------------------------------

function calcHeight(frameID)
{
  //find the height of the internal page
  var the_height=
    document.getElementById(frameID).contentWindow.
      document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById(frameID).height=
      the_height + 20;
}



