function resizeImage(obj, MaxW, MaxH)
{
	var imageObject = obj;
    var state = imageObject.readyState;
	if(state!='complete') 
	{
        setTimeout("resizeImage("+imageObject+","+MaxW+","+MaxH+")",50);
		return;
    }
    var oldImage = new Image();
    oldImage.src = imageObject.src;
    var dW = oldImage.width; 
    var dH = oldImage.height;
    if(dW>MaxW || dH>MaxH) 
	{
        a = dW/MaxW; b = dH/MaxH;
        if( b>a ) a = b;
        dW = dW/a; dH = dH/a;
    }
    if(dW > 0 && dH > 0) 
	{
        imageObject.width = dW;
		imageObject.height = dH;
	}
	//alert(obj.src);
}

function AddFav( p_Url,p_Title )
{
	if( p_Url == '' )
	{
		p_Url = location.href;
	}
	if( p_Title == '' )
	{
		p_Title = document.title;
	}
	window.external.addFavorite( p_Url , p_Title );
}

function SetHomePage( p_Url )
{
	if( p_Url == '' )
	{
		p_Url = location.href;
	}
	var strHref = window.location.href;
	event.srcElement.style.behavior = 'url(#default#homepage)';
	event.srcElement.setHomePage( p_Url );
}

function AddTd( TableId,ColNum )
{
	var oTable = document.all[ TableId ];
	var oTr = oTable.rows[oTable.rows.length-1];
	var iNum = oTr.cells.length;	
	for( var i = iNum; i < ColNum; i++ )
	{
		var oCell = oTr.insertCell(i);
		oCell.bgColor = oTable.rows[0].cells[0].style.backgroundColor;		
	}
}


function lTrim(str) 
{ 
	if (str.charAt(0) == " ") 
	{ 

		str = str.slice(1);
		//equal str = str.substring(1, str.length); 
		str = lTrim(str);
	} 
	return str; 
} 


function rTrim(str) 
{ 
	var iLength; 

	iLength = str.length; 
	if (str.charAt(iLength - 1) == " ") 
	{ 

		str = str.slice(0, iLength - 1);
		//equal str = str.substring(0, iLength - 1); 
		str = rTrim(str); 
	} 
	return str; 
} 


function trim(str) 
{ 
	return lTrim(rTrim(str)); 
} 

//*****当前时间*****BY:雪幕天涯*****转载请保留此信息*****www.xuemu.net*****
function tick() {
	var hours, minutes, seconds;
	var intHours, intMinutes, intSeconds, intAuHours, intCaHours;
	var today;
	var intMon;
		today = new Date();
		intHours = today.getHours();
		intAuHours = today.getHours();
		intCaHours = today.getHours();
		intMinutes = today.getMinutes();
		intSeconds = today.getSeconds();
		intMon = today.getMonth()
	var week=new Array(7);
		week[0]="天";
		week[1]="一";
		week[2]="二";
		week[3]="三"; 
		week[4]="四";
		week[5]="五";
		week[6]="六";

	//中国时间*****BY:雪幕天涯*****转载请保留此信息*****
	if (intHours == 0) {
		hours = "00:";
	} else if (intHours < 10) { 
		hours = "0" + intHours+":";
	} else {
		hours = intHours + ":";
	}

	//悉尼时间*****BY:雪幕天涯*****转载请保留此信息*****
	if (intAuHours == 0) { 
		syhours = "03:";
	} else if (intAuHours < 7) {
                intAuHours = intAuHours + 3; 
		syhours = "0" + intAuHours + ":";
	} else if (intAuHours >= 7 && intAuHours <21) { 
		intAuHours = intAuHours + 3;
		syhours = intAuHours + ":";
	} else if (intAuHours >= 21 && intAuHours <=24) {
		intAuHours = intHours - 21; 
		syhours = "0" + intAuHours + ":";
	} else {
		syhours = intAuHours + ":";
	}

	//加拿大时间*****BY:雪幕天涯*****转载请保留此信息*****
	if (intCaHours == 0) { 
		cahours = "12:";
	} else if (intCaHours < 12) { 
                intCaHours = intCaHours + 12;
		cahours = intCaHours + ":";
	} else if (intCaHours >= 12 && intCaHours < 22 ) { 
		intCaHours = intCaHours - 12;
		cahours = "0" + intCaHours + ":";
	} else if (intCaHours >= 22 && intCaHours <= 24 ) { 
		intCaHours = intCaHours - 12;
		cahours = intCaHours + ":";
	} else { 
		cahours = intCaHours + ":";
	}

	//时间：分*****BY:雪幕天涯*****转载请保留此信息*****www.xuemu.net*****
	if (intMinutes < 10) {
		minutes = "0"+intMinutes+":";
		} else {
		minutes = intMinutes+":";
		}
		if (intSeconds < 10) {
		seconds = "0"+intSeconds+" ";
		} else {
		seconds = intSeconds+" ";
		} 

	intMon =intMon +1;
//	timeString =today.getFullYear()+"年"+ intMon +"月"+ today.getDate()+"日 星期"+ week[today.getDay()] + "┇" +  "北京：" + hours+minutes+seconds +  " 悉尼：" + syhours+minutes+seconds +  " 温哥华：" + cahours+minutes+seconds;
    timeString =today.getFullYear()+"年"+ intMon +"月"+ today.getDate()+"日 星期"+ week[today.getDay()] + "┇" +  "北京：" + hours+minutes+seconds +  " 悉尼：" + syhours+minutes+seconds +  "&nbsp;&nbsp;本网站为澳洲鼎丰集团指定的公司官方网站，其他任何网站中出现“澳洲鼎丰集团”或“AIA”字样的，都不能代表本公司。";
	Clock.innerHTML = timeString;
	window.setTimeout("tick();", 1000);
}