function highlight()
{ 
var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
var strTest = sPage;
switch(strTest)
  {
	case 'index.htm':
	var sel=document.getElementById("home");			
    sel.className="selected";
    hide(1,1);
	break;		
	
	case 'aboutus.htm':
	case 'management.htm':
	case 'infra.htm':
	case 'sales.htm':
	case 'awards.htm':		
	case 'award1.htm':
	var sel=document.getElementById("about");			
    sel.className="selected";
    hide(1,2);
	break;
	
	case 'cntct.htm':
	var sel=document.getElementById("contact");			
    sel.className="selected";	
    hide(4,4);
	break;
	
	case 'rmc.htm':	
	case 'ps.htm':
	case 'esp.htm':
	case 'qsc.htm':
	var sel=document.getElementById("rmc");			
    sel.className="selected";	
    hide(3,4);
	break;
	
	case 'projects.htm':
	case 'ongoing.htm':
	case 'completed.htm':
	case 'hallmark.htm':
	var sel=document.getElementById("projects");			
    sel.className="selected";		
    hide(2,3);
	break;			
	default:	
	break;
   }
}
var awardarray=[];
    awardarray[0]="Builders Association of India.";
    awardarray[1]="Schwing Stetter (India) Pvt Ltd.";
    awardarray[2]="Leighton Contractors (India) Pvt Ltd.";
    awardarray[3]="UCAL Polymer Industries Ltd.";
    awardarray[4]="Orchid Chemicals & Pharmaceuticals ltd.";
    awardarray[5]="Rayala Corporation Private Ltd.";
    awardarray[6]="Toyo Engineering Ltd.";
    awardarray[7]="Fujita Corporation.";
	awardarray[8]="Schwing Stetter (INDIA) Pvt. Ltd.";

    var currentimgarr1=[];    
    currentimgarr1[0]="./images/current/landt1.gif"; 
	currentimgarr1[1]="./images/current/landt2.gif"; 
    currentimgarr1[2]="./images/current/landt3.gif"; 
    var currentimgarr2=[];    
    currentimgarr2[0]="./images/current/cosma1.gif";
    var currentimgarr3=[];
    currentimgarr3[0]="./images/current/yoruzo1.gif";
    currentimgarr3[1]="./images/current/yoruzo2.gif";
    currentimgarr3[2]="./images/current/yoruzo3.gif";  
    var currentimgarr4=[];    
    currentimgarr4[0]="./images/current/kobelco1.gif";
    currentimgarr4[1]="./images/current/kobelco2.gif";
    currentimgarr4[2]="./images/current/kobelco3.gif";
	var currentimgarr5=[];    
    currentimgarr5[0]="./images/current/nissan1.gif";
	var currentimgarr6=[];    
    currentimgarr6[0]="./images/current/virgo1.gif";
    currentimgarr6[1]="./images/current/virgo2.gif";
    currentimgarr6[2]="./images/current/virgo3.gif";
	var currentimgarr7=[];    
    currentimgarr7[0]="./images/current/sanmina1.gif";
	var currentimgarr8=[];    
    currentimgarr8[0]="./images/current/national1.gif";

    var imgarr1=[]
    imgarr1[0]="./images/completed/tacle1.gif";
    imgarr1[1]="./images/completed/tacle2.gif";
    imgarr1[2]="./images/completed/tacle3.gif";
    var imgarr2=[];   
    imgarr2[0]="./images/completed/foxcon1.gif";
    imgarr2[1]="./images/completed/foxcon2.gif";
    imgarr2[2]="./images/completed/foxcon3.gif"; 
    imgarr2[3]="./images/completed/foxcon4.gif"; 
    var imgarr1=[];    
    imgarr1[0]="./images/completed/nokia1.gif";
    imgarr1[1]="./images/completed/nokia2.gif";
    imgarr1[2]="./images/completed/nokia3.gif";
    var imgarr2=[];    
    imgarr2[0]="./images/completed/sanmina1.gif";
    imgarr2[1]="./images/completed/sanmina2.gif";
    imgarr2[2]="./images/completed/sanmina3.gif"; 
    imgarr2[3]="./images/completed/sanmina4.gif"; 
    var imgarr3=[];    
    imgarr3[0]="./images/completed/winwind1.gif";
    imgarr3[1]="./images/completed/winwind2.gif";
    imgarr3[2]="./images/completed/winwind3.gif";
    imgarr3[3]="./images/completed/winwind4.gif";
    imgarr3[4]="./images/completed/winwind5.gif";

    var imgarr4=[];    
    imgarr4[0]="./images/completed/schwing1.gif";
    imgarr4[1]="./images/completed/schwing2.gif";
    imgarr4[2]="./images/completed/schwing3.gif"; 
    imgarr4[3]="./images/completed/schwing4.gif";
    
    var imgarr5=[];    
    imgarr5[0]="./images/completed/nokia_main1.gif";
     var imgarr6=[]
    imgarr6[0]="./images/completed/nissan1.gif";
    imgarr6[1]="./images/completed/nissan2.gif";
    imgarr6[2]="./images/completed/nissan3.gif";
    var imgarr7=[];    
    imgarr7[0]="./images/completed/Rayala_techno1.gif";
      
    var imgarr8=[]
    imgarr8[0]="./images/completed/unipres1.gif";
    imgarr8[1]="./images/completed/unipres2.gif";
    imgarr8[2]="./images/completed/unipres3.gif";
    imgarr8[3]="./images/completed/unipres4.gif";    
    var imgarr9=[]
    imgarr9[0]="./images/completed/winwind_corp1.gif";
    imgarr9[1]="./images/completed/winwind_corp2.gif";
    imgarr9[2]="./images/completed/winwind_corp3.gif";
	var imgarr10=[]
    imgarr10[0]="./images/completed/kobelco1.gif";
    imgarr10[1]="./images/completed/kobelco2.gif";
    imgarr10[2]="./images/completed/kobelco3.gif";
	var imgarr11=[]
    imgarr11[0]="./images/completed/galaxy1.gif";
    imgarr11[1]="./images/completed/galaxy2.gif";
	var imgarr12=[]
    imgarr12[0]="./images/completed/toshiba1.gif";
    imgarr12[1]="./images/completed/toshiba2.gif";
    imgarr12[2]="./images/completed/toshiba3.gif";
	var imgarr13=[]
    imgarr13[0]="./images/completed/virgo1.gif";
    imgarr13[1]="./images/completed/virgo2.gif";
    imgarr13[2]="./images/completed/virgo3.gif";
          
