//	@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//	@		Description			: This function checks whether the entered qty is correct or not.
//  @   Pages Affected  : Index,Items, searchresult,Psearchresult
//  @		Function Name		: preproc(frm,index,code,type)									
//	@		Input Parameters: frm = Form Name, index = Index value, code = Item Code, type = Item Type
//	@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


<!-- Copyright 2006,2007 Bontrager Connection, LLC
// http://bontragerconnection.com/ and http://willmaster.com/
// Version: July 28, 2007
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}

function ShowQPDiv(showHideDiv) 
	{
		var ele = document.getElementById(showHideDiv);
		if(ele.style.display == "none") {
			ele.style.display = "block";
		} 		        
	}
function HideQPDiv(showHideDiv) 
	{
		var ele = document.getElementById(showHideDiv);
		if(ele.style.display == "block") {
			ele.style.display = "none";
		} 
	}
//-->


function editaddress(action){
	var sNonEditableAddrCodes;
	var sAddrSeperator;
	var sSelectedShipAddress = " ";
	if(action=="S")
	{							
			if((document.FrmRepairForm.iShipCode.length)>1)
			{
				for(var intTemp=0;intTemp<document.FrmRepairForm.iShipCode.length;intTemp++)
				{
					if(document.FrmRepairForm.iShipCode[intTemp].checked)
					{
						sSelectedShipAddress = document.FrmRepairForm.iShipCode[intTemp].value;
						break;
					}
				}
			}
			else
				sSelectedShipAddress = document.FrmRepairForm.iShipCode.value;				
			
			//if(sNonEditableAddrCodes.indexOf(sAddrSeperator + sSelectedShipAddress + sAddrSeperator)>=0)
			//{
				//alert(getMessage("iNonEditableAddresses"));
				//return;
			//}			
	}
	else if(action=="B")
	{
		if(sNonEditableAddrCodes.indexOf(sAddrSeperator + document.FrmRepairForm.iBillCode.value + sAddrSeperator)>=0)
		{
			alert(getMessage("iNonEditableAddresses"));
			return;
		}
	}
	
	//document.FrmRepairForm.todo.value = action;
	if((action == "C") || (action == "EC"))
		document.FrmRepairForm.action = "contactaddress.asp";
	else 
		document.FrmRepairForm.action = "ManageAddress.asp?Source=AC";	
	document.FrmRepairForm.submit();
	return;
}

