
/**
 * Author: 				danisowa
 * Company: 			SD Software Development
 * date of creation:	2011-07-08
 * current version:		0.01
 * 
 * Description:
 * This javascript library implements all individual javascript functions for the mk-print.de shopsystem instance
 * 
 * 
 * Changelog:
 * 2011-08-07	|	danisowa	| 0.01	|	start of javascript library
 */



/**
 * This function submits the articles to the shoppingcart
 */
function submit_article()
{
    
    //document.getElementById('article_form').submit();
}


/**
 * increases the amount in the articles table
 * and submits the form
 * required parameter is the id of the textfield
 * @param givenID 
 */
function submit_article_increase(givenID)
{
	//alert("increase given ID is " + givenID);
	if (document.getElementById(givenID).value<0)
	{
		document.getElementById(givenID).value = 1;
	}
	else
	{
		document.getElementById(givenID).value++;
	}
	submit_article();
}

/**
 * decreases the amount in the articles table
 * and submits the form
 * required parameter is the id of the textfield
 * @param givenID 
 */
function submit_article_decrease(givenID)
{
	//alert("decrease given ID is " + givenID);
	if (document.getElementById(givenID).value<1)
	{
		document.getElementById(givenID).value = '';
	}
	else
	{
		document.getElementById(givenID).value--;
	}
	submit_article();
}

/**
 * sets the amount in the articles table to 0
 * and submits the form
 * required parameter is the id of the textfield
 * @param givenID 
 */
function submit_article_clear(givenID)
{
	//alert("delete given ID is " + givenID);
	document.getElementById(givenID).value = '';
	submit_article();
}

function submit_form_byID(formID)
{
	document.forms[formID].submit();
}


function set_field_to_value(fieldID,value)
{
	document.getElementById(fieldID).value=value;
}


