﻿/*--------------- check user login ---------------*/
        var xmlHttp;
        function userLogin()
        {
          //ShowLoadingMessage();
        try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          
          var emailid=document.getElementById("ctl00_txt_login_name").value;//user email
          var u_password=calcMD5(document.getElementById("ctl00_txt_login_password").value);//hash password
          
          
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
//               var div_left=document.getElementById("ctl00_Panel_login").style.left;
//               var div_top=document.getElementById("ctl00_Panel_login").style.top;
//               var div_width=document.getElementById("ctl00_Panel_login").offsetWidth;
//               var div_height=document.getElementById("ctl00_Panel_login").offsetHeight;
//               
//               document.getElementById("loading_div").style.display="";
//               document.getElementById("loading_div").style.top= div_top-div_height + "px";
//               document.getElementById("loading_div").style.left= div_left-div_width + "px";
               document.getElementById('ctl00_img_loading_login').style.display="";              
               document.getElementById('ctl00_Label_e').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('ctl00_img_loading_login').style.display ='none';
              
                if (xmlHttp.responseText=="yes")
               {
                 
                 document.getElementById('ctl00_Label_e').innerHTML = "Welcome to FusionSurface";
                 //alert(window.location.href);
                 window.location=window.location.href;
               }
               else
               {
                 
                 document.getElementById('ctl00_Label_e').innerHTML = "Sorry! information is wrong";
                 //document.getElementById("txt_email").focus();
               }
              }
            }
          xmlHttp.open("GET","handler/admin_login.ashx?user_id=" + emailid + "&user_pass=" + u_password,true);
          xmlHttp.send(null);
         }
     
     
     
     /* user news letter subscription */
     function insertNewsLetterMember()
     {
      var emailid=document.getElementById("txt_subs_image").value;//user email
       var status = 1;
          
    if(emailid=="")
    {
     alert("Please enter your email address for newsletter subscribtion");
     document.getElementById("txt_subs_image").focus();
    }
    else
    {
    
      
      
      try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
      
      xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {

            }
            if(xmlHttp.readyState==4)
              {
               // document.getElementById('ctl00_img_loading_login').style.display ='none';
              
             
              
                if (xmlHttp.responseText=="yes")
               {
                 
                alert("you have successfully subscribed the news letter");
                // document.getElementById('ctl00_Label_e').innerHTML = "Welcome to FusionSurface";
                 //alert(window.location.href);
                 //window.location=window.location.href;
               }
               else if(xmlHttp.responseText=="registred")
               {
                 alert("you have already subscribed the news letter");
                 //document.getElementById('ctl00_Label_e').innerHTML = "Sorry! information is wrong";
                 //document.getElementById("txt_email").focus();
               }
              }
            }
          xmlHttp.open("GET","handler/news_letter_registration.ashx?email=" + emailid + "&status=" + status,true);
          xmlHttp.send(null);
                  
      }
     }
         
/*------------------------------------------user registration-----------------------------------------------*/
/*-----------1---------------*/
function registrationValidate()
{
    var status=""; 
    if (document.getElementById("txt_name").value!="")
    {
        status="no";
        document.getElementById("val_userName").value="user name";
        return status;
    }
    else if(echeck(document.getElementById("txt_email").value) == false)
    {
        status="no";
        document.getElementById("val_email").value="wrong e-mail id";
        return status;
    }
    else if(document.getElementById("txt_password").value=="") 
    {
        status="no";
        document.getElementById("val_password").value="wrong e-mail id";
        return status;
    }
    else if(document.getElementById("txt_password").value!=document.getElementById("txt_confirm_password").value)
    {
       status="no";
       return status; 
    }
    else
    {
        status="yes";
    }
    return status;
    
}

/*------------2--------------*/
function userRegistration()
{
    //var validate=registrationValidate();
    
//    if (validate=="yes")
//    {
          //ShowLoadingMessage();
        try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var uname = document.getElementById("ctl00_txt_name").value;
          var uemailid=document.getElementById("ctl00_txt_email").value;//user email
          var upassword=calcMD5(document.getElementById("ctl00_txt_password").value);//hash password
          var mylist=document.getElementById("ctl00_ddl_country");
          var ucountry=mylist.options[mylist.selectedIndex].text;
          var upermision=0;
          
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
               var div_left=document.getElementById("ctl00_Panel_registration").style.left;
               var div_top=document.getElementById("ctl00_Panel_registration").style.top;
               var div_width=document.getElementById("ctl00_Panel_registration").offsetWidth;
               var div_height=document.getElementById("ctl00_Panel_registration").offsetHeight;
               
               document.getElementById("loading_divR").style.display="";
               document.getElementById("loading_divR").style.top= div_top-div_height + "px";
               document.getElementById("loading_divR").style.left= div_left-div_width + "px";
              
               document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divR').style.display = 'none';
              
                if (xmlHttp.responseText=="yes")
               {
                 
                 document.getElementById('ctl00_Label_eR').innerHTML = "successfully registered";
                 document.getElementById("ctl00_txt_name").value="";
                 document.getElementById("ctl00_txt_email").value="";
                 document.getElementById("txt_confirm_password").value="";
                 
                 //alert(window.location.href);
                 //window.location=window.location.href;
               }
               else
               {
                 document.getElementById("ctl00_txt_name").value="";
                 document.getElementById("ctl00_txt_email").value="";
                 document.getElementById("txt_confirm_password").value="";
                 document.getElementById('ctl00_Label_eR').innerHTML = "Sorry! Try again";
                 //document.getElementById("txt_email").focus();
               }
              }
            }
          xmlHttp.open("GET","handler/user_registration.ashx?uname=" + uname + "&uemail=" + uemailid + "&upass=" + upassword + "&ucontry=" + ucountry + "&uper=" + upermision,true);
          xmlHttp.send(null);
    }
//    else
//    {
//    
//    }
//}
/*------------------------------------- fusion create user ---------------------------------------------*/
function fusionUserRegistration()
{
    //var validate=registrationValidate();
    
//    if (validate=="yes")
//    {
          //ShowLoadingMessage();
        try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var uname = document.getElementById("ctl00_ctl08_txt_name").value;
          var uemailid=document.getElementById("ctl00_ctl08_txt_email").value;//user email
          var upassword=calcMD5(document.getElementById("ctl00_ctl08_txt_password").value);//hash password
          var mylist=document.getElementById("ctl00_ctl08_ddl_country");
          var ucountry=mylist.options[mylist.selectedIndex].text;
          var upermision=1;
          
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
               var div_left=document.getElementById("admin_body_user").offsetLeft;
              var div_top=document.getElementById("admin_body_user").offsetTop;
              var div_width=document.getElementById("admin_body_user").offsetWidth;
              var div_height=document.getElementById("admin_body_user").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               document.getElementById('ctl00_ctl08_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
              
                if (xmlHttp.responseText!="no")
               {
                 
                 document.getElementById('ctl00_ctl08_Label_eR').innerHTML = "successfully registered";
                 document.getElementById("ctl00_ctl08_txt_name").value="";
                 document.getElementById("ctl00_ctl08_txt_email").value="";
                 document.getElementById("ctl00_ctl08_txt_confirm_password").value="";
                 document.getElementById('ctl00_ctl08_user_grid').innerHTML = xmlHttp.responseText;
                 
                 //alert(window.location.href);
                 //window.location=window.location.href;
               }
               else
               {
                 document.getElementById("ctl00_ctl08_txt_name").value="";
                 document.getElementById("ctl00_ctl08_txt_email").value="";
                 document.getElementById("ctl00_ctl08_txt_confirm_password").value="";
                 document.getElementById('ctl00_ctl08_Label_eR').innerHTML = "Sorry! Try again";
                 //document.getElementById("txt_email").focus();
               }
              }
            }
          xmlHttp.open("GET","handler/fusionUser.ashx?uname=" + uname + "&uemail=" + uemailid + "&upass=" + upassword + "&ucontry=" + ucountry + "&uper=" + upermision ,true);
          xmlHttp.send(null);
    }

//------------------ delete user ---------------//

