

// Top of page slideshow

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================



// Specify the image files
var LeftPic = new Array(); // don't touch this
// to add more images, just continue
// the pattern, adding to the array below


for (zz=0; zz<=34; zz++)
{
	LeftPic[zz] = 'images/Slideshow/' + zz + '.jpg';
}


// get the name of the page we're on so we can run the scrolling ads if needed.
var page = window.location.pathname;

// Preload the scrolling ads
// Specify the image files
var scrollName = new Array();
var scrollLink = new Array();
var scrollTarget = new Array();
var scrollText = new Array();


// Scrolling photos, text, and links for the index page
if (window.location.href.search("index.html") > 0 || window.location.href.search(".html") == -1 )
{
	scrollName[0] = 'images/ScrollAds/Index0000.JPG';
	scrollName[1] = 'images/ScrollAds/Index0001.JPG';
	scrollName[2] = 'images/ScrollAds/Index0002.JPG';
	scrollName[3] = 'images/ScrollAds/Index0003.JPG';
	scrollName[4] = 'images/ScrollAds/Index0004.JPG';
	scrollName[5] = 'images/ScrollAds/Index0005.JPG';
	scrollName[6] = 'images/ScrollAds/Index0006.JPG';
	scrollName[7] = 'images/ScrollAds/Index0007.JPG';

	scrollLink[0] = 'KKSales.html';
	scrollLink[1] = 'KKAccessories.html';
	scrollLink[2] = 'KKSales.html';
	scrollLink[3] = 'KKSalesPreowned.html';
	scrollLink[4] = 'KKGalleries.html';
	scrollLink[5] = 'KKParts.html';
	scrollLink[6] = '#';
	scrollLink[7] = 'http://www.genuinescooters.com/springbling.html';

	scrollTarget[0] = '';
	scrollTarget[1] = '';
	scrollTarget[2] = '';
	scrollTarget[3] = '';
	scrollTarget[4] = '';
	scrollTarget[5] = '';
	scrollTarget[6] = '';
	scrollTarget[7] = 'NewGenuineWindow';

	scrollText[0] = '<font color="lime" face="arial" size="3"><b>Hurry in for our best deals on new Arctic Cat sleds!</b><br>';
	scrollText[0] += '<font color="red" face="arial" size="3"><b><i>Sale prices now even lower!</i></b><br><br>';
	scrollText[0] += '<font color="lime" size="3">2012 Arctic Cat M8 153” SP <font color="white">NOW ONLY $11,499<br>';
	scrollText[0] += '<font color="lime" size="3">2012 Arctic Cat M8 162” SP <font color="white">NOW ONLY $11,599<br>';
	scrollText[0] += '<font color="lime" size="3">2012 Arctic Cat M1100 Turbo 162” SP <font color="white">NOW ONLY $12,999<br>';
	scrollText[0] += '<font color="lime">2011 M8 162 <font color="white">NOW ONLY $9,299<br>';
	scrollText[0] += '<font color="lime" size="3">2011 M8 162 SP <font color="white">NOW ONLY $9,799<br>';
	scrollText[0] += '<font color="lime">2011 HCR <font color="white">NOW ONLY $10,199<br>';
	scrollText[0] += '<font color="lime">2011 CROSSFIRE 800 SP 141 <font color="white">NOW ONLY $9,999<br>';


	scrollText[1] = '';

	scrollText[2] = '<font color="lime" face="arial" size="3">';
	scrollText[2] += '<b>2011 & 2012 Snowmobiles</b><br>';
	scrollText[2] += '<font color="white" face="arial" size="2">No Down Payment<br>';
	scrollText[2] += 'No Payments<br>';
	scrollText[2] += 'No Interest<br>';
	scrollText[2] += 'Till January 1, 2013!';
	scrollText[2] += '<p><font color="lime" face="arial" size="3"><a href="http://www.wsdot.wa.gov/traffic/passes/snoqualmie/default.aspx" target="NewWindow"><b>Click here</b></a> to check the mountain pass reports.';
	scrollText[2] += '<p><img src="images/Snoqualmie.JPG" width="200">';

	scrollText[3] = '<font color="lime" face="arial" size="4">';
	scrollText[3] += '<div align="center">Check out our larger pre-owned inventory</div>';

	scrollText[4] = '<font color="lime" face="arial" size="4">';
	scrollText[4] += 'Visit our Photo Galleries page to see what we\'ve been up to!';

	scrollText[5] = '<font color="lime" face="arial" size="4">Shop our OEM Parts and Accessories site 24/7</font>';

	scrollText[6] = '<font color="lime" face="arial" size="3">';
	scrollText[6] += '<a href="http://twitter.com/KentKawasaki" target="NewTwitterWindow"><img src="images/TwitSmall.jpg" border="0" align="bottom"> Follow us on Twitter</a> for daily updates on new units, parts & Accessories specials<p>';
	scrollText[6] += '<a href="http://www.facebook.com/home.php#!/pages/Kent-Kawasaki/215522301812554" target="NewFacebookWindow"><img src="images/Facebook.jpg" border="0"> Facebook friends</a> of Kent Kawasaki get exclusive offers and discounts';

	scrollText[7] = '';

}


