function Save() {}
function ExpandAccount(id) {}
function DeleteAccount(id) {}
function expandCategory(id) {}
function unExpandCategory() {}
function OrderDisplay(id, req) {}
function doPriced() {}


function Communicate()
{
    sQueryStr ="";
	OpenEditPopUp('Communication.htm', sQueryStr, 640, 480, 'winBPComm');	
}
function Communicate_Blank()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_Blank.htm', sQueryStr, 640, 480, 'winBPComm');	
}
function Communicate_OrderDispute()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_OrderDispute.htm', sQueryStr, 640, 480, 'winBPCommOrd');	
}
function Communicate_OrderDispute_Cancel()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_OrderDispute_Cancel.htm', sQueryStr, 640, 480, 'winBPCommOrdCancel');	
}

function Communicate_InvoiceDispute()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_InvoiceDispute.htm', sQueryStr, 640, 480, 'winBPCommInv');	
}
function Communicate_InvoiceDispute_Cancel()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_InvoiceDispute_Cancel.htm', sQueryStr, 640, 480, 'winBPCommInvCanc');	
}

// class
function CCalendar() {
	this.show = CCalendar_show;
}

function CCalendar_show() {}

calendarStartDate=new CCalendar();
calendarFromDate=new CCalendar();
calendarToDate=new CCalendar();

function displayInvoice(id) {}
function selectForPayment(id, x, y) {}
function toggleInvChecks(sender,i) {}
function selectAccount(id) {}

function displayInvoice2(id, flag) {}

function openArchive()
	{
	
		
		OpenEditPopUp('More_Invoices.htm', sQueryStr, 640, 550, 'winBPOrders');
	}


function SetDivHidden(id) 
{
	//setCookie(id, "hidden", null);
}

function SetDivVisible(id) 
{
	//deleteCookie(id);
}

function DivStatusReload(id) {
	if (getCookie(id)=="hidden") {
		var element=document.getElementById(id);
		if (element!=null) {
			var divstyle = element.style;
			divstyle.overflow="hidden";
			divstyle.height=1;
		}
	}
}


function DivSwitchAccounts(id, minHeight, maxHeight)
{	
	var divstyle = document.getElementById(id).style;
	var divCurrentState = divstyle.overflow;
	
	if (divCurrentState == "hidden" )
	{
		divstyle.overflow = "visible";
		divstyle.height = "";	
		if (document.getElementById(id).offsetHeight > maxHeight) {
		divstyle.overflow = "auto";
		divstyle.height = maxHeight;}			

		SetDivVisible(id);					
	}
	else
	{
		divstyle.overflow = "hidden";
		divstyle.height = minHeight;			

		SetDivHidden(id);
	}
}

function DivSwitch(id)
	{	
		var divstyle = document.getElementById(id).style;
		var divCurrentState = divstyle.overflow;
		
		if (divCurrentState == "hidden" )
		{
			divstyle.overflow = "visible";
			divstyle.height = "";

			SetDivVisible(id);					
		}
		else
		{
			divstyle.overflow = "hidden";
			divstyle.height = 1;
			
			SetDivHidden(id);
		}
	}

function checkAll(fieldName)
{
var field = document.getElementsByName(fieldName);
for (i = 0; i < field.length; i++)
	field[i].checked = true ;
}

function uncheckAll(fieldName)
{
var field = document.getElementsByName(fieldName);
for (i = 0; i < field.length; i++)
	field[i].checked = false ;
}

// Begin: Function for masthead //

function modelesswin(url,mwidth,mheight){
	if (document.all&&window.print) //if ie5
		eval('window.showModelessDialog(url,"","help:0;resizable:0;dialogWidth:'+(mwidth)+'px;dialogHeight:'+(mheight+80)+'px;status:no;scroll:no;")')
	else 
		eval('window.open(url,"","width='+(mwidth+50)+'px,height='+(mheight+80)+'px,resizable=0,scrollbars=0")')
}
	
