function getFichiers(){  
	document.write('<link rel="stylesheet" type="text/css" href="http://www.compcond.com/mainsite/css/main.css" title="" media="screen" />');
	document.write('<script language="Javascript" type="text/javascript" src="http://www.compcond.com/mainsite/fonctions/validateForm.js"></script>');
	}
/*
   DynAPI Distribution
   Browser Class
   The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
*/
function Browser() {
	var b=navigator.appName;
	
	if (b.indexOf('Netscape')!=-1) this.b="ns";
	else if ((b=="Opera") || (navigator.userAgent.indexOf("Opera")>0)) this.b = "opera";
	else if (b=="Microsoft Internet Explorer") this.b="ie";
	if (!b) alert('Unidentified browser.\nThis browser is not supported,');
	this.version=navigator.appVersion;
	this.v=parseInt(this.version);
	this.ns=(this.b=="ns" && this.v>=4);
	this.ns4=(this.b=="ns" && this.v==4);
	this.ns6=(this.b=="ns" && this.v==5);
	this.ie=(this.b=="ie" && this.v>=4);
	this.ie4=(this.version.indexOf('MSIE 4')>0);
	this.ie5=(this.version.indexOf('MSIE 5')>0);
	this.ie55=(this.version.indexOf('MSIE 5.5')>0);
	this.ie6=(this.version.indexOf('MSIE 6.0')>0);
	this.opera=(this.b=="opera");
	this.dom=(document.createElement && document.appendChild && document.getElementsByTagName)?true:false;
	this.def=(this.ie||this.dom); // most used browsers, for faster if loops
	var ua=navigator.userAgent.toLowerCase();
	if (ua.indexOf("win")>-1) this.platform="win32";
	else if (ua.indexOf("mac")>-1) this.platform="mac";
	else this.platform="other";	
	this.scrwidth=screen.width;	
  }

//give us graphics
	
function img(name,alt,id){

  if (arguments.length != 3){
	 alert("function imgres called with " + arguments.length +
	       " arguments, but it expects 3 arguments.");
				  return null;
					}
					
var name= name;
var id=id;
var alt= alt;
folder=new Browser(); 
 
 document.write ('<img id="' + id + '" alt="' + alt + '"'); 
 //document.write ('src="http://www.compcond.com/mainsite/images/' + folder.scrwidth + '/' + name + '" />'); 
 document.write ('src="http://www.compcond.com/mainsite/images/main/' + name + '" />');
}


//get Date function
 
function laDate(){

var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";

var days=new Array(8);
days[1]="Sunday";
days[2]="Monday";
days[3]="Tuesday";
days[4]="Wednesday";
days[5]="Thursday";
days[6]="Friday";
days[7]="Saturday";

var now=new Date();

var month=months[now.getMonth()+ 1];
var day=days[now.getDay()+ 1];
var ladate=now.getDate();
var year=now.getYear();
if (year < 2000)    // Y2K Fix, Isaac Powell
year = year + 1900; // http://onyx.idbsu.edu/~ipowell

var mn="th";

if      (ladate == 1)  {mn = "st";}
else if (ladate == 2)  {mn = "nd";}
else if (ladate == 3)  {mn = "rd";}
else if (ladate == 21) {mn = "st";}
else if (ladate == 22) {mn = "nd";}
else if (ladate == 23) {mn = "rd";}
else if (ladate == 31) {mn = "st";}

document.write(" "+day+" "+month+" "+ladate+""+mn+", "+year+" ");
}

//basic form validation

function newContact(){

var fv=new validateForm();

if(fv.isEmpty(document.form.Last_Name.value)){
	fv.showError('Please enter your last name')
	return false;
	}
if(fv.isEmpty(document.form.First_Name.value)){
	fv.showError('Please enter your first name')
	return false;
	}
if(fv.isEmail(document.form.email.value)){
	fv.showError('Please enter a valid email address')
	return false;
	}
	document.forms[0].submit();
  return true;
}

function serviceCall(){

var fv=new validateForm();

if(fv.isEmpty(document.form.txtname.value)){
	fv.showError('Please enter Company Name')
	return false;
	}
if(fv.isEmpty(document.form.txtaddress.value)){
	fv.showError('Please enter street number')
	return false;
	}
if(fv.isEmpty(document.form.txtstreet.value)){
	fv.showError('Please enter street name')
	return false;
	}
if(fv.isEmpty(document.form.txtcity.value)){
	fv.showError('Please enter city')
	return false;
	}
if(fv.isEmpty(document.form.txtstate.value)){
	fv.showError('Please enter state')
	return false;
	}	
if(fv.isUSZip(document.form.txtzipcode.value)){
	fv.showError('Please enter valid zip code')
	return false;
	}
	
if(fv.isEmpty(document.form.txtlname.value)){
	fv.showError('Please enter contact person last name')
	return false;
	}
if(fv.isEmpty(document.form.txtfname.value)){
	fv.showError('Please enter contact person first name')
	return false;
	}
if(fv.isPhone(document.form.txtphone.value)){
	fv.showError('Please enter phone number')
	return false;
	}
if(fv.isEmail(document.form.txtemail.value)){
	fv.showError('Please enter valid email address')
	return false;
	}
	
if(fv.isEmpty(document.form.txttype.value)){
	fv.showError('Please enter machine type')
	return false;
	}
if(fv.isEmpty(document.form.txtbrand.value)){
	fv.showError('Please enter machine brand')
	return false;
	}
	if(fv.isEmpty(document.form.txtmodel.value)){
	fv.showError('Please enter machine model')
	return false;
	}
	
//radio buttons
if(fv.isChecked(document.form.warranty)){
	fv.showError('Please indicate warranty status ')
	return false;
	}	
if(fv.isChecked(document.form.service)){
		fv.showError('Please indicate service preference ')
	return false;
	}
//checkboxes
if(fv.isChecked(document.form.desc)){
   fv.showError('Please enter problem description')
	return false;
	}
  document.forms[0].submit();
  return true;
}


