//<![CDATA[
/* checked with jsLint 2007 11 23 */
/*User configuration -- menu pulls out from the left */
limit="0";pPos="top";vPos="middle";state=true;scrollSpeed=20;
move=10;menuSpeed=20;moveOnScroll=true;pullImg=false;
inImg="images/menua.gif";outImg="images/menub.gif";
// Do not change anything below this point ***********
var bObj,fObj,iObj,pObj,frmObj,pullObj,tabObj,ltop;
var mHeight,mWidth,pWidth,saveBack,saveBorder,saveTab,timerId;
function getX(oNode){var x=0;
while (oNode){x+=oNode.offsetLeft;oNode=oNode.offsetParent;}
return x;}
function getY(oNode){var y=0;
while (oNode){y+=oNode.offsetTop;oNode=oNode.offsetParent;}
return y;}
function getWidth(oNode){return oNode.offsetWidth;}
function getHeight(oNode){return oNode.offsetHeight;}
function getMarker(){
  if(!(obj=document.getElementById('marker'))){return -1;}
  curleft=curtop=0;
  if(obj.offsetParent){
    curleft=obj.offsetLeft;curtop=obj.offsetTop;
    while ((obj=obj.offsetParent)){
      curleft+=obj.offsetLeft;curtop+=obj.offsetTop;
      }} return curtop;}
function mIn(){
if(pullImg===true){tabObj.innerHTML='<img src="'+inImg+'/>';}
if(parseInt(frmObj.left,10)>-mWidth+pWidth+9){
  frmObj.left=parseInt(frmObj.left,10)-move+'px';
  timerId=setTimeout(mIn,menuSpeed);
  }else{state=true;} }
function mOut(){
if(pullImg===true){tabObj.innerHTML='<img src="'+outImg+'/>';}
if(parseInt(frmObj.left,10)<0){
  frmObj.left=parseInt(frmObj.left,10)+move+'px';
  timerId=setTimeout(mOut,menuSpeed);
  }else{state=false;}}
function moveMenu(){
clearTimeout(timerId);if(!state){mIn();}else{mOut();}}
function checkScrolled(){
spot=document.documentElement.scrollTop+ltop;lim=getMarker();
if (lim<0){lim=parseInt(limit,10);}
if(spot>lim){frmObj.top=spot+'px';}else{frmObj.top=lim+'px';}
setTimeout(checkScrolled,scrollSpeed);}
function menuPosn(){ //re-entry point for resize
mHeight=getHeight(fObj);mWidth=getWidth(fObj);
pHeight=getHeight(pObj);pWidth=getWidth(pObj);
p=document.documentElement.clientHeight;
switch (vPos.toLowerCase()){
  case'top':ltop=0;break;
  case'middle':ltop=(p-mHeight)/2;break;
  case'bottom':ltop=p-mHeight;break;
  default:ltop=parseInt(vPos,10);}
if(pullImg===true){pullObj.height=pHeight+'px';
  tabObj.innerHTML='<img src="'+inImg+'/>';
  pullObj.backgroundColor='transparent';pullObj.border='0px';}
else{tabObj.innerHTML=saveTab;
  pullObj.backgroundColor=saveBack;pullObj.border=saveBorder;}
frmObj.left=(pWidth-mWidth)+'px';frmObj.top=(ltop)+'px';
switch (pPos.toLowerCase()){ //vertical posn of pulltab
  case'top':ptop=-(mHeight-pHeight)/2+4;break;
  case'middle':ptop=0;break;
  case'bottom':ptop=(mHeight-pHeight)/2-4;break;
  default:ptop=-(mHeight-pHeight)/2+4+parseInt(pPos,10);}
pullObj.top=ptop+'px';
if(!state){mOut();} }
function toggle(){
  if(pullImg===false){pullImg=true;}else{pullImg=false;}
  menuPosn();}
function menuInit(){ //fudge for conformant browsers!
  document.getElementById('jsmsg').style.display='none';//noscript fix
  menuWrite();bObj=document.getElementById('body');
  if(!bObj){alert('Body must have id="body" tag');}
  fObj=document.getElementById('frame');
  if(!fObj){alert('Menu frame must have id="frame" tag');}
  frmObj=document.getElementById('frame').style;
  iObj=document.getElementById('items');
  if(!iObj){alert('Item list must have id="items" tag');}
  pObj=document.getElementById('pull');
  if(!pObj){alert('Pulltab must have id="pull" tag');}
  pullObj=document.getElementById('pull').style;
  tabObj=document.getElementById('tab');
  if(!tabObj){alert('Tab must have id="tab" tag');}
  saveBack=pullObj.backgroundColor;
  saveBorder=pullObj.border;saveTab=tabObj.innerHTML;
  menuPosn();if(!state){mOut();}
  if(moveOnScroll){checkScrolled();}}
window.onresize=menuPosn;
function menuWrite(){
m ='';m+='<table id="frame"><tr><td>';
m+='<ul class="cl1" id="items"><li class="bar">&nbsp;<\/li>';
m+='<li><a class="item" href="index.htm">HTML<\/a><\/li>';
m+='<li><a class="item" href="flashq.htm">FLASH<\/a><\/li>';
m+='<li><a class="item" href="ecomq.htm">E-COMMERSE<\/a><\/li>';
m+='<li><a class="item" href="carpetcleaning/index.htm">CARPET CLEANING<\/a><\/li>';
m+='<li><a class="item" href="#gr">LOCK SMITH<\/a><\/li>';
m+='<li class="bar">&nbsp;<\/li>';
m+='<\/ul><\/td><td><table id="pull" onmouseover="moveMenu();"><tr>';
m+='<th id="tab">M<br\/>E<br\/>N<br\/>U<\/th>';
m+='<\/tr><\/table><\/td><\/tr><\/table>';
document.getElementById('zone').innerHTML=m;} //]]>