function deleteUser(uid)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
                    
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                //document.getElementById('loading_divAdmin').style.display = 'none';
              
                if (xmlHttp.responseText!="")
               {
                 
                 document.getElementById('ctl00_ContentPlaceHolder1_contentarea2').innerHTML = xmlHttp.responseText;
                 
               }
               else
               {
                 
               }
              }
            }
          xmlHttp.open("GET","../handler/userModifier.ashx?m_type=1&u_id=" + uid,true);
          xmlHttp.send(null);
}
//------------------------------- modify user -----------------------------------//
function changeRoal(uid,e)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var chkUser=document.getElementById(e.id);
          var role_type;
          if (chkUser.checked==true) 
          {
            role_type=1;
          }
          else
          {
            role_type=0;
          }
                    
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_home").offsetLeft;
              var div_top=document.getElementById("admin_body_home").offsetTop;
              var div_width=document.getElementById("admin_body_home").offsetWidth;
              var div_height=document.getElementById("admin_body_home").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
              
                if (xmlHttp.responseText!="")
               {
                 
                 document.getElementById('ctl00_ctl08_user_grid').innerHTML = xmlHttp.responseText;
                 
               }
               else
               {
                 
               }
              }
            }
          xmlHttp.open("GET","handler/userModifier.ashx?m_type=2&u_id=" + uid + "&role_id=" + role_type,true);
          xmlHttp.send(null);
}

//----------------------------------------------------------------------------------------------//

//------------------------------- links and link groups ----------------------------------//

function insertLinkgroup()
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var linkGroupName=document.getElementById("ctl00_ctl08_txt_newlinkgroup").value;    
                
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_link").offsetLeft;
              var div_top=document.getElementById("admin_body_link").offsetTop;
              var div_width=document.getElementById("admin_body_link").offsetWidth;
              var div_height=document.getElementById("admin_body_link").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                document.getElementById("ctl00_ctl08_txt_newlinkgroup").value="";
                
                if (xmlHttp.responseText!="")
               {
                 var ddl=document.getElementById("ctl00_ctl08_ddl_linkGroup"); 
                 var ddl_txt = xmlHttp.responseText;
                 var mySplitResult = ddl_txt.split("|");
                 
                 //remove all nodes
                 while (ddl.childNodes[0])
                 {
                   ddl.removeChild(ddl.childNodes[0]);
                 }
                 //readd nodes         
                 for(i = 0; i < mySplitResult.length; i++)
                 {
                    
                     var opt=mySplitResult[i].split("^");
                     
                     var optn = document.createElement("OPTION");
                     optn.text = opt[1];
                     optn.value = opt[0];
                     ddl.options.add(optn);
                 }

               }
               else
               {
                 
               }
              }
            }
          xmlHttp.open("GET","handler/links.ashx?lg_name=" + linkGroupName + "&l_type=1",true);
          xmlHttp.send(null);
}

//----------------------------------------------------------------------------------------//

function insertLink()
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var linkGroupID=document.getElementById("ctl00_ctl08_ddl_linkGroup").value;    
          var linkName=document.getElementById("ctl00_ctl08_linkname").value;
          var link=document.getElementById("ctl00_ctl08_url").value;
                
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_link").offsetLeft;
              var div_top=document.getElementById("admin_body_link").offsetTop;
              var div_width=document.getElementById("admin_body_link").offsetWidth;
              var div_height=document.getElementById("admin_body_link").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                //document.getElementById("ctl00_ctl08_txt_newlinkgroup").value="";
                document.getElementById("ctl00_ctl08_linkname").value="";
                document.getElementById("ctl00_ctl08_url").value="";
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_linkCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/links.ashx?l_id=" + linkGroupID + "&l_name="+linkName+"&l_url=" + link + "&l_type=2",true);
          xmlHttp.send(null);
}

/*--------------------------------------------------------------------------------------------------*/

function deleteLink(linkID)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
                          
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_link").offsetLeft;
              var div_top=document.getElementById("admin_body_link").offsetTop;
              var div_width=document.getElementById("admin_body_link").offsetWidth;
              var div_height=document.getElementById("admin_body_link").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                //document.getElementById("ctl00_ctl08_txt_newlinkgroup").value="";
                document.getElementById("ctl00_ctl08_linkname").value="";
                document.getElementById("ctl00_ctl08_url").value="";
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_linkCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/links.ashx?l_id=" + linkID + "&l_type=3",true);
          xmlHttp.send(null);
}

/***************************************** show ***********************************************/

function insertShow()
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var show_tit=document.getElementById("ctl00_ctl08_txt_showName").value;    
          var show_desc=document.getElementById("ctl00_ctl08_txt_showDesc_ifr").contentWindow.document.body.innerHTML;
          var show_dt=document.getElementById("ctl00_ctl08_txt_showDate").value;
                
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (ymlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_shows").offsetLeft;
              var div_top=document.getElementById("admin_body_shows").offsetTop;
              var div_width=document.getElementById("admin_body_shows").offsetWidth;
              var div_height=document.getElementById("admin_body_shows").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                //document.getElementById("ctl00_ctl08_txt_newlinkgroup").value="";
                document.getElementById("ctl00_ctl08_txt_showName").value="";
                document.getElementById("ctl00_ctl08_txt_showDesc_ifr").contentWindow.document.body.innerHTML="";
                document.getElementById("ctl00_ctl08_txt_showDate").value="";
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_showCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/show.ashx?show_tit=" + show_tit + "&show_desc=" + show_desc + "&show_dt=" + show_dt + "&show_type=1",true);
          xmlHttp.send(null);
}

/*-------------------------------------------------------------------------------------------*/
function deleteShow(show_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
                
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_shows").offsetLeft;
              var div_top=document.getElementById("admin_body_shows").offsetTop;
              var div_width=document.getElementById("admin_body_shows").offsetWidth;
              var div_height=document.getElementById("admin_body_shows").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                //document.getElementById("ctl00_ctl08_txt_newlinkgroup").value="";
                document.getElementById("ctl00_ctl08_txt_showName").value="";
                document.getElementById("ctl00_ctl08_txt_showDesc").value="";
                document.getElementById("ctl00_ctl08_txt_showDate").value="";
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_showCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/show.ashx?show_id=" + show_id + "&show_type=2",true);
          xmlHttp.send(null);
}



/********************************** Notes **********************************/
function insertNotes()
{
    
    ///var editor = new FCKeditor("txt_noteDesc");

// ... Then later, to get the value
  
 
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var c_date=new Date();  
          
          var note_tit=document.getElementById("ctl00_ctl08_txt_noteTitle").value; 
          
          var note_desc = "N";  
         // var note_desc=document.getElementById("ctl00_ctl08_txt_noteDesc").value;
          var note_dt=c_date.getDate();   
          
            
           //alert(note_desc); 
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_notes").offsetLeft;
              var div_top=document.getElementById("admin_body_notes").offsetTop;
              var div_width=document.getElementById("admin_body_notes").offsetWidth;
              var div_height=document.getElementById("admin_body_notes").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                //document.getElementById("ctl00_ctl08_txt_newlinkgroup").value="";
                document.getElementById("ctl00_ctl08_txt_noteTitle").value="";
                
                //document.getElementById("ctl00_ctl08_txt_blogDesc_ifr").contentWindow.document.body.innerHTML="";
                
                if (xmlHttp.responseText!="")
                {
					//alert(xmlHttp.responseText);
                    document.getElementById("ctl00_ctl08_div_notesCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/notes.ashx?note_tit=" + note_tit + "&note_desc=" + note_desc + "&note_dt=" + note_dt + "&b_type=1",true);
          xmlHttp.send(null);
}

function deleteBuilding(bid,lid)
{
     
     var confirmdelete = confirm("Are you sure you want to Delete?");
     
       if(confirmdelete == true)
       {
     try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange = function () {
              if (xmlHttp.readyState == 1) {
                  //              var div_left=document.getElementById("admin_body_notes").offsetLeft;
                  //              var div_top=document.getElementById("admin_body_notes").offsetTop;
                  //              var div_width=document.getElementById("admin_body_notes").offsetWidth;
                  //              var div_height=document.getElementById("admin_body_notes").offsetHeight;

                  // document.getElementById("loading_divAdmin").style.display="";
                  // document.getElementById("loading_divAdmin").style.top= div_top + "px";
                  // document.getElementById("loading_divAdmin").style.left= div_left + "px";

                  //document.getElementById('ctl00_Label_eR').innerHTML=""; 
              }
              if (xmlHttp.readyState == 4) {
                  //document.getElementById('loading_divAdmin').style.display = 'none';


                  if (xmlHttp.responseText != "") {

                      if (xmlHttp.responseText == "unitavailable") {
                          alert("Builiding cannot be deleted.Since units available for this buidling.");
                      }
                      else {
                          //alert(xmlHttp.responseText);
                          document.getElementById("ldbld_" + lid).innerHTML = xmlHttp.responseText;
                      }
                  }
              }
          }
          xmlHttp.open("GET","../handler/building.ashx?bid=" + bid + "&b_type=2&lid=" +lid,true);
          xmlHttp.send(null);
          
          }
}


function deleteBuildingUnit(bid,uid)
{
     
     var confirmdelete = confirm("Are you sure you want to Delete?");
     
       if(confirmdelete == true)
       {
       
     try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                                             
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ContentPlaceHolder1_loadunits").innerHTML = xmlHttp.responseText;
                }
              }
            }
        xmlHttp.open("GET", "../handler/building.ashx?bid=" + bid + "&b_type=4&unit_id=" + uid, true);
          xmlHttp.send(null);
          
          }
}


