
 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_owin_viewer(url) {

   windowprops = "top=100,"
               + "left=100," 
               + "toolbar=no,"
               + "location=no,"
               + "directories=no,"
               + "menubar=no,"
               + "copyhistory=yes,"
               + "status=no,"
               + "resizable=no,"
               + "scrollbars=no,"
               + "width=100,"
               + "height=100";

   page = "viewer.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  validateNumeric(strValue) {

  var objRegExp  =  /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;
  
  return objRegExp.test(strValue);
  
 } // end function        




//Get Cookie Function
function getCookie(name) {
	var cname = name + "=";
	var dc = document.cookie;
	
	if (dc.length > 0) {
		begin = dc.indexOf(cname);
		if (begin != -1) {
			begin += cname.length;
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
				return unescape(dc.substring(begin, end));
		}
	}
	return null;
}

//Set Cookie Function
function setCookie(name, value, expires, path, domain, secure) {
	document.cookie = name + "=" + escape(value) + 
	((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
	((path == null) ? "" : "; path=" + path) +
	((domain == null) ? "" : "; domain=" + domain) +
	((secure == null) ? "" : "; secure");
}


 setCookie('CITEM', '');

 function SiteMenu(item) {
 
  citem = getCookie('CITEM');
  
  if(item != citem) {
  
     setCookie('CITEM', item);
  
     if(citem != '' && citem != null && document.getElementById("MenuItem" + citem))
        document.getElementById("MenuItem" + citem).style.display = "none";
     
     if(document.getElementById("MenuItem" + item))
        document.getElementById("MenuItem" + item).style.display = "block";
     
  } // end if 
 
 } // end function
 
 