function confirmLink(theLink, melding)
{
	if (typeof(window.opera) != 'undefined') {
		return true;
	}
	var is_confirmed = confirm(melding);
	if (is_confirmed) {
		window.location=theLink;
	}
	return is_confirmed;
} 

function ShowContent (element){
	buttonname = "button" + element;

    if (document.getElementById(element).style.display == 'none'){
        document.getElementById(element).style.display = 'block';
		link = '<a href="#" onclick="ShowContent(\'' + element + '\');"> - </a>';
		document.getElementById(buttonname).innerHTML=link;
    } else {
        document.getElementById(element).style.display = 'none';
		link = '<a href="#" onclick="ShowContent(\'' + element + '\');"> + </a>';
		document.getElementById(buttonname).innerHTML=link;
    }
}

function jumpto(x){
	if (document.form.jumpmenu.value != "null") {
		document.location.href = x
	}
}

function confirmLink_wait(theLink, melding)
{
	if (typeof(window.opera) != 'undefined') {
		return true;
	}
	var is_confirmed = confirm(melding);
	if (is_confirmed) {
		document.getElementById('PleaseWait').style.pixelTop = (document.body.scrollTop + 50);
		document.getElementById('PleaseWait').style.visibility="visible";
		window.location=theLink;
	}
	return is_confirmed;
} 

/*For admin_invoice_edit quickadd */

function submitform_quickadd(product){
  var product_split=product.split("X----X"); 
  document.editform.NEW_product.value=product_split[2];
  document.editform.NEW_price_ex.value=product_split[0];
  document.editform.NEW_quantity.value=product_split[1];
  document.editform.submit();
}

function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}
