﻿function GotoUrl(strUrl,iOpenNew)
{
	if (parseInt(iOpenNew)>0){
		open(strUrl, '_blank', 'fullscreen=no,addressbar=yes,toolbar=yes,titlebar=yes,scrollbars=yes,status=yes,resizable=yes');
	}else{
		window.parent.location = strUrl;	
	}
}

function OpenImage(vLink,vWidth,vHeight)
{
	var sLink = (typeof(vLink.href) == 'undefined') ? vLink : vLink.href;

	if (sLink == '')
	{
		return false;
	}

	winDef = 'status=no,resizable=no,scrollbars=no,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(vHeight).concat(',').concat('width=').concat(vWidth).concat(',');
	winDef = winDef.concat('top=').concat((screen.height - vHeight)/2).concat(',');
	winDef = winDef.concat('left=').concat((screen.width - vWidth)/2);
	newwin = open('', '_blank', winDef);

	newwin.document.writeln('<title>Image Preview</title><body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">');
	newwin.document.writeln('<img onclick="window.close()" src="', sLink, '" border=0>');
	newwin.document.writeln('</body>');

	if (typeof(vLink.href) != 'undefined')
	{
		return false;
	}
}
function switchActive(i){
    if(i == 1){	   
	    document.getElementById('Left').className = 'ctHeaderLeft_None';
	    document.getElementById('Center').className = 'ctHeaderCenter_None';
	    document.getElementById('Right').className = 'ctHeaderRight_None';
	    
	    document.getElementById('Left_None').className = 'ctHeaderLeft';
	    document.getElementById('Center_None').className = 'ctHeaderCenter';
	    document.getElementById('Right_None').className = 'ctHeaderRight';
	   
	    document.getElementById('divNews').className = 'Hide';
	    document.getElementById('divEvent').className = 'Show';
	    document.getElementById('ArticleHome_lblSlide').className = 'Hide';
	    document.getElementById('ArticleHome_lblEvent11').className = 'Show';
    }
    else{	    
	    document.getElementById('Left').className = 'ctHeaderLeft';
	    document.getElementById('Center').className = 'ctHeaderCenter';
	    document.getElementById('Right').className = 'ctHeaderRight';
	    
	    document.getElementById('Left_None').className = 'ctHeaderLeft_None';
	    document.getElementById('Center_None').className = 'ctHeaderCenter_None';
	    document.getElementById('Right_None').className = 'ctHeaderRight_None';
	   
	    document.getElementById('divNews').className = 'Show';
	    document.getElementById('divEvent').className = 'Hide';	  
	    document.getElementById('ArticleHome_lblSlide').className = 'Show';
	    document.getElementById('ArticleHome_lblEvent11').className = 'Hide';  
    }
    jQuery(document).ready(function() {
    jQuery('#ArticleSlide0').jcarousel({
        scroll: 1,       
        initCallback: ArticleSlide0_initCallback
    });
    jQuery('#ArticleSlide1').jcarousel({
        scroll: 1,       
        initCallback: ArticleSlide1_initCallback
    });   
});
}
function StoreActive(i){
    if(i == 1){	   
	    document.getElementById('IdSoLeft').className = 'ctHeaderLeft_None';
	    document.getElementById('IdSoCenter').className = 'ctHeaderCenter_None';
	    document.getElementById('IdSoRight').className = 'ctHeaderRight_None';
	    
	    document.getElementById('IdTpLeft').className = 'ctHeaderLeft';
	    document.getElementById('IdTpCenter').className = 'ctHeaderCenter';
	    document.getElementById('IdTpRight').className = 'ctHeaderRight';
	   
	    document.getElementById('divSobannganh').className = 'Hide';
	    document.getElementById('divTpho').className = 'Show';
    }
    else{
        document.getElementById('IdSoLeft').className = 'ctHeaderLeft';
	    document.getElementById('IdSoCenter').className = 'ctHeaderCenter';
	    document.getElementById('IdSoRight').className = 'ctHeaderRight';
	    
	    document.getElementById('IdTpLeft').className = 'ctHeaderLeft_None';
	    document.getElementById('IdTpCenter').className = 'ctHeaderCenter_None';
	    document.getElementById('IdTpRight').className = 'ctHeaderRight_None';
	   
	    document.getElementById('divSobannganh').className = 'Show';
	    document.getElementById('divTpho').className = 'Hide';  
    }
}
function MTTQActive(i){
    if(i == 1){	   
	    document.getElementById('Td2').className = 'ctHeaderLeft_None';
	    document.getElementById('Td3').className = 'ctHeaderCenter_None';
	    document.getElementById('Td4').className = 'ctHeaderRight_None';
	    
	    document.getElementById('Td6').className = 'ctHeaderLeft';
	    document.getElementById('Td7').className = 'ctHeaderCenter';
	    document.getElementById('Td8').className = 'ctHeaderRight';
	   
	    document.getElementById('divMttq').className = 'Hide';
	    document.getElementById('divOrther').className = 'Show';
    }
    else{
        document.getElementById('Td2').className = 'ctHeaderLeft';
	    document.getElementById('Td3').className = 'ctHeaderCenter';
	    document.getElementById('Td4').className = 'ctHeaderRight';
	                             
	    document.getElementById('Td6').className = 'ctHeaderLeft_None';
	    document.getElementById('Td7').className = 'ctHeaderCenter_None';
	    document.getElementById('Td8').className = 'ctHeaderRight_None';
	   
	    document.getElementById('divMttq').className = 'Show';
	    document.getElementById('divOrther').className = 'Hide';  
    }
}
function ThongtinNgoaite(){    
    if(document.getElementById('ttNgoaite').className == 'Hide'){
        document.getElementById('cssNgoaite').className = 'ChildHeader11';	 
	    document.getElementById('ttNgoaite').className = 'Show';	        
    } 
    else
    {document.getElementById('ttNgoaite').className = 'Hide';
    document.getElementById('cssNgoaite').className = 'ChildHeader';	
    }  
}
function ThongtinUSD(){    
    if(document.getElementById('ttUSD').className == 'Hide'){	 
	    document.getElementById('ttUSD').className = 'Show';document.getElementById('cssUSD').className = 'ChildHeader11';		        
    } 
    else
    {document.getElementById('ttUSD').className = 'Hide';document.getElementById('cssUSD').className = 'ChildHeader';}  
}
function ThongtinGold(){    
    if(document.getElementById('ttGold').className == 'Hide'){	 
	    document.getElementById('ttGold').className = 'Show';	
	    document.getElementById('cssGold').className = 'ChildHeader11';	         
    } 
    else
    {document.getElementById('ttGold').className = 'Hide';document.getElementById('cssGold').className = 'ChildHeader';	}  
}
function ThongtinWeather(){    
    if(document.getElementById('ttWeather').className == 'Hide'){	
        document.getElementById('cssWeather').className = 'ChildHeader11';	 
	    document.getElementById('ttWeather').className = 'Show';	        
    } 
    else
    {document.getElementById('ttWeather').className = 'Hide';
    document.getElementById('cssWeather').className = 'ChildHeader';	
    }  
}
function EmailActive(i){
    if(i == 1){	   
	    document.getElementById('IdSoLeft1').className = 'ctHeaderLeft_None';
	    document.getElementById('IdSoCenter1').className = 'ctHeaderCenter_None';
	    document.getElementById('IdSoRight1').className = 'ctHeaderRight_None';
	    
	    document.getElementById('IdTpLeft1').className = 'ctHeaderLeft';
	    document.getElementById('IdTpCenter1').className = 'ctHeaderCenter';
	    document.getElementById('IdTpRight1').className = 'ctHeaderRight';
	   
	    document.getElementById('divSobannganh1').className = 'Hide';
	    document.getElementById('divTpho1').className = 'Show';
    }
    else{
        document.getElementById('IdSoLeft1').className = 'ctHeaderLeft';
	    document.getElementById('IdSoCenter1').className = 'ctHeaderCenter';
	    document.getElementById('IdSoRight1').className = 'ctHeaderRight';
	    
	    document.getElementById('IdTpLeft1').className = 'ctHeaderLeft_None';
	    document.getElementById('IdTpCenter1').className = 'ctHeaderCenter_None';
	    document.getElementById('IdTpRight1').className = 'ctHeaderRight_None';
	   
	    document.getElementById('divSobannganh1').className = 'Show';
	    document.getElementById('divTpho1').className = 'Hide';  
    }
}
function GetCurrentDate()
{
    var date = new Date();
    var d  = date.getDate();
    var day = (d < 10) ? '0' + d : d;
    var m = date.getMonth() + 1;
    var month = (m < 10) ? '0' + m : m;
    var yy = date.getYear();
    var h = date.getHours();
    var hour = (h<10)? '0' + h : h;
    var m = date.getMinutes();
    var minute = (m<10)? '0' + m : m;
    var s = date.getSeconds();
    var second = (s<10)? '0' + s : s;
    var time = hour + ':' + minute + ':' + second;
    var year = (yy < 1000) ? yy + 1900 : yy;
    var current_date = day + "/" + month + "/" + year + " " + time;
    return current_date;
}
function show_date()
{
    document.getElementById("CurrentDate").innerHTML = GetCurrentDate();
}


function GotoPage(iPage)
{
    var strURL = "index.aspx?hdnPage=" + iPage;
    strURL = strURL + "&ID=76"+"&vs=UC_PRODUCTGROUP";
    window.location = strURL;
}