function deleteNotes(note_id)
{
     
     
       
     try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
//              var div_left=document.getElementById("admin_body_notes").offsetLeft;
//              var div_top=document.getElementById("admin_body_notes").offsetTop;
//              var div_width=document.getElementById("admin_body_notes").offsetWidth;
//              var div_height=document.getElementById("admin_body_notes").offsetHeight;
//              
//              document.getElementById("loading_divAdmin").style.display="";
//              document.getElementById("loading_divAdmin").style.top= div_top + "px";
//              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                //document.getElementById('loading_divAdmin').style.display = 'none';
               //document.getElementById("ctl00_ctl08_txt_noteTitle").value="";
                
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/notes.ashx?note_id=" + note_id + "&b_type=2",true);
          xmlHttp.send(null);
}





function deleteFeatures(feature_id)
{
     
     
       
     try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
//              var div_left=document.getElementById("admin_body_notes").offsetLeft;
//              var div_top=document.getElementById("admin_body_notes").offsetTop;
//              var div_width=document.getElementById("admin_body_notes").offsetWidth;
//              var div_height=document.getElementById("admin_body_notes").offsetHeight;
//              
//              document.getElementById("loading_divAdmin").style.display="";
//              document.getElementById("loading_divAdmin").style.top= div_top + "px";
//              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                //document.getElementById('loading_divAdmin').style.display = 'none';
               //document.getElementById("ctl00_ctl08_txt_noteTitle").value="";
                
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/notes.ashx?note_id=" + feature_id + "&b_type=4",true);
          xmlHttp.send(null);
}



/*---------------------------------------------------------------------------------------------*/
function editNotesTopics(id,fid,lblid)
{


    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var editor= "ctl00_CPH_body_Repeater1_ct"+fid+"_description";
         
          
          //making iframe id
          var inst = FCKeditorAPI.GetInstance(editor);
          var note_desc = inst.GetHTML();
          
                     
//          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
          {
            if (xmlHttp.readyState==1)
            {
                //document.getElementById(lbl_id).innerHTML="Loading.........";
            }
            if(xmlHttp.readyState==4)
              {
                if (xmlHttp.responseText!="")
                {
                    document.getElementById(lblid).innerHTML=xmlHttp.responseText;
                }
              }
           }
          xmlHttp.open("GET","handler/notes.ashx?note_id=" + id + "&note_desc=" + note_desc + "&b_type=3",true);
          xmlHttp.send(null);

}








/********************************** Notes **********************************/















/********************************** Blog **********************************/

function insertBlog()
{
    
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var c_date=new Date();  
          
          var blog_tit=document.getElementById("ctl00_ctl08_txt_blogName").value;    
          var blog_desc=document.getElementById("ctl00_ctl08_txt_blogDesc_ifr").contentWindow.document.body.innerHTML;
           var blog_dt=c_date.format("MM/dd/yyyy");  
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_blog").offsetLeft;
              var div_top=document.getElementById("admin_body_blog").offsetTop;
              var div_width=document.getElementById("admin_body_blog").offsetWidth;
              var div_height=document.getElementById("admin_body_blog").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                //document.getElementById("ctl00_ctl08_txt_newlinkgroup").value="";
                document.getElementById("ctl00_ctl08_txt_blogName").value="";
                document.getElementById("ctl00_ctl08_txt_blogDesc_ifr").contentWindow.document.body.innerHTML="";
                
                if (xmlHttp.responseText!="")
                {
					alert(xmlHttp.responseText);
                    document.getElementById("ctl00_ctl08_div_blogCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/blog.ashx?blog_tit=" + blog_tit + "&blog_desc=" + blog_desc + "&blog_dt=" + blog_dt + "&b_type=1",true);
          xmlHttp.send(null);
}

/*-------------------------------------------------------------------------------------------------------*/

function deleteBlog(blog_id)
{
     try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_blog").offsetLeft;
              var div_top=document.getElementById("admin_body_blog").offsetTop;
              var div_width=document.getElementById("admin_body_blog").offsetWidth;
              var div_height=document.getElementById("admin_body_blog").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                //document.getElementById("ctl00_ctl08_txt_newlinkgroup").value="";
                document.getElementById("ctl00_ctl08_txt_blogName").value="";
                document.getElementById("ctl00_ctl08_txt_blogDesc_ifr").contentWindow.document.body.innerHTML="";
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_blogCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/blog.ashx?blog_id=" + blog_id + "&b_type=2",true);
          xmlHttp.send(null);
}
/*---------------------------------------------------------------------------------------------*/
function editBlogTopics(id,txt_id,lbl_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var editor= "ctl00_CPH_body_Repeater1_ct"+txt_id+"_description";
         
          
          //making iframe id
          var inst = FCKeditorAPI.GetInstance(editor);
          var blog_Topicsdesc = inst.GetHTML();
            
          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
          {
            if (xmlHttp.readyState==1)
            {
                document.getElementById(lbl_id).innerHTML="Loading.........";
            }
            if(xmlHttp.readyState==4)
              {
                if (xmlHttp.responseText!="")
                {
                    document.getElementById(lbl_id).innerHTML=xmlHttp.responseText;
                }
              }
           }
          xmlHttp.open("GET","handler/blog.ashx?blog_id=" + id + "&blog_desc=" + blog_Topicsdesc + "&b_type=3",true);
          xmlHttp.send(null);
}

/**************************************** video ************************************************/

function deleteVideo(video_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_video").offsetLeft;
              var div_top=document.getElementById("admin_body_video").offsetTop;
              var div_width=document.getElementById("admin_body_video").offsetWidth;
              var div_height=eocument.getElementById("admin_body_video").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_videoCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/video.ashx?video_id=" + video_id + "&v_type=1",true);
          xmlHttp.send(null);
}
/*-----------------------------------------------------------------------------------------*/

function selectVideos()
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_video").offsetLeft;
              var div_top=document.getElementById("admin_body_video").offsetTop;
              var div_width=document.getElementById("admin_body_video").offsetWidth;
              var div_height=document.getElementById("admin_body_video").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_videoCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/video.ashx?v_type=3",true);
          xmlHttp.send(null);
}
/*-----------------------------------------------------------------------------------------*/

function playVideo(v_url)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
               //document.getElementById("ctl00_CPH_body_Label_video").innerHTML="<img src='images/vdol.jpg' />";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_CPH_body_Label_video").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/video.ashx?video_url=" + v_url + "&v_type=2",true);
          xmlHttp.send(null);
}

/*********************************** day in life **************************************/

function deleteDIF(dif_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_daylife").offsetLeft;
              var div_top=document.getElementById("admin_body_daylife").offsetTop;
              var div_width=document.getElementById("admin_body_daylife").offsetWidth;
              var div_height=document.getElementById("admin_body_daylife").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_dayinlifeCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/dayinlife.ashx?dif_id=" + dif_id + "&dif_type=1",true);
          xmlHttp.send(null);
   }
 /*------------------------------------------------------------------------------------------------*/
 function selectDayInlife()
 {
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_daylife").offsetLeft;
              var div_top=document.getElementById("admin_body_daylife").offsetTop;
              var div_width=document.getElementById("admin_body_daylife").offsetWidth;
              var div_height=document.getElementById("admin_body_daylife").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_dayinlifeCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/dayinlife.ashx?dif_type=3",true);
          xmlHttp.send(null);
 }
   
