/*
+===================================================================
|   DONGKIM PORTAL (DPORTAL)
|   (C) 2006 Dong Kim Software Technology & Advertising Co., Ltd
+===================================================================
|   > Filename		: utilitis.js
|   > Description	: Ho tro cac ham tuong tac js
|   > Version 		: 1.0.0
|	> Author		: Khoand
+===================================================================
*/
/**************************************************************************
	Function: alertMessage
	Description: Show message box
	Parameters:
		message: Messages list
	Return:
		None	
	Usage:
		alertMessage(new Array("Hello", "World"));
*****************************************************************************/
function alertMessage(messages)
{
	var str="";
	for(var i=0; i<messages.length; i++)
	{
		str+=messages[i] + "\n";
	}
	window.alert(str);
}

/**************************************************************************
	Function: getCurrentDateDDMMYYYY
	Description: Get system date in dd/MM/yyyy format
	Parameters:
		None
	Return:
		System date	
	Usage:
		var date = getCurrentDateDDMMYYYY();
*****************************************************************************/
function getCurrentDateDDMMYYYY()
{
	var date = new Date();
	return date.getDate() + "/" + (date.getMonth()+1) + "/" + date.getYear();
}

/**************************************************************************
	Function: getCurrentDateMMDDYYYY
	Description: Get system date in MM/dd/yyyy format
	Parameters:
		None
	Return:
		System date	
	Usage:
		var date = getCurrentDateMMDDYYYY();
*****************************************************************************/
function getCurrentDateMMDDYYYY()
{
	var date = new Date();
	return (date.getMonth()+1) + "/" + date.getDate() + "/" + date.getYear();
}

/**************************************************************************
	Function: getCurrentDateYYYYMMDD
	Description: Get system date in yyyy/MM/dd format
	Parameters:
		None
	Return:
		System date	
	Usage:
		var date = getCurrentDateYYYYMMDD();
*****************************************************************************/
function getCurrentDateYYYYMMDD()
{
	var date = new Date();
	return date.getYear() + "/" + (date.getMonth()+1) + "/" + date.getDate();
}
/**************************************************************************
	Function: showCenterWindow
	Description: Show a popup with position of center window
	Parameters:
		None
	Return:
		None	
	Usage:
		<a href="javascript:showCenterWindow()">Click to really center the Figure 1 window!</a>
*****************************************************************************/
function showCenterWindow(url, width, height) {
	leftPos = 0
	topPos = 0
	if (screen) 
	{
		leftPos = (screen.width / 2) - (width/2)
		topPos = (screen.height / 2) - (height/2)
	}
	ElementWindow = window.open(url,"ElementWin","width="+width+",height="+height+",left="+leftPos+",top="+topPos)
	//The above line was broken in two for display purposes only! 
}
function showCenterWindowScrollbar(url, width, height) {
	leftPos = 0
	topPos = 0
	if (screen) 
	{
		leftPos = (screen.width / 2) - (width/2)
		topPos = (screen.height / 2) - (height/2)
	}
	ElementWindow = window.open(url,"ElementWin","width="+width+",height="+height+",left="+leftPos+",top="+topPos+",scrollbars=yes")
	//The above line was broken in two for display purposes only! 
}  
<!-------------------------- Style for link Images: Start
function imagesLinkOver(imageid) {
	imageid.style.filter="Alpha(Opacity=80)";
}
function imagesLinkOut(imageid) {
	imageid.style.filter="Alpha(Opacity=100)";
}
//--> Style for link Images: End

<!--  Change Title: Start
function changeTitle(string)
{
		window.document.title = window.document.title + " " + string;
}
//--> Change Title: End


function showDownload(url)
{
	window.open(url);
}

function showWindows(url, name, width, height, scrollbar) {
	newWindow = window.open(url, name, "width="+width+",height="+height+",scrollbars="+scrollbar+"");
}

function showDetails(url) {
	newWindow = window.open(url, 'details', "width=400,height=550,scrollbars=no");
}

function showSendProduct(url) {
	newWindow = window.open(url, 'details', "width=510,height=440,scrollbars=no");
}