// Scrolling photos, text, and links for the Accessories page.
if (window.location.href.search("KKAccessories.html") > 0)
{
	scrollName[0] = 'images/ScrollAds/Acc0001.JPG';
	scrollName[1] = 'images/ScrollAds/Acc0002.JPG';
	scrollName[2] = 'images/ScrollAds/Acc0003.JPG';
	scrollName[3] = 'images/ScrollAds/Acc0004.JPG';
	scrollName[4] = 'images/ScrollAds/Acc0005.JPG';
	scrollName[5] = 'images/ScrollAds/Acc0006.JPG';
	scrollName[6] = 'images/ScrollAds/Acc0007.JPG';
	scrollName[7] = 'images/ScrollAds/Acc0008.JPG';
}




var count = 0;
var S = 0;
var SL = scrollName.length;
var preLoadScroll = new Array();
for (i = 0; i < SL; i++)
{
   preLoadScroll[i] = new Image();
   preLoadScroll[i].src = scrollName[i];
}



// =======================================
// do not edit anything below this line
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 6000;

// Duration of crossfade (seconds)
var crossFadeDuration = 3;

var t;
var j = 0;
var lp = LeftPic.length;

// Preload the top banner slideshow pics
var preLoadLeft = new Array();

for (i = 0; i < lp; i++)
{
   preLoadLeft[i] = new Image();
   preLoadLeft[i].src = LeftPic[i];
}

function runSlideShow()
{
	var scrollPhoto = document.getElementById("PhotoAd");
	if (scrollPhoto != null)
	{
		scrollPhoto.src = preLoadScroll[S].src;
		sLink = document.getElementById("ScrollLink");
		if (sLink != null)
		{
			sLink.href=scrollLink[S];
			sLink.target=scrollTarget[S];
		}
		sCell = document.getElementById("ScrollCell");
		if (sCell != null)  sCell.innerHTML=scrollText[S];
	} 
   	document.images.SlideShowLeft.src = preLoadLeft[j].src;

   	j = j + 1;
   	S = S + 1;
   	if (j > (lp-1)) j=0;
   	if (S > (SL-1))  S = 0;
   	t = setTimeout('runSlideShow()', slideShowSpeed);
}





// Drop-down navigation menu functions
// Copyright 2006-2007 javascript-array.com

var timeout	= 100;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 












// Preowned page photo functions