/*-------------------------------------------------------------------------------------------------------*/
   function playDIFVideo(v_url)
    {
        try
              {
              // Firefox, Opera 8.0+, Safari
              xmlHttp=new XMLHttpRequest();
              }
            catch (e)
              {
              // Internet Explorer
              try
                {
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
                }
              catch (e)
                {
                try
                  {
                  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                  }
                catch (e)
                  {
                  alert("Your browser does not support AJAX!");
                  return false;
                  }
                }
              }
              

              //alert(emailid + "***" + u_password);
              xmlHttp.onreadystatechange=function()
                {
                if (xmlHttp.readyState==1)
                {
                   document.getElementById("ctl00_CPH_body_Label_video").innerHTML="<img src='images/vdol.jpg' />";
                  
                   //document.getElementById('ctl00_Label_eR').innerHTML=""; 
                }
                if(xmlHttp.readyState==4)
                  {
                    if (xmlHttp.responseText!="")
                    {
                        document.getElementById("ctl00_CPH_body_Label_video").innerHTML=xmlHttp.responseText;
                    }
                  }
                }
              xmlHttp.open("GET","handler/dayinlife.ashx?video_url=" + v_url + "&dif_type=2",true);
              xmlHttp.send(null);
    }

/************************************** music *****************************************/

function deleteMusic(music_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_video").offsetLeft;
              var div_top=document.getElementById("admin_body_video").offsetTop;
              var div_width=document.getElementById("admin_body_video").offsetWidth;
              var div_height=document.getElementById("admin_body_video").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_AlbumCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/music.ashx?music_id=" + music_id + "&m_type=1",true);
          xmlHttp.send(null);
}
/*---------------------------------------------------------------------------------------------*/
function selectMusic()
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_video").offsetLeft;
              var div_top=document.getElementById("admin_body_video").offsetTop;
              var div_width=document.getElementById("admin_body_video").offsetWidth;
              var div_height=document.getElementById("admin_body_video").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_AlbumCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/photo.ashx?p_type=20",true);
          xmlHttp.send(null);
}
/*---------------------------------------------------------------------------------------------*/
function playMusic(m_url)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
               //document.getElementById("ctl00_CPH_body_Label_mPlayer").innerHTML="<img src='images/loading_mplayer.jpg' />";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                if (xmlHttp.responseText!="")
                {                    
                    document.getElementById("Label_mPlayer").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/music.ashx?m_url=" + m_url + "&m_type=2",true);
          xmlHttp.send(null);
}

/*************************************** photo section *****************************************/

function deletePhoto(p_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_photoCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/photo.ashx?p_id=" + p_id + "&p_type=1",true);
          xmlHttp.send(null);
}





function deletePhoto2(p_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_musicCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/photo.ashx?p_id=" + p_id + "&p_type=3",true);
          xmlHttp.send(null);
}



function deletePhoto3(p_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
//              var div_left=document.getElementById("admin_body_photo").offsetLeft;
//              var div_top=document.getElementById("admin_body_photo").offsetTop;
//              var div_width=document.getElementById("admin_body_photo").offsetWidth;
//              var div_height=document.getElementById("admin_body_photo").offsetHeight;
//              
//              document.getElementById("loading_divAdmin").style.display="";
//              document.getElementById("loading_divAdmin").style.top= div_top + "px";
//              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                //document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/photo.ashx?p_id=" + p_id + "&p_type=6",true);
          xmlHttp.send(null);
}



function deletePhoto4(p_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_presentationCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/photo.ashx?p_id=" + p_id + "&p_type=11",true);
          xmlHttp.send(null);
}



function deletePhoto5_new(bid,p_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
                         
            if (xmlHttp.readyState==1)
            {
                           
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                               
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/photo.ashx?p_id=" + p_id + "&bid=" +  bid + "&p_type=31",true);
          xmlHttp.send(null);
}

function deletePhoto6_new(bid,p_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
                         
            if (xmlHttp.readyState==1)
            {
                           
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                               
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/photo.ashx?p_id=" + p_id + "&bid=" +  bid + "&p_type=32",true);
          xmlHttp.send(null);
}





function deletePhoto7_new(bid,p_id,uid)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
                         
            if (xmlHttp.readyState==1)
            {
                           
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                               
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/photo.ashx?p_id=" + p_id + "&bid=" +  bid + "&p_type=33&uid=" + uid,true);
          xmlHttp.send(null);
}


function deletePhoto5(p_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_linkCollections").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/photo.ashx?p_id=" + p_id + "&p_type=13",true);
          xmlHttp.send(null);
}


function deletePhoto10(p_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_documentCollections").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/photo.ashx?p_id=" + p_id + "&p_type=15",true);
          xmlHttp.send(null);

}

function deletePhoto22(p_id, bid,uid)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {             
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {              
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/photo.ashx?p_id=" + p_id + "&p_type=21&bid=" + bid + "&uid=" + uid,true);
          xmlHttp.send(null);

}

/*-------------------------------------------------------------------------------------------------*/
function selectAllPhoto()
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_photoCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/presentation.ashx?p_type=2",true);
          xmlHttp.send(null);
}


/******************************************** event **************************************************/

function deleteEvent(e_id)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_event").offsetLeft;
              var div_top=document.getElementById("admin_body_event").offsetTop;
              var div_width=document.getElementById("admin_body_event").offsetWidth;
              var div_height=document.getElementById("admin_body_event").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_EventCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/events.ashx?e_id=" + e_id + "&e_type=1",true);
          xmlHttp.send(null);
}

/*----------------------------------------------------------------------------------------------------*/

function selectEvent()
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_event").offsetLeft;
              var div_top=document.getElementById("admin_body_event").offsetTop;
              var div_width=document.getElementById("admin_body_event").offsetWidth;
              var div_height=document.getElementById("admin_body_event").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_EventCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/events.ashx?e_type=2",true);
          xmlHttp.send(null);
}

/**********************************page title********************************/

function changePageTitle(p_name)
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          
          var pageTitle=document.getElementById('ctl00_pageHandler1_txt_pageTitle').value;
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
               document.getElementById('ctl00_pageHandler1_Label_err').innerHTML="<img src='images/small_loader.gif' />"; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('ctl00_pageHandler1_Label_err').innerHTML = xmlHttp.responseText;
               
              }
            }
          xmlHttp.open("GET","handler/pageTitle.ashx?page_type=1" + "&page_name=" + p_name + "&page_title=" + pageTitle,true);
          xmlHttp.send(null);
}

/********************************** documents ********************************/

function selectAlldocuments()
{
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_documentCollections").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/documents.ashx?p_type=1",true);
          xmlHttp.send(null);
}


function deleteDocuments(p_id)
{
   
  
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                document.getElementById("ctl00_ctl08_div_documentCollections").innerHTML="";
                
                if (xmlHttp.responseText!="")
                {
                
                    document.getElementById("ctl00_ctl08_div_documentCollections").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/documents.ashx?p_id=" + p_id + "&p_type=2",true);
          xmlHttp.send(null);
}


/********************************** presentations ********************************/

function deletePresentations(p_id)
{
   
  
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
//              var div_left=document.getElementById("admin_body_photo").offsetLeft;
//              var div_top=document.getElementById("admin_body_photo").offsetTop;
//              var div_width=document.getElementById("admin_body_photo").offsetWidth;
//              var div_height=document.getElementById("admin_body_photo").offsetHeight;
//              
//              document.getElementById("loading_divAdmin").style.display="";
//              document.getElementById("loading_divAdmin").style.top= div_top + "px";
//              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                //document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/presentation.ashx?p_id=" + p_id + "&p_type=1",true);
          xmlHttp.send(null);
}

function selectAllPresentations()
{


try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_presentationCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/photo.ashx?p_type=10",true);
          xmlHttp.send(null);

}




function selectAllBuilding_Units()
{


try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_presentationCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/building.ashx?b_type=3",true);
          xmlHttp.send(null);

}



function selectAllCurrentLunchItems()
{

try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_presentationCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/lunch.ashx?p_type=1",true);
          xmlHttp.send(null);
          
          
}




function selectAllCurrentDinnerItems()
{

try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_documentCollections").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/lunch.ashx?p_type=3",true);
          xmlHttp.send(null);
          
          
}






function selectAllCateringItems()
{

try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_showCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/lunch.ashx?p_type=5",true);
          xmlHttp.send(null);
          
          
}




function selectAllNextMonthItems()
{

try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_musicCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/building.ashx?b_type=1",true);
          xmlHttp.send(null);
          
          
}




