var vInterval=1000;
var timerID = null;
var runTimer = false;
var hideSubMenu = true;
function init()
{ if (id1stTab.clientWidth <1000)    id1stTab.width=1000;
  if (window.location.href.indexOf('default.html')  != -1 ) idH.style.color="#434B9A";
  if (window.location.href.indexOf('clinSolution.html')  != -1 ) idH.style.color="#434B9A";
  if (window.location.href.indexOf('about.html')  != -1 ) idA.style.color="#434B9A";
  if (window.location.href.indexOf('job.html')  != -1 ) idJ.style.color="#434B9A";
  if (window.location.href.indexOf('contact.html')!= -1 ) {idC.style.color="#434B9A";contact.fname.focus();}
  if (window.location.href.indexOf('service.html')!= -1 ) idS.style.color="#434B9A";
  if (window.location.href.indexOf('product.html')!= -1 ) idP.style.color="#434B9A";
  if (window.location.href.indexOf('clinCRF.html')!= -1 ) idCRF.style.color="#434B9A";
  if (window.location.href.indexOf('ClinPV.html')!= -1 ) idCTT.style.color="#434B9A";
  if (window.location.href.indexOf('clinDW.html')!= -1 ) idDW.style.color="#434B9A";
//  logForm.submit();
}
function mClick(pObj)
{ 
  if (pObj =='idA')  window.location.href="about.html";
  if (pObj =='idP')  window.location.href="product.html";
  if (pObj =='idS')  window.location.href="service.html";
  if (pObj =='idC')  window.location.href="contact.html";
  //if (pObj =='idJ')  window.location.href="job.html";
  if (pObj =='idBro')  window.location.href="Clinsolutions-Feature-Brochure.pdf";
  if (pObj =='idL')  window.location.href="login.html";
  if (pObj =='idH')  window.location.href="clinSolution.html";
  if (pObj =='idCRF')  window.location.href="clinCRF.html";
  if (pObj =='idCTT')  //window.location.href="ClinPV.html";
    alert('coming soon.');
  if (pObj =='idDW')  //window.location.href="clinDW.html";
    alert('coming soon.');
  if (pObj == 'crfAdm' || pObj == 'crfBld'|| pObj == 'crfDE'|| pObj == 'crfDV' || pObj == 'crfLog' || pObj == 'crfRpt' )
    window.open('clinCRFDetail.html?part='+pObj);
  if (pObj == 'privacy') window.location.href="privicy.html";
  //if (pObj == 'copyRight') alert('is coming');
  //if (pObj == 'term') alert('is coming');
  if (pObj == 'achieve') alert('is coming');
}
function showImg(pEvt,pImg,pPart)
{ 
    window.open("showImg.htm?img="+pImg+"&part="+pPart,"_self","height=555,width=888");
}
function mOver(pObj,pSumMenu)
{ eval(pObj).className="menuMOver"
  if (pSumMenu) //has submeun, currently only has product submenu, so this is for it
  {
    eval(pSumMenu).style.display="";
    idEmptyRow.style.display="none";
	//idSubMenuP.style.position="absolute";
	//idSubMenuP.style.left="200px";
  }
}
function mOut(pObj,pSumMenu)
{ eval(pObj).className="menu";
  if (pSumMenu) //has submeun
    startInterval(pSumMenu);  
}
function startInterval(pSumMenu)
{
  runTimer = true;
  if (timerID)
    clearInterval(timerID);
  timerID = setInterval("mOutMenuMum("+"'"+pSumMenu+"'"+")",vInterval);
}
function mOutMenuMum(pObj)
{ if (runTimer)
  {
    if (hideSubMenu)
    {
      eval(pObj).style.display="none";
      idEmptyRow.style.display="";
    }
  }
  runTimer = false;
}
function mOutSubMenu(pObj,pSumMenu)
{ eval(pObj).className="subMenu";
  if (pSumMenu)
  { hideSubMenu = true;
    startInterval(pSumMenu); 
  }
}
function mOverSubMenu(pObj)
{ hideSubMenu = false;
  eval(pObj).className="subMenuMOver";
}
//--## resize the screen 
function myResize()
{ var vSW=window.screen.width+10;     
  var vSH=window.screen.height+10;
  
  window.moveTo(-5,-5);
  window.resizeTo(vSW,vSH);
}
/*
function showDemo(pObj)
{
  if (eval(pObj).style.display == "") eval(pObj).style.display="none";
  else eval(pObj).style.display="";
  
}*/
function bookMark()
{ var title=' ~ C l i n S o l u t i o n s ~ ';
  var url='http://www.clinSolutions.com.au';
  //window.external.AddFavorite(url,title);
    if (window.sidebar) // firefox
    window.sidebar.addPanel(title, url, "");
  else if(window.opera && window.print)
  { // opera
    var elem = document.createElement('a');
    elem.setAttribute('href',url);
    elem.setAttribute('title',title);
    elem.setAttribute('rel','sidebar');
    elem.click();
  } 
  else if(document.all)// ie
    window.external.AddFavorite(url, title);
  else 
  { alert("Sorry! Your browser doesn't support this function. Please bookmark this page manually.");}
}  
function openRpt()
{
  window.location="rpt.php"
}
//----------------------trim function----------------------//
function trim (str) 
{
  str = this != window? this : str;
  return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
String.prototype.trim = trim;

