function init(){
 		
         menuInit();      
         contentScrollInit();  
         newsScrollInit();
         rotateInit();
}


/*menu code start */
function setMenu(){
		
       limit=771;
		if(navigator.appName.indexOf("Microsoft")!=-1){//ie
		       width2= document.body.clientWidth;
  	           limit=799;
	   			   if(width2>limit)offset_=(width2-limit)/2;
				   else offset_=0;
  		       offset2=5;
  		       offset3=-1;
   					document.getElementById('company1').style.width="121px";
					document.getElementById('solutions1').style.width="316px";
					document.getElementById('clients1').style.width="105px";
					document.getElementById('knowledge1').style.width="187px";
					document.getElementById('contact1').style.width="132px";
					

			}
		else if (navigator.appName=="Netscape") {//mozilla
		       limit=792;
			   width2= document.documentElement.scrollWidth;
					if(width2>limit)offset_=(width2-limit)/2;
					else offset_=0;
				offset2=0;
				offset3=0;
		}
					document.getElementById('company1').style.left=(106+offset2+Math.floor(offset_));
					document.getElementById('solutions1').style.left=(228+offset2+Math.floor(offset_));
					document.getElementById('clients1').style.left=offset3+(355+offset2+Math.floor(offset_));
					document.getElementById('knowledge1').style.left=offset3+(461+offset2+Math.floor(offset_));
					document.getElementById('contact1').style.left=offset3+(649+offset2+Math.floor(offset_));
	}

 	 function show(id){
 	 	 document.getElementById(id+"1").style.display="block";
 	 }
 	 function hide(id){
 	 	document.getElementById(id+"1").style.display="none";
 	 }
 	 function menuInit(){
		document.getElementById('company').style.display="none";
    	document.getElementById('solutions').style.display="none";
		document.getElementById('clients').style.display="none";
		document.getElementById('knowledge').style.display="none";
		document.getElementById('contact').style.display="none";
					
		document.body.innerHTML+='<div class="subMenuContent" id="company1" onmouseover="show(\'company\');" onmouseout="hide(\'company\')" >'+document.getElementById("company").innerHTML+'</div>';
		document.body.innerHTML+='<div class="subMenuContent" id="solutions1" onmouseover="show(\'solutions\');" onmouseout="hide(\'solutions\')" >'+document.getElementById("solutions").innerHTML+'</div>';
		document.body.innerHTML+='<div class="subMenuContent" id="clients1" onmouseover="show(\'clients\');" onmouseout="hide(\'clients\')" >'+document.getElementById("clients").innerHTML+'</div>';
		document.body.innerHTML+='<div class="subMenuContent" id="knowledge1" onmouseover="show(\'knowledge\');" onmouseout="hide(\'knowledge\')" >'+document.getElementById("knowledge").innerHTML+'</div>';
		document.body.innerHTML+='<div class="subMenuContent" id="contact1" onmouseover="show(\'contact\');" onmouseout="hide(\'contact\')" >'+document.getElementById("contact").innerHTML+'</div>';
		
        setMenu();
 	 	
 	 }	
	
/*menu code end 	*/





/*rotate code start	*/
	
	var rotateNumber=0;
	var rotateTimer;
	function rotate(){
		
		if(rotateNumber<ids.length){
	      	document.getElementById('slideContent').innerHTML=document.getElementById('cont'+ids[rotateNumber]).innerHTML;
	      	document.getElementById('slideName').innerHTML=document.getElementById('name'+ids[rotateNumber]).innerHTML;
	      	document.getElementById('picRotate').src=document.getElementById('img'+ids[rotateNumber]).src;
	      	
	      	
	      	rotateNumber++;
	      	 
	      	rotateTimer=setTimeout("rotate()",rotateTimeout);
		}else {rotateNumber=0;rotate();} 
		
		
	}
	function rotateInit(){
        if(document.getElementById('slideContent')&&document.getElementById('slideName'))
      	  rotate();
	}
/*rotate code end		*/
	

/*content scroll code start */

			 var increment=5;
			 var delay=10;
			 var timer;
			 var _height=1000;
			 function movedown(){
			 	initialTop=parseInt(document.getElementById('work').style.top);
				if(initialTop>-_height){
				document.getElementById('work').style.top=initialTop-increment+"px";
				timer=setTimeout("movedown()",delay);
				}

			 }

			 function moveup(){
			 	initialTop=parseInt(document.getElementById('work').style.top);
				if(initialTop<0){
				document.getElementById('work').style.top=initialTop+increment+"px";
				timer=setTimeout("moveup()",delay);
				}
			 } 	 
             function computeHeight(id){
             	html=document.getElementById(id).innerHTML;
             	html=html.toLowerCase();
             	height=html.length/10;
             	nrP=countInstances(html,'<p');
             	nrImg=countInstances(html,'<img');
             	nrBr=countInstances(html,'<br');
             	nrUl=countInstances(html,'<ul');
             	nrOl=countInstances(html,'<ol');
             	
             	
             	height+=nrBr*17;
             	height+=nrImg*185;
             	height+=nrP*17;
             	height+=nrUl*20;
             	height+=nrOl*20;
             	
             	//alert("inital height="+height+" \n nr imgs="+nrImg+"/n nr Br="+nrBr+"/n nr P="+nrP+" /n nrUl="+nrUl+" /n nrOl="+nrOl+" /n height="+height);
             	return height;
             }
             function countInstances(haystack, needle ) { 
             	   
				    var count = 0;
				    var offset = 0;
				    do {
				        offset = haystack.indexOf(needle, offset);
				        count += (offset != -1) ? 1 : 0;
				    } while (offset++ != -1)
				    return count
			 }
			 function contentScrollInit(){
		        if(document.getElementById('work')){
		          _height=computeHeight('work');
		          
	          
		           document.getElementById('work').style.top="0px";
		           
		           
		           if(_height<130){
		            document.getElementById('up').style.display='none';
		            document.getElementById('down').style.display='none';
		           }
		        }
			 	
			 }
 	/*content scroll code end */

 	
 	
 	/*news scroll code start */
			 
			 var timer1;
			 var _height1=1000;
			 function movedown1(){
			 	initialTop=parseInt(document.getElementById('news').style.top);
				if(initialTop>-_height1){
				document.getElementById('news').style.top=initialTop-increment+"px";
				timer1=setTimeout("movedown1()",delay);
				}

			 }

			 function moveup1(){
			 	initialTop=parseInt(document.getElementById('news').style.top);
				if(initialTop<0){
				document.getElementById('news').style.top=initialTop+increment+"px";
				timer1=setTimeout("moveup1()",delay);
				}
			 } 	 			 
			 function newsScrollInit(){
		        if(document.getElementById('news')){
		          
		           _height1=computeHeight('news');
		           document.getElementById('news').style.top="0px";
		           
		           
		           if(_height1<130){
		            document.getElementById('up1').style.display='none';
		            document.getElementById('down1').style.display='none';
		           }
		        }
			 	
			 }
 	/*news scroll code end*/