function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];

   }

}

function hideDiv(idea) {
	if (idea == "topstuffattr") {
		document.getElementById('topstuffattr').style.display='block';
		document.getElementById('topstuff').style.display='none';
		document.getElementById('topstuffrest').style.display='none';
	} else if (idea == "topstuffrest") {
		document.getElementById('topstuffrest').style.display='block';
		document.getElementById('topstuff').style.display='none';
		document.getElementById('topstuffattr').style.display='none';
	} else if(idea == "topstuff") {
		document.getElementById('topstuff').style.display='block';
		document.getElementById('topstuffattr').style.display='none';
		document.getElementById('topstuffrest').style.display='none';
	}
}
var cityNames = new Array("New York City, NY", "Chicago, IL", "Boston, MA", "Miami, FL", "Las Vegas, NV", "Paris, France", "London, England", "Orlando, Florida", "Rome, Italy", "Montreal, Quebec");
var cityDesc = new Array(
	"New York City is known as 'the city that never sleeps' for a reason. As the largest city in the United States, it serves as the epicenter of American commerce, finance, media, politics, education, entertainment and fashion.																	   ",
	"Chicago is a Midwestern mecca rich in music, art and architecture. It's a city which thrives on the diversity of its inhabitants, making it a top tourist destination renowned for international dining choices, lakeside attractions and world-class shopping.                                       ",
	"A city steeped in history, Boston boasts modern marvels like the Big Dig and the Prudential Tower skyscraper while still keeping its place as the birthplace of Colonialism in America. It was also home to the very first public school, college and subway system.                                  ",
	"Often referred to as the 'American Riviera', Miami is a tropical paradise located on the tip of Florida. Salsa music, fresh seafood and miles of open beach help to make this city a popular and accessible vacation destination.                                                                     ",
	"Millions of tourists flock to Las Vegas every year to take in the sites and sounds of one of the fastest growing cities in America. Hotels line the neon Las Vegas Strip and offer a variety of world-class shopping, dining, spas, casinos and more.                                                 ",
	"A romantic city at heart, Paris casts a spell over  visitors with a bottle of Bordeaux and a seat next to the famed River Seine. Culture and art abound in the French 'City of Light' with the majestic Eiffel Tower, bustling street fairs and delectable food and pastries.                         ",
	"London is often thought of as the center for European art, culture, business and finance. Modern technology and architecture juxtapose St. Paul's Cathedral, the London Bridge and Big Ben. While there, visitors must adapt to riding the Tube, eating bangers and mash and drinking yards of ale.   ",
	"A prime family vacation destination, Orlando is home to Walt Disney World, Universal Studios and Discovery Cove Theme Park. If you're lucky, the sun will shine and you can soak up some rays by the pool, walk high-end shopping areas or visit the Orlando Science Center or Kennedy Space Center.  ",
	"A Mediterranean metropolis, Rome needs no introduction. For more than two thousand years, Rome has played an integral role in shaping art, religion and politics. Modern life coexist with the Colosseum, Vatican City, the Pantheon and St. Peter's Basilica.					                       ",
	"Known for its European flair and diverse cultural influences,  Montreal is one of the largest French-speaking cities in the world. Museums, symphonies, concerts, festivals and shopping abound and it was recently ranked as the second best dining city in North America.                           ");
var images = new Array("pic_nyc.jpg","pic_chicago.jpg","pic_boston.jpg","pic_miami.jpg","pic_vegas.jpg","pic_paris.jpg","pic_london.jpg","pic_orlando.jpg","pic_rome.jpg","pic_montreal.jpg");

var cityLinks = new Array(
	"New_York_City_New_York_United_States-309170.html",
	"Chicago_Illinois_United_States-291760.html",
	"Boston_Massachusetts_United_States-291810.html",
	"Miami_Florida_United_States-291540.html",
	"Las_Vegas_Nevada_United_States-291680.html",
	"Paris_France-291590.html",
	"London_United_Kingdom-291550.html",
	"Orlando_Florida_United_States-291790.html",
	"Rome_Italy-291470.html",
	"Montreal_Quebec_Canada-291970.html");

