// JavaScript Document
function submitForm( formObj, type, id )
{
	if ( type == "bump" )
		formObj.bump.value = id;
		
	if ( type == "delthumb" )
		formObj.delthumb.value = id;
		
	var titleObjects = new Array();

	// loop through all form elements, check for image1_# and image2_#
	
	for ( var i = 0; i < formObj.elements.length; i++ )
	{
		var elementName = formObj.elements[i].name;
		var elementValue = formObj.elements[i].value;
		
		if ( elementName.indexOf( "image" ) != -1 && elementValue != "" )
		{
			// split elementValue to get the ID value
			var objParts = elementName.split( "_" );
		
			var pathObj = "path_" + objParts[1];
			
			formObj[ pathObj ].value = elementValue;
		}
		
		if ( elementName.indexOf( "title_new" ) != -1 ) 
		{
			titleObjects[titleObjects.length] = formObj.elements[i];
		}
	}
	

	for ( var i = 0; i < titleObjects.length; i++ )
	{
		// check to see if ANY 1 title object is non-blank
		if ( titleObjects[i].value != "" )
		{
			// assign " " to any title object without a value
			for ( var j = 0; j < titleObjects.length; j++ )
			{
				if ( titleObjects[j].value == "" )
				{
					//alert( "now filling: " + titleObjects[j].name );
					titleObjects[j].value = " ";
				}
			}
			formObj.submit();// no need to continue	
			return;
		}
	}

	formObj.submit();
}

