﻿
function ButtonOver(button){
	button.style.cursor = 'default';
	button.className="ButtonOver";
}

function ButtonOut(button){
	button.style.cursor = 'default';
	button.className="ButtonNormal";
}

function ButtonSubOver(button){
	button.style.cursor = 'default';
	button.className="ButtonOverSub";
}

function ButtonSubOut(button){
	button.style.cursor = 'default';
	button.className="ButtonNormalSub";
}
function showDateVIE()
{   
    var strdate;
	var dt = new Date();
	var strarrDay = new Array("Chủ Nhật", "Thứ Hai", "Thứ Ba", "Thứ Tư", "Thứ Năm", "Thứ Sáu", "Thứ Bảy"); 
	var strarrMonth = new Array("01","02","03","04","05","06","07","08","09","10","11","12"); 
		
	var strThu = dt.getDay();
	strThu = strarrDay[strThu] + ", ";
	var strDay=dt.getDate();
	if (strDay<10) strDay="0" + strDay
	var strMonth= dt.getMonth();
	strMonth= strarrMonth[strMonth] ;
	var strYears = dt.getYear();
	if (strYears<1900) strYears += 1900;
	
	strdate=strThu + "ngày " + strDay + "/" + strMonth + "/" + strYears
		
	window.document.write (strdate);
}
function showdateEN() {
    // variables declaration
    var dt=new Date();
    var strMonth = new Array("January","February","March","April","May","June","July","August","September","Octorber","November","December");
    var strDay = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
    var date=strDay[dt.getDay()] + ", ";
    var years= dt.getYear();
    if (years<1900) years+= 1900;
    strdate=date + strMonth[dt.getMonth()] + "-" + dt.getDate() + "-" + years
    window.document.write (strdate);
}

function openLink(url) {

    window.open(url,'mywindow','width=600,height=400,addressbar=yes,scrollbars=yes,toolbar=yes,resizable=yes,menubar=yes');
}
function openProjectPic(url) {
    window.open(url,'NewWin','width=620,height=470,left=10,addressbar=no,scrollbars=no,toolbar=no,resizable=no,menubar=no');
	
}
function openDesigner(url) {
    window.open(url,'NewWin','width=600,height=400,left=20 top=20,addressbar=no,scrollbars=no,toolbar=no,resizable=no,menubar=no');
}
function openPopup(url) {
    window.open(url,'NewWin','width=560,height=555,left=0 top=0,addressbar=no,scrollbars=no,toolbar=no,resizable=no,menubar=no');
}

function openDic(url) {

    window.open(url,'mywindow','width=600,height=400,addressbar=yes,scrollbars=yes,toolbar=yes,resizable=yes,menubar=yes');
    return false;
}
function  showImage(url,width,height)
{
    var top = (screen.height - height) / 2;
	var left = (screen.width - width) / 2;
	window.open(url,"_blank", "width=" + (width+4) + ", height="+ (height+25) + ", top=" + top + ", left=" + left + ",menubar=no,status=no");
	
}
function showImage1(url, width, height)
{   
	return showWindow(url, false, false, true, false, false, false, false, false, true, width+10, height+10, 0, 0);
}
function showDialog(url, width, height)
{
	return showWindow(url, false, false, false, false, false, false, false, true, true, width, height, 0, 0);
}

function showWindow(url, isStatus, isResizeable, isScrollbars, isToolbar, isMenubar, isLocation, isFullscreen, isTitlebar, isCentered, width, height, top, left)
{
	if (isCentered)
	{
		top = (screen.height - height) / 2;
		left = (screen.width - width) / 2;
	}

	open(url, '_blank', 'status=' + (isStatus ? 'yes' : 'no') + ','
	+ 'resizable=' + (isResizeable ? 'yes' : 'no') + ','
	+ 'scrollbars=' + (isScrollbars ? 'yes' : 'no') + ','
	+ 'toolbar=' + (isToolbar ? 'yes' : 'no') + ','
	+ 'menubar=' + (isMenubar ? 'yes' : 'no') + ','
	+ 'location=' + (isLocation ? 'yes' : 'no') + ','
	+ 'fullscreen=' + (isFullscreen ? 'yes' : 'no') + ','
	+ 'titlebar=' + (isTitlebar ? 'yes' : 'no') + ','
	+ 'height=' + height + ',' + 'width=' + width + ','
	+ 'top=' + top + ',' + 'left=' + left);
}

function displayInfo(info)
{
	if (info == 'weather')
		showDialog('http://www3.tuoitre.com.vn/transweb/rams.htm', 492, 659);
	if (info == 'forex')
		showDialog('http://www3.tuoitre.com.vn/transweb/tygia.htm', 450, 382);
	if (info == 'gold')
		showDialog('http://www3.tuoitre.com.vn/transweb/giavang.htm', 450, 199);
	if (info == 'tvguide')
		showWindow('http://www3.tuoitre.com.vn/transweb/truyenhinh.htm', false, false, true, false, false, false, true, true, 450, 354, 0, 0);
	if (info == 'lottery')
		showDialog('http://www3.tuoitre.com.vn/transweb/xoso.htm', 600, 344);
		//showDialog('http://www.xsktcantho.com.vn/xsktcantho.asp', 1024, 1350);
	if (info == 'stock')
		showDialog('http://www3.tuoitre.com.vn/transweb/chungkhoan.htm', 770, 750);
	//return 0;
}

function showStock()
	{		
		myWin = open("http://www.bsc.com.vn/OP/OP.htm", "displayWindow", "width=800,height=590,status=no,toolbar=no,menubar=no,top=0,left=0");
	}
function openNewWin(url) {
    window.open(url,'NewWin','width=700,height=530,left=10,addressbar=no,scrollbars=yes,toolbar=no,resizable=no,menubar=no');
}   
function DownloadFile(sDocID,DownloadType)
{
	sURL="DownloadFile.aspx?DocID="+sDocID+"&DownloadType="+DownloadType;
	window.open(sURL,"_blank","resizable,width=550,height=200,menubar=no,status=no");
	return false;
}