function win2col(url2col){
	window.open(url2col,'BP','width=433,height=500,status=no,resizable=no,top=110,left=200,toolbar=no,menubar=no,scrollbars=yes')
}

function win3col(url3col){
	window.open(url3col,'Bp_com','width=627, height=500,resizable=0,top=110,left=200,toolbar=0,titlebar=0,menubar=0,scrollbars=yes')
}


if (navigator.platform.indexOf("MacPPC")!=-1)
{
	document.write('<link rel="stylesheet" type="text/css" href="english/css/modules/pageNav_Mac.css" />');
	document.write('<link rel="stylesheet" type="text/css" href="english/css/text/en/text_Mac.css" />');
	document.write('<link rel="stylesheet" type="text/css" href="english/modules/cda/css/relatedLinks_Mac.css" />');
	document.write('<link rel="stylesheet" type="text/css" href="english/css/expandedTemplate_Mac.css" />');	
	
}

function MakePayment()
{
    sQueryStr ="";
	OpenEditPopUp("MakePayment.htm", "",  640, 480, 'winMPaym');	
}

function openSpecialRequest()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_SpecialRequest.htm', sQueryStr, 640, 480, 'winBPSR');	
}
function Admin_BankAccounts()
{
    sQueryStr ="";
	OpenEditPopUp('Admin_BankAccounts.htm', sQueryStr, 640, 480, 'winAdminBA');	
}



function Communicate()
{
    sQueryStr ="";
	OpenEditPopUp('Communication.htm', sQueryStr, 640, 480, 'winBPComm');	
}
function Communicate_Blank()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_Blank.htm', sQueryStr, 640, 480, 'winBPComm');	
}
function Communicate_OrderDispute()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_OrderDispute.htm', sQueryStr, 640, 480, 'winBPCommOrd');	
}
function Communicate_OrderDispute_Cancel()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_OrderDispute_Cancel.htm', sQueryStr, 640, 480, 'winBPCommOrdCancel');	
}

function Communicate_InvoiceDispute()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_InvoiceDispute.htm', sQueryStr, 640, 480, 'winBPCommInv');	
}
function Communicate_InvoiceDispute_Cancel()
{
    sQueryStr ="";
	OpenEditPopUp('Communication_InvoiceDispute_Cancel.htm', sQueryStr, 640, 480, 'winBPCommInvCanc');	
}
function Profile_ChangePassword()
{
    sQueryStr ="";
	OpenEditPopUp('Profile_ChangePassword.htm', sQueryStr,640, 480, 'winBPProfilePwd');	
}
function Order_Receive()
{
    sQueryStr ="";
	OpenEditPopUp('Order_Receive.htm', sQueryStr,640, 480, 'winBPOrderRcv');	
}

function Order_Receive_Cancel()
{
    sQueryStr ="";
	OpenEditPopUp('Order_Receive_Cancel.htm', sQueryStr,640, 480, 'winBPOrderRcvCancel');	
}


function FavMore()
{
    sQueryStr ="";
	OpenEditPopUp('More_Favourites.htm', sQueryStr, 640, 480, 'winBPFavs');	
}
function OrdersMore()
{
    sQueryStr ="";
	OpenEditPopUp('More_Orders.htm', sQueryStr, 640, 480, 'winBPOrders');	
}
function InvoicesMore()
{
    sQueryStr ="";
	OpenEditPopUp('More_Invoices.htm', sQueryStr, 640, 550, 'winBPInvoices');	
}
function PaymentsMore()
{
    sQueryStr ="";
	OpenEditPopUp('More_Payments.htm', sQueryStr, 640, 550, 'winBPPayments');	
}

function MakePayment()
{
    sQueryStr ="";
	OpenEditPopUp('MakePayment.htm', sQueryStr, 540, 550, 'winBPPayments');	
}

