// BEGIN ROTATING BANNER

pic_width=265;
pic_height=75;
border_size=2;
alignment=1;      /* 0=left,1=center */

if (document.images)
 {
     pic1= new Image(pic_width,pic_height);
     pic1.src="/images/sponsors/featured_transparts.jpg";
     pic2= new Image(pic_width,pic_height); 
     pic2.src="/images/sponsors/featured_borgwarner.jpg";
     pic3= new Image(pic_width,pic_height);
     pic3.src="/images/sponsors/featured_superior.jpg";
     pic4= new Image(pic_width,pic_height);
     pic4.src="/images/sponsors/featured_transtec.jpg";
     pic5= new Image(pic_width,pic_height); 
     pic5.src="/images/sponsors/featured_adaptacase.jpg";
     pic6= new Image(pic_width,pic_height); 
     pic6.src="/images/sponsors/featured_rockland.jpg";
	   pic7= new Image(pic_width,pic_height); 
     pic7.src="/images/sponsors/featured_rostra.jpg";
	   pic8= new Image(pic_width,pic_height); 
	   pic8.src="/images/sponsors/featured_precision.jpg";
     pic9= new Image(pic_width,pic_height); 
     pic9.src="/images/sponsors/featured_protorque.jpg";
	   pic10= new Image(pic_width,pic_height); 
     pic10.src="/images/sponsors/featured_gearspeed.jpg";
          
// NewSponsorPic
 }    

urlad1="http://www.bulkpart.com";
urlad2="http://www.bwauto.com";
urlad3="http://www.superior-transmission.com/";
urlad4="http://www.transtec.com";
urlad5="http://www.adaptacase.com";
urlad6="http://www.rsgear.com"; 
urlad7="http://www.rostratransmission.com";
urlad8="http://www.transmissionkits.com";
urlad9="http://www.protorque.com";
urlad10="http://www.gearspeedpartsstore.com/portal.html";

// NewSponsorUrl

if (alignment==1)
 {
  cent_it="<CENTER>";
  cent_it2="<\/CENTER>";
 }
else
 {
  cent_it="";
  cent_it2="";
 }
 
function get_random(maxNum)
{
  if (Math.random && Math.round)
  {
    var ranNum= Math.round(Math.random()*(maxNum-1));
    ranNum+=1;
    return ranNum;
  }
  else
  {
  today= new Date();
  hours= today.getHours();
  mins=   today.getMinutes();
  secn=  today.getSeconds();
  if (hours==19)
   hours=18;
  var ranNum= (((hours+1)*(mins+1)*secn)%maxNum)+1;
  return ranNum;
  }
}

function get_Image()
{
 if (document.images)
 {
  var choose_one= get_random(10);  
  choose_one--;

  var pics= new Array(10) 
   pics[0]=pic1.src;
   pics[1]=pic2.src;
   pics[2]=pic3.src;
   pics[3]=pic4.src;
   pics[4]=pic5.src; 
   pics[5]=pic6.src;
   pics[6]=pic7.src;
   pics[7]=pic8.src;
   pics[8]=pic9.src;
   pics[9]=pic10.src;
  //newArray

  var aurl= new Array(10)
  aurl[0]=urlad1;
  aurl[1]=urlad2;
  aurl[2]=urlad3;
  aurl[3]=urlad4;
  aurl[4]=urlad5;
  aurl[5]=urlad6;
  aurl[6]=urlad7;
  aurl[7]=urlad8;
  aurl[8]=urlad9;
  aurl[9]=urlad10;
   //newUrl

  document.write(cent_it+"<A HREF='"+aurl[choose_one]+"'><IMG SRC='"+pics[choose_one]+"' width='"+pic_width+"' height='"+pic_height+"' border='"+border_size+"'></A>"+cent_it2);
 }
}


// BEGIN ROTATING IMAGES