function selectAllServicePageImages()
{

try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_showCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/photo.ashx?p_type=5",true);
          xmlHttp.send(null);
          
          
}




function deleteNextMonthItems(item_id)
{
      try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_musicCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/lunch.ashx?itemid=" + item_id + "&p_type=8",true);
          xmlHttp.send(null);
          
}



function deleteCatering(item_id)
{
      try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_showCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/lunch.ashx?itemid=" + item_id + "&p_type=6",true);
          xmlHttp.send(null);
          
}



function deleteDinner(item_id)
{
      try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_documentCollections").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/lunch.ashx?itemid=" + item_id + "&p_type=4",true);
          xmlHttp.send(null);
          
}



function deleteLunch(item_id)
{
      try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_presentationCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/lunch.ashx?itemid=" + item_id + "&p_type=2",true);
          xmlHttp.send(null);
          
}



function add_notes_caleder(datevalue)
{


    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            
            if(xmlHttp.readyState==4)
              {
                               
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("innertext").innerHTML=xmlHttp.responseText;
                    setVisible('layer1',true);
                }
              }
            }
          xmlHttp.open("GET","handler/calendar_notes.ashx?p_type=1&dvalue="+datevalue,true);
          xmlHttp.send(null);
}


function insert_notes_caleder(datevalue)
{

var comments;
comments = document.getElementById("day_notes").value;

    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            
            if(xmlHttp.readyState==4)
              {
                setVisible('layer1');
                               
                if (xmlHttp.responseText!="")
                {
                  
                    //document.getElementById("innertext").innerHTML=xmlHttp.responseText;
                    //setVisible('layer1',true);
                }
              }
            }
          xmlHttp.open("GET","handler/calendar_notes.ashx?p_type=2&notes="+comments+"&dvalue="+datevalue,true);
          xmlHttp.send(null);
}


function select_add_notes_caleder(datevalue)
{


    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            
            if(xmlHttp.readyState==4)
              {
                               
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("innertext").innerHTML=xmlHttp.responseText;
                    setVisible('layer1',true);
                }
              }
            }
          xmlHttp.open("GET","handler/calendar_notes.ashx?p_type=3&dvalue="+datevalue,true);
          xmlHttp.send(null);
}

function show_documents(p_id)
{
  
  //alert(p_id);
  
  try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            
            if(xmlHttp.readyState==4)
              {
                               
                if (xmlHttp.responseText!="")
                {
                
                 document.getElementById("innertext1").innerHTML=xmlHttp.responseText;
                
                    //document.getElementById("ctl00_ctl08_div_documentCollections").innerHTML=xmlHttp.responseText;
               setVisible2('layer2');
               
                }
              }
            }
          xmlHttp.open("GET","handler/documents.ashx?p_id=" + p_id + "&p_type=3",true);
          xmlHttp.send(null);
  
  
  
}

function check_review_order()
{

var itemcount;

itemcount = document.getElementById("itemcount").value;
var itemselected;
itemselected = 0;
for(i=1;i<=itemcount;i++)
{
 element= document.getElementById("itm_" + i);
 if(element.checked == true)
 {
  itemselected = 1;
  break;
 }
 
}

if(itemselected==0)
{
 alert("Please select atleast one item");
 return false;
}
else
{

element = "";
itemselected = 0;
for(j=1;j<=2;j++)
{
element= document.getElementById("location" + j);
 if(element.checked == true)
 {
  itemselected = 1;
  break;
 }

}
if(itemselected==0)
{
 alert("Please select the location");
 return false;
}


}

}

function rating_dish(itemcount)
{
 alert(itemcount);
}

function insert_items_page_title(pname,ctrlname)
{
 var page_disp_text;
 page_disp_text= document.getElementById("ctl00_ctl08_" + ctrlname + "_dispname").value;
 if(page_disp_text=="")
 {
  alert("Please enter the Display title "); 
 }
 else
 {
 
 
 
 
 try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            
            if(xmlHttp.readyState==4)
              {
                               
                if (xmlHttp.responseText =="1")
                {                               
                 alert("Saved Successfully");
                  document.getElementById("ctl00_ctl08_" + ctrlname + "_dispname").value = page_disp_text;
                }
              }
            }
          xmlHttp.open("GET","handler/add_disp_name.ashx?dname=" + page_disp_text + "&pname=" + pname + "&p_type=1",true);
          xmlHttp.send(null);
 
 
 
 
 
 
 
 //alert(page_disp_text);
 }
}




function selectAllNewsRoomItems()
{
         
          try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_linkCollections").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/photo.ashx?p_type=12",true);
          xmlHttp.send(null);
          
}

function selectAllBuildingUnits()
{
         
          try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_documentCollections").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/photo.ashx?p_type=14",true);
          xmlHttp.send(null);
          
}


function deleteNewsItems(item_id)
{
      try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    document.getElementById("ctl00_ctl08_div_linkCollections").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/news_room_items.ashx?itemid=" + item_id + "&p_type=2",true);
          xmlHttp.send(null);
          
}

function check_front_page_featured(record_id,item_position)
{
try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
           
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';    
                alert("Saved Successfully")            

              }
            }
           
          xmlHttp.open("GET","handler/photo.ashx?p_id=" + record_id + "&f_id=" + item_position + "&p_type=7",true);
          xmlHttp.send(null);


}


function update_item_order(itemID, posValue)
{
 
 
 try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    alert("Saved Successfully");
                    //document.getElementById("ctl00_ctl05_div_presentationCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
           
          xmlHttp.open("GET","handler/lunch.ashx?itemid=" + itemID + "&p_type=10&pos=" + posValue,true);
          xmlHttp.send(null);

}


function havequestion_validation(element_id,flag)
{
 var ele;
 var val;
 ele=  document.getElementById("ctl00_CPH_body_" + element_id);
 val = ele.value;
 if(flag==1)
 {
 if (val=="Enter your name")
 {
  ele.value = "";
 }
 
 }
 
 if(flag==2)
 {
 if (val=="")
 {
  ele.value = "Enter your name";
 }  
 }
 
 if(flag==3)
 {
 if (val=="Enter your phone")
 {
  ele.value = "";
 }
 }
 
  if(flag==4)
 {
 if (val=="")
 {
  ele.value = "Enter your phone";
 }
 
 }
  
  
  if(flag==5)
 {
 if (val=="Enter you Question")
 {
  ele.value = "";
 }
 }
 
  if(flag==6)
 {
 if (val=="")
 {
  ele.value = "Enter you Question";
 }
 }
  
}

function chage_procedure_location(pid,flag)
{

if(flag==1)
{
window.location = "treatments.aspx?pid=" + pid;
}
else
{
window.location = "skincare.aspx?pid=" + pid;
}
}


function validate_form_user()
{

var username =  document.getElementById("ctl00_CPH_body_usr_name").value;
var email =  document.getElementById("ctl00_CPH_body_usr_email").value;
var phone =  document.getElementById("ctl00_CPH_body_usr_phone").value;
var question =  document.getElementById("ctl00_CPH_body_usr_question").value;

if(username=="")
{
alert("Please enter the name");
document.getElementById("ctl00_CPH_body_usr_name").focus();
return false;
}
else if(email=="")
{
alert("Please enter the email");
document.getElementById("ctl00_CPH_body_usr_email").focus();
return false;

}
else if(phone=="")
{
alert("Please enter the phone");
document.getElementById("ctl00_CPH_body_usr_phone").focus();
return false;

}
else if(question=="")
{
alert("Please enter the question");
document.getElementById("ctl00_CPH_body_usr_question").focus();
return false;
}
else
{
return true;
}
}


function update_video_order(itemID, posValue)
{
 
 
 try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
                        
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    alert("Saved Successfully");
                    //document.getElementById("ctl00_ctl05_div_presentationCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
            xmlHttp.open("GET","handler/video.ashx?video_id=" + itemID + "&v_type=10&pos=" + posValue,true);
          //xmlHttp.open("GET","handler/lunch.ashx?itemid=" + itemID + "&p_type=10&pos=" + posValue,true);
          xmlHttp.send(null);

}



