function makeArray(n){
  this.length = n;
  for (i=1;i<=n;i++){
    this[i]=0;
  }
  return this;
}

function displayDate() {
  var this_month = new makeArray(12);
    this_month[0]  = "January";
    this_month[1]  = "February";
    this_month[2]  = "March";
    this_month[3]  = "April";
    this_month[4]  = "May";
    this_month[5]  = "June";
    this_month[6]  = "July";
    this_month[7]  = "August";
    this_month[8]  = "September";
    this_month[9]  = "October";
    this_month[10] = "November";
    this_month[11] = "December";
  var today = new Date();
  var day   = today.getDate();
  var month = today.getMonth();
  var year  = today.getFullYear();
  document.write(this_month[month]+" "+day+", "+year);
}

function chg_button(which,onoff) {
	document[which].src = "images/button_" + which + "_" + onoff + ".gif";
}

function open_popup (page,w,h) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open (page,"a" + counter + "a","width="+w+",height="+h+",toolbar=no,location=no,scrollbars=no,directories=no,menubar=no,resizable=no");
}


function cent(amount) {
    amount -= 0;
    amount = (Math.round(amount*100))/100;
    return (amount == Math.floor(amount)) ? amount + '.00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
}

function open_image (imagefile) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open (imagefile,"a" + counter + "a","width=640,height=450,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=yes");
}

function open_otherimage (imagefile, width, height) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open (imagefile,"a" + counter + "a","width="+width+",height="+height+",toolbar=no,location=no,scrollbars=no,directories=no,menubar=no,resizable=no");
}

function open_review (imagefile, width, height) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open (imagefile,"a" + counter + "a","width="+width+",height="+height+",toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=yes");
}

function open_wheel (imagefile) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

//	new_window = window.open ("/images/wheels/big/" + imagefile + ".jpg","a" + counter + "a","width=410,height=410,toolbar=no,location=no,scrollbars=no,directories=no,menubar=no,resizable=no");
	new_window = window.open("enlargement.asp?image_type=wheels&image_src=" + imagefile + ".jpg","a" + counter + "a","width=800,height=600,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=no");
}

function open_page (page) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open (page,"a" + counter + "a","width=730,height=450,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=yes");
}

function open_article() {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open ("article_partsmag.htm","a" + counter + "a","width=730,height=450,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=yes");
}

function open_testimonial (which) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open ("/testimonials/testimonial_" + which,"a" + counter + "a","width=640,height=480,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=yes");
}


function open_video (videoname) {

	new_window = window.open (videoname,"video","width=640,height=500,toolbar=no,location=no,scrollbars=no,directories=no,menubar=no,resizable=yes");
}

function open_otherimages (imagefile, width, height) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open (imagefile,"a" + counter + "a","width="+width+",height="+height+",toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=no");
}


function open_videos (videoname) {

	new_window = window.open (videoname,"videos","width=600,height=500,toolbar=no,location=no,scrollbars=no,directories=no,menubar=no,resizable=yes");
}

function open_wheels(image_src) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open("enlargement.asp?image_type=wheels&image_src=" + image_src,"a" + counter + "a","width=800,height=600,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=no");
}

function open_seats(image_src) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open("enlargement.asp?image_type=seats&image_src=" + image_src,"a" + counter + "a","width=800,height=600,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=no");
}

function open_customer_bikes(image_src) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open("enlargement.asp?image_type=customer_bikes&image_src=" + image_src,"a" + counter + "a","width=800,height=600,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=no");
}

function y2k(number) { return (number < 1000) ? number + 1900 : number; }

function daysElapsed(date1,date2) {
    var difference =
        Date.UTC(y2k(date1.getYear()),date1.getMonth(),date1.getDate(),0,0,0)
      - Date.UTC(y2k(date2.getYear()),date2.getMonth(),date2.getDate(),0,0,0);
    return difference/1000/60/60/24;
}