var theImages = new Array() 
theImages[0] = 'images/new/rotate/0.jpg'
theImages[1] = 'images/new/rotate/1.jpg'
theImages[2] = 'images/new/rotate/2.jpg'
theImages[3] = 'images/new/rotate/3.jpg'
theImages[4] = 'images/new/rotate/4.jpg'
theImages[5] = 'images/new/rotate/5.jpg'
theImages[6] = 'images/new/rotate/6.jpg'
theImages[7] = 'images/new/rotate/7.jpg'
theImages[8] = 'images/new/rotate/8.jpg'
theImages[9] = 'images/new/rotate/9.jpg'
theImages[10] = 'images/new/rotate/10.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}


// BEGIN CALENDAR

today = new Date();
day = today.getDate();
month = today.getMonth();
month++;
if (month == 1) { month1 = "01" }
if (month == 2) { month1 = "02" }
if (month == 3) { month1 = "03" }
if (month == 4) { month1 = "04" }
if (month == 5) { month1 = "05" }
if (month == 6) { month1 = "06" }
if (month == 7) { month1 = "07" }
if (month == 8) { month1 = "08" }
if (month == 9) { month1 = "09" }
if (month == 10) { month1 = "10" }
if (month == 11) { month1 = "11" }
if (month == 12) { month1 = "12" }
year = today.getYear();

function displayCalendar() {
var num = eval('m' + year + month1);
num.className=('view');
}

function lastMonth(num) {
numero = parseInt(num);
numero--;
	if (numero == 200601) {
	alert ("Please check back frequently for updates\n\nIf you have any events that you would like to see added to our calendar, please send you inquiries to tod@transbuilder.com");
	numero = 200602;
	} else if (numero == 200600) {
	numero = 200512;
	} else if (numero == 200700) {
	numero = 200612;
	}
outcome = eval(numero);
addy = outcome + ".html";
window.location=(addy);
}

function nextMonth(num) {
numero = parseInt(num);
numero++;
	if (numero == 200513) {
	numero = 200601;
	} else if (numero == 200613) {
	numero = 200701;
	}
	if (numero == 200712) {
	alert ("Please check back frequently for updates\n\nIf you have any events that you would like to see added to our calendar, please send you inquiries to tod@transbuilder.com");
	numero = 200711;
	}
outcome = eval(numero);
addy = outcome + ".html";
window.location=(addy);
}

