function submitForm( sFormName, sElementName, sElementvalue) {
	// Beispiel: javascript:submitForm('LivetradingForm','sell.x','2')
	// das Hidden-Element "sell.x" (sElementName) bekommt den Wert "2" (sElementvalue),
	// danach wird die Form "LivetradingForm" (sFormName) ausgeführt.
	var oForm = null;
	var oElement = null;
	oForm = document.forms[sFormName]; 
	oElement = oForm.elements[sElementName];
	oElement.value = sElementvalue;
	oForm.submit();
}	
function submitForm2( sFormName, sElementName, sElementvalue, sElementName2, sElementvalue2) {
	// Beispiel: javascript:submitForm('LivetradingForm','sell.x','2')
	// das Hidden-Element "sell.x" (sElementName) bekommt den Wert "2" (sElementvalue),
	// danach wird die Form "LivetradingForm" (sFormName) ausgeführt.
	var oForm = null;
	var oElement = null;
	oForm = document.forms[sFormName]; 
	oElement = oForm.elements[sElementName];
	oElement.value = sElementvalue;
	oElement = oForm.elements[sElementName2];
	oElement.value = sElementvalue2;	
	oForm.submit();
}		
function submitFormWithAction( sFormName, sAction) {
	// Beispiel: javascript:submitForm('LivetradingForm','sell.x','2')
	// das Hidden-Element "sell.x" (sElementName) bekommt den Wert "2" (sElementvalue),
	// danach wird die Form "LivetradingForm" (sFormName) ausgeführt.
	var oForm = null;
	var oElement = null;
	oForm = document.forms[sFormName]; 
	oForm.action = sAction;
	oForm.submit();
}	
function openPopup(url, width, height, scrollbar, winname) {
	if(winname == null) winname = "news";
	if (navigator.appName.indexOf("Microsoft"))	{
		Info = window.open(url,winname,"width=" + width + ",height=" + height + ",scrollbars=" + scrollbar + ",location=no,directories=no,status=no,menubar=no,toolbar=no,left=50,top=50");
		Info.focus();
	}
	else	{
		window.open(url,winname,"width=" + width + ",height=" + height + ",scrollbars=" + scrollbar + ",location=no,directories=no,status=no,menubar=no,toolbar=no,left=50,top=50");
	}
} 
function openPopupAll(url, width, height, scrollbar, winname, resizable, location, directories, status,menubar,toolbar,left,top) {
	if(winname == null) winname = "news";
	if (navigator.appName.indexOf("Microsoft"))	{
		Info = window.open(url,winname,"width=" + width + ",height=" + height + ",scrollbars=" + scrollbar + ",location=" + location + ",directories=" + directories + ",status=" + status +",menubar=" + menubar + ",toolbar=" + toolbar + ",left=" + left + ",top=" + top );
		Info.focus();
	}
	else	{
		window.open(url,winname,"width=" + width + ",height=" + height + ",scrollbars=" + scrollbar + ",resizable=" + resizable + ",location=" + location + ",directories=" + directories + ",status=" + status +",menubar=" + menubar + ",toolbar=" + toolbar + ",left=" + left + ",top=" + top );
	}
} 
function display(elementid)
{
	var oDiv=document.getElementById(elementid);
	if (oDiv.style.display=="inline") {
		oDiv.style.display="none";
	} else {
		oDiv.style.display="inline";
	}
}
function setLocation(f,url1)
{
	if( parent.frames[f] != null)
	{
		parent.frames[f].location.href=url1;
	}
}

function getSum()
	// is needed to calculate the price of all ordered packages (Tradermatrix --> Registration)
{
	var all = null;
	var sumField = null;
	var checkedBoxes = 0;
	var iSum = 0;
	var sSum = null;
	
	all = document.getElementsByTagName('input');
	for (var i = 0; i < all.length; i++) 
	{
		if (all[i].type == 'checkbox')
		{
			if (all[i].checked == true)
			{
				checkedBoxes++;
				value = parseInt(all[i].value);
				iSum = iSum + value;
			}
		}
	}

	//alert(checkedBoxes);
	sumField = document.getElementById('sumTradReg');
	iSum = iSum.toFixed(2);
	parts = iSum.split('.');
	sSum = parts[0] + ',' + parts[1] + ' EUR';

	sumField.firstChild.nodeValue = sSum;
}

function setFocusEnd (id)
{
	try {
		var oTextarea = document.getElementById(id);
		oTextarea.focus();
		oTextarea.value += '';
		oTextarea.scrollTop = 10000;
	}	catch (e) {
		// nothing
	}
}