function OpenEditPopUp (sURL, sQueryString, width,height, winName)
{
	
	var sAttr;
	var sWidth;
	var sHeight;
	var sWindowName;
	var IE = (document.all) ? 1 : 0;
	var left;
	var top;
			if (IE)
			{
				// IE sizes
				sWidth = width;
				sHeight = height;
			}
			else
			{
				// other (Netscape) sizes
				sWidth = width;
				sHeight = height;
			}
			left = (screen.width - sWidth) / 2;
			top = (screen.height - sHeight) / 3;

			sAttr = "width=" + sWidth + ",height=" + sHeight + ",top=" + top + ",left=" + left + ",toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=no,status=yes";
			sWindowName = winName;



		// maintain a reference to the pop up window in the .win property of
		// the objPopUp object, which was created as global to this page.
		window.open(sURL, sWindowName, sAttr);
		//window.open("MakePayment.htm");
	
}

function contactUs(UserID, BorgID)
	{
		var sHeight = 480;
		var sWidth = 640;
		var left = (screen.width - sWidth) / 2;
		var top  = (screen.height - sHeight) / 2;
		sAttr = "width=" + sWidth + ",height=" + sHeight + ",top=" + top + ",left=" + left + ",resizable=yes, status=yes, titlebar=no, menubar=no, toolbar=no, location=no, scrollbars=yes";  
		var sURL = "";
		sURL = '/procurement/edriver?ACT=ContactUs&EID=1&SID=5e78d1f64c1e4a71790fd0e3f3594d1f|1&KIU=8de6d51d7a1c1f79342802441d12fa90&UserID='+UserID+'&LOSID='+BorgID;
		var openSpecialRequest = window.open(sURL,"contactUs", sAttr)
		//alert(sURL);
	}


function changeBorg()
{
	document.frmHome.action = '/procurement/edriver?ACT=ProductSearch&EID=1&SID=5e78d1f64c1e4a71790fd0e3f3594d1f|1&KIU=8de6d51d7a1c1f79342802441d12fa90' + '&BOID=0';
	document.frmHome.submit();
}

function openProductDesc()
	{
		var partID = 8;
		var sWidth = 400;
		var sHeight = 300;
		var left = (screen.width - sWidth) / 2;
		var top  = (screen.height - sHeight) / 2;
		sAttr = "width=" + sWidth + ",height=" + sHeight + ",top=" + top + ",left=" + left + ",resizable=yes, status=yes, titlebar=yes, menubar=no, toolbar=no, location=no, scrollbars=yes";
		var sURL = "ProductPopup.htm";
		var popupWin = window.open(sURL,"ProductDescription"+partID, sAttr)
	}



function DrillDown(commodityID)
{

}

function SearchFind()
{
 
	alertMsg("You made changes to order quantities that have not been saved. Please save Order before searching for new products"); 
}

function MoveFirstPage()
{

}

function MovePreviousPage()
{

}

function MoveNextPage()
{

}

function MoveLastPage()
{

}

function checkOrderProduct(partBaseId, checkbox)
	{

	}

function openAltPopup2(checkbox)
	{
		
		var width = 640;
		var height = 550;
		var left = (screen.width - width) / 2;
		var top = (screen.height - height) / 2;
		
		var sAttr = "width=" + width + ", height=" + height + ", top=" + top + ", left=" + left + ", resizable=yes, status=yes, titlebar=yes, menubar=no, toolbar=no, location=no, scrollbars=yes";
		
		//checkbox.checked = false;
		
		window.open("ProductDiscontinued.htm", "CampaignConfirmAlternative", sAttr);
		
	}









function ReqDelete(reqId)
	{
	    
		confirmMsg("This will remove this Order. Are you sure?", "mainForm");
	}

function pageModified()
	{
		//setPageModified(true);
	}

function enablePageModified(pageModifiedEnabled)
	{
		//alert("enablePageModified(" + pageModifiedEnabled + ")");
		//enablePageModifiedValue = pageModifiedEnabled;
	}



function submitReq()
	{
		var isSubmit = false;
		
		
			isSubmit = true;
		
		
		if( isSubmit )
		{
			var form = document.mainForm;		
			form.BOID.value = 0;
			form.OP.value = "REQ_SUBMIT";
			form.action = "/procurement/edriver?ACT=OrderListing&EID=1&SID=36fbaf05467785be8ec96a2a7de47898|1&KIU=b4768d2b3a766c80547d5927e13dbeb1";
			setPageModified(false);
			form.submit();	
		}
	}

