// JavaScript Document

function popup(mylink, windowname, zWidth, zHeight)
{
if (! window.focus)return true;

var vWidth = zWidth;
var vHeight = zHeight;
var pStr = 'width=' + vWidth + ',height=' + vHeight + ',scrollbars=yes';

var href;

if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, pStr);
return false;
}


function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) 
	alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }


function show_hide(a,b,c){
	
	if(b !== 0){
	if(document.getElementById(b).style.display == 'inline'){
		document.getElementById(b).style.display = 'none';
		document.getElementById('projects_text').innerHTML = 'hide';
	}}
	
	if (document.getElementById(a).style.display == 'none'){
		document.getElementById(a).style.display = 'inline';
		if(c !== 0){
			document.getElementById('projects_text').innerHTML = 'hide';
		}
	} else {
		document.getElementById(a).style.display = 'none';
		if(c !== 0){
			document.getElementById('projects_text').innerHTML = 'show';
		}
	}
}


function chk_form(){
	var error = 0;
	var myName = document.getElementById('name').value;
	var myPhone = document.getElementById('phone').value;
	var myEmail = document.getElementById('email').value;
	
	if((myName == 'Name:') || (myName == '')){
		var error = 1;
	}
	if((myPhone == 'Phone:') || (myPhone == '')){
		var error = 1;
	}
	if((myEmail == 'Email:') || (myEmail == '')){
		var error = 1;
	}
	if(error == 1){
		alert('Please check your form');
	} else {
		document.myForm.submit();
	}
}

function cnt_form_name(a,b){
	var change = 0;
	
	if(b == 'name'){
		var compare = 'Name:';
	} else if (b == 'phone') {
		var compare = 'Phone:';
	} else if (b == 'email') {
		var compare = 'Email:';
	}
	

	if((a == compare) || (a == '')){
		document.getElementById(b).value = compare;
		document.getElementById(b).style.border = "1px solid red";
		var change = 1;
	}
	if(change == 0){
		if(a == 'change_color_on'){
			document.getElementById(b).style.border = "1px solid #999999";
		}
	}
	
}


function hide_start(){
	document.getElementById('start').style.display = 'none';
}

function ShowTodaysDate() {

<!-- Begin

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
								}

// Join it all together
today =  days[now.getDay()] + ", " +
         months[now.getMonth()] + " " +
         date + ", " +
         (fourdigits(now.getYear())) ;

// Print out the data.
document.write(today);

//  End -->
}