function calendar(num) {
day = num;
docMonth = document.form.month.value;
docYear = document.form.year.value;
document.form.day.value = day;
document.form.formButton.className=('submitButtonView');
document.form.formButton.value="More Information";

// EVENTS
	if ((day == 28) && (docMonth == 1) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Ft. Lauderdale, FL.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 4) && (docMonth == 2) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Louiseville, KY.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 11) && (docMonth == 2) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Houston, TX.\nATSG Technical Seminar in Dallas, TX.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 18) && (docMonth == 2) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Charlotte, NC.\nATSG Technical Seminar in Baltimore, MD.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 25) && (docMonth == 2) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Chicago, IL.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 4) && (docMonth == 3) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminars in St. Louis, MO & Biloxi, MS.\nATSG Technical Seminar in San Francisco, CA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 11) && (docMonth == 3) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Orlando, FL.\nATSG Technical Seminar in Minneapolis, MN.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 18) && (docMonth == 3) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Jamaica, NY.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 25) && (docMonth == 3) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Philadelphia, PA.\nATSG Technical Seminar in Los Angelas, CA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 1) && (docMonth == 4) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Worcestor, MA.\nATSG Technical Seminar in Cincinnati, OH.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 8) && (docMonth == 4) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Minneapolis, MN.\nATSG Technical Seminar in Philadelphia, PA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 29) && (docMonth == 4) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Oklahoma City, OK.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 6) && (docMonth == 5) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Atlanta, GA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 13) && (docMonth == 5) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Denver, CO.\nATRA Technical Seminar in Fremont, CA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 20) && (docMonth == 5) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminars in Anchorage, AK & Anaheim, CA.\nATSG Technical Seminar in Phoenix, AZ.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 17) && (docMonth == 6) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Coeur D'Alene, ID.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 24) && (docMonth == 6) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Slidell, LA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 5) && (docMonth == 8) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Albuquerque, NM.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 12) && (docMonth == 8) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in St. Louis, MO.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 26) && (docMonth == 8) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Cleveland, OH.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 9) && (docMonth == 9) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Detroit, MI.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 16) && (docMonth == 9) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Chicago, IL.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 14) && (docMonth == 10) && (docYear == 2006)) {
	document.form.details.value="ATRA Technical Seminar in Portland, OR.\nATSG Technical Seminar in Boston, MA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 28) && (docMonth == 10) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Wichita, KS.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 4) && (docMonth == 11) && (docYear == 2006)) {
	document.form.details.value="ATSG Technical Seminar in Pittsburgh, PA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 3) && (docMonth = 3) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminars in Biloxi, MS. & St Louis MO.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 10) && (docMonth == 3) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Toronto, Canada\n\nFor more details, click the 'more info' button";
	}
	if ((day == 17) && (docMonth == 3) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Orlando, FL.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 31) && (docMonth == 3) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminars in Phoenix, AZ. & Boston, MA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 21) && (docMonth == 4) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminars in Philadelphia, PA. & Tunica, MS.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 28) && (docMonth == 4) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Coeur d'Alene, ID. & Salt Lake City, UT.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 5) && (docMonth == 5) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Minneapolis, MN.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 12) && (docMonth == 5) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Anchorage, AK. & Denver, CO.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 19) && (docMonth == 5) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Fremont, CA. & Los Angelas, CA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 2) && (docMonth == 6) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Dallas, TX. & Vancouver, Canada\n\nFor more details, click the 'more info' button";
	}
	if ((day == 9) && (docMonth == 6) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Pittsburgh, PA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 4) && (docMonth == 8) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Albuquerque, NM.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 18) && (docMonth == 8) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in San Antonio, TX.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 8) && (docMonth == 9) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Billings, MT.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 29) && (docMonth == 9) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Council Bluffs, IA.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 6) && (docMonth == 10) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Portland, OR.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 11) && (docMonth == 10) && (docYear == 2007)) {
	document.form.details.value="ATRA's Powertrain Expo in Las Vegas, NV.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 12) && (docMonth == 10) && (docYear == 2007)) {
	document.form.details.value="ATRA's Powertrain Expo in Las Vegas, NV.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 13) && (docMonth == 10) && (docYear == 2007)) {
	document.form.details.value="ATRA's Powertrain Expo in Las Vegas, NV.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 14) && (docMonth == 10) && (docYear == 2007)) {
	document.form.details.value="ATRA's Powertrain Expo in Las Vegas, NV.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 20) && (docMonth == 10) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Chicago, IL.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 3) && (docMonth == 11) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in New York, NY.\n\nFor more details, click the 'more info' button";
	}
	if ((day == 10) && (docMonth == 11) && (docYear == 2007)) {
	document.form.details.value="ATRA Technical Seminar in Baltimore, MD.\n\nFor more details, click the 'more info' button";
	}
//	if ((day == _) && (docMonth == _) && (docYear == 2007)) {
//	document.form.details.value="_ Technical Seminar in _\n\nFor more details, click the 'more info' button";
//	}
}

function calendarNone(num) {
day = num;
alert ("We're sorry. There are no events scheduled on that day. Please note that events are scheduled on the dates marked in green.\n\nIf you would like us to add an event to our calendar, please send all inquiries to tod@transbuilder.com");
}

function goTo(num) {
numb = eval(num);
addy = "z_calendar/" + num + ".html";
window.open(addy, "TRNi", "Width=400,Height=775");
}


// SEARCH ENGINE CODE

function check_search(f){
if(f.term.value.length < 1){
	alert("Please enter some text to search for");
	f.term.focus();
	return (false);
}
}


// SPONSOR BOXES

