function getXmlLeftnavDataSource() {
	var url = "../swf/data/leftnavSample.xml";
	return url;
}
function getXmlAwardDataSource() {
	/* var url = "../awards/main.do?method=awardsXML&mappingName=Awards&id=4028e5b82698f3e8012698f5d2bd0002"; */
	var url = "../swf/data/awardSample.xml";
	return url;
}

function getXmlIPODataSource() {
	var url = "../swf/data/ipoSample.xml";
	return url;
}
function getXmlFinancialReportDataSource() {
	var url = "../swf/data/financialReportsSample.xml";
	return url;
}
function getXmlFacilitiesDataSource() {
	var url = "../swf/data/facilitiesSample.xml";
	return url;
}
function getXmlResponsibilityDataSource() {
	var url = "../swf/data/responsibilitySample.xml";
	return url;
}
function getXmlGalleryDataSource() {
	var url = "../swf/data/gallerySample.xml";
	return url;
}



function showMenu(id_menu){
	var my_menu = document.getElementById(id_menu);
	if(my_menu.style.display=="none" || my_menu.style.display=="") {
		my_menu.style.display="block";
	} else { 
		my_menu.style.display="none";
	}
}
function swapImage(idStatus){
	if(idStatus==0){
		document.arrow_profile.src ="../images/arrow.jpg";
	} else if(idStatus==1){
		document.arrow_profile.src ="../images/arrow.jpg";
	} else if(idStatus==2){
		document.arrow_profile.src ="../images/arrow.jpg";
	}
}

/*
function SWFDelegate(url,width,height,caption) {
	var objLink = document.createElement('a');
	objLink.setAttribute('href',url);
	objLink.setAttribute('rel','lightbox');
	
	caption = "";
	objLink.setAttribute('title',caption);
	if(typeof width != 'undefined') {
		objLink.setAttribute('width',width);
	}
	if(typeof height != 'undefined') {
		objLink.setAttribute('height',height);
	}
	Lightbox.prototype.start(objLink);
}
*/
	
function SWFDelegate(path, width,height,caption) { 
	if ($('a#lightbox').length == 0) {
		$("body").append("<A id='lightbox' href=" + path + "></A>");                            
		$('a#lightbox').lightBox();       
		// if it already exists but the path is different we will set the new path
	} else if ($('a#lightbox').attr("href") != path) {
		$('a#lightbox').attr("href", path);
	}
	
	// now we will simulate the click here.
	$('a#lightbox').trigger("click");
}

// ============ show/hide, swap image ============

function unhide(divID) {
	var i=1;
	var NUM = 1000;
	//while (document.getElementById("Q"+i)){
	for(i = 1 ; i <= NUM ; i++) {
		var item = document.getElementById("Q"+i);
		//alert("AAA" + item);
		if (("Q"+i) != divID){
			
			if (item ) {
				item.className='hideanswerpanel';
				if (i>=10){
					if (document.getElementById("arrow"+i))
						document.getElementById("arrow"+i).src = '../images/box-close.gif';
				}else{
					if (document.getElementById("arrow0"+i))
						document.getElementById("arrow0"+i).src = '../images/box-close.gif';				
				}
			}
		}else{
			  item2 = document.getElementById(divID);
			  if (item2) {
				  if (item2.className=='hideanswerpanel'){
					  item2.className=  'showanswerpanel';
						if (i>=10){
							if (document.getElementById("arrow"+i))
								document.getElementById("arrow"+i).src = '../images/box-open.gif';
						}else{
							if (document.getElementById("arrow0"+i))
								document.getElementById("arrow0"+i).src = '../images/box-open.gif';				
						}

				  }else{
					  item2.className=  'hideanswerpanel';
					  
						if (i>=10){
							if (document.getElementById("arrow"+i))
								document.getElementById("arrow"+i).src = '../images/box-close.gif';
						}else{
							if (document.getElementById("arrow0"+i))
								document.getElementById("arrow0"+i).src = '../images/box-close.gif';				
						}

				  }
				
			  }
		}
	//	i++
	}
	
}



function showDetail(_i){
	var table1 = document.getElementById('Q' + _i);
	var icon = document.getElementById('arrow' + _i);
	if(table1){
		var src = icon.src;
		if(src.indexOf('box-close.gif') != -1)
			icon.src = '../images/box-open.gif';
		else
			icon.src = '../images/box-close.gif';
		table1.className = (table1.className=='hideanswerpanel')?'showanswerpanel':'hideanswerpanel';
	}
}


function changeLan(_lang)
{
	var lang = '/' + _lang + '/'; 
	var url = window.location.href;
	window.location.href = url.replace(/\/en\//,lang);
}