var current=0,imagnum=0,total=0,arraynum=1,clear1;
function slide(mode)
{
    imgnum=document.getElementById("count").value;
    total=document.getElementById("total").value;
    arraynum=document.getElementById("array").value;     
	
       if((imgnum-1)<0 && mode=='prev')
       {
        return;
       }
       if((parseInt(imgnum)+1)>=total && mode=='next')
       {
        return;
       }
       
       if(mode=='initial')
       {
        document.getElementById("count").value=0;
        imgnum=0;
       }
       if(mode=="next")
       {
            imgnum=parseInt(imgnum)+1;
            if(imgnum>=total)
                imgnum=parseInt(total-1);           
            document.getElementById("count").value=imgnum;
       }
       
       if(mode=="prev")
       {
            imgnum=imgnum-1;
            if(imgnum<0)
                imgnum=0;
            document.getElementById("count").value=imgnum;
       }      
        if (window.sidebar)
        {
            value=0;
            document.getElementById("showimg").style.MozOpacity=0;
            clear1=setInterval("MOZ()",100)
        }
        if (document.all)
        {
            value=0;
            document.getElementById("showimg").filters[0].opacity=0;
            clear1=setInterval("IE()",100)
        }
         if(arraynum==1)
            document.getElementById('showimg').src=imgarr1[imgnum]; 
         if(arraynum==2)
            document.getElementById('showimg').src=imgarr2[imgnum];
         if(arraynum==3)
            document.getElementById('showimg').src=imgarr3[imgnum]; 
         if(arraynum==4)
            document.getElementById('showimg').src=imgarr4[imgnum];
         if(arraynum==5)
            document.getElementById('showimg').src=imgarr5[imgnum]; 
         if(arraynum==6)
            document.getElementById('showimg').src=imgarr6[imgnum];
         if(arraynum==7)
            document.getElementById('showimg').src=imgarr7[imgnum]; 
         if(arraynum==8)
            document.getElementById('showimg').src=imgarr8[imgnum];             
         if(arraynum==9)
            document.getElementById('showimg').src=imgarr9[imgnum]; 
		 if(arraynum==10)
            document.getElementById('showimg').src=imgarr10[imgnum];
		 if(arraynum==11)
            document.getElementById('showimg').src=imgarr11[imgnum];  
		 if(arraynum==12)
            document.getElementById('showimg').src=imgarr12[imgnum];  
		 if(arraynum==13)
            document.getElementById('showimg').src=imgarr13[imgnum]; 
                    
}

