
// Current Server Time script (SSI or PHP)- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// This notice must stay intact for use.

//Depending on whether your page supports SSI (.shtml) or PHP (.php), UNCOMMENT the line below your page supports and COMMENT the one it does not:
//Default is that SSI method is uncommented, and PHP is commented:

//var currenttime = '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' //SSI method of getting server date
//var currenttime = '<? print date("F d, Y H:i:s", time())?>' //PHP method of getting server date

///////////Stop editting here/////////////////////////////////

/*var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var serverdate=new Date(currenttime)

function padlength(what){
var output=(what.toString().length==1)? "0"+what : what
return output
}

function displaytime(){
serverdate.setSeconds(serverdate.getSeconds()+1)
var datestring=montharray[serverdate.getMonth()]+" "+padlength(serverdate.getDate())+", "+serverdate.getFullYear()
var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds())
document.getElementById("servertime").innerHTML=datestring+" "+timestring
}

window.onload=function(){
setInterval("displaytime()", 1000)
}*/


var faq_0 = new Image(90,21);
faq_0.src = 'images/service_nav_faqs0.gif';
var faq_1 = new Image(90,21);
faq_1.src = 'images/service_nav_faqs1.gif';

var news_0 = new Image(90,21);
news_0.src = 'images/service_nav_news0.gif';
var news_1 = new Image(90,21);
news_1.src = 'images/service_nav_news1.gif';

var events_0 = new Image(90,21);
events_0.src = 'images/service_nav_events0.gif';
var events_1 = new Image(90,21);
events_1.src = 'images/service_nav_events1.gif';

var artilces_0 = new Image(90,21);
artilces_0.src = 'images/service_nav_articles0.gif';
var artilces_1 = new Image(90,21);
artilces_1.src = 'images/service_nav_articles1.gif';


/* NS*/
var call_me_now_0 = new Image(175,31);
call_me_now_0.src = 'images/ns_call_me_now0.gif';
var call_me_now_1 = new Image(175,31);
call_me_now_1.src = 'images/ns_call_me_now1.gif';

var ask_a_question_0 = new Image(175,31);
ask_a_question_0.src = 'images/ns_ask_a_question0.gif';
var ask_a_question_1 = new Image(175,31);
ask_a_question_1.src = 'images/ns_ask_a_question1.gif';

var book_a_demo_0 = new Image(175,31);
book_a_demo_0.src = 'images/ns_book_a_demo0.gif';
var book_a_demo_1 = new Image(175,31);
book_a_demo_1.src = 'images/ns_book_a_demo1.gif';

var get_a_free_brochure_0 = new Image(175,31);
get_a_free_brochure_0.src = 'images/ns_get_a_free_brochure0.gif';
var get_a_free_brochure_1 = new Image(175,31);
get_a_free_brochure_1.src = 'images/ns_get_a_free_brochure1.gif';

var contact_us_0 = new Image(175,31);
contact_us_0.src = 'images/ns_contact_us0.gif';
var contact_us_1 = new Image(175,31);
contact_us_1.src = 'images/ns_contact_us1.gif';


/* HOME BUTTONS*/

var eBusiness0 = new Image(73,49);
eBusiness0.src = 'images/icon_eBusiness0.png';
var eBusiness1 = new Image(73,49);
eBusiness1.src = 'images/icon_eBusiness1.png';

var eDocs0 = new Image(73,49);
eDocs0.src = 'images/icon_eDocs0.png';
var eDocs1 = new Image(73,49);
eDocs1.src = 'images/icon_eDocs1.png';

var eXplore0 = new Image(73,49);
eXplore0.src = 'images/icon_eXplore0.png';
var eXplore1 = new Image(73,49);
eXplore1.src = 'images/icon_eXplore1.png';

var eXpressLink0 = new Image(73,49);
eXpressLink0.src = 'images/icon_eXpressLink0.png';
var eXpressLink1 = new Image(73,49);
eXpressLink1.src = 'images/icon_eXpressLink1.png';

var eXpressWay0 = new Image(73,49);
eXpressWay0.src = 'images/icon_eXpressWay0.png';
var eXpressWay1 = new Image(73,49);
eXpressWay1.src = 'images/icon_eXpressWay1.png';

var FreightWare0 = new Image(73,49);
FreightWare0.src = 'images/icon_FreightWare0.png';
var FreightWare1 = new Image(73,49);
FreightWare1.src = 'images/icon_FreightWare1.png';

var MobileControl0 = new Image(73,49);
MobileControl0.src = 'images/icon_MobileControl0.png';
var MobileControl1 = new Image(73,49);
MobileControl1.src = 'images/icon_MobileControl1.png';


var solutions0 = new Image(103,69);
solutions0.src = 'images/home_button_solutions0.gif';
var solutions1 = new Image(103,69);
solutions1.src = 'images/home_button_solutions1.gif';

var products0 = new Image(103,69);
products0.src = 'images/home_button_products0.gif';
var products1 = new Image(103,69);
products1.src = 'images/home_button_products1.gif';


function SwapImage(objectname,objectnewstate) {
	var imageobj = document.getElementById(objectname);
	imageobj.src = this[objectnewstate].src;
}

function verifyTestimonials() {
	var theForm = document.getElementById("testimonials");
	var requiredMessage = "";
	var validateMessage = "";
	var fullMessage = "";
	
	if (theForm.f_name.value == "") {
		requiredMessage += "\t* First name.\n";
	} 
	if (theForm.l_name.value == "") {
		requiredMessage += "\t* Last name.\n";
	} 
	if (theForm.company.value == "") {
		requiredMessage += "\t* Company.\n";
	} 
	if (theForm.testimonial.value == "") {
		requiredMessage += "\t* Testimonial.\n";
	}
	
	if (requiredMessage != "") {
		fullMessage += "This field is required:\n"+requiredMessage;
	}
	if (validateMessage != "") {
		fullMessage += "This field has invalid values:\n"+validateMessage;
	}
	
	if (fullMessage != "") {
		alert(fullMessage);
	} else {
		theForm.submit();
	}
}

function checkContact() {
	var theForm = document.getElementById("contact");
	var requiredMessage = "";
	var validateMessage = "";
	var fullMessage = "";
	
	if (theForm.name.value == "") {
		requiredMessage += "\t* First name.\n";
	} 
	if (theForm.last_name.value == "") {
		requiredMessage += "\t* Last name.\n";
	} 
	if (theForm.email_address.value == "") {
		requiredMessage += "\t* Email Address.\n";
	} else if (!isValidEmail(theForm.email_address.value)) {
		validateMessage += "\t* Email Address.\n";
	}
	
	if (requiredMessage != "") {
		fullMessage += "This field is required:\n"+requiredMessage;
	}
	if (validateMessage != "") {
		fullMessage += "This field has invalid values:\n"+validateMessage;
	}
	
	if (fullMessage != "") {
		alert(fullMessage);
	} else {
		theForm.submit();
	}
}



function isValidEmail(strEmail){
	validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	// search email text for regular exp matches
	if (strEmail.search(validRegExp) == -1) {
		return false;
	} 
	return true; 
}

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   //alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   //alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		//alert("Invalid E-mail ID")
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		//alert("Invalid E-mail ID")
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		//alert("Invalid E-mail ID")
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		//alert("Invalid E-mail ID")
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		//alert("Invalid E-mail ID")
		return false
	 }

	 return true					
}


