var sim= new Array();
var radius=200;
var radius1=165;
var step=30;
var Xc=291;
var Yc=214;
var theta=90;
var c=new Array(6);
var n=1;
for(var i=1;i<=6;i++){
    c[i]=new Array(2);
    c[i][0]=0;
    c[i][1]=0;    
}
    
function rotate(){
   //alert('sims are not visible yet');
   sim= new Array();
   for(var i=1;i<=6;i++){
     sim[i]=document.getElementById('sim'+i);
     sim[i].style.visibility="visible";
   }
  //alert('sims are visible now');
  //alert('click to start rotation');
  move();
}
function  move(){  
    getXY();
    if(theta>=90)   n=2;
    if(theta>=138)   n=3;
    if(theta>=176)   n=4;
    if(theta>=212)   n=5;
    if(theta>=268)   n=6;
    if(theta>=319)   n=7;
    for(var i=n;i<=5;i++){
        c[i][0]=c[i+1][0];
        c[i][1]=c[i+1][1];
    }

    for(var p=n;p<=6;p++){        
        sim[p].style.left=""+ (Math.ceil(c[p][0])-76) + "px";        
        sim[p].style.top=""+ (Math.ceil(c[p][1])-41) + "px";
    }
    theta+=1;
    if(n<=6)
        setTimeout("move()", 20);
}
function getXY(){   
   c[6][0]=Xc + radius*Math.cos((theta*22)/(7*180)) ;
   c[6][1]=Yc + radius1*Math.sin(theta*22/(7*180));
}

function validateLogin(){
   var uname=document.getElementById('tb1');
   var pass=document.getElementById('tb2');
   if(uname == null || uname.value==''||pass==null || pass.value == ''){
       document.getElementById('errorMsg').style.visibility='visible';       
       return false;
  }
 document.getElementById('bt_go').disabled=true; 
 return true;
}
function underline(link,action){    
  if(action==1)
   link.style.textDecoration="underline";
  else
   link.style.textDecoration="none";
}
function alignMiddle(){
    document.getElementById('wrapper').style.left=""+(Math.ceil((screen.width-1024)/2))+"px";
}