/** 
 * @fileoverview Displays the JS functionality of index page gallery
*/

/**
 * Index gallery listing
 * @class 
 * @constructor
 * @returns Displays the index page gallery
 */
function indexGallery()
{
	var vUrl = gSitePath+'comp/cmp_user/web/indexgallery.php';
	document.getElementById('divgallery').innerHTML = "<span class='loading'>Loading...</span>";
	ajaxrequest(vUrl,'resultajax',document.getElementById('divgallery'),0);
}

/**
 * Index gallery return ajax value
 * @class 
 * @constructor
 * @param string txt : Ajax result
 * @param object obj : Div Object
 * @returns Ajax result to fill in div object
 */
function resultajax(txt, obj)
{
	obj.innerHTML = txt;	
}

//#-- index gallery onclick redirect to gallery photo book page
/**
 * Post photobook id when onclick
 * @class 
 * @constructor
 * @param int pmbookid : Photobook id
 * @returns Photobook form submit
 */
function funindexgallery(pmbookid)
{
	if(pmbookid)
	{
		document.frmgallery.photobookid.value = pmbookid;
		document.frmgallery.submit();
	}	
}