
/*
CheckBrowser() - check browser version and redirect [must set replace page]
showDate() - Show Current Date and Time
PopStaticWindow(Url, W, H) - Create non-resizable window
PopDynamicWindow(Url, W, H) - Create resizable window
init() - Init Window Code
hideMenu(menuId) - Hide popup menu
showMenu(menuId) - Show popup menu
hideAllMenus() - Hide all menus [must set menu names]
*/


/* This code checks and redirects the browser
based on the browser vendor and version

Saturday, May 24, 2003

CodeMaze Software Group
Copyright 2002
*/

 function CheckBrowser() {

  var App = navigator.userAgent;
  var Version;
  var BrowserName;

	if (App.indexOf("Win") == -1) {

		window.location.replace("siteb/index.htm");

	} else if (App.indexOf("MSIE") >= 0 && App.indexOf("Opera") == -1) {

	    BrowserName = "Internet Explorer";
	     Version = App.substring(((App.indexOf("MSIE"))+5),(App.indexOf("MSIE"))+8);
		  Version = parseInt(Version);

		       if(Version >= 5) {
			   //do nothing;
			     return true;
		       } else {
			   window.location.replace("siteb/index.htm");
		       }

	} else if (App.indexOf("Netscape") >= 0) {

	    BrowserName = "Netscape";

	    if (App.indexOf("Netscape6") >= 0) {
	      Version = App.substring(((App.indexOf("Netscape"))+8), (App.indexOf("Netscape"))+9);
		  Version = parseInt(Version);
	    } else {
	      Version = App.substring(((App.indexOf("Netscape"))+9), (App.indexOf("Netscape"))+10);
		  Version = parseInt(Version);
	    }
		   if(Version >= 6) {
		       //do nothing;
			 return true;
		   } else {
			 window.location.replace("siteb/index.htm");
		   }

	} else if (App.indexOf("Opera") >= 0 && App.indexOf("MSIE") >=0) {

	    BrowserName = "Opera";
	     Version = App.substring(((App.indexOf("Opera"))+6), (App.indexOf("Opera"))+11);
		  Version = parseInt(Version);

		   if(Version >= 6) {
		       //do nothing
			 return true;
		   } else {
		       window.location.replace("siteb/index.htm");
		   }

	} else if (App.indexOf("Opera") >= 0) {

	    BrowserName = "Opera";
	     Version = App.substring(((App.indexOf("Opera"))+6), (App.indexOf("Opera"))+11);
		  Version = parseInt(Version);

		   if(Version >= 6) {
		       //do nothing
			 return true;
		   } else {
		       window.location.replace("siteb/index.htm");
		   }

	} else if (App.indexOf("Mozilla") >= 0) {

	    BrowserName = "Mozilla";
	     Version = App.substring(((App.indexOf("Mozilla"))+8), (App.indexOf("Mozilla"))+11);
			  Version = parseInt(Version);

	       if(Version >= 5) {
		   //do nothing
		     return true;
	       } else {
		   window.location.replace("siteb/index.htm");
	       }

	} else {

	    BrowserName = "None";
	     window.location.replace("siteb/index.htm");

	}

   }


    
    /* This code returns the date in a string to
       the calling script.
       
       Sunday, September 29, 2002
    
       CodeMaze Software Group
       Copyright 2002
    */
       
    
    function showDate() {
    
      try{

      var Today = new Date()
      var greeting;

	    switch(Today.getDay())
	    {
	      case 0:
		greeting = "Sunday, ";
		break;
	      case 1:
		greeting = "Monday, ";
		break;
	      case 2:
		greeting = "Tuesday, ";
		break;
	      case 3:
		greeting = "Wednesday, ";
		break;
	      case 4:
		greeting = "Thursday, ";
		break;
	      case 5:
		greeting = "Friday, ";
		break;
	      case 6:
		greeting = "Saturday, ";
		break;
	      default:
		greeting = " ";
	    }

       		
 	    switch(Today.getMonth())
 	    {
 	      case 0:
 	        greeting = greeting + "January ";
 	        break;
 	      case 1:
 	        greeting = greeting + "February ";
 	        break;
 	      case 2:
 	        greeting = greeting + "March ";
 	        break;
 	      case 3:
 	        greeting = greeting + "April ";
 	        break;
 	      case 4:
 	        greeting = greeting + "May ";
 	        break;
 	      case 5:
 	        greeting = greeting + "June ";
 	        break;
 	      case 6:
 	        greeting = greeting + "July ";
 	        break;
 	      case 7:
 	        greeting = greeting + "August ";
 	        break;
 	      case 8:
 	        greeting = greeting + "September ";
 	        break;
 	      case 9:
 	        greeting = greeting + "October ";
 	        break;
 	      case 10:
 	        greeting = greeting + "November ";
 	        break;
 	      case 11:
 	        greeting = greeting + "December ";
 	        break;
 	      default:
 	        greeting = greeting + " ";
 	    }
 
            greeting = greeting + Today.getDate() + ", " + Today.getFullYear();
            
         return(greeting);
         
	}catch(e){
	    // do not return error
	}

    }
    
    
    /* This code contains generic use windowing functions
       for the calling script.
       
       Sunday, September 29, 2002
    
       CodeMaze Software Group
       Copyright 2002
    */


    function PopStaticWindow(Url, W, H) {
    
      window.open(Url,'','toolbar=no,location=no,scrollbars=no,resizable=no,width=' + W + ',height='+ H + '');
          
    }
    
    function PopDynamicWindow(Url, W, H) {
    
      window.open(Url,'','toolbar=yes,location=no,scrollbars=yes,resizable=yes,width=' + W + ',height=' + H + '');
      
    }
       
    
    /* This code setups the dynamic pull down
       menus for the calling script
       
       Sunday, September 29, 2002
    
       CodeMaze Software Group
       Copyright 2002
    */
       

       var menuStartRef;
       var menuCloseRef;
       var sflag;
       var vers;

	   function init() {
	   
	  	try{

		   if (document.layers) {
			  // running older Netscape
			  menuStartRef = "document.layers['";
			  menuCloseRef = "']";
			  sflag = ".style";
			  vers = "ns4";
			} else if (document.all) {
			  // running IE
			  menuStartRef = "document.all['";
			  menuCloseRef = "']";
			  sflag = ".style";
			  vers = "ie";
			} else if (document.getElementById) {
			  // running ns6
			  menuStartRef = "document.getElementById('";
			  menuCloseRef = "')";
			  sflag = ".style";
			  vers = "ns6";
			} else {
			  // not supported
			  vers = "none";
			}
			
		}catch(e){
		       	  // do not return error
		}

	}

	   function hideMenu(menuId) {
	   	try{
			   if (vers != "none") {
				 eval(menuStartRef + menuId + menuCloseRef + sflag + '.visibility="hidden"');
			   } else {
				 return;
			   }
		   }catch(e){
		           // do not return error
		   }
       }

	   function showMenu(menuId) {
	   
	   	try{
	   	
			   if (vers != "none") {
				 eval(menuStartRef + menuId + menuCloseRef + sflag + '.visibility="visible"');
			   } else {
				 return;
			   }
		   }catch(e){
			   // do not return error
		   }
       }


	   function hideAllMenus() {
			  hideMenu('menuId');
			  hideMenu('contact_us');
	      }
	      
	      