function setarray(num)
{
    document.getElementById("count").value=0;
    document.getElementById('array').value=num;   
    for(i=1;i<=13;i++)
    {
        var divid="Div"+i;
        try{
        document.getElementById(divid).style.display="none";
        if(document.getElementById('img'+i).src.match('over')!=null)
            document.getElementById('img'+i).src=document.getElementById('img'+i).src.replace(/_over.gif/,'.gif');    
		          
        document.getElementById('img'+i).className='old';    
       }catch(e){} 
    }       
    document.getElementById('img'+num).src=document.getElementById('img'+num).src.replace(/.gif/,'_over.gif');
    document.getElementById('img'+num).className='current';
    if(num==1)
        document.getElementById("total").value= imgarr1.length;
     if(num==2)
       document.getElementById("total").value= imgarr2.length;
     if(num==3)
        document.getElementById("total").value= imgarr3.length;
     if(num==4)
        document.getElementById("total").value= imgarr4.length;
     if(num==5)
       document.getElementById("total").value= imgarr5.length;
     if(num==6)
        document.getElementById("total").value= imgarr6.length;
    if(num==7)
       document.getElementById("total").value= imgarr7.length;
    if(num==8)
        document.getElementById("total").value= imgarr8.length;
    if(num==9)
        document.getElementById("total").value= imgarr9.length;
	if(num==10)
        document.getElementById("total").value= imgarr10.length;
	if(num==11)
        document.getElementById("total").value= imgarr11.length;
	if(num==12)
        document.getElementById("total").value= imgarr12.length;
	if(num==13)
        document.getElementById("total").value= imgarr13.length;
             
    var divid="Div"+num;
    document.getElementById(divid).style.display="block";
    slide('initial');
}
function slideCurrent(mode)
{
    imgnum=document.getElementById("count").value;
    total=document.getElementById("total").value;
    arraynum=document.getElementById("array").value;   
	
       if((imgnum-1)<0 && mode=='prev')
       {
        return;
       }
       if((parseInt(imgnum)+1)>=total && mode=='next')
       {
        return;
       }
       
       if(mode=='initial')
       {
        document.getElementById("count").value=0;
        imgnum=0;
       }
       if(mode=="next")
       {
            imgnum=parseInt(imgnum)+1;
            if(imgnum>=total)
                imgnum=parseInt(total-1);           
            document.getElementById("count").value=imgnum;
       }
       
       if(mode=="prev")
       {
            imgnum=imgnum-1;
            if(imgnum<0)
                imgnum=0;
            document.getElementById("count").value=imgnum;
       }      
        if (window.sidebar)
        {
            value=0;
            document.getElementById("showimg").style.MozOpacity=0;
            clear1=setInterval("MOZ()",100)
        }
        if (document.all)
        {
            value=0;
            document.getElementById("showimg").filters[0].opacity=0;
            clear1=setInterval("IE()",100)
        }
         if(arraynum==1)
            document.getElementById('showimg').src=currentimgarr1[imgnum]; 
         if(arraynum==2)
            document.getElementById('showimg').src=currentimgarr2[imgnum];
         if(arraynum==3)
            document.getElementById('showimg').src=currentimgarr3[imgnum]; 
         if(arraynum==4)
            document.getElementById('showimg').src=currentimgarr4[imgnum];
         if(arraynum==5)
            document.getElementById('showimg').src=currentimgarr5[imgnum]; 
         if(arraynum==6)
            document.getElementById('showimg').src=currentimgarr6[imgnum];
         if(arraynum==7)
            document.getElementById('showimg').src=currentimgarr7[imgnum]; 
         if(arraynum==8)
            document.getElementById('showimg').src=currentimgarr8[imgnum];             

                    
}
function setCurrentarray(num)
{
    document.getElementById("count").value=0;
    document.getElementById('array').value=num;
    for(i=1;i<=8;i++)
    {
        var divid="Div"+i;
        try{
        document.getElementById(divid).style.display="none";
        if(document.getElementById('img'+i).src.match('over')!=null)
            document.getElementById('img'+i).src=document.getElementById('img'+i).src.replace(/_over.gif/,'.gif');    
		          
        document.getElementById('img'+i).className='old';    
       }catch(e){} 
    }       
    document.getElementById('img'+num).src=document.getElementById('img'+num).src.replace(/.gif/,'_over.gif');
    document.getElementById('img'+num).className='current';	
   
    if(num==1)
        document.getElementById("total").value= currentimgarr1.length;
     if(num==2)
        document.getElementById("total").value= currentimgarr2.length;
    if(num==3)
        document.getElementById("total").value= currentimgarr3.length;  
     if(num==4)
        document.getElementById("total").value= currentimgarr4.length;   
     if(num==5)
        document.getElementById("total").value= currentimgarr5.length;   		                 
     if(num==6)
        document.getElementById("total").value= currentimgarr6.length;   		                 
     if(num==7)
        document.getElementById("total").value= currentimgarr7.length;   	
	 if(num==8)
        document.getElementById("total").value= currentimgarr8.length; 	                 

    var divid="Div"+num;
    document.getElementById(divid).style.display="block";
    slideCurrent('initial');
}
var plus=1;
var minus=0;
function IE()
{
    if (value<100&&plus)
    value+=25
    else{
    plus=0
    minus=0
    }
    if(value>90)
    {
        clearInterval(clear1);    
    }
    document.getElementById("showimg").filters[0].opacity=value;
}
function MOZ()
{
    if (value<100&&plus)
    value+=25
    else{
    plus=0
    minus=0
    }
    if(value>90)
    {
        clearInterval(clear1);    
    }    
    document.getElementById("showimg").style.MozOpacity=parseInt(value)/100;
}

