/*
Javascript functions for Add/Edit Pages
*/

function display_image( strElementID, strFile, intLibraryID, intHeight, intWidth )
{
	
	/*
	
	strElementID - should be an <input> tag, hidden or text
	
	strFile - The complete path and filename to the document
	
	intLibraryID - the library_id of the document
	
	*/
	
	document.getElementById(strElementID).value = intLibraryID;
	
	//This changes the image source of an <img> tag
	document.getElementById('pg-' + strElementID ).src = strFile;
	
	document.getElementById('pg-' + strElementID ).height = intHeight;
	
	document.getElementById('pg-' + strElementID ).width = intWidth;
	
	//true allows calling element to continue to next javascript command
	return true;
	
	/*
	
	Sample code of changing the background image of a span or div
	
	document.getElementById( 'pg-' + strElementID ).style.background = 'url(strFile)';

	document.getElementById('pg-' + strElementID ).style.display = 'block';
	
	*/
	
}	//end function


function display_document( strElementID, strFile, intLibraryID, strHighLightColor )
{
	/*
	
	strElementID - must be an <input> tag, hidden or text
	
	strFile - The complete path and filename to the document
	
	intLibraryID - the library_id of the document
	
	strHighhLightColor - Used to highlight a div or span or any other displayable tags

	*/
	
	document.getElementById( strElementID + '_h').value = intLibraryID;
	
	document.getElementById(strElementID).style.backgroundColor = strHighLightColor;
	
	//true allows calling element to continue to next javascript command
	return true;
	
	/*
	sample code for adding the filename
	document.getElementById( strElementID + '_filename').value = strFile;
	
	*/
	
	
}	//end function

function pop_photo(path, file, desc, w, h)
{
	window.open(path+'pop_photo.php?file='+file+'&desc='+desc,'pdza_pop','width='+w+',height='+h+',scrollbars=yes,resizable=yes');	
}
