/*
The following functions randomly select a homepage feature item from among the array of defined features.
Flash or a static image is displayed, depending on the version of the user's Flash player.
*/

var homepageFeatures = [];
/*
homepageFeatures.push({
	swf: "/flash/home/e1100.swf",
	flashvars: {},
	parameters: {bgcolor: "#ffffff"},
	attributes: {id: "homeFlash"},
	nonFlashImage: "/image/home/flash/e1100.jpg",
	nonFlashURL: "http://www.igniteneo.com",
	nonFlashURLTarget: "_blank"
});

homepageFeatures.push({
	swf: "/flash/home/e1100_m1400_m2000.swf",
	flashvars: {url1: "/e1100-phone", url2: "/m1400-phone", url3: "/m2000-phone"},
	parameters: {bgcolor: "#ffffff"},
	attributes: {id: "homeFlash"},
	width: "750",
	nonFlashImage: "/image/home/flash/e1100_m1400_m2000.jpg"
});

homepageFeatures.push({
	swf: "/flash/home/allAccess.swf",
	flashvars: {url: "http://www.allaccessdocs.com/KYO.htm"},
	parameters: {bgcolor: "#ffffff"},
	attributes: {id: "homeFlash"},
	nonFlashImage: "/flash/home/allAccess.jpg",
	nonFlashURL: "http://www.allaccessdocs.com",
	nonFlashURLTarget: "_blank"
});


homepageFeatures.push({
	swf: "/flash/home/incognito.swf",
	flashvars: {url1: "http://www.sanyowireless.com/incognito"},
	parameters: {bgcolor: "#ffffff"},
	attributes: {id: "homeFlash"},
	width: 610, 
	nonFlashImage: "/flash/home/incognito.jpg",
	nonFlashURL: "http://www.sanyowireless.com/incognito",
	nonFlashURLTarget: "_blank"

});
*/
homepageFeatures.push({
	swf: "/flash/home/zio_teaser_main.swf", 
	flashvars: {url1: "http://www.ziobykyocera.com", target1: "_blank"}, 
	parameters: {bgcolor: "#ffffff"}, 
	attributes: {id: "homeFlash"}, 
	nonFlashImage: "/flash/home/zio1.jpg", 
	nonFlashURL: "http://www.ziobykyocera.com",
	nonFlashURLTarget: "_blank"
});

function writeHomepageFeature(index) {
	var width = (homepageFeatures[index].width) ? homepageFeatures[index].width : "590";
	swfobject.embedSWF(homepageFeatures[index].swf, "homeFlash", width, "360", "8.0.0", false, homepageFeatures[index].flashvars, homepageFeatures[index].parameters, homepageFeatures[index].attributes, writeHomepageFeatureCallback);
}

function writeHomepageFeatureCallback(e) {
	if (!e.success) {
		if (homepageFeatures[homepageFeatureIndex].width)
			document.getElementById("homeFlashNonFlashImage").width = homepageFeatures[homepageFeatureIndex].width;
		document.getElementById("homeFlashNonFlashImage").src = homepageFeatures[homepageFeatureIndex].nonFlashImage;
		if (homepageFeatures[homepageFeatureIndex].nonFlashURL)
			document.getElementById("homeFlashNonFlashLink").href = homepageFeatures[homepageFeatureIndex].nonFlashURL;
		if (homepageFeatures[homepageFeatureIndex].nonFlashURLTarget) 
			document.getElementById("homeFlashNonFlashLink").target = homepageFeatures[homepageFeatureIndex].nonFlashURLTarget;
	}
}

var homepageFeatureIndex = getRandomNumber(homepageFeatures.length);
writeHomepageFeature(homepageFeatureIndex);

/*
The following script defines the various promotional code blocks
that will be randomly displayed on this page.
*/

var left = [];
var middle = [];
var right = [];

/* Rio E3100 */
/*
left.push(
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/e3100-phone"><img src="/image/home/promo_hd_e3100.gif" alt="Rio E3100" width="83" height="12" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="/e3100-phone"><img src="/image/home/promo_img_e3100.jpg" alt="" width="46" height="92" border="0"/></a></div>' +
	'<div style="position:absolute; left:63px; top:25px; width:100px;" class="homePromo"><a href="/e3100-phone">Cool to the touch.</a></div>' +
	'</div>'
);
*/

/* Sanyo Zio */
left.push(
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/sanyo/usa/m6000-phone"><img src="/image/home/promo_hd_m6000.gif" alt="Zio™ M6000" width="82" height="12" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="/sanyo/usa/m6000-phone"><img src="/image/home/promo_img_m6000.jpg" alt="" width="49" height="96" border="0"/></a></div>' +
	'<div style="position:absolute; left:63px; top:25px; width:110px;" class="homePromo"><a href="/sanyo/usa/m6000-phone">Intelligence is a beautiful thing.</a></div>' +
	'</div>'
);

