﻿var cycles=new Array();
//SET IMAGE PATHS. Extend or contract array as needed
// [0] cycleTitle
// [1] cycleSpecs
// [2] cycleExtras
// [3] cycleDesc
// [4] cycleImg
// [5] cyclePrice
cycles[0]=["Honda Goldwing", "<ul><li>Engine Size: 1832cc</li><li>Weight: 900 lbs</li><li>Seat Height: 29.1 in</li></ul>", "Audio Package, Headsets available, Heated grips and seat", "When you want to tour in luxury and style the Goldwing is the bike for you.  It can comfortably take the two of you across the country and back, but it’s also good for those one day tours around Lancaster County.  Just think how many baked goods you could fit in those bags!", "images/cycles/cycle3.png", "<ul><li>Single Day - $170/day</li><li>2-5 days - $150/day</li><li>6+ days - $130/day</li></ul>"];
cycles[1]=["Honda ST1300", "<ul><li>Engine Size:  1261 cc</li><li>Weight: 720 lbs</li><li>Seat Height: 31.1 in</li></ul>", "Givi topcase with backrest, available GPS", "The ST1300 provides all the amenities a touring bike should with great wind protection, a smooth torquey engine, and integrated hard luggage, but this bike has a second personality that will have you seeking the roads with the most curves per mile.  Highways or twisty mountain roads?  Enjoy both with an ST1300.", "images/cycles/cycle2.png", "<ul><li>Single Day - $150/day</li><li>2-5 days - $130/day</li><li>6+ days - $110/day</li></ul>"];
cycles[2]=["Suzuki V-strom 650", "<ul><li>Engine Size: 645cc</li><li>Weight: 479 lbs</li><li>Seat Height: 32.3 in</li></ul>", "Givi topcase with backrest, seat can be lowered to 31 in.", "Suzuki has quietly created one of the best all purpose motorcycles on the market today. Whether you are riding on highways or small, unpaved, back roads the V-Strom handles the challenge with ease. It is light enough to inspire confidence in newer riders, but powerful and agile enough to keep even the most experienced riders entertained.", "images/cycles/cycle1.png", "<ul><li>Single Day - $130/day</li><li>2-5 days - $110/day</li><li>6+ days - $95/day</li></ul>"];
cycles[3]=["Triumph Bonneville", "<ul><li>Engine Size: 865cc</li><li>Weight: 448 lbs</li><li>Horsepower 67 hp</li><li>Torque: 50.1 ft-lbs</li></ul>", "windshield, saddlebags, ram accessory mount", "The classic goods looks of a Triumph, with the performance of a modern bike.  You'll be amazed how well the combination works on the backroads of Lancaster County.  With the windshield and saddlebags, it's up for longer rides as well.", "images/cycles/cycle6.png", "<ul><li>Single Day - $130/day</li><li>2-5 days - $110/day</li><li>6+ days - $95/day</li></ul>"];
cycles[4]=["Suzuki Boulevard S40", "<ul><li>Engine Size: 652cc</li><li>Weight: 381 lbs</li><li>Seat Height: 27.6 in</li></ul>", "Magnetic tank bag available", "Small is beautiful.  This is one of the lightest and lowest bikes out there.  It has plenty of power, but places it in a small easy to ride motorcycle.  Great for enjoying the countryside of Lancaster Country.", "images/cycles/cycle4.png", "<ul><li>Single Day - $100/day</li><li>2-5 days - $80/day</li><li>6+ days - $70/day</li></ul>"];

function cycleNav()
{
	var cycleNavString = '';
	for (c = 0; c < cycles.length; c++)
	{
		cycleNavString += '<img id="cycle_' + c + '" alt="" class="imgBounce" src="' + cycles[c][4] + '" onclick="showBike(' + c + ')" />'
	}
	document.write(cycleNavString);
}

function showBike(id) 
{
	document.getElementById("cycleInst").style.display = "none";
	document.getElementById("cycleTitle").innerHTML = "<h3>" + cycles[id][0] + "</h3>";
	document.getElementById("cycleSpecs").innerHTML = "<h5>Specifications: </h5>" + cycles[id][1];
	document.getElementById("cycleExtras").innerHTML = "<h5>Extras: </h5>" + cycles[id][2];
	document.getElementById("cycleDesc").innerHTML = "<h5>Description: </h5>" + cycles[id][3];
	document.getElementById("cycleImg").innerHTML = "<img src='" + cycles[id][4] + "' alt='" + cycles[id][0] + "' title='" + cycles[id][0] + "'/>";
	document.getElementById("cyclePrice").innerHTML = "<h5>Price:</h5>" + cycles[id][5] + "<br/><br/><span class='footnote'>* Prices do not include $15/day for required insurance.</span>";
}


function navigateMenu(){
document.write('<ul>' +
		'<li><a href="index.html">Home</a></li>' +
		'<li>|</li>' +
		'<li><a href="rent_cycle.html">Rental Motorcycles</a></li>' +
		'<li>|</li>' +
		'<li><a href="http://countryroadscooters.com">Rent a Scooter</a></li>' +
		'<li>|</li>' +
		'<li><a href="destinations.html">Destinations</a></li>' +
		'<li>|</li>' +
		'<li><a href="links.html">Links</a></li>' +
		'<li>|</li>' +
		'<li><a href="contactus.php">Contact Us</a></li>' +
		'<li>|</li>' +
		'<li><a href="findus.html">Find Us</a></li>' +
	'</ul>');

}

function HideContent(d) {
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
document.getElementById(d).style.display = "block";
}
function ReverseDisplay(d) {
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}


var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
// [0] Image SRC
// [1] Image Link URL
// [2] Link Target
// [3] Background Color
fadeimages[0]=["images/slideshow/closed.jpg", "", "_blank", "#e6e6e6"]
fadeimages[1]=["images/slideshow/slideshow1.jpg", "", "_blank", "#e6e6e6"]
fadeimages[2]=["images/slideshow/slideshow2.jpg", "", "_blank", "#e6e6e6"]
fadeimages[3]=["images/slideshow/closed.jpg", "", "_blank", "#e6e6e6"]
fadeimages[4]=["images/slideshow/slideshow3.jpg", "", "_blank", "#e6e6e6"]
fadeimages[5]=["images/slideshow/slideshow4.jpg", "", "_blank", "#e6e6e6"]
fadeimages[6]=["images/slideshow/closed.jpg", "", "_blank", "#e6e6e6"]
fadeimages[7]=["images/slideshow/slideshow5.jpg", "", "_blank", "#e6e6e6"]
fadeimages[8]=["images/slideshow/slideshow6.jpg", "", "_blank", "#e6e6e6"]
fadeimages[9]=["images/slideshow/closed.jpg", "", "_blank", "#e6e6e6"]
fadeimages[10]=["images/slideshow/slideshow7.jpg", "", "_blank", "#e6e6e6"]
fadeimages[11]=["images/slideshow/slideshow9.jpg", "", "_blank", "#e6e6e6"]

//var fadebgcolor="black"
var fadebgcolor="#e6e6e6"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all 

function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
//document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;"></div></div>')
document.write('<div id="master'+this.slideshowid+'" style="text-align:center; position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML

// Set background color of page
//document.body.style.background = this.theimages[this.curimageindex][3];
picobj.style.background = this.theimages[picindex][3];

}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)

// Set background color of page
//document.body.style.background = this.theimages[this.curimageindex][3];
//document.getElementById(this.curcanvas).style.background = this.theimages[this.curimageindex][3];
//document.body.style.background = document.getElementById(this.curcanvas).style.background;


this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

