 function open_calendar(item_date_name, tdisplay) {

   windowprops = "top=0,"
               + "left=0," 
               + "toolbar=no,"
               + "location=no,"
               + "directories=no,"
               + "menubar=no,"
               + "copyhistory=yes,"
               + "status=no,"
               + "resizable=no,"
               + "scrollbars=no,"
               + "width=400,"
               + "height=220";


   page = "calendar.php?item_date_name=" + item_date_name + "&tdisplay=" + tdisplay;  
   win_area = window.open(page, "", windowprops);

   if (!win_area.opener) win_area.opener = self;

 } // end function        


/*
 // use open_owin_site
 function open_win_site(url, resize, scroll, width, height) {

   windowprops = "top=300,"
               + "left=300," 
               + "toolbar=no,"
               + "location=no,"
               + "directories=no,"
               + "menubar=no,"
               + "copyhistory=yes,"
               + "status=no,"
               + "resizable=" + resize + ","
               + "scrollbars=" + scroll + ","
               + "width=" + width + ","
               + "height=" + height;

   page = "site_popup.php?" + url  
   window.open(page, "", windowprops);

 }    */     


 function open_win_gcards(url, resize, scroll, width, height) {
   
   windowprops = "top=300,"
               + "left=300," 
               + "toolbar=no,"
               + "location=no,"
               + "directories=no,"
               + "menubar=no,"
               + "copyhistory=yes,"
               + "status=no,"
               + "resizable=" + resize + ","
               + "scrollbars=" + scroll + ","
               + "width=" + width + ","
               + "height=" + height;

   page = "gcards_popup.php?" + url  
   window.open(page, "", windowprops);

 } // end function        


 function open_owin_site(url, resize, scroll, width, height) {

   windowprops = "top=300,"
               + "left=300," 
               + "toolbar=no,"
               + "location=no,"
               + "directories=no,"
               + "menubar=no,"
               + "copyhistory=yes,"
               + "status=no,"
               + "resizable=" + resize + ","
               + "scrollbars=" + scroll + ","
               + "width=" + width + ","
               + "height=" + height;

   page = "site_popup.php?" + url  
   win_area = window.open(page, "", windowprops);

   if (!win_area.opener) win_area.opener = self;

 } // end function        
      

 function open_win_images(url) {

   windowprops = "top=0,"
               + "left=0," 
               + "toolbar=no,"
               + "location=no,"
               + "directories=no,"
               + "menubar=no,"
               + "copyhistory=yes,"
               + "status=no,"
               + "resizable=yes,"
               + "scrollbars=yes,"
               + "width=100,"
               + "height=100";

   page = "site_popup_images.php?" + url  
   window.open(page, "", windowprops);

 } // end function        


 function open_win_site_save(url, resize, scroll, width, height) {

    document.getElementById("export_data_page").src = "site_popup_save.php?" + url;
    
 } // end function        


/*
 // use open_win_data
 function open_win(url, resize, scroll, width, height) {

   windowprops = "top=300,"
               + "left=300," 
               + "toolbar=no,"
               + "location=no,"
               + "directories=no,"
               + "menubar=no,"
               + "copyhistory=yes,"
               + "status=no,"
               + "resizable=" + resize + ","
               + "scrollbars=" + scroll + ","
               + "width=" + width + ","
               + "height=" + height;

   page = admin_path + "_popup.php?" + url  
   window.open(page, "", windowprops);

 } // end function    */    


 function open_win_data(url, resize, scroll, width, height) {

   windowprops = "top=0,"
               + "left=0," 
               + "toolbar=no,"
               + "location=no,"
               + "directories=no,"
               + "menubar=no,"
               + "copyhistory=yes,"
               + "status=no,"
               + "resizable=" + resize + ","
               + "scrollbars=" + scroll + ","
               + "width=" + width + ","
               + "height=" + height;

   page = admin_path + "_popup.php?" + url  

   win_area = window.open(page, "", windowprops);

   if (!win_area.opener) win_area.opener = self;

 } // end function        


 function print_page(v) {
 
   if(document.getElementById("top_options"))
      document.getElementById("top_options").style.display = v;

   if(document.getElementById("bottom_options"))
      document.getElementById("bottom_options").style.display = v;
 
 } // end function        

 
 function Remove_Spaces(string) {
 
    string = string + " "
    newString = ""
  
    schars = string.split(" ")
 
    for(j=0;j<schars.length;j++)
        newString = newString + schars[j]
  
    return newString
  
 } // end function        


 function Check_Email(email) {

  ss = ""
  at = email.indexOf("@")
  
  if(at == -1)	
	  ss = "Not a valid e-mail"  
  
  return ss
    
 } // end function        
 
 

 function login_check(e) {
   
  key = window.event ? e.keyCode : e.which;

  if(key == 13)
     ich()
    
 } // end function        


 function mbn_view(idname, n) {

    document.getElementById(idname).scrollAmount = n;
    
 } // end function        
 

 function  validateNumeric(strValue) {

  var objRegExp  =  /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;
  
  return objRegExp.test(strValue);
  
 } // end function        


 function additional() {

   objects = document.getElementsByTagName("object");

   for(var i = 0; i < objects.length; i++) {
    if(objects[i].outerHTML) {
       odata = objects[i].outerHTML;
       if(odata.indexOf('Sitefobj_') < 0)
          objects[i].outerHTML = objects[i].outerHTML;
    }      
   }    

   embeds = document.getElementsByTagName("embed");

   for(var i = 0; i < embeds.length; i++)
       embeds[i].outerHTML = embeds[i].outerHTML;

 } // end function
 



