/*
 * Created on May 19, 2007 by kyang
 *
 * NXADVOCATE
 * All Rights Reserved - Unauthorized Use Prohibited
 * For information contact licensing@nxadvocate.com
 * 
 */ 


/********** CALENDAR POPUP **********/


var cal = new CalendarPopup("calendarSpan"); 
cal.showYearNavigation();
cal.showYearNavigationInput();
cal.setCssPrefix("SBI");
cal.offsetX = -80;
cal.offsetY = -60;


/********** SPAN PRINTING FUNCTION **********/


function printSpan (spanId, pageTitle, pageWidth, pageHeight) {
	OpenWindow=window.open("", "newwin", "height="+pageHeight+", width="+pageWidth+",toolbar=no,scrollbars=yes,menubar=no");
	OpenWindow.document.write("<html><head>");
	OpenWindow.document.write("<title>"+pageTitle+"</title>");
	OpenWindow.document.write("<body>");
	OpenWindow.document.write(document.getElementById(spanId).innerHTML);
	OpenWindow.document.write("</body>");
	OpenWindow.document.write("</html>");
	
	// load nxadvocate.css
	var nxwebCssRef = document.createElement("link");
	nxwebCssRef.setAttribute("rel", "stylesheet");
	nxwebCssRef.setAttribute("type", "text/css");
	nxwebCssRef.setAttribute("href", "/nxweb_nxadvocate_core/styles/1/nxadvocate.css");
	OpenWindow.document.getElementsByTagName("head")[0].appendChild(nxwebCssRef);
	
	// load volunteer.css
	var volunteerCssRef = document.createElement("link");
	volunteerCssRef.setAttribute("rel", "stylesheet");
	volunteerCssRef.setAttribute("type", "text/css");
	volunteerCssRef.setAttribute("href", "styles/1/volunteer.css");
	OpenWindow.document.getElementsByTagName("head")[0].appendChild(volunteerCssRef);
	
	// load tablesort.css
	var tablesortCssRef = document.createElement("link");
	tablesortCssRef.setAttribute("rel", "stylesheet");
	tablesortCssRef.setAttribute("type", "text/css");
	tablesortCssRef.setAttribute("href", "/nxweb_nxadvocate_core/styles/1/tablesort/tablesort.css");
	OpenWindow.document.getElementsByTagName("head")[0].appendChild(tablesortCssRef);
	
	OpenWindow.document.close();
	OpenWindow.print();
}


/********** SHOW/HIDE OUTLINE IN SEARCH RESULTS **********/


function showVolunteerOutline(volunteerId) {
	var o=document.getElementById('viewVolunteerLink'+volunteerId);
	
	x=AnchorPosition_getPageOffsetLeft(o);
	y=AnchorPosition_getPageOffsetTop(o);

	document.getElementById('volunteerOutlineSpan'+volunteerId).style.left = (x+30)+'px';
	document.getElementById('volunteerOutlineSpan'+volunteerId).style.top = (y-40)+'px';
	document.getElementById('volunteerOutlineSpan'+volunteerId).style.visibility='visible';
}


function hideVolunteerOutline(volunteerId) {
	document.getElementById('volunteerOutlineSpan'+volunteerId).style.visibility='hidden';
}


function showClientOutline(clientId) {
	var o=document.getElementById('viewClientLink'+clientId);

	x=AnchorPosition_getPageOffsetLeft(o);
	y=AnchorPosition_getPageOffsetTop(o);

	document.getElementById('clientOutlineSpan'+clientId).style.left = (x+30)+'px';
	document.getElementById('clientOutlineSpan'+clientId).style.top = (y-40)+'px';
	document.getElementById('clientOutlineSpan'+clientId).style.visibility='visible';
}


function hideClientOutline(clientId) {
	document.getElementById('clientOutlineSpan'+clientId).style.visibility='hidden';
}

