function calcProfit(dblPrice, txtOwnPrice, objProfit) {
    var OwnPrice = parseFloat(document.getElementById(txtOwnPrice).value.replace(',','.'));
    var Price = parseFloat(dblPrice.replace(',','.'));
    if(OwnPrice == '' || OwnPrice < 0) {
        OwnPrice = 0;
    }
    
    var CustomerProfit = ((OwnPrice - Price) / OwnPrice) * 100;
    
    if(CustomerProfit == 'Infinity' || CustomerProfit < 0) {
        CustomerProfit = 0
    }
    if (isNaN(CustomerProfit)) {
        CustomerProfit = 0;
    }
        
    document.getElementById(objProfit).innerHTML = CustomerProfit.toFixed(2).replace('.',',') + '%';
}

function openWin(url,h,w)
{
	var leftPos = null, topPos = null;
	
	if (top.screen)
	{
		if (screen.width)
		{ 
    		leftPos = Math.round((screen.width-w-4)/2); 
    		topPos = Math.round((screen.height-h-10)/2); 
		}
		else
		{
		leftPos = 50 
		topPos = 50 
		} 
	} 			
	popupwin = window.open(url, "popup", "width=" + w + ",height=" + h + ",top=" + topPos + ",left=" + leftPos + ",scrollbars=yes,status=1");
}

function submitpayment() {
	var orderid = document.getElementById("orderid");
	if (orderid != null) {
		var form = document.getElementById("Form1");
		form.submit();
	}
}
