// JavaScript Document

var about = new Array();
about[0]=['Sandur Group Profile','about1.html'];
about[1]=['Company Profile','about2.html'];

var products = new Array();
products[0]=['Electromagnetic Dosing Pump','#'];
products[1]=['E-Series','products1.html'];
products[2]=['CC3-Series','products2.html'];
products[3]=['B-Series','products3.html'];
products[4]=['Motor Driven Dosing Pump','#'];
products[5]=['Multifertic','products4.html'];
products[6]=['Dostec-40','products5.html'];
products[7]=['Dostec-50','products13.html'];
products[8]=['Electrofertic','products6.html'];
products[9]=['Other Products','#'];
products[10]=['Proportional Volumetric Dosing Pump','products7.html'];
products[11]=['Turbine Agitator Controllers','products8.html'];
products[12]=['Controllers','products9.html'];
products[13]=['Hydraulic injection pump','products10.html'];
products[14]=['De-Fluoridation Systems','products11.html'];
products[15]=['Skid Mounted Dosing System','products12.html'];

var quality = new Array();
quality[0]=['Quality Policy','quality1.html'];
quality[1]=['Certification','quality2.html'];


document.write('<div id="div0" class="menu">');
for(i=0; i<about.length; i++)
{document.write('<a href="'+about[i][1]+'">'+about[i][0]+'</a>')}
document.write('</div>');
checkit(document.getElementById('div0'))

document.write('<div id="div1" class="menu">');
for(i=0; i<products.length; i++)
{document.write('<a href="'+products[i][1]+'">'+products[i][0]+'</a>')}
document.write('</div>');
checkit(document.getElementById('div1'))


document.write('<div id="div2" class="menu">');
for(i=0; i<quality.length; i++)
{document.write('<a href="'+quality[i][1]+'">'+quality[i][0]+'</a>')}
document.write('</div>');
checkit(document.getElementById('div2'))


function checkit(divobj)
{  if(divobj.hasChildNodes())
	{	for(i=0; i<divobj.childNodes.length; i++)
		{ 	if(divobj.childNodes[i].href.indexOf("#")==-1)
			{ }
			else{divobj.childNodes[i].className="current";}
		}
	}
}

var ie4=document.all;
var dom=document.getElementById &&! ie4;
var ns4 = document.layers;
var opera = navigator.userAgent.indexOf('opera') != -1

var menuobj = null;

function iecompat()
{ return (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body; }

function gety(what)
{ var objtop = what.offsetTop;
  var objp = what.offsetParent;
  
  while(objp)
  { objtop = objtop+objp.offsetTop;
    objp = objp.offsetParent;
  }
  return objtop;

}

function gettoppos(what, offsettype)
{ var topy = gety(what);
  var winheight = (!opera)? iecompat().scrollTop+iecompat().clientHeight : window.pageYOffset+window.innerHeight;
  var maxheight = topy+menuobj.offsetHeight;
  
  if(winheight < maxheight)
  { var objy = topy-(menuobj.offsetHeight);
 }
  else{objy = topy+what.offsetHeight;}
  return objy;
}

function getx(what)
{ var objleft = what.offsetLeft;
  var objp = what.offsetParent;
  while(objp)
  { objleft = objleft+objp.offsetLeft;
    objp = objp.offsetParent;
  }
	return objleft;	
}

function getleftpos(what, offsettype)
{ var leftx = getx(what);
  var winwidth = (!opera)? iecompat().scrollLeft+iecompat().clientWidth : window.pageXOffset+window.innerWidth;
  var maxwidth = leftx+menuobj.offsetWidth;
  
  if(winwidth < maxwidth)
  { var objx = winwidth - menuobj.offsetWidth}
  else
  {objx = leftx;}
  return objx;
  }


function dropmenu(obj,e)
{  if(window.event) window.event.cancelBubble=true;
   else if(e.stopPropagation) e.stopPropagation();
   
   if(menuobj != null)
   {hidemenu();}
   
   menuobj = document.getElementById(obj.rel)
   cleardelay()
   
   if(ie4 || dom)
   {menuobj.style.visibility="visible";
    menuobj.style.top = gettoppos(obj,"top")+"px"; 
	menuobj.style.left = getleftpos(obj,"left")+"px"; 
	}
	
	if(ns4)
   {menuobj.visibility="visible";
    menuobj.clip.top = gettoppos(obj,"top")+"px"; 
	menuobj.clip.left = getleftpos(obj,"left")+"px"; 
	}
	
	if(opera)
   {menuobj.style.visibility="visible";
    menuobj.pixelTop = gettoppos(obj,"top")+"px"; 
	menuobj.pixelLeft = getleftpos(obj,"left")+"px"; 
	}
   
   menuobj.onmouseover=function()
   {cleardelay();
    prev = obj.className;
   	obj.className = "current"; 
	}
	
   menuobj.onmouseout=function()
   {delayhide();
   obj.className = prev ;}

}

function delayhide()
{stopit = setTimeout('hidemenu()',200);}

function hidemenu()
{menuobj.style.visibility="hidden";}

function cleardelay()
{ if(typeof stopit != "undefined")
	clearTimeout(stopit);
}

// -------------------------------------------------------------- date and time ------------------------------------------------------------------

function datetime()
{
var month=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var dplace = document.getElementById('buttons1');

var todate = new Date();
var today = todate.getDate();
var months = todate.getMonth()+1 ;
var year = todate.getFullYear();

var hour = todate.getHours();
var minute = todate.getMinutes();
var sec = todate.getSeconds();

var dn="AM";

if(hour>=12)
{hour -= 12; dn="PM"}
else{ dn = "AM";}

if(hour==0){hour=12;}

if(hour<10){hour = "0"+hour;}
if(minute<10){minute = "0"+minute;}
if(sec<10){sec = "0"+sec;}

dplace.innerHTML=today+" . "+months+" . "+year+" / "+hour+":"+minute+" "+dn;
dplace.style.color="#F85200";
}

if(window.addEventListener)
{window.addEventListener('load',function(){setInterval('datetime()',1000)},false)}
else if(window.attachEvent)
{window.attachEvent('onload',function(){setInterval('datetime()',1000)})}
else if(document.getElementById)
{window.onload=function(){setInterval('datetime()',1000)}}