if (document.images) {

	b1 = new Image;
	b1_f2 = new Image;
	b1.src = "/images/buttons/priceoff.gif";
	b1_f2.src = "/images/buttons/priceon.gif";
	
	b2 = new Image;
	b2_f2 = new Image;
	b2.src = "/images/buttons/specialsoff.gif";
	b2_f2.src = "/images/buttons/specialson.gif";
	
	b3 = new Image;
	b3_f2 = new Image;
	b3.src = "/images/buttons/creditoff.gif";
	b3_f2.src = "/images/buttons/crediton.gif";
	
	b4 = new Image;
	b4_f2 = new Image;
	b4.src = "/images/buttons/orderoff.gif";
	b4_f2.src = "/images/buttons/orderon.gif";
	
	b5 = new Image;
	b5_f2 = new Image;
	b5.src = "/images/buttons/faqoff.gif";
	b5_f2.src = "/images/buttons/faqon.gif";
	
	b6 = new Image;
	b6_f2 = new Image;
	b6.src = "/images/buttons/contactoff.gif";
	b6_f2.src = "/images/buttons/contacton.gif";
	
	b7 = new Image();
	b7_f2 = new Image();
	b7.src = "/fabrics/roclon/images/buttons/ardryoff.gif";
    b7_f2.src = "/fabrics/roclon/images/buttons/ardryon.gif";

 	b8 = new Image();
    b8_f2 = new Image();
	b8.src = "/fabrics/roclon/images/buttons/burloff.gif";
    b8_f2.src = "/fabrics/roclon/images/buttons/burlon.gif";

    b9 = new Image();
    b9_f2 = new Image();
	b9.src = "/fabrics/roclon/images/buttons/chamoisoff.gif";
    b9_f2.src = "/fabrics/roclon/images/buttons/chamoison.gif";
	
    b10 = new Image();
    b10_f2 = new Image();
	b10.src = "/fabrics/roclon/images/buttons/indusoff.gif";
    b10_f2.src = "/fabrics/roclon/images/buttons/induson.gif";
	
    b11 = new Image();
    b11_f2 = new Image();
	b11.src = "/fabrics/roclon/images/buttons/larosaoff.gif";
    b11_f2.src = "/fabrics/roclon/images/buttons/larosaon.gif";

    b12 = new Image();
    b12_f2 = new Image();
	b12.src = "/fabrics/roclon/images/buttons/micaoff.gif";
    b12_f2.src = "/fabrics/roclon/images/buttons/micaon.gif";
	
	b13 = new Image();
	b13_f2 = new Image();
	b13.src = "/fabrics/roclon/images/buttons/textralonoff.gif";
	b13_f2.src = "/fabrics/roclon/images/buttons/textralonon.gif";
	
	b14 = new Image();
	b14_f2 = new Image();
	b14.src = "/fabrics/roclon/images/buttons/watermarkoff.gif";
	b14_f2.src = "/fabrics/roclon/images/buttons/watermarkon.gif";

}

function chgImg(imgField, newImg)
{
	if (document.images) {
		document [imgField].src = eval(newImg + ".src");
	}
}

function checkSamplebook(form)
{
	contact = form ["contact"].value.trim();
	email = form ["email"].value.trim();
	company = form ["company"].value.trim();
	address = form ["address"].value.trim();
	city = form ["city"].value.trim();
	state = form ["state"].value.trim();
	zip = form ["zip"].value.trim();
	phone = form ["phone"].value.trim();
	
	ok = true;
	bad = new Array();
		
	if(contact == ""){
		ok = false;
		bad[bad.length] = "Contact";
	}
	var atPos = email.indexOf("@",1);
	var pPos = email.indexOf(".",1);
	if(email == "" || atPos == -1 || email.indexOf("@",atPos+1) > -1 || pPos == -1){
		ok = false;
		bad[bad.length] = "Email";
	}
	if(company == ""){
		ok = false;
		bad[bad.length] = "Company";
	}
	if(address == ""){
		ok = false;
		bad[bad.length] = "Address";
	}
	if(city == ""){
		ok = false;
		bad[bad.length] = "City";
	}
	if(state == ""){
		ok = false;
		bad[bad.length] = "State";
	}
	if(zip == ""){
		ok = false;
		bad[bad.length] = "Zip";
	}
	if(phone == ""){
		ok = false;
		bad[bad.length] = "Phone";
	}
	
	if(!ok){
		msg = "The following fields are required:\n\n";
		for(i=0; i<bad.length; i++){
			msg = msg + "    - " +  bad[i] + "\n";
		}
		alert(msg);
		return false;
	} else {
		//form ["submit"].disabled = true;
		return true;
	}
}

