function viewOrder(status, list)
{
		
	window.location.href = 'index.php?page=contacts&status=' + status + '&list=' + list;

}



function viewCurrency()
{
	statusList = window.document.frmCurrency.currency;
	status     = statusList.options[statusList.selectedIndex].value;	
	
	if (status != '') {
		
		window.location.href = 'index.php?page=prices&action=calculate&status=' + status;

	} else {
		window.location.href = 'index.php?page=prices';
	}
}


function reload(form)
{ 
	statusList = window.document.frmCurrency.currency;
	status     = statusList.options[statusList.selectedIndex].value;	
	
	if (status != '') {
		
		window.location.href = 'index.php?page=prices&action=calculate&status=' + status;

	} else {
		window.location.href = 'index.php?page=prices';
	}
}

//--------------------------- NAUDOJAMA ORDERS PUSLAPIUI ---------------------------------------


function checkForm()
{ 
	theForm = window.document.orderFrm;
	
	//productList = window.document.orderFrm.product;
	//product     = productList.options[productList.selectedIndex].value;
	
	licence_d = theForm.licence_d.value;
	licence_c = theForm.licence_c.value;
	
	currency     = document.getElementById("currency").value;
	
if (!theForm.submitButton1) {
	
	if (licence_d > 0 || licence_c > 0) {
		
		window.location.href = 'order.php?action=calculate';

	} else { 
		window.location.href = 'order.php';
	}
	
	theForm.submit();
	
}
	
	if (theForm.submitButton1) {
		
			
			if (licence_d == "" && licence_c == "") {
					hideAllErrors();
					document.getElementById("licenceError").style.display = "inline";
  				return false;
			}
			
			if (currency == "") {
					hideAllErrors();
					document.getElementById("currencyError").style.display = "inline";
					document.getElementById("currency").focus();
  				return false;
			}
	
	 	theForm.action = 'order2.php'; return true;
  	theForm.submit();			
	}	
	
	
}


function selectCurrency(form)
{ 
	theForm = window.document.orderFrm;
	
	currList = window.document.orderFrm.currency;
	ccurr    = currList.options[currList.selectedIndex].value;			
	
	if (ccurr != "") {
		
		window.location.href = 'order.php?action=exchange';
		theForm.submit();
		
		
	} else { 
		window.location.href = 'order.php';
	}
}

function checkNumber(textBox)
{
	
	while (textBox.value.length > 0 && isNaN(textBox.value)) {
		textBox.value = textBox.value.substring(0, textBox.value.length - 1)
	}
}

function hideAllErrors() {

document.getElementById("licenceError").style.display = "none"
document.getElementById("currencyError").style.display = "none"

}

function checkForm2()
{ 
	theForm = window.document.orderFrm2;
	
	nameX 		= document.getElementById("name").value;
	email 		= document.getElementById("email").value;


	if (theForm.submitButton3) {
		
			if (nameX == "") {
					hideAllErrors2();
					document.getElementById("nameError").style.display = "inline";
					document.getElementById("name").focus();
  				return false;
			}
			
			if (email == "") {
					hideAllErrors2();
					document.getElementById("emailError").style.display = "inline";
					document.getElementById("email").focus();
  				return false;
			}
	
	 	theForm.action = 'view_order.php'; return true;
  	theForm.submit();			
	}	
	

	
	
}


function hideAllErrors2() {

document.getElementById("nameError").style.display = "none"
document.getElementById("emailError").style.display = "none"

}


//--------------------------- // NAUDOJAMA ORDERS PUSLAPIUI ---------------------------------------