var eqList = new Array();
eqList[0] = '<b>&#8220;TiO<sup>2+</sup>&#8221; (aq) + 2H<sup>2</sup> + <i>e</i> = Ti<sup>3+</sup> + H<sub>2</sub>O &nbsp;&nbsp;&nbsp;&nbsp;E<sup>0</sup>=<i>ca</i>.0.1V</b>';
eqList[1] = '<b><sub>11</sub>Na<sup>23</sup> + <sub>8</sub>O<sup>16</sup> + Electrical Excitation + ATP Energy = <sub>19</sub>K<sup>39</sup></b> + <b>Bio Energy</b>';
eqList[2] = '<b><sub>11</sub>Na<sup>23</sup> + Electrical Excitation + <sub>8</sub>O<sup>16</sup> = <sub>19</sub>K<sup>39</sup></b> + <b>Energy</b>';
eqList[3] = '<b>SMI ANALYTICAL: X-Ray diffraction Laboratory</b>';
   
var selImg = new Array();
var selImgCount = 1;
var incr = 1;
var selectTimer = null;
var selObj = null;
var lastItem = null;
var selRow = "O";
   		
eqCount = 1;
var eqObj = null;
        
//                                                                
function doSwap() {
eqObj = getIdObj("eqlife");
if ( eqObj ) eqObj.innerHTML = eqList[eqCount];
doInitSelecter();
}
//                                                                
function doInitSelecter(){
selImg[ 0] = new Image();
selImg[ 1] = new Image();
selImg[ 2] = new Image();
selImg[ 3] = new Image();
selImg[ 4] = new Image();
selImg[ 5] = new Image();
selImg[ 6] = new Image();
selImg[ 7] = new Image();
selImg[ 8] = new Image();
selImg[ 9] = new Image();
selImg[10] = new Image();
selImg[11] = new Image();
selImg[12] = new Image();
    		
selImg[ 0].src = "img/select00.jpg";
selImg[ 1].src = "img/select01.jpg";
selImg[ 2].src = "img/select02.jpg";
selImg[ 3].src = "img/select03.jpg";
selImg[ 4].src = "img/select04.jpg";
selImg[ 5].src = "img/select05.jpg";
selImg[ 6].src = "img/select06.jpg";
selImg[ 7].src = "img/select07.jpg";
selImg[ 8].src = "img/select08.jpg";
selImg[ 9].src = "img/select09.jpg";
selImg[10].src = "img/select10.jpg";
selImg[11].src = "img/select11.jpg";
selImg[12].src = "img/select12.jpg";
    		
selObj = getIdObj("selector");
}
//                                                                
function doStartRotateSelect(){
if ( selectTimer ) return;
doRotateSelect();
}
//                                                                
function doRotateSelect(){
if ( lastItem ) doHide( lastItem );
if ( selObj ) {
//	if ( incr > 0 ) {
//	   if ( selImgCount==selImg.length-1 )	incr = -1;
//  } else {
//     if ( selImgCount<=1 ) incr = 1;
//  }
if ( selImgCount==selImg.length-1 ) selImgCount = 0;
selImgCount += incr;
selObj.src = selImg[selImgCount].src;
if ((selRow=="A" && selImgCount==12) ||
    (selRow=="B" && selImgCount== 3) ||
    (selRow=="C" && selImgCount== 7) ) {
    clearTimeout( selectTimer );
    selectTimer = null;
    return;
    }
}
selectTimer = setTimeout("doRotateSelect()",200);
}
//                                                                
function doStopRotateSelect(){
if ( selectTimer ) {
    clearTimeout( selectTimer );
    selectTimer = null;
    incr = 1;
    selImgCount = 0;
    selObj.src = selImg[0].src;
    }
}
//                                                                
function doStartEQ(){
if ( eqObj ) {
//	if ( (fixNum(eqObj.style.left)*1) > (fixNum(document.body.clientHeight)*1) ) {
    if ( (fixNum(eqObj.style.left)) < -(eqList[eqCount].length*3) ) { //> (799) ) {
        eqCount++;
        if ( eqCount>=eqList.length ) eqCount = 0;
        eqObj.innerHTML = eqList[eqCount];
//        eqObj.style.left = (800); //-( (eqList[eqCount].length*2)+(1*20) );
//      alert( eqObj.style.left );
        }
//    eqObj.style.left = ((fixNum(eqObj.style.left)*1) - (1*1));
//    alert("Msg: "+eqObj.message);
    eqObj.start();
    }
//setTimeout("doStartEQ()",20);
}
//																						
var trailimage=["favicon.gif", 16, 16] //image path, plus width and height
var offsetfrommouse=[16,8] //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0 //duration in seconds image should remain visible. 0 for always.

if (document.getElementById || document.all)
    document.write('<div id="trailimageid" style="position:absolute; z-index: 99; visibility:visible; left:0px; top:0px; width:1px; height:1px"><img src="'+trailimage[0]+'" border="0" width="'+trailimage[1]+'px" height="'+trailimage[2]+'px"></div>')

function gettrailobj(){
    if (document.getElementById)
        return document.getElementById("trailimageid").style
    else if (document.all)
        return document.all.trailimagid.style
}

function truebody(){
    return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail(){
    gettrailobj().visibility="hidden"
    document.onmousemove=""
}

function followmouse(e){
    var xcoord=offsetfrommouse[0]
    var ycoord=offsetfrommouse[1]
    if (typeof e != "undefined"){
        xcoord+=e.pageX
        ycoord+=e.pageY
    }
    else 
    if (typeof window.event !="undefined"){
        xcoord+=truebody().scrollLeft+event.clientX
        ycoord+=truebody().scrollTop+event.clientY
    }

    var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
    var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
    if (xcoord+trailimage[1]+3>docwidth || ycoord+trailimage[2]> docheight)
        gettrailobj().display="none"
    else 
        gettrailobj().display=""
        gettrailobj().left=xcoord+"px"
        gettrailobj().top=ycoord+"px"
}

document.onmousemove=followmouse;

if (displayduration>0)
    setTimeout("hidetrail()", displayduration*1000)

function mailenquiry() {
var head, body, doc;
head = "mailto:SMI Analytical - South Africa<smi@smianalytical.com>?subject=Analytical Consultation Request";
body = "\n"
+"I have come across your analytical services on the \n"
+"internet and I would like to know the following please: \n\n\n\n"
+"Regards,\n\n\nTel : \nCell: \nFax : \n";
doc = head + "&body=" + escape(body);
location.href = doc;
}