function check (location, count, domainContext, refParam) {
	var next;	
	count = (count + location) % 10;

	if (count == 10) count = 0;
	if (count == 11) count = 1;
	if (count == -1) count = 9;
	if (count == -2) count = 8;
	next = count +1;

	if (next == 10) next = 0;
	if (next == 11) next = 1;
	if (next == -1) next = 9;
	if (next == -2) next = 8;

	var abc = new Array();
	var elem = document.getElementById('spotlight');
	var imgPath = domainContext + '/content/graphics/';

	abc.push('<div class="hdr"><h3>Spotlight Cities</h3></div>');		
	abc.push('<div class="nav"><a href="javascript:check(-2,'+ count +',\''+ domainContext +'\',\''+ refParam +'\');">');
	abc.push('<img src="' + domainContext + '/content/graphics/b_previous.gif" width="22" height="12" border="0" align="top" alt="previous">');	
	abc.push('&nbsp;prev</a>   |  <a href="javascript:check(2,'+ count +',\''+ domainContext +'\',\''+ refParam +'\')">'); 
	abc.push('next <img src="' + domainContext + '/content/graphics/b_next.gif"	="22" height="12"');
	abc.push('border="0" align="top" alt="next"></a></div>');
	abc.push('<div class="clear"></div>');

	for (var i=1; i<3; ++i) {
		var ci = (i==1?count:next);

		abc.push('<div class="city' + (i==1?'left':'right') + '">');
		abc.push('<h4><a href="' + domainContext + '/cities/'+cityLinks[ci]+'?' + refParam + '">'+cityNames[ci]+' &raquo;</a></h4>');
		abc.push('<hr/><div class="content">');
		abc.push('<div class="citypic"><img alt="' + cityNames[ci] + '" src="' + domainContext + '/content/graphics/'+images[ci]+'" width="221" height="100" border="0" align="top"></div>');

		abc.push('<div class="buttons">');
			abc.push('<a onmouseover="MM_swapImage(\'hotels' + i + '\',\'\',\'' + imgPath + '/sp_n_hotels_on.gif\',' + i + ')" onmouseout="MM_swapImgRestore()"'); 
				abc.push(' href="' + (domainContext + '/cityhotels/' + cityLinks[ci] + '?' + refParam) + '"><img height="16" border="0" alt="hotels" src="' + imgPath + '/sp_n_hotels.gif" name="hotels' + i + '"/></a>');
			abc.push('<a onmouseover="MM_swapImage(\'restaurants' + i + '\',\'\',\'' + imgPath + '/sp_n_restaurants_on.gif\',' + i + ')" onmouseout="MM_swapImgRestore()"'); 
				abc.push(' href="' + (domainContext + '/cityrestaurants/' + cityLinks[ci] + '?' + refParam) + '"><img height="16" border="0" alt="restaurants" src="' + imgPath + '/sp_n_restaurants.gif" name="restaurants' + i + '"/></a>');
			//PP Feb 18,2008 - As no attractions are available for Paris, London and Rome - disabling the attractions tab for these cities
			if (cityNames[ci].indexOf("Paris") == -1 && cityNames[ci].indexOf("London") == -1 && cityNames[ci].indexOf("Rome") == -1) {
				abc.push('<a onmouseover="MM_swapImage(\'attractions' + i + '\',\'\',\'' + imgPath + '/sp_n_attraction_on.gif\',' + i + ')" onmouseout="MM_swapImgRestore()"'); 
					abc.push(' href="' + (domainContext + '/cityattractions/' + cityLinks[ci] + '?' + refParam) + '"><img height="16" border="0" alt="attractions" src="' + imgPath + '/sp_n_attraction.gif" name="attractions' + i + '"/></a>');
			}
			abc.push('<a onmouseover="MM_swapImage(\'about' + i + '\',\'\',\'' + imgPath + '/sp_n_about_on.gif\',' + i + ')" onmouseout="MM_swapImgRestore()"'); 
				abc.push(' href="' + (domainContext + '/cities/' + cityLinks[ci] + '?' + refParam) + '"><img height="16" border="0" alt="about" src="' + imgPath + '/sp_n_about.gif" name="about' + i + '"/></a>');
		abc.push('</div>');
	
		abc.push(cityDesc[ci]);
		abc.push('</div></div>');
	}
	abc.push('<div class="clear"></div>');
	elem.innerHTML =abc.join('');
}