

function sendHTMLtoControl_Load(res)
{
	var output = res.value[1];
	var sendto = "display_" + res.value[0];
	var link = "link_" + res.value[0];
	var openlink = "open_" + res.value[0];
	
	document.getElementById(link).innerHTML="<a href=\"javascript:htmlHide('" + res.value[0] + "');void(0)\">Hide Summary</a>";
	document.getElementById(openlink).innerHTML = "";
	document.getElementById(sendto).innerHTML=output;
	

}
function htmlDisplay(page)
{
	ClientHome.loadControlHTML(page, sendHTMLtoControl_Load);

}


function htmlHide(page)
{
	ClientHome.closeControlHTML(page, sendBlankHTMLtoControl_Load);

}

function sendBlankHTMLtoControl_Load(res)
{
	var output = res.value[1];
	var sendto = "display_" + res.value[0];
	var link = "link_" + res.value[0];
	var openlink = "open_" + res.value[0];
	
	document.getElementById(link).innerHTML="";
	document.getElementById(openlink).innerHTML = "<a href=\"javascript:htmlDisplay('" + res.value[0] + "');void(0)\">Show Summary</a>";
	document.getElementById(sendto).innerHTML=output;
	

}
function punchclockpunch(customerpersonID)
{
	var dropdownIndex = document.getElementById('TimeMacheene1_TimeMachine1_SuperSelector1_dSelector').selectedIndex;
	var projectID = document.getElementById('TimeMacheene1_TimeMachine1_SuperSelector1_dSelector')[dropdownIndex].value;

	
	var notes =document.getElementById('TimeMacheene1_TimeMachine1_txtTask').value;
	document.getElementById("TimeMacheene1_TimeMachine1_response").innerHTML="<span style='color:red'>working... please wait</span>";
	TimeMachine.punch(notes, projectID, customerpersonID, punchclockpunch_Load);
}

function punchclockpunch_Load(res)
{
	document.getElementById("TimeMacheene1_TimeMachine1_response").innerHTML=res.value;


}

