<!--

document.write('<link rel="icon" type="image/gif" href="/favicon.gif" />');
if (document.all)
{
	
	if(document.charset=='utf-8')
		history.go(0);
}
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;

if(parent.frames.length!=0 && mainSection == "home")
{
	top.location='http://www.irasia.com';
}

var time = new Date();

function TodayDate() { //Display Current Date

var tdate = time.getDate();
if (tdate < 10) tdate = "0" + tdate
document.write(tdate + ', ');
}

function TodayMonth() { //Display Current Month

var stmonth;
var tmonth = time.getMonth() + 1;

if (tmonth == 1) stmonth = "January"
if (tmonth == 2) stmonth = "February"
if (tmonth == 3) stmonth = "March"
if (tmonth == 4) stmonth = "April"
if (tmonth == 5) stmonth = "May"
if (tmonth == 6) stmonth = "June"
if (tmonth == 7) stmonth = "July"
if (tmonth == 8) stmonth = "August"
if (tmonth == 9) stmonth = "September"
if (tmonth == 10) stmonth = "October"
if (tmonth == 11) stmonth = "November"
if (tmonth == 12) stmonth = "December"

document.write(stmonth + ' ');
}

function TodayYear() { //Display Current Year

var styear;
var tyear = time.getYear();

if (tyear < 2000) styear = (tyear + 1900)
if (tyear >= 2000) styear = tyear

document.write(styear);
}

function TodayDay() { //Display Current Day

var stday;
var tday = time.getDay();

if (tday == 0) stday = "Sun"
if (tday == 1) stday = "Mon"
if (tday == 2) stday = "Tue"
if (tday == 3) stday = "Wed"
if (tday == 4) stday = "Thu"
if (tday == 5) stday = "Fri"
if (tday == 6) stday = "Sat"

document.write(stday + ', ');
}
	
function todayDateChi()
{
	var tday = '';
	var tdayTemp = time.getDay();
	var tdate = time.getDate();
	var tmonth = time.getMonth() + 1;
	var tyear = time.getFullYear();
	
	if (tdayTemp == 0) tday = "&#26085;"
	if (tdayTemp == 1) tday = "&#19968;"
	if (tdayTemp == 2) tday = "&#20108;"
	if (tdayTemp == 3) tday = "&#19977;"
	if (tdayTemp == 4) tday = "&#22235;"
	if (tdayTemp == 5) tday = "&#20116;"
	if (tdayTemp == 6) tday = "&#20845;"
	
	if (tdate < 10)
	{
		tdate = "0" + tdate;
	}
	
	if (tmonth < 10)
	{
		tmonth = "0" + tmonth;
	}
	
	document.write('&#26143;&#26399;'+tday+'&nbsp;&nbsp;'+tyear+'&#24180;'+tmonth+'&#26376;'+tdate+'&#26085;');
	
}


