
///////////////////////////////////////////////////////////////////////////////
//   ..:: realMenu v1.27 ::..
// copyright © jordan neill 2000
// Script featured on JavaScript Kit (http://javascriptkit.com)
//
// change the menuItems array with your options and set the urls to link to
//  use addMenuItem("Text to show", "Url To Link To"); to make an item
//  use addMenuItem("Text", Url", "Img To Show"); to make an item with an image
//  use addMenuItem(); to indicate a separator bar
//  you can use html tags in the text, eg, <i>, <b> or <u>
//
// images used should be 16x16 transparent gifs
///////////////////////////////////////////////////////////////////////////////

 menuItems = new Array();
 menuItemNum = 0;

 function addMenuItem(text, url, img){
  if(img) menuItems[menuItemNum] = new Array(text, url, img);
  else if(text) menuItems[menuItemNum] = new Array(text, url);
  else menuItems[menuItemNum] = new Array();
  menuItemNum++;
 }

 menuWidth = 150; //menu width
 menuHeight = 100; //menu height
 menuDelay = 50; //delay before menu appears
 menuSpeed = 8; //speed which menu appears (lower=faster)
 menuOffset = 2; //offset of menu from mouse pointer

 addMenuItem("<center>Home Page</center>","http://www.freightsolutionsuk.com");
 addMenuItem();
 addMenuItem("Project Solutions","www.freightsolutionsuk.com");
 addMenuItem("Parcel Solutions","http://www.projectsolutionsuk.com");
 addMenuItem("Supplychain Solutions","http://www.supplychainsolutionsuk.com");
 addMenuItem();


 ///////////////////////////////////////////////////////////////////////////////
 // do not edit the code below, it is required for the menu to work correctly
 ///////////////////////////////////////////////////////////////////////////////


 if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5)
  isIe = 1;
 else
  isIe = 0;

 if(isIe){
  menuContent = '<table id="rightMenu" width="0" height="0" cellspacing="0" cellpadding="0" style="font:menu;color:menutext;"><tr height="1"><td style="background:threedlightshadow" colspan="4"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight" colspan="2"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="10"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"><table cellspacing="0" cellpadding="0" nowrap style="font:menu;color:menutext;cursor:default;">';
  for(m=0;m<menuItems.length;m++){
   if(menuItems[m][0] && menuItems[m][2])
    menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="parent.window.location.href=\'' + menuItems[m][1] + '\'"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap><img src="' + menuItems[m][2] + '"></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';
   else if(menuItems[m][0])
    menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="parent.window.location.href=\'' + menuItems[m][1] + '\'"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';
   else
    menuContent += '<tr><td colspan="5" height="4"></td></tr><tr><td colspan="5"><table cellspacing="0"><tr><td width="2" height="1"></td><td width="0" height="1" style="background:threedshadow"></td><td width="2" height="1"></td></tr><tr><td width="2" height="1"></td><td width="100%" height="1" style="background:threedhighlight"></td><td width="2" height="1"></td></tr></table></td></tr><tr><td colspan="5" height="3"></td></tr>';
  }
  menuContent += '</table></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedshadow" colspan="3"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threeddarkshadow" colspan="5"></td></tr></table>';

  menuPopup = window.createPopup();
  menuPopup.document.body.innerHTML = menuContent;
 }

 function showMenu(){
  menuXPos = event.clientX + menuOffset;
  menuYPos = event.clientY + menuOffset;

  menuXIncrement = menuWidth / menuSpeed;
  menuYIncrement = menuHeight / menuSpeed;

  menuTimer = setTimeout("openMenu(0,0)", menuDelay);

  return false;
 }


 function openMenu(height, width){
  iHeight = height;
  iWidth = width;

  menuPopup.show(menuXPos, menuYPos, iWidth, iHeight, document.body);

  if(iHeight < menuHeight)
   menuTimer = setTimeout("openMenu(iHeight + menuYIncrement, iWidth + menuXIncrement)", 1);
  else
   clearTimeout(menuTimer);
 }


 if(isIe) document.oncontextmenu = showMenu;


