// JavaScript Document


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


// Begin checking form
function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if ((tempobj.name=="realname")&& (tempobj.value==''||tempobj.value=='***please complete***')) {
pass=false;
break;
         }
	if ((tempobj.name=="email")&& (tempobj.value==''||tempobj.value=='***please complete***')) {
pass=false;
break;
         }
		 if ((tempobj.name=="country")&& (tempobj.value==''||tempobj.value=='***please complete***')) {
pass=false;
break;
         }
		 if ((tempobj.name=="zip")&& (tempobj.value==''||tempobj.value=='***please complete***')) {
pass=false;
break;
         }
		 

   }
}


if (!pass) {
tempobj.value='please complete';
tempobj.style.color='#FF0000';
return false;
}
else
return true;
}
// Clear text field
function setFormText(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); 
  if (obj && obj.value=='please complete') {
  obj.value = newText;
  obj.style.color='#444444';
}
}

// end checking form


//begin Navigation Bar


function addLoadEvent(func) {
	
	var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }

}


function linkHighlight(){
   var urlPath = window.location.pathname;
   var thisPage = urlPath.substring(urlPath.lastIndexOf('/') + 1);
   //alert(thisPage);
   var pageName = thisPage.split('.');
   document.getElementById(pageName[0]).style.color = '#c30';
     
}


addLoadEvent(linkHighlight);


//end Navigation Bar