function showHide(theButton,showId){var objId=document.getElementById(showId);var objIdRow=document.getElementById('td'+showId);if(objId.style.display=='none'){objId.style.display='';theButton.value='Hide >';objIdRow.className='subTableHeaderHide';}
else{objId.style.display='none';theButton.value='Show >';objIdRow.className='subTableHeaderShow';}}
function report(message,url,line){alert('Error : '+message+' at line '+line+' in '+url);return true;}
function confirm_delete()
{if(confirm("Are you sure you want to perform this action?")==true)
{return true;}
else
{return false;}}
function RefreshSystem_delete()
{if(confirm("All current details on the system will be deleted. Are you sure you want to perform this action?")==true)
{return true;}
else
{return false;}}
function confirm_casedelete()
{if(confirm("Are you sure you want to delete this case?")==true)
{return true;}
else
{return false;}}
function confirm_copy()
{if(confirm("Are you sure you want to copy this case?")==true)
{return true;}
else
{return false;}}
function confirm_gcmscopy()
{if(confirm("Are you sure you want to copy this LCMS Case to GCMS?")==true)
{return true;}
else
{return false;}}
function confirm_lcmscopy()
{if(confirm("Are you sure you want to copy this GCMS Case to LCMS?")==true)
{return true;}
else
{return false;}}
function confirm_copy_invoice()
{if(confirm("Are you sure you want to copy this Invoice?")==true)
{return true;}
else
{return false;}}
function GridHelp(){document.write("<a onMouseover=\"ddrivetip('Click on headings to sort.<br>Move headings sideways to order.<br>Drag headings here to group.')\" onMouseout='hideddrivetip()' class='help'>?</a>");}
var ClickCellButtonLocation;function ClickCellButton(gridName,itemName){var row=igtbl_getRowById(itemName);var cell=row.getCell(0);window.location=ClickCellButtonLocation+cell.getValue();return true;}
function extractNumber(obj,decimalPlaces,allowNegative,Mindec)
{var temp=obj.value;if(temp=="."||temp=="-")
{temp="";}
if(temp!="")
{var reg0Str='[0-9]*';if(decimalPlaces>0)
{reg0Str+='\\.?[0-9]{0,'+decimalPlaces+'}';}
else if(decimalPlaces<0)
{reg0Str+='\\.?[0-9]*';}
reg0Str=allowNegative?'^-?'+reg0Str:'^'+reg0Str;reg0Str=reg0Str+'$';var reg0=new RegExp(reg0Str);if(reg0.test(temp))
{temp=roundNumber(temp,2)
if(Mindec>0)
{temp=temp.toFixed(2);}
obj.value=temp;return true;}
var reg1Str='[^0-9'+(decimalPlaces!=0?'.':'')+(allowNegative?'-':'')+']';var reg1=new RegExp(reg1Str,'g');temp=temp.replace(reg1,'');if(allowNegative)
{var hasNegative=temp.length>0&&temp.charAt(0)=='-';var reg2=/-/g;temp=temp.replace(reg2,'');if(hasNegative)temp='-'+temp;}
if(decimalPlaces!=0)
{temp=roundNumber(temp,2)
if(Mindec>0)
{temp=temp.toFixed(2);}}}
obj.value=temp;}
function extractNumberWithNullText(obj,decimalPlaces,allowNegative,Mindec,NullText)
{var temp=obj.value;if(temp==".")
{temp="";}
if(temp!="")
{var reg0Str='[0-9]*';if(decimalPlaces>0)
{reg0Str+='\\.?[0-9]{0,'+decimalPlaces+'}';}
else if(decimalPlaces<0)
{reg0Str+='\\.?[0-9]*';}
reg0Str=allowNegative?'^-?'+reg0Str:'^'+reg0Str;reg0Str=reg0Str+'$';var reg0=new RegExp(reg0Str);if(reg0.test(temp))
{temp=roundNumber(temp,2);if(Mindec>0)
{temp=temp.toFixed(2);}
if(temp=="")
{temp=NullText;}
obj.value=temp;return true;}
var reg1Str='[^0-9'+(decimalPlaces!=0?'.':'')+(allowNegative?'-':'')+']';var reg1=new RegExp(reg1Str,'g');temp=temp.replace(reg1,'');if(allowNegative)
{var hasNegative=temp.length>0&&temp.charAt(0)=='-';var reg2=/-/g;temp=temp.replace(reg2,'');if(hasNegative)temp='-'+temp;}
if(decimalPlaces!=0)
{temp=roundNumber(temp,2);if(Mindec>0)
{temp=temp.toFixed(2);}
if(temp=="")
{temp=NullText;}}}
if(temp=="")
{temp=NullText;}
obj.value=temp;}
function extractNumberWithMinValue(obj,decimalPlaces,allowNegative,Mindec,NullText,MinValue)
{var temp=obj.value;if(temp==".")
{temp="";}
if(temp!="")
{var reg0Str='[0-9]*';if(decimalPlaces>0)
{reg0Str+='\\.?[0-9]{0,'+decimalPlaces+'}';}
else if(decimalPlaces<0)
{reg0Str+='\\.?[0-9]*';}
reg0Str=allowNegative?'^-?'+reg0Str:'^'+reg0Str;reg0Str=reg0Str+'$';var reg0=new RegExp(reg0Str);if(reg0.test(temp))
{if(decimalPlaces!=0)
{temp=roundNumber(temp,2)
if(Mindec>0)
{temp=temp.toFixed(2);}}
if(temp!="0")
{if(temp=="")
{temp=NullText;}}
if(temp!="")
{if(MinValue!="")
{if(temp<MinValue)
{temp=MinValue;}}}
obj.value=temp;return true;}
var reg1Str='[^0-9'+(decimalPlaces!=0?'.':'')+(allowNegative?'-':'')+']';var reg1=new RegExp(reg1Str,'g');temp=temp.replace(reg1,'');if(allowNegative)
{var hasNegative=temp.length>0&&temp.charAt(0)=='-';var reg2=/-/g;temp=temp.replace(reg2,'');if(hasNegative)temp='-'+temp;}
if(decimalPlaces!=0)
{temp=roundNumber(temp,2);if(Mindec>0)
{temp=temp.toFixed(2);}
if(temp!="0")
{if(temp=="")
{temp=NullText;}}
if(temp!="")
{if(MinValue!="")
{if(temp<MinValue)
{temp=MinValue;}}}}}
if(temp!="0")
{if(temp=="")
{temp=NullText;}}
if(temp!="")
{if(MinValue!="")
{if(temp<MinValue)
{temp=MinValue;}}}
obj.value=temp;}
function roundNumber(num,dec)
{var result=Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);return result;}
function blockNonNumbers(obj,e,allowDecimal,allowNegative)
{var key;var isCtrl=false;var keychar;var reg;if(window.event){key=e.keyCode;isCtrl=window.event.ctrlKey}
else if(e.which){key=e.which;isCtrl=e.ctrlKey;}
if(isNaN(key))return true;keychar=String.fromCharCode(key);if(key==8||isCtrl)
{return true;}
reg=/\d/;var isFirstN=allowNegative?keychar=='-'&&obj.value.indexOf('-')==-1:false;var isFirstD=allowDecimal?keychar=='.'&&obj.value.indexOf('.')==-1:false;return isFirstN||isFirstD||reg.test(keychar);}
document.write("<div id='tooltip'></div>");var offsetxpoint=10,offsetypoint=10,ie=document.all,ns6=document.getElementById&&!document.all,enabletip=false;if(ie||ns6)
{var tipobj=document.all?document.all["tooltip"]:document.getElementById?document.getElementById("tooltip"):"";}
function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;}
function ddrivetip(thetext,thecolor,thewidth){if(ns6||ie){if(typeof thewidth!="undefined"){tipobj.style.width=thewidth+"px";}
if(typeof thecolor!="undefined"&&thecolor!=""){tipobj.style.backgroundColor=thecolor;}
tipobj.innerHTML=thetext;enabletip=true;return false;}}
function positiontip(e){if(enabletip){var curX=(ns6)?e.pageX:event.clientX+ietruebody().scrollLeft;var curY=(ns6)?e.pageY:event.clientY+ietruebody().scrollTop;var rightedge=ie&&!window.opera?ietruebody().clientWidth-event.clientX-offsetxpoint:window.innerWidth-e.clientX-offsetxpoint-20;var bottomedge=ie&&!window.opera?ietruebody().clientHeight-event.clientY-offsetypoint:window.innerHeight-e.clientY-offsetypoint-20;var leftedge=(offsetxpoint<0)?offsetxpoint*(-1):-1000;if(rightedge<tipobj.offsetWidth)
tipobj.style.left=ie?ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px":window.pageXOffset+e.clientX-tipobj.offsetWidth+"px";else if(curX<leftedge)
tipobj.style.left="5px";else
tipobj.style.left=curX+offsetxpoint+"px";if(bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie?ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px":window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px";else
tipobj.style.top=curY+offsetypoint+"px";tipobj.style.visibility="visible";}}
function hideddrivetip(){if(ns6||ie){enabletip=false;tipobj.style.visibility="hidden";tipobj.style.left="-1000px";tipobj.style.backgroundColor='';tipobj.style.width='';}}
document.onmousemove=positiontip;