function mmLoadMenus() {
  if (window.mm_menu_0803105605_0) return;
                          window.mm_menu_0803105605_0 = new Menu("root",123,20,"Verdana, Arial, Helvetica, sans-serif",9,"#333333","#FFFFFF","#F1F3F5","#5A86B3","left","middle",3,0,200,-5,7,true,true,true,0,false,false);
  mm_menu_0803105605_0.addMenuItem("Home","location='index.php'");
  mm_menu_0803105605_0.addMenuItem("Overview","location='overview.php'");
  mm_menu_0803105605_0.addMenuItem("Mission&nbsp;Statement","location='mission.php'");
  mm_menu_0803105605_0.addMenuItem("Location","location='location.php'");
  mm_menu_0803105605_0.addMenuItem("Join&nbsp;Us","location='joinus.php'");
   mm_menu_0803105605_0.hideOnMouseOut=true;
   mm_menu_0803105605_0.bgColor='#555555';
   mm_menu_0803105605_0.menuBorder=1;
   mm_menu_0803105605_0.menuLiteBgColor='';
   mm_menu_0803105605_0.menuBorderBgColor='#CCCCCC';
  window.mm_menu_0804105307_0 = new Menu("root",130,20,"Verdana, Arial, Helvetica, sans-serif",9,"#333333","#FFFFFF","#F1F3F5","#5A86B3","left","middle",3,0,200,-5,7,true,true,true,0,false,false);
  mm_menu_0804105307_0.addMenuItem("Introduction","location='intro.php'");
  mm_menu_0804105307_0.addMenuItem("Services","location='services.php'");
  mm_menu_0804105307_0.addMenuItem("Register","location='employerreg.php'");
   mm_menu_0804105307_0.hideOnMouseOut=true;
   mm_menu_0804105307_0.bgColor='#555555';
   mm_menu_0804105307_0.menuBorder=1;
   mm_menu_0804105307_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0804105307_0.menuBorderBgColor='#CCCCCC';
    window.mm_menu_0804105724_0 = new Menu("root",130,20,"Verdana, Arial, Helvetica, sans-serif",9,"#333333","#FFFFFF","#F1F3F5","#5A86B3","left","middle",3,0,200,-5,7,true,true,true,0,false,false);
  mm_menu_0804105724_0.addMenuItem("Register","location='candidatereg.php'");
  mm_menu_0804105724_0.addMenuItem("CV&nbsp;Builder","location='cvbuilder.php'");
  mm_menu_0804105724_0.addMenuItem("Interview&nbsp;Tips","location='interviewtip.php'");
  mm_menu_0804105724_0.addMenuItem("Are&nbsp;you&nbsp;paid&nbsp;enough?","location='paidenough.php'");
   mm_menu_0804105724_0.hideOnMouseOut=true;
   mm_menu_0804105724_0.bgColor='#555555';
   mm_menu_0804105724_0.menuBorder=1;
   mm_menu_0804105724_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0804105724_0.menuBorderBgColor='#CCCCCC';
  window.mm_menu_0804111514_0 = new Menu("root",130,20,"Verdana, Arial, Helvetica, sans-serif",9,"#333333","#FFFFFF","#F1F3F5","#5A86B3","left","middle",3,0,200,-5,7,true,true,true,0,false,false);
  mm_menu_0804111514_0.addMenuItem("Search","location='search.php'");
   mm_menu_0804111514_0.hideOnMouseOut=true;
   mm_menu_0804111514_0.bgColor='#555555';
   mm_menu_0804111514_0.menuBorder=1;
   mm_menu_0804111514_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0804111514_0.menuBorderBgColor='#CCCCCC';
  window.mm_menu_0804113042_0 = new Menu("root",148,20,"Verdana, Arial, Helvetica, sans-serif",9,"#333333","#FFFFFF","#F1F3F5","#5A86B3","left","middle",3,0,200,-5,7,true,true,true,0,true,false);
  mm_menu_0804113042_0.addMenuItem("Location&nbsp;Map","location='map.php'");
  mm_menu_0804113042_0.addMenuItem("Operations&nbsp;&nbsp;Division","location='opsdiv.php'");
  mm_menu_0804113042_0.addMenuItem("Sales&nbsp;Division","location='salesdiv.php'");
  mm_menu_0804113042_0.addMenuItem("Management&nbsp;Division","location='mandiv.php'");
   mm_menu_0804113042_0.hideOnMouseOut=true;
   mm_menu_0804113042_0.bgColor='#555555';
   mm_menu_0804113042_0.menuBorder=1;
   mm_menu_0804113042_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0804113042_0.menuBorderBgColor='#CCCCCC';

mm_menu_0804113042_0.writeMenus();
} // mmLoadMenus()

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



/*************************************/

window.status='Freight Solutions UK'

document.onmouseover = function ( e ) {   
if ( !e ) e = window.event;   
var el = e.target ? e.target : e.srcElement;   
while ( el != null && el.tagName != "A" ) el = el.parentNode;   
if ( el == null ) return;   
if ( e.preventDefault ) e.preventDefault();   
else e.returnValue = true;
}

