//<!--
/* Calendare script */
var names     = new makeArray0('January','February','March','April','May','June','July','August','September','October','November','December');
var days      = new makeArray0(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var dow       = new makeArray0('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
var today     = new Date();
var day   = today.getDate();

function Calendar(Month,Year) {
    var output = '';
    
    output += '<FORM NAME="Cal"><table border="0" cellspacing="0" cellpadding="4" WIDTH="100%"><TR><TD ALIGN=LEFT>';
    output += '' + names[Month] + ' ' + Year + '<\/TD><TD ALIGN=RIGHT>';
    output += '<SELECT NAME="Month" onChange="changeMonth();">';

    for (month=0; month<12; month++) {
        if (month == Month) output += '<OPTION VALUE="' + month + '" SELECTED>' + names[month] + '<\/OPTION>';
        else                output += '<OPTION VALUE="' + month + '">'          + names[month] + '<\/OPTION>';
    }

    output += '<\/SELECT><SELECT NAME="Year" onChange="changeYear();">';

    for (year=2002; year<2010; year++) {
        if (year == Year) output += '<OPTION VALUE="' + year + '" SELECTED>' + year + '<\/OPTION>';
        else              output += '<OPTION VALUE="' + year + '">'          + year + '<\/OPTION>';
    }

    output += '<\/SELECT><\/TD><\/TR><TR><TD ALIGN=CENTER COLSPAN=2>';

    firstDay = new Date(Year,Month,1);
    startDay = firstDay.getDay();

    if (((Year % 4 == 0) && (Year % 100 != 0)) || (Year % 400 == 0))
         days[1] = 29; 
    else
         days[1] = 28;

    output += '<TABLE width="100%" CALLSPACING=0 CELLPADDING=0 BORDER=0 class="thinborder"><TR>';

    for (i=0; i<7; i++)
        output += '<TD  bgcolor="#990000" style="border: 1px solid #EEEEE0; border-bottom: 1px solid #EEEEE0; border-left: 1px solid #EEEEE0" ALIGN=CENTER VALIGN=MIDDLE><FONT COLOR="#FFFFFF"><B>' + dow[i] +'<\/B><\/FONT><\/TD>';

    output += '<\/TR><TR ALIGN=CENTER VALIGN=MIDDLE>';

    var column = 0;
    var lastMonth = Month - 1;
    if (lastMonth == -1) lastMonth = 11;

    for (i=0; i<startDay; i++, column++){
	
        if (i==day)
          output += '<TD style="border: 1px solid #EEEEE0; border-bottom: 1px solid #EEEEE0; border-left: 1px solid #EEEEE0" bgcolor="#FF0000"><FONT COLOR="#808080">' + (days[lastMonth]-startDay+i+1) + '<\/TD>';
		else
		 output += '<TD style="border: 1px solid #EEEEE0; border-bottom: 1px solid #EEEEE0; border-left: 1px solid #EEEEE0">' + (days[lastMonth]-startDay+i+1) + '<\/TD>';
    }
    for (i=1; i<=days[Month]; i++, column++) {
     
	    if (i==day)
	      output += '<TD style="border: 1px solid #EEEEE0; border-bottom: 1px solid #EEEEE0; border-left: 1px solid #EEEEE0" bgcolor="#EEEEEE">' + '<A HREF="javascript:changeDay(' + i + ')">' + i + '<\/A>' +'<\/TD>';
        else 
		  output += '<TD style="border: 1px solid #EEEEE0; border-bottom: 1px solid #EEEEE0; border-left: 1px solid #EEEEE0" >' + '<A HREF="javascript:changeDay(' + i + ')">' + i + '<\/A>' +'<\/TD>';
		
	    if (column == 6) {
            output += '<\/TR><TR ALIGN=CENTER VALIGN=MIDDLE>';
            column = -1;
        }
    }

    if (column > 0) {
        for (i=1; column<7; i++, column++)
		  if (i==day)
		    output +=  '<TD style="border: 1px solid #EEEEE0; border-bottom: 1px solid #EEEEE0; border-left: 1px solid #EEEEE0" bgcolor="#FF0000"><FONT SIZE=-1 COLOR="#808080" FACE="ARIAL">' + i + '<\/FONT><\/TD>';
		  else 
			output +=  '<TD style="border: 1px solid #EEEEE0; border-bottom: 1px solid #EEEEE0; border-left: 1px solid #EEEEE0" ><FONT SIZE=-1 COLOR="#808080" FACE="ARIAL">' + i + '<\/FONT><\/TD>';
    }

    output += '<\/TR><\/TABLE><\/FORM><\/TD><\/TR><\/TABLE>';

    return output;
}

function changeDay(day) {
    opener.day = day + '';
    opener.restart();
    self.close;
}

function changeMonth() {
    opener.month = document.Cal.Month.options[document.Cal.Month.selectedIndex].value + '';
    location.href = 'cal.htm';
}

function changeYear() {
    opener.year = document.Cal.Year.options[document.Cal.Year.selectedIndex].value + '';
    location.href = "cal.htm";
}

function makeArray0() {
    for (i = 0; i<makeArray0.arguments.length; i++)
        this[i] = makeArray0.arguments[i];
}


function y2k(number)    { return (number < 1000) ? number + 1900 : number; }

var today = new Date();
var day   = today.getDate();
var month = today.getMonth();
var year  = y2k(today.getYear());

function padout(number) { return (number < 10) ? '0' + number : number; }

function restart() {
     
	obj.value = '' + year + '-' + + padout(month - 0 + 1) + '-' + padout(day) ;
	  mywindow.close();
}

function newWindow(st) {
    mywindow=open('/includes/cal.htm','myname','resizable=no,width=300,height=220');
    mywindow.location.href = '/includes/cal.htm';
	obj=st
    if (mywindow.opener == null) mywindow.opener = self;
}

/* 	==============================================================================
	This function is check the email address

 	============================================================================== 
*/
function emailCheck (emailStr) {
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var matchArray=emailStr.match(emailPat)
	if (matchArray==null) {
		alert("Email address seems incorrect (check @ and .'s)")
		return false
	}
	var user=matchArray[1]
	var domain=matchArray[2]
	if (user.match(userPat)==null) {
	    alert("The username doesn't seem to be valid.")
	    return false
	}
	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) {
		  for (var i=1;i<=4;i++) {
		    if (IPArray[i]>255) {
		        alert("Destination IP address is invalid!")
			return false
		    }
	    }
	    return true
	}
	
	var domainArray=domain.match(domainPat)
	if (domainArray==null) {
		alert("The domain name doesn't seem to be valid.")
	    return false
	}
	
	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || 
	    domArr[domArr.length-1].length>3) {
	   alert("The address must end in a three-letter domain, or two letter country.")
	   return false
	}
	
	if (len<2) {
	   var errStr="This address is missing a hostname!"
	   alert(errStr)
	   return false
	}

return true;
}
//  End -->
if (document.images) {
  
  image10on = new Image();
  image10on.src = "/images/home_roll.gif";
  image10off = new Image();
  image10off.src = "/images/home.gif";

  image20on = new Image();
  image20on.src = "/images/services_roll.gif";
  image20off = new Image();
  image20off.src = "/images/services.gif";
  
  image30on = new Image();
  image30on.src = "/images/contact_us_roll.gif";
  image30off = new Image();
  image30off.src = "/images/contact_us.gif";
 
  image60on = new Image();
  image60on.src = "/images/site_map_roll.gif";
  image60off = new Image();
  image60off.src = "/images/site_map.gif";

  image70on = new Image();
  image70on.src = "/images/search_roll.gif";
  image70off = new Image();
  image70off.src = "/images/search.gif";

  image80on = new Image();
  image80on.src = "/images/go_roll.gif";
  image80off = new Image();
  image80off.src = "/images/go.gif";

}