/* Kyocera Loft */
left.push(
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/loft-phone"><img src="/image/home/promo_hd_loft.gif" alt="Loft S2300" width="90" height="12" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="/loft-phone"><img src="/image/home/promo_img_loft.jpg" alt="" width="46" height="82" border="0"/></a></div>' +
	'<div style="position:absolute; left:65px; top:25px; width:50px;" class="homePromo"><a href="/loft-phone">Enough talking, more connecting.</a></div>' +
	'</div>'
);

/* Kyocera Zio */
/*
left.push(
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/m6000-phone"><img src="/image/home/promo_hd_m6000.gif" alt="Zio™ M6000" width="82" height="12" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="/m6000-phone"><img src="/image/home/promo_img_m6000.jpg" alt="" width="49" height="96" border="0"/></a></div>' +
	'<div style="position:absolute; left:63px; top:25px; width:110px;" class="homePromo"><a href="/m6000-phone">Check out the new Zio Android phone!</a></div>' +
	'<div style="position:absolute; left:65px; top:55px;"><a href="/m6000-phone"><img src="/image/home/promo_img_m6000_alien.gif" alt="" width="52" height="76" border="0"/></a></div>' +
	'</div>'
);
*/

/*
left[ left.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/s2300-phone"><img src="/image/home/promo_hd_s2300.gif" alt="Torino S2300" width="104" height="12" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="/s2300-phone"><img src="/image/home/promo_img_s2300.jpg" alt="" width="50" height="77" border="0"/></a></div>' +
	'<div style="position:absolute; left:65px; top:25px; width:95px;" class="homePromo"><a href="/s2300-phone">Stay connected and in touch.</a></div>' +
	'</div>';
/*
left[ left.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/s1310-phone"><img src="/image/home/promo_hd_s1310.gif" alt="Domino S1310" width="112" height="12" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="/s1310-phone"><img src="/image/home/promo_img_s1310.jpg" alt="" width="46" height="114" border="0"/></a></div>' +
	'<div style="position:absolute; left:60px; top:25px; width:100px;" class="homePromo"><a href="/s1310-phone">Simply advanced elegance.</a></div>' +
	'</div>';
/*
left[ left.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="http://www.sanyowireless.com" target="_blank"><img src="/image/home/promo_hd_sanyo.gif" alt="SANYO Product Line" width="142" height="12" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="http://www.sanyowireless.com" target="_blank"><img src="/image/home/promo_img_sanyo.jpg" alt="" width="74" height="73" border="0"/></a></div>' +
	'<div style="position:absolute; left:80px; top:20px; width:100px;" class="homePromo"><a href="http://www.sanyowireless.com" target="_blank">Check out SANYO phones.</a><br/><a href="http://www.sanyowireless.com" target="_blank"><img src="/image/home/promo_art_sanyo.gif" width="88" height="28" border="0" vspace="10" /></a><br/></div>' +
	'</div>';
/*
left[ left.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/m1400-phone"><img src="/image/home/promo_hd_m1400.gif" alt="Kyocera Laylo M1400" width="156" height="14" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="/m1400-phone"><img src="/image/home/promo_img_m1400.gif" alt="" width="46" height="94" border="0"/></a></div>' +
	'<div style="position:absolute; left:60px; top:25px; width:100px;" class="homePromo"><a href="/m1400-phone">Always stealthy. Never unnoticed.</a></div>' +
	'</div>';

/*
left[ left.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/m2000-phone"><img src="/image/home/promo_hd_m2000.gif" alt="G2GO M2000" width="107" height="11" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="/m2000-phone"><img src="/image/home/promo_img_m2000.jpg" alt="" width="50" height="105" border="0"/></a></div>' +
	'<div style="position:absolute; left:60px; top:25px; width:85px;" class="homePromo"><a href="/m2000-phone">Accelerate your expression.</a></div>' +
	'</div>';

left[ left.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/x-tc-phone"><img src="/image/home/promo_hd_x-tc.gif" alt="X-tc M2000" width="96" height="11" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="/x-tc-phone"><img src="/image/home/promo_img_x-tc.jpg" alt="" width="49" height="102" border="0"/></a></div>' +
	'<div style="position:absolute; left:60px; top:25px; width:85px;" class="homePromo"><a href="/x-tc-phone">Plays well with others.</a></div>' +
	'</div>';

left[ left.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/s1300-phone"><img src="/image/home/promo_hd_s1300.gif" alt="Kyocera Melo S1300" width="149" height="14" border="0"/></a></div>' +
	'<div style="position:absolute; left:5px; top:20px;"><a href="/s1300-phone"><img src="/image/home/promo_img_s1300.jpg" alt="" width="46" height="114" border="0"/></a></div>' +
	'<div style="position:absolute; left:60px; top:25px; width:85px;" class="homePromo"><a href="/s1300-phone">Even basic can be beautiful.</a></div>' +
	'</div>';

left[ left.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/e1100-phone"><img src="/image/home/promo_hd_e1100.gif" alt="Neo E1100" width="88" height="11" border="0"/></a></div>' +
	'<div style="position:absolute; left:0px; top:20px;"><a href="/e1100-phone"><img src="/image/home/promo_img_e1100.jpg" alt="" width="49" height="94" border="0"/></a></div>' +
	'<div style="position:absolute; left:60px; top:25px; width:85px;" class="homePromo"><a href="/e1100-phone">Tomorrow has come to light.</a></div>' +
	'</div>';

left[ left.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:5px; top:0px;"><a href="/s2410-phone"><img src="/image/home/promo_hd_s2410.gif" alt="Kyocera Tomo S2410" width="154" height="14" border="0"/></a></div>' +
	'<div style="position:absolute; left:0px; top:20px;"><a href="/s2410-phone"><img src="/image/home/promo_img_s2410.jpg" alt="" width="49" height="94" border="0"/></a></div>' +
	'<div style="position:absolute; left:60px; top:25px; width:85px;" class="homePromo"><a href="/s2410-phone">Smooth, in every sense of the word.</a></div>' +
	'</div>';
*/