var activeWin
var old,head,scrNum=0

function rpc(str,path){
 head=document.getElementsByTagName('head').item(0);
 script=document.createElement('script');
 if(path){
  script.src=path+'includes/rpc.php?'+str+'&SCRNUM='+scrNum
 }else{
  script.src='includes/rpc.php?'+str+'&SCRNUM='+scrNum
 }
 script.type='text/javascript';
 script.defer=true;
 script.id='lastScript'+scrNum
 scrNum++
 void(head.appendChild(script));
 //prompt('',script.src)
}

function removeScript(num){
 old=document.getElementById('lastScript'+num);
 if(old)head.removeChild(old);
}

function repStr(str,txt,by) {
 var strLength=str.length,txtLength=txt.length;
 if((strLength==0) || (txtLength==0))return str;
 var i=str.indexOf(txt);
 if((!i) && (txt!=str.substr(0,txtLength)))return str;
 if(i==-1)return str;
 var newstr=str.substr(0,i) + by;
 if(i+txtLength < strLength){newstr+=repStr(str.substring(i+txtLength,strLength),txt,by)}
 return newstr;
}

function editMe(id,id2){
 if(activeWin) activeWin.close()
 activeWin=window.open("textEdit.php?ID="+id,"activeWin","height=550,width=502,scrollbars=no")
}

function setCookie(name,value,days){
 if (days){
  var date = new Date();
  date.setTime(date.getTime()+(days*24*60*60*1000));
  var expires = "; expires="+date.toGMTString();
 }
 else var expires = "";
 document.cookie = name+"="+value+expires+"; path=/";
}

function getCookie(name){
 var nameEQ = name + "=";
 var ca = document.cookie.split(';');
 for(var i=0;i < ca.length;i++){
  var c = ca[i];
   while (c.charAt(0)==' ') c = c.substring(1,c.length);
 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
 }
 return '';
}

function delCookie(name){
 setCookie(name,"",-1);
}

function dispTime(){
 var now = new Date();
 var hours = now.getHours();
 var minutes = now.getMinutes();
 var seconds = now.getSeconds();
 clock = "" + ((hours>12)? hours-12 : hours);
 clock += ((minutes<10)? ":0" : ":") + minutes;
 clock += ((seconds<10)? ":0" : ":") + seconds;
 clock += (hours >= 12)? " pm" : " am"
 document.getElementById('clk').innerHTML=clock
 setTimeout("dispTime()",1000);
}

function printDetails(){
 if(document.getElementById('appDetails').innerHTML!=''){
  window.print()
 }else{
  alert('Please select an apointment date and time.')
  return false
 }
}

function nav(n){
 var nav=parent.document.getElementById('navTable').getElementsByTagName('TD')
 for(a=0;a<nav.length;a++){
  nav[a].bgColor=''
 }
 nav[n].bgColor='#91B632'
 nav[n].childNodes[0].blur()
}

function checkUserName(val){
 rpc("ACTION=CHECKUSERNAME&USERNAME="+val)
}

function checkForm(){
 var val=""
 var el=arguments[0].elements
 for(a=1;a<arguments.length;a++){
  for(b=0;b<el.length;b++){
   var obj=el[b]
   if(obj.name==arguments[a]){
	if(obj.options){
	 val=obj.options[obj.selectedIndex].innerHTML
	}else{
	 val=obj.value
	}
	 if((val==obj.def)||(val=='')){
      alert('Please complete ALL compulsory fields')
	  obj.focus()
	  return false
	  break
	}
   }
  }
 }
 return true
}

function login(u,p){
 rpc("ACTION=LOGIN&USERNAME="+u+'&PASSWORD='+p)
}

function logout(){
 rpc("ACTION=LOGOUT")
}

function setNewsContent(val){
 rpc("ACTION=UPDATENEWS&CONTENT="+repStr(repStr(val,"\r",""),"\n","<br>"))
}

function applyForJob(a,b){
 rpc("ACTION=APPLYFORJOB&JOBID="+a)
}

function deleteJob(id){
 if(confirm("Delete this job ?")){
  rpc("ACTION=DELETEJOB&ID="+id)
 }
}

function deleteCandidate(id){
 if(confirm("Delete this candidate ?")){
  rpc("ACTION=DELETECANDIDATE&ID="+id)
 }
}

function deleteClient(id){
 if(confirm("Delete this client ?")){
  rpc("ACTION=DELETECLIENT&ID="+id)
 }
}

function findCandidates(id){
 rpc("ACTION=FINDCANDIDATES&JOBID="+id)
}