var newsarray=[];
    newsarray[3]="Our turnover for the year <b>2010-2011</b> was <b>Rs.108 crores.</b>";
    newsarray[2]="Current projects include <b>Utility Buildings for L&T - Ship Building, Cosma International India, Yorozu JBM, Shimizu-Kobelco, Nissan - Press Pit, Virgo Engineers - Coimbatore, Sanmian SCI, National College - Trichy</b>";
    newsarray[1]="Our new Ready Mix Concrete plant at Oragadam, Tamilnadu can produce up to 5000 - 6000 m<sup>3</sup> per month to supply company and customer requirements.";
    newsarray[0]="Our new Ready Mix Concrete plant at Sricity, Andhra Pradesh can produce up to 7000 - 8000 m<sup>3</sup> per month to supply company and customer requirements.";

function shownews(mode)
{
    var newsnum=document.getElementById("newscount").value;
     var newstotal=document.getElementById("newstotal").value;
   if(mode=="next")
   {
        newsnum=parseInt(newsnum)+1;
        if(newsnum>=newstotal)
            newsnum=parseInt(newstotal-1);
        document.getElementById("newscount").value=newsnum;
   }
   if(mode=="prev")
   {
        newsnum=newsnum-1;
        if(newsnum<0)
            newsnum=0;
        document.getElementById("newscount").value=newsnum;
   }
   document.getElementById('newsdiv').innerHTML=newsarray[newsnum];
}
function setnewsarray()
{
    document.getElementById("newstotal").value= newsarray.length;
    document.getElementById("newscount").value=-1;   
    shownews('next');
    if(newsarray.length==1)
    {
        document.getElementById('prev').style.display="none";
        document.getElementById('next').style.display="none";
    }
}
function mover(imgname,obj)
{
     obj.src="./images/"+imgname+"_over.gif";
}
function mout(imgname,obj)
{
        if(obj.className=='old')
            obj.src="./images/"+imgname+".gif";
}
function measureHeight()
{
    var cheight=document.getElementById('divContainer').offsetHeight;
    
    var sPath = window.location.pathname;
    var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
    var strTest = sPage;
    switch(strTest)
    {
	case 'index.htm':
	case 'qp.htm':
	case 'sp.htm':
	case 'iso.htm':
	case 'cntct.htm':
	case 'rmc.htm':
	case 'sitemap.htm':
	    document.getElementById('divGrey').style.height=parseInt(cheight-502)+"px";
	break;	
	default:	
	    document.getElementById('divGrey').style.height=parseInt(cheight-478)+"px";
	break;
   }
}
function hide(obj1,obj2)
{
    var i,imgid;    
    imgid="Img"+obj1;
    document.getElementById(imgid).style.visibility="hidden";
    imgid="Img"+obj2;
    document.getElementById(imgid).style.visibility="hidden";
}
function show()
{
     for(i=1;i<=4;i++)
    {
        var imgid="Img"+i;
        document.getElementById(imgid).style.visibility="visible";
    }
    highlight();
}

function completedthumb(num)
{
    var divid,i;
    for(i=1;i<=2;i++)
    {
        divid="imgdiv"+i;
        document.getElementById(divid).style.display="none";      
    }
    divid="imgdiv"+num;
    document.getElementById(divid).style.display="block";
}
function thumbnext(mode)
{
    var count=document.getElementById('thumb').value;
    if(mode=='next' && (parseInt(count)+1)<3)
        count=parseInt(count)+1;
    else if(mode=='next')
        return;
    if(mode=='prev' && (parseInt(count)-1)>0)
        count=parseInt(count)-1;
    else if(mode=='prev')
        return;
    document.getElementById('thumb').value=count;
    completedthumb(count);
}
function award()
{
    var sPath = window.location.toString();
    var sPage = sPath.split('?');
    var strTest = sPage[1];
    document.getElementById('awardimg').src="./images/"+strTest;
    strTest=sPage[1].split('_');
    strTest=strTest[1].split('.');
    document.getElementById('awardtext').innerHTML="Award from "+awardarray[(strTest[0]-1)];
    document.getElementById('awardimg').title=awardarray[(strTest[0]-1)];
}