function expand(picName, numPics)
{

	pictureCell = document.getElementById(picName);
	pictureCellText = pictureCell.innerHTML;
	// alert(pictureCellText.length);
	if (pictureCellText.length < 10)
	{
		var zeros = '000';
		mainPicName = picName + 'Main';
		mainPic = document.getElementById(mainPicName);
		mainPic.src='images/Showroom/Preowned/' + picName +'0001.JPG';
		mainPic.width="600";
	
		for (count=1; count<=numPics; count++)
		{
			if (count > 9) zeros = '00';
			pictureCell.innerHTML += '<img src="images/Showroom/Preowned/' + picName + zeros + count + '.JPG" border="0" width="80" hspace="5" vspace="5" onMouseover="hoverDisplay(\'' + picName + '\', ' + count + ')">';
			if ((count % 8) == 0) pictureCell.innerHTML += '<br>';  // new-line every 8 pics
			if (count > 15) break;   // Only allow 2 rows, 16 pics.
		}

		if (numPics > 16)
		{ //Provide a link to the PreownedGallery page if there are more than 16 pics.
			pictureCell.innerHTML += '<font face="arial"><a href="KKPreownedGallery.html?name=' + picName + '&numPhotos=' + numPics + '">Click here for more photos!</a></font><br>';
		}
		pictureCell.innerHTML += '<input type="button" value="Close" onClick="window.location.reload()">'

	}

}

function hoverDisplay(picName, num)
{
	var zeros = '000';
	if (num > 9) zeros = '00';
	newPicName = picName + zeros + num + '.JPG';
	// alert(newPicName);

	mainPicName = picName + 'Main';
	mainPic = document.getElementById(mainPicName);
	mainPic.src='images/Showroom/Preowned/' + newPicName;
}



function loadPreownedGallery(name, numPhotos)
{
	var zeros = '000';

	for (count=1; count<=numPhotos; count++)
	{
		if (count > 9) zeros='00';
		if (count > 99) zeros='0';		
		document.write('<a href="images/Showroom/Preowned/' + name + zeros + count + '.JPG">');
		document.write('<img src="images/Showroom/Preowned/' + name + zeros + count +'.JPG" align="middle" border="0" hspace="5" vspace="5" width="100" id="' + count + '" onMouseover="galleryMakeBigger(' + count + ')" onMouseout="galleryMakeSmaller(' + count + ')" onClick="galleryMakeSmaller(' + count + ')"></a>');
		if (count%5 == 0) document.write('<br>');  // a new line after every 5 pics
		if (count > 300) return;  // Just in case of a bad URL, to prevent an endless loop
	}

}

















//  New Models page photo functions

function makeBigger(picName)
{
	thePicture = document.getElementById(picName);
	thePicture.width="300";
	textName = picName + 'Text';
	theText = document.getElementById(textName);
	theText.size="3";
}

function makeSmaller (picName)
{
	thePicture = document.getElementById(picName);
	thePicture.width="200";
	textName = picName + 'Text';
	theText = document.getElementById(textName);
	theText.size="2";
}








//  Photo Gallery functions


function loadGallery(directory, numPhotos)
{
	var zeros = '000';

	for (count=1; count<=numPhotos; count++)
	{
		if (count > 9) zeros='00';
		if (count > 99) zeros='0';		
		document.write('<a href="images/Galleries/' + directory + '/IMG_' + zeros + count + '.JPG">');
		document.write('<img src="images/Galleries/' + directory + '/small_' + zeros + count +'.JPG" align="middle" border="0" hspace="5" vspace="5" width="100" id="' + count + '" onMouseover="galleryMakeBigger(' + count + ')" onMouseout="galleryMakeSmaller(' + count + ')" onClick="galleryMakeSmaller(' + count + ')"></a>');
		if (count%5 == 0) document.write('<br>');  // a new line after every 5 pics
		if (count > 300) return;  // Just in case of a bad URL, to prevent an endless loop
	}

}


function galleryMakeBigger(picName)
{
	thePicture = document.getElementById(picName);
	thePicture.width="175";
	thePicture.border="1";
}

function galleryMakeSmaller (picName)
{
	thePicture = document.getElementById(picName);
	thePicture.width="100";
	thePicture.border="0";
}







// Finance page functions