function setCalculatedQty(totalObj, lineNum, oldTotal, newTotal, lotSize)
	{
		if (newTotal % lotSize != 0) 
		{
			alert("Please make sure the total quantity is a multiple of lot size.");
			totalObj.value = oldTotal;
			return 
		} else {
			document.getElementById('LineNumber' + lineNum).value = newTotal / lotSize;			
		}
	}

function ReqDeleteItem(lineNumber)
	{
	

		confirmMsg('You are about to remove an item from your Order.  Do you wish to continue?', 'mainForm');	
	}











function confirmNewReq(msg)
	{
		
			confirmMsg(msg, "mainForm");
	}

function cancelReqPrice()
	{
    // Switch off modified data warning
      
		document.location= "Cart_Order.htm"
	}

function downloadInvoice(invoiceNumber)
	{

	}

function enableBorgId(id, state)
	{

	}

function downloadDeliveryDocket(deliveryDocketNumber)
	{

	}

function assignValues()
			{
			  document.frmLogin.UserName.value=document.frmUserName.username_input.value;
			}


function commitPayment()
{
	
	confirmMsg("Any payments made after 2:00pm will not be processed until the following day.", "frmTransactionDetails");	
}

function SwitchVisible(id)
{

}


function openPrintView(sURL)
{
	var sWidth = 640;
	var sHeight = 550;
	var left = (screen.width - sWidth) / 2;
	var top  = (screen.height - sHeight) / 2;
	sAttr = "width=" + sWidth + ",height=" + sHeight + ",top=" + top + ",left=" + left + ",resizable=yes, status=yes, titlebar=yes, menubar=no, toolbar=no, location=no, scrollbars=yes";
	window.open(sURL, "PrintView", sAttr);
}


function refreshParent()
		{
			window.opener.PageReload();
		}

function resetForm()
		{
			document.mainForm.InvoiceNumberLike.value = "";
			document.mainForm.FromDate.value = "";
			document.mainForm.FromDateSystemFormat.value = "";
			document.mainForm.ToDate.value = "";
			document.mainForm.ToDateSystemFormat.value = "";
			document.mainForm.FromValue.value = "";
			document.mainForm.ToValue.value = "";
			document.mainForm.Account.selectedIndex = 0;
		}


function saveOrderArchive()
		{

		}


function deleteReport(reportId)
	{
		if(confirm("Are you sure you wish to delete this report?"))
		{

		}
	}

function preview()
	{
		
	}

function resetCriteria()
	{

	}

function selectAllLos()
		{
	
			
		}



function refreshButtons()
	{
		// TODO: Seems that in IE, after a button is re-enabled, it's in the
		// 'orange' kind-of-selected state.  Should be a regular button.
		
		// Add button
		if(document.mainForm.availableFields.selectedIndex == -1)
		{
			document.mainForm.buttonAdd.disabled = true;
		}
		else
		{
			document.mainForm.buttonAdd.disabled = false;
		}
		
		// Remove button
		if(document.mainForm.selectedFields.selectedIndex == -1)
		{
			document.mainForm.buttonMoveUp.disabled = true;
			document.mainForm.buttonMoveDown.disabled = true;
			document.mainForm.buttonRemove.disabled = true;
		}
		else
		{
			document.mainForm.buttonMoveUp.disabled = false;
			document.mainForm.buttonMoveDown.disabled = false;
			document.mainForm.buttonRemove.disabled = false;
		}
	}

function addField()
	{
		
	}

function removeField()
	{
		
	}

function moveUp()
	{
		
	}

function moveDown()
	{
		
	}


function popWindow(url) {
	var width  = 435;
	var height = 560;
	var winl = (screen.width-width)/2;
	var wint = (screen.height-height)/2;
	return window.open(url,'newWindow','toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=no,location=no,width='+width+',height='+height+',top='+wint+',left='+winl);
}

