<!--


function isIE(){
   if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1) 
    return true; 
   else 
    return false; 
}

if(!isIE()){   //firefox   browser 
    HTMLElement.prototype.__defineGetter__(     "innerText", 
    function(){
     var anyString = "";
     var childS = this.childNodes;
     for(var i=0; i<childS.length; i++) {
      if(childS[i].nodeType==1)
       anyString += childS[i].tagName=="BR" ? '\n' : childS[i].innerText;
      else if(childS[i].nodeType==3)
       anyString += childS[i].nodeValue;
     }
     return anyString;
    } 
   ); 
   HTMLElement.prototype.__defineSetter__(     "innerText", 
    function(sText){ 
     this.textContent=sText; 
    } 
   ); 
}

var g_current = 0;
var sight1 = {
		"title" : "The Great Wall",
		"desc" : "An ancient gigantic defensive project. It is one of the largest construction projects ever completed, and it was listed by UNESCO in 1987 as one of the world heritages.",
		"image" : {"small":"./images/01s.jpg","large" : "./images/01.jpg"}
	     };
var sight2 = {
		"title" : "Terra-cotta Warriors and Horses",
		"desc" : "Listed as the Eighth Wonder of the World and consisting of more than 7,000 life-sized terra-cotta warriors and horses, were unearthed near the Tomb of Emperor Qin Shihuang. ",
		"image" : {"small":"./images/02s.jpg","large" : "./images/02.jpg"}
	     };
var sight3 = {
		"title" : "Potala Palace",
		"desc" : "The most famous building in the region, was built in the 640's during the reign of King Songtsan Gampo and is located on Red Hill to the west of old Lhasa.",
		"image" : {"small":"./images/03s.jpg","large" : "./images/03.jpg"}
	     };
var sight4 = {
		"title" : "Expo 2010 Shanghai China",
		"desc" : "World Expo 2010 Shanghai China is the occasion for China to bring the world at home, and for the world to feel at home in China.",
		"image" : {"small":"./images/04s.jpg","large" : "./images/04.jpg"}
	     };	    
	     
var sights = new Array(sight1, sight2, sight3, sight4);

function WriteAll()
{
	for(var i = 0; i < sights.length; i++)
	{
		var sight = sights[i];
		var style = "imgbrs opa50"
		if( i == 0 )
		{
			style = "imgbrs";
		}
		document.write("<a id='hrefSight_" + i + "' href='javascript:void(0);' onclick='javascript:LoadSight(" + i + ")'><img id='imgSight_" + i + "' src='" + sight.image.small + "' class='" + style + "' /></a>");
	}
}

function LoadSight(index)
{
	if( index >= 0 && index < sights.length )
	{
		for(var i = 0; i < sights.length; i++)
		{	
			var style = "imgbrs opa50"
			if( i == index )
			{
				style = "imgbrs";
			}
			document.getElementById("imgSight_" + i).className = style;
		}
		
		var sight = sights[index];		
		document.getElementById("title").innerText = sight.title;
		document.getElementById("desc").innerText = sight.desc;
		document.getElementById("imgSight").src = sight.image.large;
	}
}

function AutoSwitch()
{
	LoadSight(g_current);
	g_current++;
	if( g_current >= sights.length )
	{
		g_current = 0;
	}
	setTimeout(AutoSwitch, 12000);
}



function InfoWindow_Open(theURL, winName) 
{ 
	window.open(theURL,winName,"height=550, width=750, top=23, left=260,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
}

-->