function FinanceSpecials(company)
{
	financeCell = document.getElementById('FinanceInfo');

	if (company == 'Kawasaki')
	{
		financeCell.innerHTML =  '<font color="white" face="arial" size="3">Kawasaki Financing Offers<br><br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">3.99% for 24 Months Units with a retail price less 10K<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">3.99% for 36 Months Units with a retail price above 10K<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">6.95% fixed for life of loan<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">1.95% for 60 Months on 2012 Jet SKis<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">3.95% for 60 Months on all Teryx and KVF750 models<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">1.95% for 60 Months on Teryx4 models<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">1.95% for 60 Months on all Mule models<br>';
		financeCell.innerHTML += '</font>';
	}

	if (company == 'ArcticCat')
	{
		financeCell.innerHTML =  '<font color="white" face="arial" size="3">Arctic Cat Financing Offers<br><br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">2011 & 2012 Snowmobiles<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">No Down Payment<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">No Payments<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">No Interest<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">Till January 1, 2013<br><br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">2011 & 2012 Snowmobiles<br>'
		financeCell.innerHTML += '<font color="white" face="arial" size="2">6.99% for 60 months<br>'
		financeCell.innerHTML += '</font>';
	}

	if (company == 'Genuine')
	{
		financeCell.innerHTML =  '<font color="white" face="arial" size="3">Genuine Financing Offers<br><br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">4.9% for 36 Months<br>'
		financeCell.innerHTML += '<font color="white" face="arial" size="2">$0 Down | 4.9% Interest Rate | $29.93 per $1,000 Financed<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">6 Months No Interest / 7 Months No Payments, Thereafter 12.95% for 48 Months<br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">$0 Down* | 0% Rate for 6 Months* | $0 Payment*<br>'
		financeCell.innerHTML += '</font>';
	}

	if (company == 'Alaska')
	{
		financeCell.innerHTML =  '<font color="white" face="arial" size="3">Alaska USA Financing Offers<br><br>';
		financeCell.innerHTML += '<font color="white" face="arial" size="2">APR as low as 6.75% all brands<br>';
		financeCell.innerHTML += '</font>';
	}



}








//  Common header function

