// Rotating header. Depends on JQuery and .cookie

// define rotating content
var rotating_html = Array(
	"<img src=\"images/tacoma.jpg\" alt=\"Happy Customer of CNR-Inc\" />\
<p>Over the past 4 years Tacoma School District has been involved in replacing their old Fujitsu\
PBX Systems.  This has been a huge undertaking of which CNR has been a major player in its\
success...<a href=\"customers.html\"><font color=\"#0000FF\">read more</font></a></p>\
<cite><font size=\"-2\">Dorothy Kippie, Technical Op. Manager, Tacoma School District </font></cite>",
	"<img src=\"images/img_chuck.jpg\" alt=\"Happy Customer of CNR-Inc\" />\
<p>CNR has provided the expertise in communications my company has needed to grow over the past\
seven years</p>\
<cite>Chuck Maylin,</cite>\
<cite>Owner/Managing Director, Bizop LLC</cite>"
);

// grab cookie for rotation number
var rotation = parseInt($.cookie("rotation"));

// set rotation default if cookie not set
if(rotation == null) {
	rotation = rotating_html.length;	
}

// display the next item in the rotation.
if(rotating_html.length > (rotation+1)) {
	// next in rotation
	rotation = rotation + 1;
} else {
	// loop
	rotation = 0;
}

// display this item
document.write(rotating_html[rotation]);

// save rotation number in cookie
$.cookie("rotation",rotation);