function turnOn(imageName) {
  if (document.images) {
    document[imageName].src = eval(imageName + "on.src");
  }
}

function turnOff(imageName) {
  if (document.images) {
    document[imageName].src = eval(imageName + "off.src");
  }
}


/* 	==============================================================================
	This function is called from the short cut drop down menu ... if short cut is blank error msg is displyed
 	============================================================================== 
*/
function gotoshortcut(form) {

	var myindex=form.shortcut.selectedIndex
	if (form.shortcut.options[myindex].value==""){
		alert("Please make a selection from the list of shortcuts!")
		 return false;
	}
	parent.location=form.shortcut.options[myindex].value;
	return true;
}


/* 	==============================================================================
	This function is called from the search button ... if search is blank error msg is displyed
 	============================================================================== 
*/

function find(form) {
	var s=form.search.value
	var sLength = s.length;
	 if (sLength==0){
		alert("Search is blank please type in your search!")
		return false;
	}
	form.submit();	
	return true;
}

/* 	==============================================================================
	This function is called to open a window that accepts the following parameters:
	 document link (html), name , specs width, hight, scholling set to YES or NO.
 	============================================================================== 
*/


function openWindow(link,name,specs) {

   if (navigator.appName.indexOf("Microsoft")>=0) {
      specs+=',left=25,top=50';
    }else{
      specs+=',screenX=25,screenY=50';
    }
   floater=window.open(link,name,specs)
}


function warrning(msg) {

   if(confirm(msg)=="TRUE"){
    return true;
   }
   return false;
}
//-->


