function ShowHideArea(id){
	// Muc dich: Thay doi class tieu de + an/hien phan noi dung.
	
	t_id = id; // ID cua phan tieu de.
	c_id = id.replace('t-',''); // ID cua phan noi dung.
	
	//convert to element:
	t_id = document.getElementById(t_id);
	c_id = document.getElementById(c_id);
	
	if ($(t_id).attr("className")=="title-hide") {	//Neu tieu de dang dong:
				$(t_id).removeClass();
				$(t_id).addClass("title-expand");	// thi mo tieu de.
			}
		else{										// Nguoc lai:
				$(t_id).removeClass();
				$(t_id).addClass("title-hide");		// thi dong tieu de.
	}
	
	// An hien phan noi dung tu dong:
	$(c_id).toggle();
}

function resizeImage(img,nsize)
{
	var nWidth=img.width;
	var	nHeight=img.height;	
	nScale = nWidth/nHeight;		
	//Check:
	if (nScale > 1) {
		nWidth = nsize;		
		nHeight = (nWidth*img.height)/img.width;
		//fix vertical-align:	
		nMargin = (nWidth - nHeight)/2;
		//Set style to image:
		img.width = nWidth;
		img.height = nHeight;
		img.style.margin = nMargin + 'px 0px';
		}
	else {
		//Return size:
		nHeight = nsize;
		nWidth = (nHeight*img.width)/img.height;
		//fix align:	
		nMargin = (nHeight - nWidth)/2;	
		//Set style to image:	
		img.width = nWidth;
		img.height = nHeight;
		img.style.margin = '0px ' + nMargin + 'px';
	}	
}

function installApp(url)
{
	if (confirm('Bạn có chắc chắn muốn cài đặt ứng dụng này?'))
	{
		window.location = url;
		return true;
	}
	else
		return false;
}

function removeApp(url)
{
	if (confirm('Bạn có chắc chắn muốn gỡ bỏ ứng dụng này?'))
	{
		window.location = url;
		return true;
	}
	else
		return false;
}

function gotoApp(url)
{
	window.location = url;
	return true;
}