function CommonHeader()
{

	document.write('<!-- Slideshow and top banner image -->		');

	document.write('<table width="800" border="0" bgcolor="black" cellpadding="5">		');
	document.write('	<tr>		');


	// Left side ad space
	// document.write('		<td rowspan="3" align="center" valign="top">	');
	// document.write('			<font color="lime" face="arial" size="4">	');
	// document.write('			<i><b>STOREWIDE<br>SALE<br>Friday<br>&<br>Saturday!</b>	');
	// document.write('			<p>All Parts<br>&<br>Accessories!	');
	// document.write('			<p>All New<br>&<br>Pre-Owned!</i>	');
	// document.write('		</td>	');



	document.write('		<td width="350" align="center">		');
	document.write('			<a href="index.html"><img src="images/08Banner.jpg" width="300" border="0"></a><br>		');
	document.write('		</td>		');

	document.write('		<td width="125" rowspan="2" align="center" valign="middle">		');
	document.write('			<img border="0" src="images/logokawasaki.jpg" width="125" vspace="10"><br>		');
	document.write('			<img border="0" src="images/logoarcticcat.gif" width="125"><br>		');
	document.write('			<img border="0" src="images/gsclogo.jpg" width="125"><br>		');
	document.write('			<font color="white" face="arial" size="2">		');
	document.write('			<div align="right">		');
	document.write('			<i>Follow us!</i> <a href="http://twitter.com/KentKawasaki" target="NewTwitterWindow"><img src="images/TwitSmall.jpg" border="0" align="bottom"></a>		');
	document.write('			<a href="http://www.facebook.com/home.php#!/pages/Kent-Kawasaki/215522301812554" target="NewFacebookWindow"><img src="images/Facebook.jpg" border="0"></a>&nbsp;&nbsp;		');
	document.write('			</font></div>		');			
	document.write('		</td>		');


	document.write('		<td width="325" height="160" rowspan="2" align="center" valign="middle">		');
	document.write('			<img src="images/Slideshow/0.jpg" border="0" width="300" name="SlideShowLeft">		');
	document.write('		</td>		');




	// Right side ad space
	// document.write('		<td rowspan="3" align="center" valign="top">	');
	// document.write('			<font color="lime" face="arial" size="4">	');
	// document.write('			<i><b>STOREWIDE<br>SALE<br>Friday<br>&<br>Saturday!</b>	');
	// document.write('			<p>All Parts<br>&<br>Accessories!	');
	// document.write('			<p>All New<br>&<br>Pre-Owned!</i>	');
	// document.write('		</td>	');




	document.write('	</tr>		');


	document.write('<!-- Menu bar -->		');
	document.write('	<tr>		');
	document.write('		<td align="center" valign="top" width="350">		');

	document.write('			<div align="center">		');
	document.write('			<table border="0"><tr><td align="center">		');
	document.write('			<ul id="sddm">		');

	document.write('			    <li><a href="index.html"		');
	document.write('		        	onmouseover="mopen(\'m1\')" 		');
	document.write('		       	 	onmouseout="mclosetime()">Home</a>		');
	document.write('		        	<div id="m1" 		');
	document.write('			            onmouseover="mcancelclosetime()" 		');
	document.write('			            onmouseout="mclosetime()">		');
	document.write('			        <a href="KKMap.html">Map/Hours</a>		');
	document.write('			        <a href="KKAboutUs.html">About Us</a>		');
	document.write('			        <a href="KKContact.html">Contact Us</a>		');
	document.write('			        <a href="KKStaff.html">Staff</a>		');
	document.write('				<a href="KKGalleries.html">Photo Galleries</a>		');
	document.write('			        </div>		');

	document.write('			    <li><a href="KKSales.html"		'); 
	document.write('		        	onmouseover="mopen(\'m2\')" 		');
	document.write('		       	 	onmouseout="mclosetime()">Sales</a>		');
	document.write('		        	<div id="m2" 		');
	document.write('			            onmouseover="mcancelclosetime()" 		');
	document.write('			            onmouseout="mclosetime()">		');
	document.write('			        <a href="KKSalesNew2012.html">New</a>		');
	document.write('			        <a href="KKSalesPreowned.html">Pre-Owned</a>		');
	document.write('			        <a href="KKSalesBoats.html">Boats & Trailers</a>		');
	document.write('			        <a href="KKSalesAlaska.html">Alaska Sales</a>		');
	document.write('			        <a href="KKSalesFinancing.html">Financing</a>		');
	document.write('			        </div>		');
	document.write('			    </li>		');


	document.write('			    <li><a href="KKParts.html" 		');
	document.write('			        onmouseover="mopen(\'m3\')"		'); 
	document.write('			        onmouseout="mclosetime()">Parts</a>		');
	document.write('			        <div id="m3" 		');
	document.write('			            onmouseover="mcancelclosetime()" 		');
	document.write('			            onmouseout="mclosetime()">		');
	document.write('				<a href="KKAccessories.html">Accessories</a>		');
	document.write('			        <a href="http://www.kentkawparts.com" target="NewKKPartsWindow">OEM Parts Finder</a>		');
	document.write('			        </div>		');
	document.write('			    </li>		');

	document.write('			    <li><a href="KKService.html">Service</a></li>		');

	document.write('			</ul>		');
	document.write('			<div style="clear:both"></div>		');
	document.write('			</td></tr></table>		');
	document.write('			</div>		');

	document.write('		</td>		');

	document.write('	</tr>		');


	document.write('	<tr>		');
	document.write('		<td colspan="3" align="center">		');
	document.write('			<img src="images/SkinnyBanner.JPG" border="0">		');
	document.write('			<br>		');
	document.write('			<div align="center">		');

	document.write('<!-- End of every page header include -->		');
	
}