function printInput(size, value, name)
{
	if (navigator.appName == "Netscape") {
		size = size - 15;
	}
	
	document.write("<input type=\"text\" name=\"" + name + "\" value=\"" + value + "\" size=\"" + size + "\">");
}

function checkOrder(form)
{
	Name = form ["Name"].value.trim();
	Email = form ["Email"].value.trim();
	Company = form ["Company"].value.trim();
	Address = form ["Address"].value.trim();
	City = form ["City"].value.trim();
	State = form ["State"].value.trim();
	Zip = form ["Zip"].value.trim ();
	bAddress = form ["bAddress"].value.trim();
	bCity = form ["bCity"].value.trim();
	bState = form ["bState"].value.trim();
	bZip = form ["bZip"].value.trim ();
	Phone = form ["Phone"].value.trim();
	Description = form ["Description"].value.trim();	
	
	ok = true;
	bad = new Array();
	
	if(Name == ""){
		ok = false;
		bad[bad.length] = "Name";
	}
	var atPos = Email.indexOf("@",1);
	var pPos = Email.indexOf(".",1);
	if(Email == "" || atPos == -1 || Email.indexOf("@",atPos+1) > -1 || pPos == -1){
		ok = false;
		bad[bad.length] = "Email";
	}
	if(Company == ""){
		ok = false;
		bad[bad.length] = "Company";
	}
	if(Address == ""){
		ok = false;
		bad[bad.length] = "Shipping Address";
	}
	if(City == ""){
		ok = false;
		bad[bad.length] = "Shipping City";
	}
	if(State == "" || State.length != 2){
		ok = false;
		bad[bad.length] = "Shipping State";
	}
	if(Zip == "" || Zip.length != 5){
		ok = false;
		bad[bad.length] = "Shipping Zip";
	}
	if(bAddress == ""){
		ok = false;
		bad[bad.length] = "Billing Address";
	}
	if(bCity == ""){
		ok = false;
		bad[bad.length] = "Billing City";
	}
	if(bState == "" || bState.length != 2){
		ok = false;
		bad[bad.length] = "Billing State";
	}
	if(bZip == "" || Zip.length != 5){
		ok = false;
		bad[bad.length] = "Billing Zip";
	}
	if(Phone == ""){
		ok = false;
		bad[bad.length] = "Phone";
	}
	if(Description == ""){
		ok = false;
		bad[bad.length] = "Product Description";
	}
	
	if(!ok){
		msg = "The following fields are required to submit your order:\n\n";
		for(i=0; i<bad.length; i++){
			msg = msg + "    - " +  bad[i] + "\n";
		}
		alert(msg);
		return false;
	} else {
		return true;
	}
}

String.prototype.trim = function()    //// trims white space off both ends of this string
{
 return( (ar=/^\s*([\s\S]*\S+)\s*$/.exec(this)) ? ar[1] : "" ); 
}

function trim(strText) { 
    // this will get rid of leading spaces 
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces 
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
}

function CheckEmail(EMAIL) {
	var rejectedDomain=new Array()

	var rejected=false
	var testresults=true
	var str=EMAIL
	var filter=/^.+@.+\..{2,3}$/
	if (filter.test(str)){
		return true;
	} else {
		return false;
	}
}