/*
Espresso Brown Headset (26 Nov 08) 
middle[ middle.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:0px; top:0px;"><a href="http://store.kyocera-wireless.com/product.aspx?product%5Fno=Universal"><img src="/image/home/promo_hd_espressoHeadset.gif" alt="Espresso Brown Headset" width="172" height="14" border="0"/></a></div>' +
	'<div style="position:absolute; left:0px; top:22px;"><a href="http://store.kyocera-wireless.com/product.aspx?product%5Fno=Universal"><img src="/image/home/promo_img_espressoHeadset.gif" alt="" width="82" height="99" border="0"/></a></div>' +
	'<div style="position:absolute; left:80px; top:30px; width:100px;" class="homePromo"><a href="http://store.kyocera-wireless.com/product.aspx?product%5Fno=Universal">Coordinate your outfit with these fashion headsets.</a></div>' +
	'</div>';
*/


/* Mile High (12 Aug 10) */
/*
middle.push(
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:0px; top:0px;"><a href="http://www.mycricket.com" target="_blank"><img src="/image/home/promo_hd_mile-high.gif" alt="Listen to Live Stream" width="146" height="12" border="0"/></a></div>' +
	'<div style="position:absolute; left:0px; top:25px;"><a href="http://www.mycricket.com" target="_blank"><img src="/image/home/promo_img_mile-high.gif" alt="Mile High Music Festival" width="88" height="52" border="0"/></a></div>' +
	'<div style="position:absolute; left:95px; top:25px; width:60px;" class="homePromo"><a href="http://www.mycricket.com" target="_blank">Click here for a live stream of the Mile High Music Festival</a></div>' +
	'</div>'



/* KR2 Mobile Router (2 Mar 08) */
middle[ middle.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:27px; top:0px;"><a href="/kr2-router"><img src="/image/home/promo_hd_kr2-mobile-router.gif" alt="KR2 Mobile Router" width="136" height="12" border="0"/></a></div>' +
	'<div style="position:absolute; left:20px; top:22px;"><a href="/kr2-router"><img src="/image/home/promo_img_kr2-mobile-router.gif" alt="" width="87" height="75" border="0"/></a></div>' +
	'<div style="position:absolute; left:110px; top:30px; width:100px;" class="homePromo"><a href="/kr2-router">Wireless Broadband Anywhere.</a></div>' +
	'</div>';


/*
15% off accessories (8 Nov 07)
middle[ middle.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:19px; top:0px;"><a href="/store/registration_home.aspx?discount_name=KWCWEB"><img src="/image/home/promo_hd_15-off-accessories.gif" alt="15% off accessories" width="145" height="12" border="0"/></a></div>' +
	'<div style="position:absolute; left:0px; top:14px;"><a href="/store/registration_home.aspx?discount_name=KWCWEB"><img src="/image/home/promo_img_15-off-accessories.gif" alt="" width="94" height="76" border="0"/></a></div>' +
	'<div style="position:absolute; left:97px; top:30px; width:90px;" class="homePromo"><a href="/store/registration_home.aspx?discount_name=KWCWEB">Receive 15% off your first order when you register.</a></div>' +
	'</div>';


Rearview Mirror with Bluetooth Technology (28 Nov 06) 
middle[ middle.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:0px; top:0px;"><a href="/store/product.aspx?product_no=BluetoothAccessories&discount_name=KWCWEB"><img src="/image/home/promo_hd_bluetooth.gif" alt="Bluetooth Technology" width="169" height="22" border="0"/></a></div>' +
	'<div style="position:absolute; left:89px; top:33px;"><a href="/store/product.aspx?product_no=BluetoothAccessories&discount_name=KWCWEB"><img src="/image/home/promo_img_bluetooth-300.jpg" alt="" width="100" height="92" border="0"/></a></div>' +
	'<div style="position:absolute; left:19px; top:33px; width:150px;" class="homePromo"><a href="/store/product.aspx?product_no=BluetoothAccessories&discount_name=KWCWEB">A great way<br/>to talk while<br/>keeping your<br/>hands free.<br/> Provides ultimate convenience.</a></div>' +
	'</div>';

*/
	
/* Cellphone Etiquette (14 Feb 07) */
/*
right[ right.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:113px; top:0px;"><a href="/cellphone-etiquette"><img src="/image/home/promo_img_cellphone-etiquette.jpg" alt="" width="71" height="71" border="0"/></a></div>' +
	'<div style="position:absolute; left:0px; top:50px;"><a href="/cellphone-etiquette"><img src="/image/home/promo_hd_cellphone-etiquette.gif" alt="Cell phone karma.  It\'s real." width="132" height="28" border="0"/></a></div>' +
	'<div style="position:absolute; left:20px; top:85px; width:135px;" class="homePromo"><a href="/cellphone-etiquette">Do you exercise proper cell phone etiquette?</a></div>' +
	'</div>';
*/

right[ right.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:8px; top:0px;"><a href="/support"><img src="/image/home/promo_img_support.gif" alt="" width="161" height="54" border="0"/></a></div>' +
	'<div style="position:absolute; left:0px; top:54px;"><a href="/support"><img src="/image/home/promo_hd_support.gif" alt="online support" width="109" height="15" border="0"/></a></div>' +
	'<div style="position:absolute; left:23px; top:80px; width:145px;" class="homePromo"><a href="/support">We\'re here if you need us, but you probably won\'t.</a></div>' +
	'</div>';

right[ right.length ] = '' +
	'<table border="0" cellpadding="0" cellspacing="0" class="homePromoLink" style="width:190px; height:115px; background:no-repeat top right url(/image/home/promo_img_enews.gif);" ' +
	'onclick="location.href=\'/enewsletter\'";' +
	'><tr><td height="60"></td></tr>' +
	'<tr><td valign="top"><a href="/enewsletter"><img src="/image/home/promo_hd_enews.gif" alt="eNews" width="60" height="14" border="0" class="inline" style="margin-bottom:8px;"></a><br>' +
	'<p class="homePromo" style="margin:0px 0px 0px 20px;"><a href="/enewsletter">Tools, tips and discounts you won\'t want to miss.</a></p></td></tr>' +
	'</table>';

/*
right[ right.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:0px; top:0px;"><a href="http://entertainment.msn.com/virgin-festival2/?icid=MUSIC1&GT1=MUSIC1" target="blank"><img src="/image/home/promo_img_virginfest.gif" alt="" width="181" height="91" border="0"/></a></div>' +
	'<div style="position:absolute; left:0px; top:93px;"><a href="http://entertainment.msn.com/virgin-festival2/?icid=MUSIC1&GT1=MUSIC1" target="blank"><img src="/image/home/promo_hd_virginfest.gif" alt="Try our phones first!" width="188" height="14" border="0"/></a></div>' +
	'<div style="position:absolute; left:20px; top:108px; width:193px;" class="homePromo"><a href="http://entertainment.msn.com/virgin-festival2/?icid=MUSIC1&GT1=MUSIC1" target="blank">Re-live every second of the music and watch performances by your favorite artists!</a></div>' +
	'</div>';
*/
	
/*
right[ right.length ] = '' +
	'<div style="position:absolute;">' +
	'<div style="position:absolute; left:126px; top:0px;"><a href="/contact/product-evaluator.htm"><img src="/image/home/promo_img_try-our-phones-first.jpg" alt="" width="77" height="90" border="0"/></a></div>' +
	'<div style="position:absolute; left:0px; top:56px;"><a href="/contact/product-evaluator.htm"><img src="/image/home/promo_hd_try-our-phones-first.gif" alt="Try our phones first!" width="147" height="14" border="0"/></a></div>' +
	'<div style="position:absolute; left:20px; top:75px; width:135px;" class="homePromo"><a href="/contact/product-evaluator.htm">Learn how to become a product evaluator...</a></div>' +
	'</div>';

*/
		

writeblock = function( array )
{
	if( !array.length ) return;
	document.write( array[ getRandomNumber( array.length ) ] );
}