function update_music_order(itemID, posValue)
{
 
 
 try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
              var div_left=document.getElementById("admin_body_photo").offsetLeft;
              var div_top=document.getElementById("admin_body_photo").offsetTop;
              var div_width=document.getElementById("admin_body_photo").offsetWidth;
              var div_height=document.getElementById("admin_body_photo").offsetHeight;
              
              document.getElementById("loading_divAdmin").style.display="";
              document.getElementById("loading_divAdmin").style.top= div_top + "px";
              document.getElementById("loading_divAdmin").style.left= div_left + "px";
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                document.getElementById('loading_divAdmin').style.display = 'none';
                
                if (xmlHttp.responseText!="")
                {
                    alert("Saved Successfully");
                    //document.getElementById("ctl00_ctl05_div_presentationCollection").innerHTML=xmlHttp.responseText;
                }
              }
            }
           
          xmlHttp.open("GET","handler/music.ashx?music_id=" + itemID + "&m_type=10&pos=" + posValue,true);
          xmlHttp.send(null);

}

function openMusicWindow(linkUrl, flag)
{
    //alert(linkUrl);
    //alert(flag);
    
    if(flag==1)
    {
    
    window.open(linkUrl);
    }
    else if(flag==2)
    {
        newwindow=window.open(linkUrl,'name','height=250,width=260,left=0,top=400,screenX=0,screenY=100');
    }

}

function redirectsearch_byval(limit)
{
    var st_price = document.getElementById("ctl00_CPH_body_st_rec").value;
    var end_price = document.getElementById("ctl00_CPH_body_end_rec").value;
    var category = document.getElementById("ctl00_CPH_body_build_location").value;
    var room = document.getElementById("ctl00_CPH_body_room_value").value;
    var building = document.getElementById("ctl00_CPH_body_build_id").value;
    //var limit = document.getElementById("ctl00_CPH_body_limit_value").value;
    
    var querystring="";

    querystring = "st=" +  st_price + "&end="  + end_price + "&location=" + category + "&room=" + room + "&bid=" + building + "&limit=" + limit; 
   //alert(querystring);
   
    window.location = "show_search.aspx?" + querystring;
}

function redirectsearch()
{
  var st_price = document.getElementById("st_price").value;
  var end_price = document.getElementById("end_price").value;
  var category = document.getElementById("ctl00_CPH_body_category").value;
  var room = document.getElementById("rooms").value;
  var building = document.getElementById("building").value;
  var querystring="";


    if(st_price == "")
     {
           st_price=0;

            }
            
       if(end_price == "")
     {
           end_price=0;

            }
            
                  if(category == "")
     {
           category=0;

            }
            
      if(room == "")
     {
           room=0;

            }
            
        if(building == "")
     {
           building=0;

            }  
            
                    
       querystring = "st=" +  st_price + "&end="  + end_price + "&location=" + category + "&room=" + room + "&bid=" + building + "&limit=10"; 
        
      window.location = "show_search.aspx?" + querystring;

}

function load_frame_new_page(id)
{
 var objFrame=document.getElementById("Iframe5"); 
 objFrame.src = "add_next_month_items.aspx?id=" + id;
 
 alert(id);
 
}