function sectionhighlight() { 
	if (mainSection != "") {
		var sectionClassN = document.getElementById(mainSection).className;
		document.getElementById(mainSection).className = sectionClassN + "Selected";
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//irasia.com change language
function changeLanguage(newLanguage,currentLanguage) 
{
	var curLoc = parent.location.href;
	var curLocEnd = '';
	var curLocStart = '';
	var fileName = '';

	if (curLoc.indexOf('?')>0 && mainSection != "community")
	{
		curLocEnd = curLoc.substring(curLoc.indexOf('?'),curLoc.length);
		curLocStart = curLoc.substring(0,curLoc.indexOf('?'));
		fileName = curLocStart.substring(curLocStart.lastIndexOf('/')+1,curLocStart.length);
		curLocStart = curLocStart.substring(0,curLocStart.lastIndexOf('/')+1);
		if(fileName == '')
		{
			fileName = 'index.htm';
		}
	}
	else
	{
		curLocStart = curLoc;
		fileName = curLocStart.substring(curLocStart.lastIndexOf('/')+1,curLocStart.length);
		curLocStart = curLocStart.substring(0,curLocStart.lastIndexOf('/')+1);
		fileName = fileName.replace('#','')
		if(fileName == '')
		{
			fileName = 'index.htm';
		}
	}
	
	if(currentLanguage == 'eng')
	{
		if(newLanguage == 'c')
		{
			fileName = eng2big5(fileName);
		}
		else if(newLanguage == 'sc')
		{
			fileName = eng2gb(fileName);
		}
	}
	else if(currentLanguage == 'big5')
	{
		if(newLanguage == '')
		{
			fileName = big52eng(fileName);
		}
		else if(newLanguage == 'sc')
		{
			fileName = big52gb(fileName);
		}
	}
	else if(currentLanguage == 'gb')
	{
		if(newLanguage == '')
		{
			fileName = gb2eng(fileName);
		}
		else if(newLanguage == 'c')
		{
			fileName = gb2big5(fileName);
		}
	}
	eval("parent.location='" + curLocStart + fileName + "'");
	//eval("parent.location='" + curLocStart + fileName + curLocEnd + "'");
	
}

function eng2big5(fileName)
{
	if(fileName.indexOf('profile') != -1 || fileName.indexOf('contact') != -1 )
	{
		fileName = fileName.replace('.','c.');
	}
	else
	{
		fileName = 'c' + fileName;
	}
	return fileName;
}

function eng2gb(fileName)
{
	if(fileName.indexOf('profile') != -1 || fileName.indexOf('contact') != -1 )
	{
		fileName = fileName.replace('.','sc.');
	}
	else
	{
		fileName = 'sc' + fileName;
	}
	return fileName;
}

function big52eng(fileName)
{
	if(fileName.indexOf('profile') != -1 || fileName.indexOf('contact') != -1 )
	{
		fileName = fileName.replace('c.','.');
	}
	else
	{
		fileName = fileName.substring(fileName.indexOf('c')+1,fileName.length);
	}
	return fileName;
}

function big52gb(fileName)
{
	if(fileName.indexOf('profile') != -1 || fileName.indexOf('contact') != -1 )
	{
		fileName = fileName.replace('c.','sc.');
	}
	else
	{
		fileName = 's' + fileName;
	}
	return fileName;
}

function gb2eng(fileName)
{
	if(fileName.indexOf('profile') != -1 || fileName.indexOf('contact') != -1 )
	{
		fileName = fileName.replace('sc.','.');
	}
	else
	{
		fileName = fileName.substring(fileName.indexOf('sc')+2,fileName.length);
	}
	return fileName;
}

function gb2big5(fileName)
{
	if(fileName.indexOf('profile') != -1 || fileName.indexOf('contact') != -1 )
	{
		fileName = fileName.replace('sc.','c.');
	}
	else
	{
		fileName = fileName.substring(fileName.indexOf('s')+1,fileName.length);
	}
	return fileName;
}


function QueryString(name)
{
	var AllVars = window.location.search.substring(1);
	var Vars = AllVars.split("&");
	for (i = 0; i < Vars.length; i++)
	{
		var Var = Vars[i].split("=");
		if (Var[0] == name) return Var[1];
	}
	return "";
}


//window onload function
window.onload = function()
{
	if(document.getElementById('stockInfo'))
	{
		hiddenLayer('stockInfo');
	}
	
	//addCallStockInfo();

	if(document.getElementById('quickSearch'))
	{
		if (QueryString('year') && QueryString('month') && QueryString('day')) {
			showQuickCal(QueryString('year'),QueryString('month'),lang);
		} else {
			showQuickCal(today_year,today_month,lang);
		}
	}
	
	// addInputEvent('Class On Blur','Class On Focus','ID Name')
//	addInputEvent('searchFieldShortBlur','searchFieldShortFocus','quickSearchField');
//	addInputEvent('searchFieldBlur','searchFieldFocus','field');

	if (mainSection != "home") {
		sectionhighlight();
	}

}



//-->