function openBox(sponsor) {
trniToday.className="hide";
	if (sponsor == 1) {
	sponsor1.className="front1";
	} else if (sponsor == 2) {
	sponsor2.className="front2";
	} else if (sponsor == 3) {
		if (document.all) {
		sponsor3.className="front3a";
		} else if (document.getElementById) {
		sponsor3.className="front3";
		} else {
		sponsor3.className="front3";
		}
	} else if (sponsor == 4) {
		if (document.all) {
		sponsor4.className="front4a";
		} else if (document.getElementById) {
		sponsor4.className="front4";
		} else {
		sponsor4.className="front4";
		}
	} else if (sponsor == 5) {
		if (document.all) {
		sponsor5.className="front5a";
		} else if (document.getElementById) {
		sponsor5.className="front5";
		} else {
		sponsor5.className="front5";
		}
	} else if (sponsor == 6) {
		if (document.all) {
		sponsor6.className="front6a";
		} else if (document.getElementById) {
		sponsor6.className="front6";
		} else {
		sponsor6.className="front6";
		}
	} else if (sponsor == 7) {
		if (document.all) {
		sponsor7.className="front7a";
		} else if (document.getElementById) {
		sponsor7.className="front7";
		} else {
		sponsor7.className="front7";
		}
	} else if (sponsor == 8) {
		if (document.all) {
		sponsor8.className="front8a";
		} else if (document.getElementById) {
		sponsor8.className="front8";
		} else {
		sponsor8.className="front8";
		}
	} else if (sponsor == 9) {
		if (document.all) {
		sponsor9.className="front9a";
		} else if (document.getElementById) {
		sponsor9.className="front9";
		} else {
		sponsor9.className="front9";
		}
	} else if (sponsor == 10) {
		if (document.all) {
		sponsor10.className="front10a";
		} else if (document.getElementById) {
		sponsor10.className="front10";
		} else {
		sponsor10.className="front10";
		}
	} else if (sponsor == 11) {
		if (document.all) {
		sponsor11.className="front11a";
		} else if (document.getElementById) {
		sponsor11.className="front11";
		} else {
		sponsor11.className="front11";
		}
	} else if (sponsor == 12) {
		if (document.all) {
		sponsor12.className="front12a";
		} else if (document.getElementById) {
		sponsor12.className="front12";
		} else {
		sponsor12.className="front12";
		}
	} else if (sponsor == 13) {
		if (document.all) {
		sponsor13.className="front13a";
		} else if (document.getElementById) {
		sponsor13.className="front13";
		} else {
		sponsor13.className="front13";
		}
	} else if (sponsor == 14) {
		if (document.all) {
		sponsor14.className="front14a";
		} else if (document.getElementById) {
		sponsor14.className="front14";
		} else {
		sponsor14.className="front14";
		}
	} else if (sponsor == 15) {
		if (document.all) {
		sponsor15.className="front15a";
		} else if (document.getElementById) {
		sponsor15.className="front15";
		} else {
		sponsor15.className="front15";
		}
	} else if (sponsor == 16) {
		if (document.all) {
		sponsor16.className="front16a";
		} else if (document.getElementById) {
		sponsor16.className="front16";
		} else {
		sponsor16.className="front16";
		}
	}
}


function closeBox(sponsor) {
	if (sponsor == 1) {
	sponsor1.className="hide";
	} else if (sponsor == 2) {
	sponsor2.className="hide";
	} else if (sponsor == 3) {
	sponsor3.className="hide";
	} else if (sponsor == 4) {
	sponsor4.className="hide";
	} else if (sponsor == 5) {
	sponsor5.className="hide";
	} else if (sponsor == 6) {
	sponsor6.className="hide";
	} else if (sponsor == 7) {
	sponsor7.className="hide";
	} else if (sponsor == 8) {
	sponsor8.className="hide";
	} else if (sponsor == 9) {
	sponsor9.className="hide";
	} else if (sponsor == 10) {
	sponsor10.className="hide";
	} else if (sponsor == 11) {
	sponsor11.className="hide";
	} else if (sponsor == 12) {
	sponsor12.className="hide";
	} else if (sponsor == 13) {
	sponsor13.className="hide";
	} else if (sponsor == 14) {
	sponsor14.className="hide";
	} else if (sponsor == 15) {
	sponsor15.className="hide";
	} else if (sponsor == 16) {
	sponsor16.className="hide";
	}
trniToday.className="view";
}

