
 function BrwoserWidthHeight() {
 
   var viewportwidth;
   var viewportheight;
  
   // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
  
   if(typeof window.innerWidth != 'undefined') 
   {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
   }
 
   // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

   else if(typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) 
   {
      viewportwidth = document.documentElement.clientWidth,
      viewportheight = document.documentElement.clientHeight
   }
 
   // older versions of IE
 
   else
   {
      viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
      viewportheight = document.getElementsByTagName('body')[0].clientHeight
   }

   return {w:viewportwidth, h:viewportheight};
   
 } // end 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;
	
 } // end 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");

 } // 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 Validation_Email(em) {
 
   emree = true;
   
   if(em.indexOf('@') < 1)
      emree = false;
      
   return emree;
 
 } // end function
 
 
 function isNumber(s) {
  
      nre = true;
      
      var i;
  
      for (i = 0; i < s.length; i++) {
      
         var c = s.charAt(i);

         if((c != '.' && !isDigit(c)) || (c == '.' && i == s.length-1)) {
            return false;
            i = s.length;
         }
                    
      } // end for
    
      return nre;
      
 } // end function        
 
  
 function isInteger(s) {
 
      var i;

      if (isEmpty(s))
      if (isInteger.arguments.length == 1) return 0;
      else return (isInteger.arguments[1] == true);

      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);

         if (!isDigit(c)) return false;
      }

      return true;
 
 } // end function
  
  
 function isIntegerInRange (s, a, b) {
 
    if (isEmpty(s))
         if (isIntegerInRange.arguments.length == 1) return false;
         else return (isIntegerInRange.arguments[1] == true);

      // Catch non-integer strings to avoid creating a NaN below,
      // which isn't available on JavaScript 1.0 for Windows.
      if (!isInteger(s, false)) return false;

      // Now, explicitly change the type to integer via parseInt
      // so that the comparison code below will work both on
      // JavaScript 1.2 (which typechecks in equality comparisons)
      // and JavaScript 1.1 and before (which doesn't).
      var num = parseInt (s);
      return ((num >= a) && (num <= b));
      
 } // end function

  
 function isEmpty(s) {
      return ((s == null) || (s.length == 0))
 }

 function isDigit (c) {
      return ((c >= "0") && (c <= "9"))
 }
  
  

 function DetectBrowserCookies() {

   setCookie("CookieIsSet", '1');
   cookie_is_set = getCookie("CookieIsSet");

   if(cookie_is_set == '' || cookie_is_set == null) {
      display_area = "BrowserCookiesNote";
   }
   else {
      display_area = "LoginFormArea";
   }
   
   document.getElementById(display_area).style.display = "block";   
   
 } // end function
 
  