﻿function styleScreenWidth()
{var screenWidth=screen.availWidth
var contentWidth=screenWidth-50
var browser=WhichBrowser()
var style='<style type="text/css">'
style+='#content'
style+='{'
style+=' width: '+contentWidth+';'
style+='}'
contentWidth1=contentWidth+20;style+='* html #content '
style+='{'
style+=' \width: '+contentWidth1+'px; /* for IE5 and IE6 in quirks mode */'
style+=' w\idth: '+contentWidth+'px; /* for IE6 in standards mode */'
style+='}'
style+='</style>'
document.write(style)}
function printMe()
{var a=window.open('','','scrollbars=yes,width=750,height=450');a.document.open("text/html");a.document.write('<html><head><link type="text/css" rel="Stylesheet" media="all" href="website.css" /><style type="text/css">div{background-image:none;background-color:#FFFFFF;} </style>');a.document.write('</head><body style="overflow-y: auto; overflow-x: hidden; padding-bottom:10px; background-image:none;background-color:#FFFFFF;">');a.document.write(document.getElementById('printMe').innerHTML);a.document.write('<div align="center" style="margin-top: 30px; margin-bottom: 30px;">');a.document.write('<a href="#" onclick="javascript:window.close();" style="font: normal 10px Verdana;">Close Window</a></div>');a.document.write('</body></html>');a.document.close();a.print();}
function postForm(formId)
{document.getElementById(formId).submit();}
function noPostBack(sNewFormAction)
{document.forms[0].action='default.aspx';document.forms[0].__VIEWSTATE.name='NOVIEWSTATE';document.forms[0].__VIEWSTATE.value='';document.forms[0].method='post';document.forms[0].submit();}
function LeaveDaysTip(text)
{Tip(text,WIDTH,200,PADDING,5,BGCOLOR,'#fff',FONTCOLOR,'#404040',TITLE,'Days Taken',TITLEFONTCOLOR,'#fff',TITLEBGCOLOR,'#404040',BORDERCOLOR,'#404040',BORDERSTYLE,'solid',BORDERWIDTH,1,FADEIN,200,FADEOUT,200,CLOSEBTN,true,CLOSEBTNTEXT,'Close',STICKY,true);}
function Bullet(picId,state,target,OU)
{var html;if(state=='open')
(html='<a style="background: transparent;" href="javascript:'+target+'.slidedown();Bullet(\''+picId+'\', \'close\', \''+target+'\', \''+OU+'\');"><span><IMG SRC="newIcons/Icons/bullet_open.png" border="0"/> <img src="newIcons/Icons/bullet_users.png" border="0"/></span> '+OU+'</a>')
else
(html='<a style="background: #DCE1E8;" href="javascript:'+target+'.slideup();Bullet(\''+picId+'\', \'open\', \''+target+'\', \''+OU+'\');"><span><IMG SRC="newIcons/Icons/bullet_close.png" border="0"/> <img src="newIcons/Icons/bullet_users.png" border="0"/></span> '+OU+'</a>')
document.getElementById(picId).innerHTML=html;}
function printLeaveForm()
{var type=document.getElementById('LeaveType').value;switch(type)
{case'Sick':var heading='<span style="font-size:1.5em;">SICK LEAVE FORM</span>';heading+='<br>DELFT ADMINISTRATION (PTY) LTD';heading+='<br><span style="text-align: left; display:block; width: 80%; padding: 5px; background: #DCE1E8; font-size:0.8em;">PLEASE NOTE: a Doctor\'s Certificate is required in the following instances:<br>';heading+='i.) you take more than 2 consecutive days off sick<br>ii.) you are sick on a Monday or a Friday<br>iii.) you are sick the day before or the day after a Public Holiday</span>';break;case'Annual':var heading='<span style="font-size:1.5em;">ANNUAL LEAVE FORM</span>';heading+='<br>DELFT ADMINISTRATION (PTY) LTD';break;case'Maternity':var heading='<span style="font-size:1.5em;">MATERNITY LEAVE FORM</span>';heading+='<br>DELFT ADMINISTRATION (PTY) LTD';break;default:var heading='<span style="font-size:1.5em;">SICK LEAVE FORM</span>';heading+='<br>DELFT ADMINISTRATION (PTY) LTD';heading+='<br><span style="text-align: left; display:block; width: 80%; padding: 5px; background: #DCE1E8; font-size:0.8em;">PLEASE NOTE: a Doctor\'s Certificate is required in the following instances:<br>';heading+='i.) you take more than 2 consecutive days off sick<br>ii.) you are sick on a Monday or a Friday<br>iii.) you are sick the day before or the day after a Public Holiday</span>';}
var awayFor=document.getElementById('dateInput').value;var newDates=awayFor.replace(/\n/g,', ');document.getElementById('printFormHeading').innerHTML=heading;document.getElementById('periodAway').innerHTML=newDates;printMe();}
function contentTitle(title)
{document.getElementById('contentTitle').innerHTML=title;}
function makeTitle(id,title)
{var html='<div class="rounded">';html+='<b class="rtop"><b class="rb1"></b><b class="rb2 r_c">';html+='</b><b class="rb3 r_b"></b><b class="rb4 r_b"></b></b>';html+='<div class="rcontent">';html+='<h1 class="r_a">'+title+'</h1></div>';document.getElementById(id).innerHTML=html;}
function openLock()
{var icon='<img src="icons/lock_open.png">';document.getElementById('lockIcon').innerHTML=icon;}
function closeLock()
{var icon='<img src="icons/lock.png">';document.getElementById('lockIcon').innerHTML=icon;}
function checkPW(target)
{if(document.getElementById('pass1').value=='')
{alert('WARNING:\nThe passwords do not match.\n\nPlease try again...');document.getElementById('pass1').value='';document.getElementById('pass2').value='';document.getElementById('pass1').focus();}
else if(document.getElementById('pass2').value=='')
{alert('WARNING:\nThe passwords do not match.\n\nPlease try again...');document.getElementById('pass1').value='';document.getElementById('pass2').value='';document.getElementById('pass1').focus();}
else if(document.getElementById('pass1').value!=document.getElementById('pass2').value)
{alert('WARNING:\nThe passwords do not match.\n\nPlease try again...');document.getElementById('pass1').value='';document.getElementById('pass2').value='';document.getElementById('pass1').focus();}
else
{if(document.getElementById('pass1').value.length<5)
{alert('WARNING:\nThe password must be at least 5 characters long.\n\nPlease try again...');document.getElementById('pass1').value='';document.getElementById('pass2').value='';document.getElementById('pass1').focus();}
else
{document.getElementById('resetPW').action='resetPassword.aspx?ResetUser='+target;postForm('resetPW');}}}
function jsButton(divID,icon,label)
{var html='<div class="btnHolder">';html+='<b class="btntop"><b class="btnb1"></b><b class="btnb2 btn_c">';html+='</b><b class="btnb3 btn_b"></b><b class="btnb4 btn_b"></b></b>';html+='<div class="btncontent">';html+='<h1 class="btn_a"><img src="icons/'+icon+'" border="0"><br />'+label+'</h1></div>';html+='<b class="btnbottom"><b class="btnb4"></b><b class="btnb3 btn_c"></b>';html+='<b class="btnb2 btn_b"></b><b class="btnb1 btn_b"></b></b></div>';document.getElementById(divID).innerHTML=html;}
function jsDropDown(instanceName,inputID,width,onChange)
{this.Render=Render;this.Return=Return;this.Open=Open;this.Select=Select;this.Add=Add;this.toString=toString;this.Activate=Activate;this.OutputCode=OutputCode;this.Shut=Shut;if(width==null)
{width=300;}
var change=null;var liChange=null;if(onChange!=null)
{change='onChange=\"javascript:'+onChange+';\" ';liChange=' '+onChange+';';}
else
{change='';liChange='';}
var emwidth=width-42;var parentId=inputID+'_'+instanceName+'_parent';var childId=inputID+'_'+instanceName+'_child';var titleId=inputID+'_'+instanceName+'_title';var ddLabel='';var valueArray=new Array();var index=valueArray.length-1;var jsParent=null;var jsChild=null;var dropdown_html=null;function toString()
{return instanceName;}
function Items(id,Itemvalue,Itemlabel,selected,Itemhref)
{this.id=id;this.Itemvalue=Itemvalue;this.Itemlabel=Itemlabel;if(selected)
{this.selected=true;}
else
{this.selected=false;}
if(Itemhref!=null)
{this.Itemhref=Itemhref;}
else
{this.Itemhref='#';}}
function Add(Itemvalue,Itemlabel,selected,Itemhref)
{index++;var id=index;valueArray[id]=new Items(id,Itemvalue,Itemlabel,selected,Itemhref);}
function Return()
{dropdown_html='<input id="'+inputID+'" name="'+inputID+'" '+change+'type="hidden" value="" />\n';dropdown_html+='<ul id="'+parentId+'" class="jsdropdown" style="width : '+width+'px;">\n';dropdown_html+='<li><a href="#" ondblclick="javascript:'+this.toString()+'.Shut();" onclick="javascript:'+this.toString()+'.Open();">\n';dropdown_html+='<b></b><span style="width: '+emwidth+'px;" id="'+titleId+'">Select</span></a></li>\n';dropdown_html+='</ul>\n';dropdown_html+='<div id="'+childId+'" class="jsdropdownbox">\n';dropdown_html+='<ul>\n';for(key in valueArray)
{dropdown_html+='<li><a href="'+valueArray[key].Itemhref+'" onclick="javascript:'+this.toString()+'.Select('+valueArray[key].id+');'+liChange+'">'+valueArray[key].Itemlabel+'</a></li>\n';if(valueArray[key].selected==true)
{ddLabel=valueArray[key].Itemlabel;}}
dropdown_html+='</ul></div>\n';dropdown_html+='<script type="text/javascript">\n';dropdown_html+='ADD_DHTML("'+parentId+'" + NO_DRAG);\n';dropdown_html+='ADD_DHTML("'+childId+'" + NO_DRAG);\n';dropdown_html+=this.toString()+'.Activate();\n';dropdown_html+='</script>\n';return dropdown_html;}
function Render()
{var html=this.Return();document.write(html);}
function OutputCode()
{var output='<script type="text/javascript">var '+this.toString()+' = new jsDropDown(\''+this.toString()+'\', \''+inputID+'\', '+width+', \''+onChange+'\');\n';for(key in valueArray)
{output+=this.toString()+'.Add("'+valueArray[key].Itemvalue+'", "'+valueArray[key].Itemlabel+'", '+valueArray[key].selected+', "'+valueArray[key].Itemhref+'");\n';}
output+=this.toString()+'.Render();\n</script>\n';return output;}
function Select(id)
{document.getElementById(inputID).value=valueArray[id].Itemvalue;document.getElementById(titleId).innerHTML=valueArray[id].Itemlabel;jsChild.hide(true);}
function Open()
{jsChild.show();}
function Shut()
{jsChild.hide(true);}
function Activate()
{jsParent=dd.elements[parentId];document.getElementById(titleId).innerHTML=ddLabel;var yPos=jsParent.y;if(dd.n6)
{var pwidth=width-2;var xPos=jsParent.x-2;}
else
{var pwidth=width-2;var xPos=jsParent.x-2;}
var height=22;jsChild=dd.elements[childId];var newHeight=yPos+height;childHeight=18*(index+1);jsChild.resizeTo(pwidth,childHeight);jsChild.moveTo(xPos,newHeight);jsChild.hide(true);}}
function WhichBrowser()
{if(navigator.userAgent.indexOf("MSIE")!=-1){return"IE";}
else if(navigator.userAgent.indexOf("Firefox")!=-1){return"FF";}
else if(navigator.userAgent.indexOf("Navigator")!=-1){return"NN";}
else if(navigator.userAgent.indexOf("Opera")!=-1){return"O";}
else{return"?";}}
function findPos(obj)
{var curleft=0;var curtop=0;if(obj.offsetParent)
{do
{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}
while(obj=obj.offsetParent);}
var pos=new Array();pos[0]=curleft;pos[1]=curtop;return pos;}
function getOffset(parent)
{var p=document.getElementById(parent);var top=p.offsetHeight;var left=p.offsetWidth;for(;p;p=p.offsetParent)
{top+=p.offsetTop;left+=p.offsetLeft;}
var pos=new Array(2);pos[0]=left;pos[1]=top;return pos;}
function opendd(parentId,childId)
{var browser=WhichBrowser();var parent=document.getElementById(parentId);var child=document.getElementById(childId);var parentWidth=parent.offsetWidth;var jsParent=dd.elements[parentId];var xPos=jsParent.x-2;var yPos=jsParent.y;var width=jsParent.w-20;var height=jsParent.h;var jsChild=dd.elements[childId];childHeight=jsChild.h;jsChild.resizeTo(width,childHeight);jsChild.moveTo(xPos,(yPos+height));jsChild.show();alert(jsContent.name+':\nx: '+xStart+'\ny: '+yStart);alert(jsParent.name+':\nx: '+xPos+'\ny: '+yPos);}
function closedd(childId)
{var jsChild=dd.elements[childId];jsChild.hide(true);}
function checkAD(user,OU,Tvid)
{document.getElementById('changeProfile').action='editEmployee.aspx?Employee='+user+'&viewOU='+OU+'&Tvid='+Tvid;document.getElementById('new_DateEmployed').value=document.getElementById('new_Date').value;document.getElementById('old_DateEmployed').value=document.getElementById('old_Date').value;document.getElementById('Submitted').value='true';postForm('changeProfile');}
function submitLogin()
{if(document.getElementById('Uname').value=="")
{document.getElementById('Uname').value="";document.getElementById('Upass').value="";document.getElementById('Uname').focus();alert('Please try again...');}
else if(document.getElementById('Upass').value=="")
{document.getElementById('Uname').value="";document.getElementById('Upass').value="";document.getElementById('Uname').focus();alert('Please try again...');}
else
{document.getElementById('ok').value='true';postForm('login');}}
function submitSearch()
{if(document.getElementById('SearchOption').value=="")
{document.getElementById('SearchOption').value="1";postForm('searchForm');}
else
{postForm('searchForm');}}
function submitUpload(input)
{if(document.getElementById('FileUpload').value=="")
{document.getElementById('FileUpload').focus();alert('Please select a file to upload');}
else
{document.getElementById('hideFile').value=document.getElementById('FileUpload').value;postForm('UploadForm');}}
function MarkAsPaid()
{if(document.getElementById('PaidDate').value=="")
{alert('Please select a date by clicking\nthe calendar icon on the right...');}
else
{var idate=document.getElementById('PaidDate').value;postForm('InvForm');}}
function jsCheckList(instanceName,Title,inputID)
{this.Render=Render;this.Click=Click;this.Add=Add;this.toString=toString;if(Title==null)
{Title='Select an option:';}
var valueArray=new Array();var index=valueArray.length;function toString()
{return instanceName;}
function Items(id,Itemlabel)
{this.id=id;this.Itemlabel=Itemlabel;}
function Add(Itemlabel)
{index++;var id=instanceName+index;valueArray[id]=new Items(id,Itemlabel);}
function Render()
{var checkbox_html='<span style="margin-bottom: 2px; display: block; padding: 4px; background: #DCE1E8; border:1px solid #404040;"><legend>'+Title+'</legend><table class="jsCheckList">';var hiddeninput="";var num=1;var rows=index
for(key in valueArray)
{checkbox_html+='<tr><td width="20" align="left" valign="middle">';checkbox_html+='<a id="'+valueArray[key].id+'" class="unchecked" href="javascript: '+this.toString()+'.Click(\''+valueArray[key].id+'\', \''+inputID+'\', \''+valueArray[key].Itemlabel+'\');">'+valueArray[key].Itemlabel+'</a></td>';checkbox_html+='</tr>';if(num!=rows)
{hiddeninput+=valueArray[key].Itemlabel+':false,';}
else
{hiddeninput+=valueArray[key].Itemlabel+':false';}
num++;}
checkbox_html+='</table></span>';checkbox_html+='<input type="hidden" id="'+inputID+'" name="'+inputID+'"  value="'+hiddeninput+'" />';document.write(checkbox_html);}
function Click(hrefId,InputId,val)
{var string=document.getElementById(InputId).value;if(document.getElementById(hrefId).className=='unchecked')
{var replacement=string.replace(val+':false',val+':true')
document.getElementById(InputId).value=replacement
document.getElementById(hrefId).className='checked'}
else
{var replacement=string.replace(val+':true',val+':false')
document.getElementById(InputId).value=replacement
document.getElementById(hrefId).className='unchecked'}}}
function jsCheckBox(instanceName,Title,inputID)
{this.Render=Render;this.Click=Click;this.Add=Add;this.toString=toString;if(Title==null)
{Title='Select an option:';}
var valueArray=new Array();var index=valueArray.length;function toString()
{return instanceName;}
function Items(id,Itemvalue,Itemlabel,selected,Itemtip)
{this.id=id;this.Itemvalue=Itemvalue;this.Itemlabel=Itemlabel;this.selected=selected;this.Itemtip=Itemtip;}
function Add(Itemvalue,Itemlabel,selected,Itemtip)
{index++;var id=instanceName+index;valueArray[id]=new Items(id,Itemvalue,Itemlabel,selected,Itemtip);}
function Render()
{var checkbox_html='<span style="border:0px solid #000;"><legend>'+Title+'</legend><table style=\"border: 1px solid #404040; width: 100%; background: #DCE1E8;\">';var initialVal="";for(key in valueArray)
{checkbox_html+='<tr><td width="20" align="center" valign="middle">';if(valueArray[key].selected==true)
{checkbox_html+='<div class="jsCheckBox" id="'+valueArray[key].id+'"><a href="#" onclick="javascript: '+this.toString()+'.Click(\''+valueArray[key].id+'\', \'checked\');">';checkbox_html+='<img src="../media/checkbox_checked.gif" border="0" /></a></div></td>';checkbox_html+='<td valign="middle" align="left"><strong>'+valueArray[key].Itemlabel+'</strong></td>';initialVal=valueArray[key].Itemvalue;}
else
{checkbox_html+='<div class="jsCheckBox" id="'+valueArray[key].id+'"><a href="#" onclick="javascript: '+this.toString()+'.Click(\''+valueArray[key].id+'\', \'unchecked\');">';checkbox_html+='<img src="../media/checkbox_unchecked.gif" border="0" /></a></div></td>';checkbox_html+='<td valign="middle" align="left">'+valueArray[key].Itemlabel+'</td>';}
if(valueArray[key].Itemtip!=null)
{checkbox_html+='<td valign="middle" align="left"><a href="#" onmouseover="Tip(\''+valueArray[key].Itemtip+'\', BALLOON, true, ABOVE, true, PADDING, 8)" onmouseout="UnTip()" style="text-decoration: none; border: 0;"><img style="position: relative; top: -1px;" src="icons/help.png" border="0" /></a></td>';}
checkbox_html+='</tr>';}
checkbox_html+='</table></span>';var hideinput='<input id="'+inputID+'" name="'+inputID+'" type="hidden" value="'+initialVal+'" />';document.write(hideinput+checkbox_html);}
function Click(divId,state)
{for(key in valueArray)
{if(divId==valueArray[key].id)
{if(state=='unchecked')
{var icon='checkbox_checked';var status='checked';document.getElementById(inputID).value=valueArray[key].Itemvalue}
else
{var icon='checkbox_unchecked';var status='unchecked';document.getElementById(inputID).value=''}}
else
{var icon='checkbox_unchecked';var status='unchecked';}
var html='<a href="#" onclick="javascript: '+this.toString()+'.Click(\''+valueArray[key].id+'\', \''+status+'\');"><img src="../media/'+icon+'.gif" border="0" /></a>'
document.getElementById(valueArray[key].id).innerHTML=html;}}}
function newClaim()
{document.getElementById('newClaimDiv').className='newClaimShow';}
function hideNewClaim()
{document.getElementById('newClaimDiv').className='newClaimHide';}
function showComment()
{document.getElementById('newCommentDiv').className='newCommentShow';}
function showSettlementEdit()
{document.getElementById('editSettlementDiv').className='editSettlementShow';}
function hideComment()
{document.getElementById('newCommentDiv').className='newCommentHide';}
function hideSettlementEdit()
{document.getElementById('editSettlementDiv').className='editSettlementHide';}
function showUserPass(id)
{document.getElementById(id).className='userPassShow';}
function hideUserPass(id)
{document.getElementById(id).className='userPassHide';}
function showEditUser(id)
{document.getElementById(id).className='EditUserShow';}
function hideEditUser(id)
{document.getElementById(id).className='EditUserHide';}
function makeClaim()
{if(document.getElementById('Rands').value=="")
{document.getElementById('Rands').focus();alert('Please enter a Settlement Amount...');}
else if(document.getElementById('claimType').value=="")
{alert('Please indicate what type of Claim this is...');}
else
{if(document.getElementById('Cents').value=="")
{document.getElementById('Cents').value='00';}
postForm('inceptClaim');}}
function updateAmount()
{if(document.getElementById('Rands').value=="")
{document.getElementById('Rands').focus();alert('Please enter a Settlement Amount...');}
else
{if(document.getElementById('Cents').value=="")
{document.getElementById('Cents').value='00';}
postForm('updateSettlement');}}
function makeComment()
{var txt=document.getElementById('CommentAdd').value
if(txt=="")
{document.getElementById('CommentAdd').focus()
alert('Please enter a Comment...')}
else
{postForm('CommentForm')}}
function showCal()
{document.getElementById('calHolder').style.display='block'}
function hideCal()
{document.getElementById('calHolder').style.display='none'}
function getAbsPos(oId,tl)
{var o=(typeof oId=='String')?document.getElementById(oId):oId;var val=0;while(o.nodeName!="BODY")
{val+=parseInt((tl=='top')?o.offsetTop:o.offsetLeft);o=o.parentNode;}
return val;}
function getDim(el){for(var lx=0,ly=0;el!=null;lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);return{x:lx,y:ly}}
function jsCounter(instanceName,inputId,defaultValue)
{this.Plus=Plus
this.Minus=Minus
this.Render=Render
this.ToString=ToString
var Count
if(defaultValue!=null)
{Count=defaultValue}
else
{Count=0}
function Plus()
{Count++
document.getElementById(inputId).value=Count}
function Minus()
{Count--
document.getElementById(inputId).value=Count}
function ToString()
{return instanceName}
function Render()
{var html='<table width="200"><tr>';html+='<td width="20" valign="middle" align="center">';html+='<a href="#" onclick="javascript:'+this.ToString()+'.Plus();"><strong>+</strong></a></td>';html+='<td width="160" valign="middle" align="center"><input id="'+inputId+'" name="'+inputId+'" type="text" value="'+Count+'"></td>';html+='<td width="20" valign="middle" align="center">';html+='<a href="#" onclick="javascript:'+this.ToString()+'.Minus();"><strong>-</strong></a></td>';html+='</tr></table>';alert(html)
document.write(html)}}
function jsButton(buttonId,buttonText)
{this.AddOnClickEvent=AddOnClickEvent
this.AddOnMouseoverEvent=AddOnMouseoverEvent
this.AddOnMouseOutEvent=AddOnMouseOutEvent
this.SetClass=SetClass
this.SetHref=SetHref
this.Render=Render
this.ToString=ToString
var OnClickEvent=new Array()
var OnMouseOverEvent=new Array()
var OnMouseOutEvent=new Array()
var Click=''
var Mouseover=''
var Mouseout=''
var OC=-1
var OMOver=-1
var OMOut=-1
var Href='#'
var cssClass='uploadPanel_uploadBtn'
function AddOnClickEvent(E_Arg)
{this.OC++;this.OnClickEvent.push(E_Arg)}
function AddOnMouseOverEvent(E_Arg)
{this.OMOver++;this.OnMouseOverEvent.push(E_Arg)}
function AddOnMouseOutEvent(E_Arg)
{this.OMOut++;this.OnMouseOutEvent.push(E_Arg)}
function SetClass(newClass)
{this.cssClass=newClass}
function SetHref(newHref)
{this.Href=newHref}
function ToString()
{return this.buttonId}
function Render()
{var html='<div id="'+this.buttonId+'" class="'+this.cssClass+'">'
html+='<a href="'+this.Href+'"'+this.Click+this.Mouseover+this.Mouseout+'>'+this.buttonText+'</a></div>'
alert(html)
document.write(html)}}
function renameImage(image,id)
{document.getElementById('renameImage').value=document.getElementById(id).value
document.getElementById('updateImg').action='index.php?Page=Images&Action=Rename&Image='+image
postForm('updateImg');}
function newUser()
{if(document.getElementById('Pass1').value!=document.getElementById('Pass2').value)
{alert('The passwords do not match...');document.getElementById('Pass1').value="";document.getElementById('Pass2').value="";document.getElementById('Pass1').focus();}
else if(document.getElementById('UserName').value=="")
{alert('You need to supply a UserName...');document.getElementById('UserName').value="";document.getElementById('UserName').focus();}
else if(document.getElementById('Pass1').value=="")
{alert('You need to supply a Password...');document.getElementById('Pass1').value="";document.getElementById('Pass1').focus();}
else if(document.getElementById('FullName').value=="")
{alert('You need to supply the User\'s\nfull name and surname...');document.getElementById('FullName').value="";document.getElementById('FullName').focus();}
else
{postForm('newUserForm');}}
function jsCheckBox(instanceName,Title,inputID)
{this.Render=Render;this.Click=Click;this.Add=Add;this.toString=toString;if(Title==null)
{Title='Select an option:';}
var valueArray=new Array();var index=valueArray.length;function toString()
{return instanceName;}
function Items(id,Itemvalue,Itemlabel,selected,Itemtip)
{this.id=id;this.Itemvalue=Itemvalue;this.Itemlabel=Itemlabel;this.selected=selected;this.Itemtip=Itemtip;}
function Add(Itemvalue,Itemlabel,selected,Itemtip)
{index++;var id=instanceName+index;valueArray[id]=new Items(id,Itemvalue,Itemlabel,selected,Itemtip);}
function Render()
{var checkbox_html='<span style="border:0px solid #000;"><legend>'+Title+'</legend><table style=\"border: 1px solid #404040; width: 100%; background: #DCE1E8;\">';var initialVal="";for(key in valueArray)
{checkbox_html+='<tr><td width="20" align="center" valign="middle">';if(valueArray[key].selected==true)
{checkbox_html+='<div class="jsCheckBox" id="'+valueArray[key].id+'"><a href="#" onclick="javascript: '+this.toString()+'.Click(\''+valueArray[key].id+'\', \'checked\');">';checkbox_html+='<img src="../media/checkbox_checked.gif" border="0" /></a></div></td>';checkbox_html+='<td valign="middle" align="left"><strong>'+valueArray[key].Itemlabel+'</strong></td>';initialVal=valueArray[key].Itemvalue;}
else
{checkbox_html+='<div class="jsCheckBox" id="'+valueArray[key].id+'"><a href="#" onclick="javascript: '+this.toString()+'.Click(\''+valueArray[key].id+'\', \'unchecked\');">';checkbox_html+='<img src="../media/checkbox_unchecked.gif" border="0" /></a></div></td>';checkbox_html+='<td valign="middle" align="left">'+valueArray[key].Itemlabel+'</td>';}
if(valueArray[key].Itemtip!=null)
{checkbox_html+='<td valign="middle" align="left"><a href="#" onmouseover="Tip(\''+valueArray[key].Itemtip+'\', BALLOON, true, ABOVE, true, PADDING, 8)" onmouseout="UnTip()" style="text-decoration: none; border: 0;"><img style="position: relative; top: -1px;" src="../media/help.gif" border="0" /></a></td>';}
checkbox_html+='</tr>';}
checkbox_html+='</table></span>';var hideinput='<input id="'+inputID+'" name="'+inputID+'" type="hidden" value="'+initialVal+'" />';document.write(hideinput+checkbox_html);}
function Click(divId,state)
{for(key in valueArray)
{if(divId==valueArray[key].id)
{if(state=='unchecked')
{var icon='checkbox_checked';var status='checked';document.getElementById(inputID).value=valueArray[key].Itemvalue}
else
{var icon='checkbox_unchecked';var status='unchecked';document.getElementById(inputID).value=''}}
else
{var icon='checkbox_unchecked';var status='unchecked';}
var html='<a href="#" onclick="javascript: '+this.toString()+'.Click(\''+valueArray[key].id+'\', \''+status+'\');"><img src="../media/'+icon+'.gif" border="0" /></a>'
document.getElementById(valueArray[key].id).innerHTML=html;}}}
function href(hlink)
{window.location=hlink;}
function isConfirmed(message)
{var c=confirm(message);return c;}
function editProfile(UserID)
{document.getElementById('pEmail').disabled=false;document.getElementById('pEmail').style.backgroundColor='#eee';document.getElementById('pFirstname').disabled=false;document.getElementById('pFirstname').style.backgroundColor='#eee';document.getElementById('pLastname').disabled=false;document.getElementById('pLastname').style.backgroundColor='#eee';document.getElementById('profileEditButton').innerHTML='<button class="icon" type="button" onclick="xajax_updateProfile(xajax.getFormValues(\'updateProfile\'), '+UserID+');;" title="Save Changes"><img style="position: relative; top: 1px;" src="admin/media/buttons/save.png" alt="Save" /></button>';}
function FCKCollect()
{this.UpdateEditorFormValue=function()
{for(i=0;i<parent.frames.length;++i)
if(parent.frames[i].FCK)
parent.frames[i].FCK.UpdateLinkedField();}}
var FCKCollector=new FCKCollect(); 