// JavaScript Document
function viewdiv(did){
 document.getElementById(did).style.display='block';	
	
}

function hidediv(did){
 document.getElementById(did).style.display='none';	
}

function hideform(){
 document.getElementById("frmlogin").style.display='none';
 document.getElementById('bluesquare').style.height=0+'px'
}

function moveTo(elm,dist) {
	
var x=parseInt(elm.style.height);
var distance=dist-x;
var tot=x+Math.ceil((distance/2));
document.getElementById("bluesquare").style.display='block';
elm.style.height=tot+'px';
function c() {
moveTo(elm,dist);
}
 if(distance==0) {
clearTimeout(timer);
return;
}
timer=setTimeout(c,100);
document.getElementById("bluesquare").innerHTML='<form name="frmlogin" action="login.php" method="post" id="frmlogin" "style="padding:0px; maring:0px;"><br />&nbsp;&nbsp;&nbsp;<span class="page_text">User Name</span><br />&nbsp;&nbsp;&nbsp;<input type="text" name="username" id="username" /><br />&nbsp;&nbsp;&nbsp;<span class="page_text">Password</span><br />&nbsp;&nbsp;&nbsp;<input type="password" name="password" id="password" /><br />&nbsp;&nbsp;&nbsp;<a href="javascript:validate();" class="flink" >Login</a>&nbsp;&nbsp;<a href="javascript:hideform();" class="flink" >Close</a><br /><br /></form>';
}

function changeWidthWrong(elm,toWidth) {
             var beginningWidth = parseInt(elm.style.height);
            for(i=beginningWidth;i<=toWidth;i+=10) {
                       var add               = beginningWidth+i;
                      elm.style.height  = add+'px';
           }
}
function changeWidthB(elm,toWidth) {
             var beginningWidth = parseInt(elm.style.height)+10;
       elm.style.height  = beginningWidth+'px';
}
function wrapchangeWidth() {
   changeWidthB(document.getElementById('bluesquare3'),400);
}
function changeWidthForReal() {
    for(i=1;i<=10;i++){
     setTimeout(wrapchangeWidth,100*i);
    }
}
function changeWidthFinal(elm,toWidth,delay){
 var height  = parseInt(elm.style.width);
 var change = toWidth-height;
 var total=width+Math.ceil((change/2));
 document.getElementById('debug').innerHTML='width:'+total+'px change:'+change+'px';
 
 elm.style.width=total+'px';
 function c() {
       changeWidthFinal(elm,toWidth,delay);
 }
 if(change==0) {
  clearTimeout(timer);
  return;
 }
 timer=setTimeout(c,delay);
}

/*menu*/
function mmLoadMenus() {
  if (window.mm_menu_1218095348_0) return;
  window.mm_menu_1218095348_0 =  new Menu("&nbsp;Company Profile",200,30,"Arial, Verdana, Tahoma",13,"#000000","#000000","#F3F8FC","#FFFFFF","left","middle",0,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_1218095348_0.addMenuItem("&nbsp;Vision","location='../vision.html'");
  mm_menu_1218095348_0.addMenuItem("&nbsp;Mission&nbsp;Statement","location='../mission.html'");
  mm_menu_1218095348_0.addMenuItem("&nbsp;Guiding&nbsp;Principle","location='../guiding-priniciples.html'");
   mm_menu_1218095348_0.fontWeight="bold";
   mm_menu_1218095348_0.hideOnMouseOut=true;
   mm_menu_1218095348_0.bgColor='#CCCCCC';
   mm_menu_1218095348_0.menuBorder=0;
   mm_menu_1218095348_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1218095348_0.menuBorderBgColor='#FFFFFF';


  window.mm_menu_1218131615_0 = new Menu("root",160,30,"Arial, Verdana, Tahoma",13,"#000000","#000000","#F3F8FC","#FFFFFF","left","middle",0,0,1000,0,0,true,true,true,0,true,true);
  mm_menu_1218131615_0.addMenuItem("&nbsp;Group&nbsp;&nbsp;Profile","location='../group-profile.html'");
  mm_menu_1218131615_0.addMenuItem(mm_menu_1218095348_0,"location='#'");
  mm_menu_1218131615_0.addMenuItem("&nbsp;People","location='../people.html'");
  mm_menu_1218131615_0.addMenuItem("&nbsp;Clients","location='../clients.html'");
  mm_menu_1218131615_0.addMenuItem("&nbsp;Corporate&nbsp;Ethics","location='../corporate-ethics.html'");
   mm_menu_1218131615_0.fontWeight="bold";
   mm_menu_1218131615_0.hideOnMouseOut=true;
   mm_menu_1218131615_0.childMenuIcon="images/arrows.gif";
   mm_menu_1218131615_0.bgColor='#CCCCCC';
   mm_menu_1218131615_0.menuBorder=0;
   mm_menu_1218131615_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1218131615_0.menuBorderBgColor='#FFFFFF';

mm_menu_1218131615_0.writeMenus();
} // mmLoadMenus()

/*form validate*/
function validate(){
	if(document.getElementById("username").value==""){
		alert("Enter User Name");
		document.getElementById("username").focus();
	}
	else if(document.getElementById("password").value==""){
		alert("Enter  Password");
		document.getElementById("password").focus();
	}
	else{
	    document.getElementById("frmlogin").submit();	
	}
}

