// popup

var xPos = (screen.width/2)-(450/2);
var yPos = (screen.height/2)-(450/2);
var pWin = null;

//open pop wait screen
function showPop1(sLoc) {
	pWin = window.open(sLoc,"pWin", "height=2,width=2,status=0,menubar=0,location=0,resizable=1,titlebar=0,scrollbars=1,top=0,left=0");
	pWin.resizeTo (500, 500);
	pWin.moveTo (xPos, yPos);
}

// check if the browser is Navigator 3 or higher:
agent = navigator.userAgent;
browserVer = 2;
if (agent.substring(0,7) == "Mozilla")
{
    if (parseInt(agent.substring(8,9)) >= 3) {
          browserVer = 1;
     }
}

// preload universal images:

if(browserVer == 1){

oneon = new Image(102,32);
oneoff = new Image(102,32);

twoon = new Image(102,32);
twooff = new Image(102,32);

threeon = new Image(102,32);
threeoff = new Image(102,32);

oneon.src = "images/nav/box_contact_on.gif";
oneoff.src = "images/nav/box_contact_off.gif";

twoon.src = "images/nav/box_more_on.gif";
twooff.src = "images/nav/box_more_off.gif";

threeon.src = "images/nav/button_contact_on.gif";
threeoff.src = "images/nav/button_contact_off.gif";

}
function press(imgName) {
    if (document.images)
      document[imgName].src = eval(imgName + 'on.src');
}
function release(imgName) {
  if (document.images)
    document[imgName].src = eval(imgName + 'off.src');
}
// -->

//works with the next function to get date string
function getCorrectedYear(year) {
  year = year - 0;
  if (year < 70) return (2000 + year);
  if (year < 1900) return (1900 + year);
  return year;
}
//function to get client date
function grabCDate() {
	var lmod = new Date();
	var monthname;
	var lmonth = lmod.getMonth();
	if (lmonth == 0) monthname = "January";
	if (lmonth == 1) monthname = "February";
	if (lmonth == 2) monthname = "March";
	if (lmonth == 3) monthname = "April";
	if (lmonth == 4) monthname = "May";
	if (lmonth == 5) monthname = "June";
	if (lmonth == 6) monthname = "July";
	if (lmonth == 7) monthname = "August";
	if (lmonth == 8) monthname = "September";
	if (lmonth == 9) monthname = "October";
	if (lmonth == 10) monthname = "November";
	if (lmonth == 11) monthname = "December";

	var yearstr = getCorrectedYear(lmod.getYear());
	var outstr = monthname + " " + lmod.getDate() + ", " + yearstr;
	return outstr;
}

function fixElement(element, message)
{
    alert(message);
    element.focus();
}

var passed = false;

function checkform() {		
    if (document.contactform.name.value == "") {
        fixElement(document.contactform.name, "Please enter your name.");
    }
    else if (document.contactform.company.value == "") {
        fixElement(document.contactform.company, "Please include your company.");
    }
    else if (document.contactform.email.value == "") {
        fixElement(document.contactform.email, "Please include your email.");
    }
    else if (document.contactform.monthly_budget.value == "") {
        fixElement(document.contactform.monthly_budget, "Please enter your monthly budget.");
    }
    else if (document.contactform.project_type.value == "") {
        fixElement(document.contactform.project_type, "Please enter the project type.");
    }
	else {
		document.contactform.submit();
	}
}
// -->

