﻿// JScript File

pic1= new Image(); 
pic1.src=""; 
pic2= new Image(); 
pic2.src="/images/Buttons/icons/Changes1.jpg";
pic3= new Image(); 
pic3.src="/images/Buttons/icons/DocComment1.jpg";
pic4= new Image(); 
pic4.src="/images/Buttons/icons/DocDelete1.jpg";
pic5= new Image(); 
pic5.src="/images/Buttons/icons/DocDownload1.jpg";
pic6= new Image(); 
pic6.src="/images/Buttons/icons/DocRemove1.jpg";
pic7= new Image(); 
pic7.src="/images/Buttons/icons/DocView1.jpg";
pic8= new Image(); 
pic8.src="/images/Buttons/icons/DocViewNew1.jpg";
pic9= new Image(); 
pic9.src="/images/Buttons/icons/EventAccept1.jpg";
pic10= new Image(); 
pic10.src="/images/Buttons/icons/EventAccepta1.jpg";
pic11= new Image(); 
pic11.src="/images/Buttons/icons/EventDecline1.jpg";
pic12= new Image(); 
pic12.src="/images/Buttons/icons/EventDeclinea1.jpg";
pic13= new Image(); 
pic13.src="/images/Buttons/icons/EventDeclineNew1.jpg";
pic14= new Image(); 
pic14.src="/images/Buttons/icons/InviteYourself1.jpg";
pic15= new Image(); 
pic15.src="/images/Buttons/Login1.jpg";
pic16= new Image(); 
pic16.src="/images/Buttons/Submit1.jpg";
pic17= new Image(); 
pic17.src="/images/Buttons/SaveChanges1.jpg";
pic18= new Image(); 
pic18.src="/images/Buttons/SaveChangesB1.jpg";
pic19= new Image(); 
pic19.src="/images/Buttons/icons/DocNewView1.jpg";




//=============================================================
function ImgObjOnfocus(ImgObj){
  var what = ImgObj.src;
    if(what.indexOf(".gif") > 0){ 
      ImgObj.src = what.substring(0,what.indexOf(".gif"))+"1.gif"
    } 
    if(what.indexOf(".jpg") > 0){ 
      ImgObj.src = what.substring(0,what.indexOf(".jpg"))+"1.jpg"
    } 
}
//=============================================================
function ImgObjNofocus(ImgObj){
  var what = ImgObj.src;
    if(what.indexOf(".gif") > 0){ 
      ImgObj.src = what.substring(0,what.indexOf("1.gif"))+".gif"
    } 
    if(what.indexOf(".jpg") > 0){ 
      ImgObj.src = what.substring(0,what.indexOf("1.jpg"))+".jpg"
    } 
}

//=============================================================
function fncAreyouSure(){
  return confirm("Are you sure you wish to permanently delete this?");
}

//=============================================================
var nscape = (document.all)? false:true;
var openDiv = ""
//=============================================================
function showhideDiv(divName){

   if(document.body.clientWidth){
     var iwidth = document.body.clientWidth
   }else{
     var iwidth = window.innerWidth
   }
   
   if(iwidth > 1200){
     var iPosition = (((iwidth) /2)-340)
   }else{ 
     var iPosition = 265
   }
   
  if (openDiv == ""){
  }else{ 
    if (openDiv !=divName){ 
    closeDiv(openDiv);
   } 
  }   
   
    var DivObj = document.getElementById(divName);

   if(DivObj.style.visibility=="visible"){
     DivObj.style.visibility="hidden";
     //DivObj.style.position="absolute"; 
   }else{ 
     if(DivObj.style.left=="1px"){
       DivObj.style.left=iPosition;
     }
     DivObj.style.visibility="visible";
     DivObj.style.zIndex = "1"
     DivObj.style.top=""; 
     openDiv  = divName
     //DivObj.style.position="relative"; 
   }
   


}

//=============================================================
function showDiv(divName){

    var DivObj = document.getElementById(divName);
    DivObj.style.visibility="visible";
}

//=============================================================
function closeDiv(divName){
    var DivObj = document.getElementById(divName);
    DivObj.style.visibility="hidden";
}

//=============================================================
function showDivChangePosition(divName){

    var DivObj = document.getElementById(divName);
    DivObj.style.position="relative"; 
    DivObj.style.visibility="visible";
}

//=============================================================
function closeDivChangePosition(divName){
    var DivObj = document.getElementById(divName);
    DivObj.style.position="absolute"; 
    DivObj.style.visibility="hidden";
}

//======================================================= 
function formSetFocus(objName){
  if(document.getElementById(objName)){
    var obj = document.getElementById(objName);
    obj.focus();
  }
}	