function load_building_property_by_id(location)
{
 //alert(location);
 
 
 //document.getElementById("load_property").innerHTML= "";
  try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            if (xmlHttp.readyState==1)
            {
             
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {
                                
                if (xmlHttp.responseText!="")
                {
                //alert(xmlHttp.responseText);
                
                    document.getElementById("ctl00_CPH_body_load_property").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","handler/building.ashx?bid=" + location + "&b_type=5",true);
          xmlHttp.send(null);
}

function redirect_page(page)
{
    window.location = page;
}

function showhidediv(elementid)
{
  var elment = document.getElementById(elementid);

    if(elment.style.display == 'block')
     {
           elment.style.display = 'none';
    }
    else
    {
             elment.style.display = 'block';
    }
}

function validate_location()
{
 
 var element = document.getElementById("ctl00_ContentPlaceHolder1_pre_title");
 element.className = "";
 if(element.value=="")
 {
   alert("Please enter the location");
   element.className ='input_highlight';
   element.focus();
   return false;
 }
 return true;
}

function validate_slideshow()
{
    var img_load = document.getElementById("ctl00_ContentPlaceHolder1_filImage");
    var img_title = document.getElementById("ctl00_ContentPlaceHolder1_pre_title");
    
    img_load.className = "";
    img_title.className = "";
    if(img_load.value == "")
    {
           alert("Please upload the image");
           img_load.className ='input_highlight';
           img_load.focus();
           return false;
     }else if(img_title.value == ""){
           alert("Please enter the image title");
           img_title.className ='input_highlight';
           img_title.focus();
           return false;
     }
     return true;
}
function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

   function IsEmpty(aTextField) {
   if ((aTextField.length==0) ||
   (aTextField.value==null)) {
      return true;
   }
   else { return false; }
}	



function validate_parking()
{
    //var park_title = document.getElementById("ctl00_ContentPlaceHolder1_pre_title");
    var pre_date = document.getElementById("ctl00_ContentPlaceHolder1_pre_date");
    //var park_loc = document.getElementById("ctl00_ContentPlaceHolder1_location");
    var park_price = parseInt(document.getElementById("ctl00_ContentPlaceHolder1_price").value);
    
    //park_title.className = "";
    pre_date.className = "";
    //park_loc.className = "";
    park_price.className = "";

    //    
    if(pre_date.value == ""){
           alert("Please select the date");
           pre_date.className ='input_highlight';
           pre_date.focus();
           return false;
      }
//else if(park_loc.value == ""){
//           alert("Please enter the location");
//           park_loc.className ='input_highlight';
//           park_loc.focus();
//           return false;
//     }
     else if(IsEmpty(park_price) == true){
           alert("Please enter the price");
           park_price.className ='input_highlight';
           park_price.focus();
           return false;
     }
     return true;
}

function validate_userdetails()
{
          var uname = document.getElementById("ctl00_ContentPlaceHolder1_txt_name").value;
          var uemailid=document.getElementById("ctl00_ContentPlaceHolder1_txt_email").value;//user email
          var upassword=document.getElementById("ctl00_ContentPlaceHolder1_txt_password").value;//hash password
          var uconpassword=document.getElementById("ctl00_ContentPlaceHolder1_txt_confirm_password").value;//hash password
          var mylist=document.getElementById("ctl00_ContentPlaceHolder1_ddl_country");
          var ucountry=mylist.options[mylist.selectedIndex].text;
          var upermision=1;
          
          //alert(uemailid);
//          errormsg1.innerHTML = "";
//          uname.className = "";
         
          if(uname == ''){
              alert("Name should not be empty");
              uname ="";
              document.getElementById("ctl00_ContentPlaceHolder1_txt_name").focus();             
              return false;
          }else if(uemailid == ''){
              alert("Email should not be empty");
              uemailid="";
              document.getElementById("ctl00_ContentPlaceHolder1_txt_email").focus();             
              return false;
          }else if(echeck(uemailid) == false){
              document.getElementById("ctl00_ContentPlaceHolder1_txt_email").value="";
              document.getElementById("ctl00_ContentPlaceHolder1_txt_email").focus();
              return false;
          }else if(upassword == ''){
              alert("Password should not be empty");
              upassword="";
              document.getElementById("ctl00_ContentPlaceHolder1_txt_password").focus();
              return false;
          }else if(uconpassword == ''){
              alert("Confirm should not be empty");
              uconpassword="";
              document.getElementById("ctl00_ContentPlaceHolder1_txt_confirm_password").focus();
              return false;
          }else if(upassword != uconpassword){
              alert("Password does not match");
              document.getElementById("ctl00_ContentPlaceHolder1_txt_password").value="";
              document.getElementById("ctl00_ContentPlaceHolder1_txt_confirm_password").value="";
              document.getElementById("ctl00_ContentPlaceHolder1_txt_password").focus();
              return false;
          }
     return true;
}

function update_unit_show_search(recordid,elementid)
{  
   var chkelement = document.getElementById(elementid);
   var chkvalue;
   if(chkelement.checked==true)
   {
     chkvalue = 1;
   }
   else
   {
     chkvalue = 0;
   }
   
   try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            
            //alert(xmlHttp.responseText);
            if (xmlHttp.readyState==1)
            {

            }
            if(xmlHttp.readyState==4)
              {
               
                             
                
                if (xmlHttp.responseText!="")
                {
                    alert("Saved Successfully");
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/building.ashx?bid=" + recordid + "&b_type=6&svalue="+chkvalue,true);
          xmlHttp.send(null);
     
 }
 
 
 function update_unit_show_search2(recordid,elment_id)
{  
   var chkelement = document.getElementById("chk_" + elment_id);
   var chkvalue;
   if(chkelement.checked==true)
   {
     chkvalue = 1;
   }
   else
   {
     chkvalue = 0;
   }
   
   try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            
            //alert(xmlHttp.responseText);
            if (xmlHttp.readyState==1)
            {

            }
            if(xmlHttp.readyState==4)
              {
               
                             
                
                if (xmlHttp.responseText!="")
                {
                    //alert("Saved Successfully");
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/building.ashx?bid=" + recordid + "&b_type=6&svalue="+chkvalue,true);
          xmlHttp.send(null);
     
 }
 
 
 function validate_open_houses(bid)
 { 
  
    document.getElementById("ctl00_ContentPlaceHolder1_buildingunit").innerHTML = "";
    //alert("Test");
    try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            try
              {
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            catch (e)
              {
              alert("Your browser does not support AJAX!");
              return false;
              }
            }
          }
          

          //alert(emailid + "***" + u_password);
          xmlHttp.onreadystatechange=function()
            {
            //alert(xmlHttp.responseText);
            if (xmlHttp.readyState==1)
            {             
              
               //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if(xmlHttp.readyState==4)
              {              
                
                if (xmlHttp.responseText!="")
                {
                   
                   document.getElementById("ctl00_ContentPlaceHolder1_buildingunit").innerHTML = xmlHttp.responseText;
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
              }
            }
          xmlHttp.open("GET","../handler/photo.ashx?bid=" + bid + "&p_type=41",true);
          xmlHttp.send(null);
   
 }
 
 function showMap(id,State,City,Address)
 {
				
        var strUrl = "http://www.mapquest.com/maps/map.adp?address=" + Address + "&city=" + City + "&state=" + State + "&zipcode=" + id;
        window.open(strUrl,'','scrollbars=yes,toolbar=no,width=680,height=600,top=100,left=100');

    }


    function showhidepagecontents(elementid) {
        alert("Test");

    }
    function redirect_by_url(url) 
    {

        window.location = url;

    }

    function showhideoptions(id, flag)
    {
        var chkelement = document.getElementById("chk_" + id);
        var svalue;

        if (chkelement.checked == true) {
            svalue = 1;
        }
        else {

            svalue = 0;
        }

        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        //alert(emailid + "***" + u_password);
        xmlHttp.onreadystatechange = function () {
            //alert(xmlHttp.responseText);
            if (xmlHttp.readyState == 1) {

                //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {

                    alert("Saved Successfully");
                    //document.getElementById("ctl00_ContentPlaceHolder1_buildingunit").innerHTML = xmlHttp.responseText;
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
            }
        }
        xmlHttp.open("GET", "../handler/showhideprocess.ashx?flag=" + flag + "&updateid=" + id + "&svalue=" + svalue, true);
        xmlHttp.send(null);

    }


    function delete_building_unit_photos(id,bid,uid,flag)
    {
        var confirmdelete = confirm("Are you sure you want to Delete?");

        if (confirmdelete == true) {
            try {
                // Firefox, Opera 8.0+, Safari
                xmlHttp = new XMLHttpRequest();
            }
            catch (e) {
                // Internet Explorer
                try {
                    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
                }
                catch (e) {
                    try {
                        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    catch (e) {
                        alert("Your browser does not support AJAX!");
                        return false;
                    }
                }
            }


            //alert(emailid + "***" + u_password);
            xmlHttp.onreadystatechange = function () {
                //alert(xmlHttp.responseText);
                //alert(xmlHttp.responseText);
                if (xmlHttp.readyState == 1) {

                    //document.getElementById('ctl00_Label_eR').innerHTML=""; 
                }

                if (xmlHttp.readyState == 4) {

                    if (xmlHttp.responseText != "") {


                        //alert("Saved Successfully");
                        document.getElementById("ctl00_ContentPlaceHolder1_loadunits").innerHTML = xmlHttp.responseText;
                        //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                    }
                    else {
                        document.getElementById("ctl00_ContentPlaceHolder1_loadunits").innerHTML = "No Records";
                    }
                }
            }
            xmlHttp.open("GET", "../handler/building.ashx?delete=" + id + "&b_type=" + flag + "&bid=" + bid + "&unit_id=" + uid, true);
            xmlHttp.send(null);
        }
    }


    function load_building_unit_photos(flag) {

        var builid_id;
        builid_id = document.getElementById("ctl00_ContentPlaceHolder1_bld_update_id").value;

        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        //alert(emailid + "***" + u_password);
        xmlHttp.onreadystatechange = function () {
            //alert(xmlHttp.responseText);
            if (xmlHttp.readyState == 1) {

                //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }

            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {

                    //alert(xmlHttp.responseText);
                    //alert("Saved Successfully");
                    document.getElementById("ctl00_ContentPlaceHolder1_loadunits").innerHTML = xmlHttp.responseText;
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML=xmlHttp.responseText;
                }
            }
        }
        xmlHttp.open("GET", "../handler/building.ashx?b_type=" + flag + "&bid=" + builid_id, true);
        xmlHttp.send(null);
    }


    function delete_parking_by_id(bid,delid) {


        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        //alert(emailid + "***" + u_password);
        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {
                //              var div_left=document.getElementById("admin_body_photo").offsetLeft;
                //              var div_top=document.getElementById("admin_body_photo").offsetTop;
                //              var div_width=document.getElementById("admin_body_photo").offsetWidth;
                //              var div_height=document.getElementById("admin_body_photo").offsetHeight;
                //              
                //              document.getElementById("loading_divAdmin").style.display="";
                //              document.getElementById("loading_divAdmin").style.top= div_top + "px";
                //              document.getElementById("loading_divAdmin").style.left= div_left + "px";

                //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if (xmlHttp.readyState == 4) {
                //document.getElementById('loading_divAdmin').style.display = 'none';
                alert("Record deleted successfully");
                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
            }
        }
        xmlHttp.open("GET", "../handler/building.ashx?b_type=16&bid=" + bid + "&delete=" + delid, true);
        xmlHttp.send(null);
    }


    function delete_open_by_id(bid,unitid,delid) {


        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        //alert(emailid + "***" + u_password);
        xmlHttp.onreadystatechange = function () {           
            if (xmlHttp.readyState == 4) {
                //document.getElementById('loading_divAdmin').style.display = 'none';
                alert("Record deleted successfully");
                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
            }
        }
        xmlHttp.open("GET", "../handler/building.ashx?b_type=17&bid=" + bid + "&delete=" + delid + "&unit_id=" + unitid, true);
        xmlHttp.send(null);
    }


    function load_building_property_by_id_admin(location) {
        //alert(location);


        //document.getElementById("load_property").innerHTML= "";
        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        //alert(emailid + "***" + u_password);
        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

                //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    //alert(xmlHttp.responseText);

                    document.getElementById("ctl00_ContentPlaceHolder1_load_building_select").innerHTML = xmlHttp.responseText;
                }
            }
        }
        xmlHttp.open("GET", "../handler/building.ashx?bid=" + location + "&b_type=45", true);
        xmlHttp.send(null);
    }


    function load_parking_by_building_id() {
        var bid;
        bid = document.getElementById("building").value;
        document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "Loading......";
        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        //alert(emailid + "***" + u_password);
        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

                document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "<br><br><center>Loading ... <img src='../images/loading.gif' /></center>";
                //              var div_left=document.getElementById("admin_body_photo").offsetLeft;
                //              var div_top=document.getElementById("admin_body_photo").offsetTop;
                //              var div_width=document.getElementById("admin_body_photo").offsetWidth;
                //              var div_height=document.getElementById("admin_body_photo").offsetHeight;
                //              
                //              document.getElementById("loading_divAdmin").style.display="";
                //              document.getElementById("loading_divAdmin").style.top= div_top + "px";
                //              document.getElementById("loading_divAdmin").style.left= div_left + "px";

                //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
                else {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "<br><br><center>No Records Found</center>";
                }
            }
        }
        xmlHttp.open("GET", "../handler/building.ashx?b_type=46&bid=" + bid , true);
        xmlHttp.send(null);
    }

    function load_units_by_building_id() {
        var bid;
        bid = document.getElementById("building").value;
        document.getElementById("ctl00_ContentPlaceHolder1_loadbuildingunits").innerHTML = "Loading......";
        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        //alert(emailid + "***" + u_password);
        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

                document.getElementById("ctl00_ContentPlaceHolder1_loadbuildingunits").innerHTML = "<br><br><center>Loading ... <img src='../images/loading.gif' /></center>";
                //              var div_left=document.getElementById("admin_body_photo").offsetLeft;
                //              var div_top=document.getElementById("admin_body_photo").offsetTop;
                //              var div_width=document.getElementById("admin_body_photo").offsetWidth;
                //              var div_height=document.getElementById("admin_body_photo").offsetHeight;
                //              
                //              document.getElementById("loading_divAdmin").style.display="";
                //              document.getElementById("loading_divAdmin").style.top= div_top + "px";
                //              document.getElementById("loading_divAdmin").style.left= div_left + "px";

                //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_loadbuildingunits").innerHTML = xmlHttp.responseText;
                }
                else {
                    document.getElementById("ctl00_ContentPlaceHolder1_loadbuildingunits").innerHTML = "<br><br><center>No Records Found</center>";
                }
            }
        }
        xmlHttp.open("GET", "../handler/building.ashx?b_type=47&bid=" + bid, true);
        xmlHttp.send(null);
    }


    function load_openhouse_by_building_id() {
        var bid;
        bid = document.getElementById("building").value;
        document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "Loading......";
        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        //alert(emailid + "***" + u_password);
        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

                document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "<br><br><center>Loading ... <img src='../images/loading.gif' /></center>";
                //              var div_left=document.getElementById("admin_body_photo").offsetLeft;
                //              var div_top=document.getElementById("admin_body_photo").offsetTop;
                //              var div_width=document.getElementById("admin_body_photo").offsetWidth;
                //              var div_height=document.getElementById("admin_body_photo").offsetHeight;
                //              
                //              document.getElementById("loading_divAdmin").style.display="";
                //              document.getElementById("loading_divAdmin").style.top= div_top + "px";
                //              document.getElementById("loading_divAdmin").style.left= div_left + "px";

                //document.getElementById('ctl00_Label_eR').innerHTML=""; 
            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
                else {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "<br><br><center>No Records Found</center>";
                }
            }
        }
        xmlHttp.open("GET", "../handler/building.ashx?b_type=48&bid=" + bid, true);
        xmlHttp.send(null);
    }

    function getfeatureapartments() 
    {
       
        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }        
       
        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

                //document.getElementById("ctl00_CPH_body_loadapartments").innerHTML = "<br><br><center>Loading ... <img src='images/loading.gif' /></center>";
               
            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_CPH_body_loadapartments").innerHTML = xmlHttp.responseText;
                }
                else {
                    document.getElementById("ctl00_CPH_body_loadapartments").innerHTML = "<br><br><center>No Records Found</center>";
                }
            }
        }
        xmlHttp.open("GET", "handler/building.ashx?b_type=13", true);
        xmlHttp.send(null);

    }

    function update_property_image(bid, uid, imgid) {


        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }

        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

                //document.getElementById("ctl00_loadapartments").innerHTML = "<br><br><center>Loading ... <img src='images/loading.gif' /></center>";
                // alert(xmlHttp.responseText);
            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_loadunits").innerHTML = xmlHttp.responseText;
                }
                else {
                    document.getElementById("ctl00_ContentPlaceHolder1_loadunits").innerHTML = "<br><br><center>No Records Found</center>";
                }
            }
        }
        xmlHttp.open("GET", "../handler/notes.ashx?b_type=5&bid=" + bid + "&uid=" + uid + "&imgid=" + imgid, true);
        xmlHttp.send(null);
    }

    function validate_category() {

        // alert("Test comments");        //ctl00_ContentPlaceHolder1_new_category

        var category_title = document.getElementById("ctl00_ContentPlaceHolder1_new_category");
        if (category_title.value == "") {
            alert("Please enter the category title");
            category_title.className = 'input_highlight';
            category_title.focus();
            return false;
        }
        else {
            return true;
        }

    }


    function delete_category(id) {
        // alert(id); 


        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }
        
       
        xmlHttp.onreadystatechange = function () {
            
            if (xmlHttp.readyState == 4) {               

                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
            }
        }
        xmlHttp.open("GET", "../handler/notes.ashx?note_id=" + id + "&b_type=6", true);
        xmlHttp.send(null);
    }

    //faq section
    function deleteFaqCategory(cat_id) {



        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
                else {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "No Categories";
                }
            }
        }
        xmlHttp.open("GET", "../handler/faq.ashx?recid=" + cat_id + "&flag=1", true);
        xmlHttp.send(null);
    }
    function showhideFaqCategory(cat_id) {

        var chkelement = document.getElementById("chk_" + cat_id);
        var svalue;

        if (chkelement.checked == true) {
            svalue = 1;
        }
        else {

            svalue = 0;
        }


        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    alert(xmlHttp.responseText);
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
                else {
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "No Categories";
                }
            }
        }
       
        xmlHttp.open("GET", "../handler/faq.ashx?recid=" + cat_id + "&flag=2&svalue=" + svalue, true);
        xmlHttp.send(null);
    }

    function deleteFaqQuestion(question_id,catid) {



        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
                else {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "No Questions";
                }
            }
        }
        xmlHttp.open("GET", "../handler/faq.ashx?recid=" + question_id + "&flag=3&catid=" + catid, true);
        xmlHttp.send(null);
    }

    function update_faq_question_order(value,id, flag) {

        if (IsNumeric(value) == false) {
            alert("Invalid number");
        }
        else {

            try {
                // Firefox, Opera 8.0+, Safari
                xmlHttp = new XMLHttpRequest();
            }
            catch (e) {
                // Internet Explorer
                try {
                    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
                }
                catch (e) {
                    try {
                        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    catch (e) {
                        alert("Your browser does not support AJAX!");
                        return false;
                    }
                }
            }


            xmlHttp.onreadystatechange = function () {
                if (xmlHttp.readyState == 1) {

                }
                if (xmlHttp.readyState == 4) {

                    if (xmlHttp.responseText != "") {
                        //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                        alert(xmlHttp.responseText)
                    }
                    else {
                        //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "No Questions";
                    }
                }
            }
            xmlHttp.open("GET", "../handler/faq.ashx?recid=" + id + "&flag=" + flag + "&svalue=" + value, true);
            xmlHttp.send(null);
        }
    }

    function IsNumeric(input) {
        return /^-?(0|[1-9]\d*|(?=\.))(\.\d+)?$/.test(input);
    }

    //ep document
    function deleteDocumentCategory(cat_id) {



        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
                else {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "No Categories";
                }
            }
        }
        xmlHttp.open("GET", "../handler/epdocuments.ashx?recid=" + cat_id + "&flag=1", true);
        xmlHttp.send(null);
    }

    function showhideDocumentCategory(cat_id) {

        var chkelement = document.getElementById("chk_" + cat_id);
        var svalue;

        if (chkelement.checked == true) {
            svalue = 1;
        }
        else {

            svalue = 0;
        }


        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    alert(xmlHttp.responseText);
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
                else {
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "No Categories";
                }
            }
        }

        xmlHttp.open("GET", "../handler/epdocuments.ashx?recid=" + cat_id + "&flag=2&svalue=" + svalue, true);
        xmlHttp.send(null);
    }

    function deleteEPDocuments(doc_id,cat_id) {



        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
                else {
                    document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "No Categories";
                }
            }
        }
        xmlHttp.open("GET", "../handler/epdocuments.ashx?recid=" + doc_id + "&flag=3&catid=" + cat_id, true);
        xmlHttp.send(null);
    }

    function showhideEpDocuments(doc_id) {

        var chkelement = document.getElementById("chk_" + doc_id);
        var svalue;

        if (chkelement.checked == true) {
            svalue = 1;
        }
        else {

            svalue = 0;
        }


        try {
            // Firefox, Opera 8.0+, Safari
            xmlHttp = new XMLHttpRequest();
        }
        catch (e) {
            // Internet Explorer
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
            }
        }


        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 1) {

            }
            if (xmlHttp.readyState == 4) {

                if (xmlHttp.responseText != "") {
                    alert(xmlHttp.responseText);
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = xmlHttp.responseText;
                }
                else {
                    //document.getElementById("ctl00_ContentPlaceHolder1_contentarea2").innerHTML = "No Categories";
                }
            }
        }

        xmlHttp.open("GET", "../handler/epdocuments.ashx?recid=" + doc_id + "&flag=4&svalue=" + svalue, true);
        xmlHttp.send(null);
    }
