function initQuote(){
	var quoteField = document.getElementById('js-quote');
	var authorField = document.getElementById('js-author');
	
	var quote_arr = [
        'I was very pleased with the work that Areteworks did for us; they are a very talented creative and hardworking organization.',
        'Areteworks delivered a compelling and complete solution, from the product vision to the UI and graphics definition.',
		'Areteworks has been working closely with Magellan Navigation Inc. on our key User Interface programs for past few years. With their extensive knowledge of the field, professionalism, and ability to work closely with our marketing and firmware teams, Arete’s team has been able to provide us with high quality services in creating world class solutions for our Vehicle Navigation and Outdoor products.',
		'I was very pleased with the work that Areteworks did for us; they are a very talented creative and hardworking organization.',
        'Areteworks delivered a compelling and complete solution, from the product vision to the UI and graphics definition.',
		'Areteworks has been working closely with Magellan Navigation Inc. on our key User Interface programs for past few years. With their extensive knowledge of the field, professionalism, and ability to work closely with our marketing and firmware teams, Arete’s team has been able to provide us with high quality services in creating world class solutions for our Vehicle Navigation and Outdoor products.',
	];
    var author_arr = [
		'<strong>- Alan Gordon<br />  Director of Engineering<br />  WaveTec Corp.</strong>',
		'<strong>- Brant Clark<br />  Senior Product Manager<br />  Magellan Navigation Inc.</strong>',
		'<strong>- Shri Jambhekar<br />  Director, Product Marketing - User Experience<br />  Magellan Navigation Inc.</strong>',
		'<strong>- Alan Gordon<br />  Director of Engineering<br />  WaveTec Corp.</strong>',
		'<strong>- Brant Clark<br />  Senior Product Manager<br />  Magellan Navigation Inc.</strong>',
		'<strong>- Shri Jambhekar<br />  Director, Product Marketing - User Experience<br />  Magellan Navigation Inc.</strong>',
	];
	

	var quoteRandom = Math.floor( ( quote_arr.length ) * Math.random() );
	if(quoteField && authorField){
          quoteField.innerHTML = quote_arr[quoteRandom];
          authorField.innerHTML = author_arr[quoteRandom];
	};     
	
};

function makered(formfield) { 
    var txtfield = formfield + "text";
    var ifield = formfield + "i";
    document.getElementById(formfield).style.borderStyle = "solid";
    document.getElementById(formfield).style.borderWidth = "1px";
    document.getElementById(formfield).style.borderColor = "#FF0000";
    document.getElementById(formfield).style.padding = "4px";
    document.getElementById(txtfield).style.color = "#FF0000";
    document.getElementById(ifield).style.color = "#FF0000";
}

function makered2(formfield) {
    document.getElementById(formfield).style.borderStyle = "solid";
    document.getElementById(formfield).style.borderWidth = "1px";
    document.getElementById(formfield).style.borderColor = "#FF0000";
    document.getElementById(formfield).style.padding = "4px";
    document.getElementById(formfield).style.backgroundColor = "#FFDDDD";
}

function makenorm(formfield) {
    var txtfield = formfield + "text";
    var ifield = formfield + "i";
    document.getElementById(formfield).style.backgroundColor= "#FAF6E8";
    document.getElementById(formfield).style.borderStyle = "solid";
    document.getElementById(formfield).style.borderWidth = "1px";
    document.getElementById(formfield).style.borderColor = "#CCCCCC";
    document.getElementById(formfield).style.padding = "5px";
    document.getElementById(txtfield).style.color = "#666";
    document.getElementById(ifield).style.color = "#666";
}

function bad_email( field ) {
    with( field ) {
        apos = value.indexOf( "@" );
        dotpos = value.lastIndexOf( "." );
        if ( apos < 1 || dotpos - apos < 2 ) {
            return true;
        }
    }
    return false;
}

function is_empty(field) {
    with (field) {
        if ( value == null || value == "" || value == "Name" || value == "Phone #" || value == "Message" || value == "Company" || value == "Select Topic" ) {
            return true;
        }
    }
    return false;
}

function validate_form( thisform ) {
    allgood = true;
    with(thisform) {
        if ( bad_email( email )) {
            makered( 'email' );
            allgood = false;
        }
        else {
            makenorm( 'email' );
        }
        if ( is_empty( name )) {
            makered( 'name' );
            allgood = false;
        }
        else {
            makenorm( 'name' );
        }
        /*
        if ( is_empty( phone )) {
            makered( 'phone' );
            allgood = false;
        }
        else {
            makenorm( 'phone' );
        }
        if ( is_empty( company )) {
            makered( 'company' );
            allgood = false;
        }
        else {
            makenorm( 'company' );
        }
        */
        if ( is_empty( subject )) {
            var browser=navigator.appName;
            if ( browser == "Microsoft Internet Explorer" ) {
                makered2( 'subject' );
            }
            else {
                makered( 'subject' );
            }
            allgood = false;
        }
        else {
            makenorm( 'subject' );
        }
        if ( is_empty( message )) {
            makered( 'message' );
            allgood = false;
        }
        else {
            makenorm( 'message' );
        }
    }
    return allgood;
}

