/**
* Joomla Community Builder User Plugin: plug_cbprofilegallery
* @version $Id$
* @package plug_cbprofilegallery
* @subpackage profilegallery.js
* @author Nant, JoomlaJoe and Beat
* @copyright (C) Nant, JoomlaJoe and Beat, www.joomlapolis.com
* @license Limited  http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
function PGsubmitForm(mfrm) {
 	var me = mfrm.elements;
 	var submitme=1;
    me['pgsubmitentry'].disabled=true;
	
	if (_TitleVariable.value.length<1) {
		alert(_pg_TitleRequired);
		submitme=0;
	}

	if (_ImageVariable.value.length<1) {
    	alert(_pg_ImageRequired);
    	submitme=0;
  	}


  	if (submitme>0) {
  		//change the following line to true to submit form
    	return true;
	}else{
  		me['pgsubmitentry'].disabled=false;
    	return false;
  	}

}

var direction='block';

function pg_Expand() {
	
	document.getElementById('pg_direction').src="components/com_comprofiler/plugin/user/plug_cbprofilegallery/images/"+direction+"-arrow.gif";
	document.getElementById('pg_divForm').style.display=direction;
	if(direction=='block') direction = 'none';
	else direction='block'
}