function site_submit_data_save_win(url, resize, scroll, width, height) {

   windowprops = "top=300,"
               + "left=300," 
               + "toolbar=no,"
               + "location=no,"
               + "directories=no,"
               + "menubar=no,"
               + "copyhistory=yes,"
               + "status=no,"
               + "resizable=" + resize + ","
               + "scrollbars=" + scroll + ","
               + "width=" + width + ","
               + "height=" + height;

   page = "site_page_save_popup.php?" + url  
   win_area = window.open(page, "", windowprops);

   if (!win_area.opener) win_area.opener = self;

} // end function


function site_submit_data_save_process() {

   alen = window.opener.document.links.length;
   
   page_links = "";
   padds = "";

   for(i=0;i<alen;i++) {
     
    l = "'" + document.links[i] + "'";

    if(l.indexOf("javascript") > -1) {
       page_links += padds + document.links[i];
       padds = "***";
    }   
   
   } // end
   
   document.export_form.page_data_title_save.value = window.opener.document.getElementById("mid_page_title").innerHTML;
   document.export_form.page_data_contents_save.value = window.opener.document.getElementById("mid_cell").innerHTML;
   document.export_form.page_data_links_save.value = page_links;

   document.export_form.submit();
   
   document.export_form.page_data_title_save.value = "";   
   document.export_form.page_data_contents_save.value = "";   
   document.export_form.page_data_links_save.value = "";   


   /*
   alen = document.links.length;
   
   page_links = "";
   padds = "";

   for(i=0;i<alen;i++) {
     
    l = "'" + document.links[i] + "'";

    if(l.indexOf("javascript") > -1) {
       page_links += padds + document.links[i];
       padds = "***";
    }   
   
   } // end
   
   document.export_form.page_data_title_save.value = document.getElementById("mid_page_title").innerHTML;
   document.export_form.page_data_contents_save.value = document.getElementById("mid_cell").innerHTML;
   document.export_form.page_data_links_save.value = page_links;

   document.export_form.submit();
   
   document.export_form.page_data_title_save.value = "";   
   document.export_form.page_data_contents_save.value = "";   
   document.export_form.page_data_links_save.value = "";   
   */
   
} // end 


 function NewsBarData(v) {
 
   document.getElementById("newsbar").scrollAmount = v;
 
 } // end function



 function hide_all_related_sections() {
 
   for(i=0;i<all_smcod_ids.length-1;i++) {
       smcod_id = all_smcod_ids[i];
       document.getElementById(smcod_id).style.display = "none";
   }
    
 } // end

 
 function fields_data_contents(vid) {

  vid_st = document.getElementById(vid).style.display;
  
  hide_all_related_sections();  
  
  if(vid_st == "block")
      document.getElementById(vid).style.display = "none";
   else 
      document.getElementById(vid).style.display = "block";

 } // end 
 

 function ch_td_bg(v, tid) {

 /*
    if(v == 0)
       tbgcolor = "#EFEFEF";
    else
       tbgcolor = "#FFFFFF";//F7F7F7
          
    document.getElementById(tid).style.backgroundColor = tbgcolor;
  */
 } // end 
 