﻿function WriteAd(id, url, link, className, target, title, width, height)
{
    if(!url) return;
    if(link=='http://') link = '';
    width = width ? "width='" + width + "'": "";
    height = height ? "height='" + height + "'": "";
    link = link ? "href='" + link + "'": "";
    title = title ? "title='" + title + "'": "";
    target = target ? "target='" + target + "'": "";
    className = className ? "class='" + className + "'": "";
    if(url.match(/.swf$/ig))
    {
        document.write("\
        <a onClick='CountAd(" + id + ")' " + className + " " + link + " " + title + " " + target + ">\
                <embed src='" + url + "' quality='high' " + width + " " + height + " allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
        </a>\
        ");
    }
    else
    {
        document.write("\
        <a onClick='CountAd(" + id + ")' " + className + " " + link + " " + title + " " + target + ">\
            <img src='" + url + "' " + width + "/>\
        </a>\
        ");
    }
}
function CountAd(id){
	window.open('CountAds.aspx?id='+id,'yourAds');
}
function GetAd(url, link, className, target, title, width)
{
	var retad;
    if(!url) return;
    width = width ? "width='" + width + "'": "";
    link = link ? "href='" + link + "'": "";
    title = title ? "title='" + title + "'": "";
    target = target ? "target='" + target + "'": "";
    className = className ? "class='" + className + "'": "";
    if(url.match(/.swf$/ig))
    {
        retad = "\
        <a " + className + " " + link + " " + title + " " + target + ">\
                <embed src='" + url + "' quality='high' wmode='transparent' " + width + " allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
        </a>\
        ";
    }
    else
    {
        retad = "\
        <a " + className + " " + link + " " + title + " " + target + ">\
            <img src='" + url + "' " + width + "/>\
        </a>\
        ";
    }
    return retad;
}

function Search(form, url)
{
    if(!form["key"] || !form["key"].value) return false;
    location.href = url + encodeURI(form["key"].value);
    return false
}

function LoadImages(className, imageClassName)
{
    var links = document.links;
    for(var i in links)
    {
        var link = links[i];
        if(link && link.className)
        {
            if(link.className == className || link.className.indexOf(className + " ") != -1 || link.className.indexOf(" " + className) != -1)
            {
                var img = document.createElement("IMG");
                img.className = imageClassName;
                img.onload = function()
                {
                    this.style.position = "static";
                    this.style.visibility = "visible";
                }
                img.style.position = "absolute";
                img.style.visibility = "hidden";
                img.src = link.rel;
                link.innerHTML = "";
                link.appendChild(img);
                if(link.style.width)
                {
                    img.style.width = link.style.width;
                    link.style.width = "auto";
                    img.style.height = "auto";
                }
            }
        }
    }
}

function CreateButtonStyles(classNames, spacerSource)
{
    if(!classNames) return;
    classNames = classNames.split(",");
    classNames.contains = function(className)
    {
        if(!className) return false;
        for(var i in this)
        {
            if(this[i] == className) return true;
        }
        return false;
    }
    
    var links = document.links;
    
    if(!spacerSource) spacerSource = "spacer.gif";
    for(var i = 0; i < links.length; i++)
    {
        var link = links[i];
        if(classNames.contains(link.className))
        {
            link.oldClickHandler = link.onclick;
            link.url = link.href;
            link.href = "#none";
            link.onclick = function(e)
                {
                    e = e ? e : window.event;
                    var result;
                    if(this.oldClickHandler) result = this.oldClickHandler(e);
                    if(typeof(result) != "undefined" && !result) return false;
                    window.open(this.url, this.target ? this.target : "_self");
                }
            var settings = link.getAttribute("settings", "");
            if(!settings) settings = "";
            settings = settings.split(",");
            var color = settings[0] ? settings[0] : "Black";
            var width = settings[1] ? "width:" + settings[1] + ";" : "";
            var fontSize = settings[2] ? "font-size:" + settings[2] + ";" : "";
            var extendedClass = settings[3] ? settings[3] : "";
            var text = typeof(link.textContent) == "undefined" ? link.innerText : link.textContent;
            var html = "<button style='" + width + fontSize + "'><table border='0' cellpadding='0' cellspacing='0'><tr><td class='" + link.className + "Left" + color + " " + extendedClass + "'></td><td class='" + link.className + "Center" + color + " " + extendedClass + "'>" + text + "</td><td class='" + link.className + "Right" + color + " " + extendedClass + "'></td></tr></table></button>";
            //var html = "<img class='" + link.className + "Left " + color + " " + extendedClass + "' src='" + spacerSource + "' alt='' /><button class='" + link.className + "Center " + color + " " + extendedClass + "' style='" + width + fontSize + "'>" + text + "</button><img class='" + link.className + "Right " + color + " " + extendedClass + "' src='" + spacerSource + "' alt='' />";
            link.innerHTML = html;
        }
    }
}
            
function CreatePager(pageCount, currentPage, url)
{
    var pages = new Array();
    var startPage = 0;
    var endPage = 0;
    
    if(eval(pageCount) == 1)
    {
    	document.getElementById("showpager").display = "none";
    }
    startPage = currentPage - 2;
    if(startPage < 0) startPage = 0;
    if(startPage + 4 < pageCount)
    {
        endPage = startPage + 4;
    }
    else
    {
        endPage = pageCount - 1;
    }
    if(endPage - 4 < 0)
    {
        startPage = 0;
    }
    else
    {
        startPage = endPage - 4;
    }
    
    pages[pages.length] = "<a class='Page' " + (pageCount > 0 ? "href='" + url.replace("{page}", 0) + "'" : "") + ">|&lt;</a>";
    pages[pages.length] = "<a class='Page' " + (currentPage - 1 >= 0 ? "href='" + url.replace("{page}", currentPage - 1) + "'" : "") + ">&lt;</a>";
    for(var i = startPage; i <= endPage; i++)
    {
        pages[pages.length] = "<a class='" + (i == currentPage?"Current":"Page") + "' href='" + url.replace("{page}", i) + "'>" + (i + 1) + "</a>";
    }
    pages[pages.length] = "<a class='Page' " + (currentPage + 1 < pageCount ? "href='" + url.replace("{page}", currentPage + 1) + "'" : "") + ">&gt;</a>";
    pages[pages.length] = "<a class='Page' " + (pageCount > 0 ? "href='" + url.replace("{page}", pageCount - 1) + "'" : "") + ">&gt;|</a>";
    document.write(pages.join("&nbsp;&nbsp;"));
}

function RemoveFormat(text)
{
    //text = text.replace(/<[/]?(font|span|xml|del|ins|[ovwxp]:\w+)[^>]*?>/ig, "");
    text = text.replace(/<\?[^>]*\?>/ig, "");
    text = text.replace(/<([^>]*)(?:size|face)=(?:'[^']*'|""[^""]*""|[^>]+)([^>]*)>/ig,"<$1 style=\"font-size: 9pt;\" $2>"); 
    text = text.replace(/style="([^"]*)font-family([^"]*)"/ig, "style=\"$1;$2\"");
    text = text.replace(/style="([^"]*)font-size([^"]*)"/ig, "style=\"$1;$2\"");
    
    return text;
}

function ConvertToUnformatText(container)
{
    container = GetTag(container);
    if(container) container.innerHTML = RemoveFormat(container.innerHTML);
}

function GetTag(tag)
{
    if(!tag) return null;
    if(typeof(tag) == "string") tag = document.getElementById(tag);
    return tag;
}

function WriteUnformatText(container, text)
{
    container = GetTag(container);
    if(container)
        container.innerHTML = RemoveFormat(text);
    else
        document.write(RemoveFormat(text));
}

function InitDefaultValueTextbox(textbox)
{
    if(!textbox) return;
    if(textbox.initialized) return;
    textbox.initialized = true;
    textbox.onfocus = function()
        {
            if(!this.valueChanged)
            {
                this.defaultValue = textbox.value;
                this.value = "";
            }
        }
    textbox.onchange = function()
        {
            this.valueChanged = true;
        }
    
    textbox.onblur = function()
        {
            if(this.value)
            {
                if(!this.valueChanged && this.value != this.defaultValue)
                {
                    this.value = this.defaultValue;
                }
            }
            else
            {
                this.valueChanged = false;
                this.value = this.defaultValue;
            }
        }
        
    textbox.onfocus();
}

function ShowImage(image, style, largeImage, popupStyle)
{
    if(!image) return;
    image.style.display = "";
    if(style != null) DropShadow(image, style);
    if(largeImage)
    {
        image.style.cursor = "pointer";
        image.onclick = function()
        {
            PopupImage(largeImage, popupStyle);
        }
    }
}

function DropShadow(obj, style)
{
	if(window.showModalDialog)
	{
		switch(style)
		{
			case 0:
				obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Images/ImageShadow0.png', sizingMethod='scale')";
    			obj.style.paddingLeft = (obj.offsetWidth / 14) + "px";
    			obj.style.paddingRight = (obj.offsetWidth / 14) + "px";
    			obj.style.paddingTop = (obj.offsetHeight / 14) + "px";
    			obj.style.paddingBottom = (obj.offsetHeight / 14) + "px";
				break;
			case 1:
				obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Images/ImageShadow1.png', sizingMethod='scale')";
    			obj.style.paddingLeft = (obj.offsetWidth / 11.5) + "px";
    			obj.style.paddingRight = (obj.offsetWidth / 10.1) + "px";
    			obj.style.paddingTop = (obj.offsetHeight / 11) + "px";
    			obj.style.paddingBottom = (obj.offsetHeight / 10) + "px";
				break;
			case 2:
			    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Images/ImageShadow2.png', sizingMethod='scale')";
    			obj.style.paddingLeft = (obj.offsetWidth / 12) + "px";
    			obj.style.paddingRight = (obj.offsetWidth / 14) + "px";
    			obj.style.paddingTop = (obj.offsetHeight / 15) + "px";
    			obj.style.paddingBottom = (obj.offsetHeight / 15) + "px";
		}
	}
	else
	{
		obj.style.border = "1px solid silver";
		obj.style.padding = "5px";
		obj.style.backgroundColor = "white";
	}
}

function PopupImage(url, style)
{
    if(!window.popupWindow)
    {
    	var div = document.createElement("DIV");
    	window.popupWindow = div;
    	var iframe = document.createElement("IFRAME");
        iframe.className = "PopupImage";
        iframe.scrolling = "no";
        iframe.frameBorder = 0;
        
        div.style.visibility = "hidden";
        div.style.position = "absolute";
        div.appendChild(iframe);
        div.style.cursor = "pointer";
        document.body.appendChild(div);
        
        var doc = iframe.contentWindow.document;
        doc.open();
        doc.write("<html><body style='margin: 0px; cursor: pointer; padding: 0px; padding-top: 14px; background: transparent url(Images/Close.gif) right top no-repeat;'></body></html>");
        doc.close();
        window.popupImage = doc.createElement("IMG");
        
        if(style == null) style = 2;
        window.popupImage.onload = function()
            {
                iframe.width = this.offsetWidth;
                iframe.height = this.offsetHeight;
                div.style.width = this.offsetWidth;
                div.style.height = this.offsetHeight;
                DropShadow(div, style);
                
                var top, left;
                top = 5 + ((typeof(window.pageYOffset) == "undefined") ? document.documentElement.scrollTop : window.pageYOffset);
                left = ((typeof(window.pageXOffset) == "undefined") ? document.documentElement.scrollLeft : window.pageXOffset) + document.documentElement.clientWidth - div.offsetWidth;
                div.style.left = left + "px";
                div.style.top = top + "px";
                div.style.visibility = "visible";
            }
        doc.body.appendChild(window.popupImage);
        div.onclick = function()
        {
            div.style.visibility = "hidden";
        }
        
        doc.body.onclick = div.onclick;
    }
    window.popupImage.src = url;
}

function ShowDate(container, date)
{
    if(!date) date = new Date();
    var dateNames = new Array("Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy");
    var dateTemplate = "{date}, {day}/{month}/{year}"
    dateTemplate = dateTemplate.replace("{date}", dateNames[date.getDay()]);
    dateTemplate = dateTemplate.replace("{day}", date.getDate());
    dateTemplate = dateTemplate.replace("{month}", date.getMonth() + 1);
    dateTemplate = dateTemplate.replace("{year}", date.getFullYear());
    if(!container)
        document.write(dateTemplate);
    else
    {
        container = document.getElementById(container);
        if(container) container.innerHTML = dateTemplate;
    }
}
function addCommas(nStr){
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

function ShowHideOpt(divmenu){
    if(!divmenu) return;
    divmenu = document.getElementById(divmenu);
    if(divmenu.style.display == "none")
    {
        divmenu.style.display = "";
    }
    else
    {
        divmenu.style.display = "none";
    }
}

function ShowGoldPricevn(){
	document.write('<table width=100% border=1 bordercolor=#eeeeee cellpadding=2><tr><td width=100>Mua vào</td><td align=right>');
	document.write(vGoldSjcBuy);
	document.write('</td></tr><tr><td>Bán ra</td><td align=right>');
	document.write(vGoldSjcSell);
	document.write('</td></tr></table>');
}
function ShowGoldPriceen(){
	document.write('<table width=100% border=1 bordercolor=#eeeeee cellpadding=2><tr><td width=100>Buy</td><td align=right>');
	document.write(vGoldSjcBuy);
	document.write('</td></tr><tr><td>Sell</td><td align=right>');
	document.write(vGoldSjcSell);
	document.write('</td></tr></table>');
}

function ShowForexRate(){
	document.write('<table width=100% border=1 bordercolor=#eeeeee cellpadding=2><tr><td width=100>'+vForexs[0]+'</td><td align=right>');
	document.write(vCosts[0]);
	document.write('</td></tr><tr><td>'+vForexs[1]+'</td><td align=right>');
	document.write(vCosts[1]);
	document.write('</td></tr><tr><td>'+vForexs[2]+'</td><td align=right>');
	document.write(vCosts[2]);
	document.write('</td></tr><tr><td>'+vForexs[3]+'</td><td align=right>');
	document.write(vCosts[3]);
	document.write('</td></tr><tr><td>'+vForexs[4]+'</td><td align=right>');
	document.write(vCosts[4]);
	document.write('</td></tr><tr><td>'+vForexs[5]+'</td><td align=right>');
	document.write(vCosts[5]);
	document.write('</td></tr><tr><td>'+vForexs[6]+'</td><td align=right>');
	document.write(vCosts[6]);
	document.write('</td></tr><tr><td>'+vForexs[7]+'</td><td align=right>');
	document.write(vCosts[7]);
	document.write('</td></tr><tr><td>'+vForexs[8]+'</td><td align=right>');
	document.write(vCosts[8]);
	document.write('</td></tr><tr><td>'+vForexs[9]+'</td><td align=right>');
	document.write(vCosts[9]);
	document.write('</td></tr><tr><td>'+vForexs[10]+'</td><td align=right>');
	document.write(vCosts[10]);
	document.write('</td></tr></table>');
}

function PlayClip(url, img)
{
	var s1 = new SWFObject('/home/player/player.swf','player','197','169','9');
	s1.addParam("allowfullscreen","true");
	s1.addParam("allownetworking","all");
	s1.addParam("allowscriptaccess","always");
	s1.addParam("flashvars","file="+url+"&image="+img+"&autostart=true&displayclick=fullscreen");
	s1.write("previewclip");
}

function SendToFriend(iframe)
{
    if(!iframe) return;
    iframe = document.getElementById(iframe);
    if(!iframe) return;
    if(iframe.style.display == "none")
    {
        iframe.src = "/Home/SendToFriend/";
        iframe.style.display = "";
    }
    else
    {
        iframe.style.display = "none";
    }
}

function SendComment(iframe,id)
{
    if(!iframe) return;
    iframe = document.getElementById(iframe);
    if(!iframe) return;
    if(iframe.style.display == "none")
    {
        iframe.src = "/SendComment/?id="+id;
        iframe.style.display = "";
    }
    else
    {
        iframe.style.display = "none";
    }
}

function validEmail(obj) {
	var s = obj.value;
	for (var i=0; i<s.length; i++)
		if (s.charAt(i)==" "){
			return false;
		}
	var elem, elem1;
	elem=s.split("@");
	if (elem.length!=2)	return false;

	if (elem[0].length==0 || elem[1].length==0)return false;

	if (elem[1].indexOf(".")==-1)	return false;

	elem1=elem[1].split(".");
	for (var i=0; i<elem1.length; i++)
		if (elem1[i].length==0)return false;
	return true;
}

function testSpaceBar(obj){
	if(obj.value=="")return false;
	else{		
		var s = obj.value;
		var temp = s.split(" ");
		var str = "";
		for(var i=0; i<temp.length; i++)str=str + temp[i];
		if(str==""){
			obj.value = str.substring(0,str.length);
			return false;
		}
	}//else
	return true;
}

function bookmarksite(title,url){
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
}


function goLink(){	
	var url = document.weblink.link.options[document.weblink.link.selectedIndex].value;
	window.open(url);
}

function openComic(url)
{
	newwin=window.open(url, "comic", "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,width=1000,height=600")
}
function isIE6()
{
	if (typeof document.body.style.maxHeight != "undefined") {
	  return false;
	} else {
	  return true;
	}
}

function removeCommasVNE(s){
	if (s.length == 0)
		return false;
	s = s.replace('.00', '');
	for (var n = 0; n < s.length; n++)
		s = s.replace(',', '');
	return s;
}

function CalcPrice(price, unitprice, toprice){
	var retPrice = 0;
	if(unitprice=='vnd'){
		if(toprice=='vnd') retPrice = price;
		if(toprice=='sjc') retPrice = Math.round(((price*1000)/removeCommasVNE(vGoldSjcSell))*100)/100;
		if(toprice=='usd') retPrice = Math.round(((price*1000)/removeCommasVNE(vCosts[0]))*100)/100;
	}
	if(unitprice=='sjc'){
		if(toprice=='vnd') retPrice = (Math.round((price*removeCommasVNE(vGoldSjcSell))*100)/100)/10000;
		if(toprice=='sjc') retPrice = price;
		if(toprice=='usd') retPrice = (Math.round(((price*removeCommasVNE(vGoldSjcSell))/removeCommasVNE(vCosts[0]))*100)/100)/10;
	}
	if(unitprice=='usd'){
		if(toprice=='vnd') retPrice = (Math.round((price*removeCommasVNE(vCosts[0]))*100)/100)/1000;
		if(toprice=='sjc') retPrice = Math.round(((price*removeCommasVNE(vCosts[0]))/removeCommasVNE(vGoldSjcSell))*100)/100;
		if(toprice=='usd') retPrice = price;
	}
	return DisplayPrice(retPrice,toprice);
}

function DisplayPrice(price,unitprice){
	var ty = 0;
	var trieu = 0;
	var ngan = 0;
	var retStr = '';
	ty = Math.floor(price/1000);
	trieu = Math.floor(price%1000);
	ngan = Math.round((price - Math.floor(price))*1000);
	if (unitprice=='vnd'){
		retStr = '';
		if (ty>0) retStr += ty + ' tỷ ';
		if (trieu>0) retStr += trieu + ' triệu ';
		if (ngan>0) retStr += ngan + ' ngàn ';
	}
	if (unitprice=='usd'){
		retStr = '';
		tyty = Math.floor(price/1000000);
		if (tyty>0) retStr += tyty + ' triệu ';
		if (ty>0) retStr += ty + ' ngàn ';
		if (trieu>0) retStr += trieu + ' đô la ';
		//if (ngan>0) retStr += ngan + ' xu ';
	}
	if (unitprice=='sjc'){
		retStr = '';
		if (ty>0) retStr += ty + ' ngàn ';
		if (trieu>0) retStr += trieu + ' lượng ';
		if (ngan>0) retStr += (ngan/100) + ' chỉ ';
	}
	return retStr;
}

function ShowActivePrice(unitprice, index){
	document.getElementById('vnd'+index).className = "nm";
	document.getElementById('sjc'+index).className = "nm";
	document.getElementById('usd'+index).className = "nm";
	document.getElementById('vndp'+index).style.display = "none";
	document.getElementById('sjcp'+index).style.display = "none";
	document.getElementById('usdp'+index).style.display = "none";
	document.getElementById(unitprice+index).className = "act";
	document.getElementById(unitprice+'p'+index).style.display = "block";
}

function ChonQuanHuyen(tinhthanh, defaultText, control)
{
    var QuanHuyen = document.getElementById(control || "QuanHuyen");
    QuanHuyen.innerHTML = "";
    
    var option = document.createElement("OPTION");
    option.value = "";
    option.innerHTML = (defaultText || "Chọn");
    QuanHuyen.appendChild(option);

    if(parseInt(tinhthanh) == 0) return;
    for(var i = 0; i < quanhuyen.length; i++)
    {
        if(quanhuyen[i][0] != tinhthanh) continue;
        option = document.createElement("OPTION");
        option.value = quanhuyen[i][1];
        option.innerHTML = quanhuyen[i][2];
        QuanHuyen.appendChild(option);
    }
}

function ChonDuan(quanhuyen, defaultText, control)
{
    var DuAn = document.getElementById(control || "DuAn");
    DuAn.innerHTML = "";
    
    var option = document.createElement("OPTION");
    option.value = "";
    option.innerHTML = (defaultText || "Chọn");
    DuAn.appendChild(option);

    if(parseInt(quanhuyen) == 0) return;
    for(var i = 0; i < duan.length; i++)
    {
        if(duan[i][0] != quanhuyen) continue;
        option = document.createElement("OPTION");
        option.value = duan[i][1];
        option.innerHTML = duan[i][2];
        DuAn.appendChild(option);
    }
}

function AddCondition(name, value)
{
    if(!conditions) return;
    if(!name) return;
    conditions[name] = value;
    FilterByConditions()
}

function AddConditions(cons)
{
    if(!conditions) return;
    if(!cons) return;
    for(var i in cons)
    {
        var condition = cons[i];
        if(condition) conditions[condition.name] = condition.value;
    }
    FilterByConditions();
}

function RemoveConditions(names)
{
    if(!conditions) return;
    if(!names) return;
    names = names.split(",")
    for(var i in names)
    {
        conditions[names[i]] = null;
    }
    FilterByConditions();
}

function FilterByConditions()
{
    if(!conditions) return;
    var url = "";
    var params = new Array();
    for(var i in conditions)
    {
        var param = conditions[i];
        if(param) params[params.length] = i + "=" + escape(param);
    }
    url = "/Home/Sieu-thi/loc/" + params.join(",");
    location = url;
}

function ParseParams(params)
{
    params = params.split(",");
    for(var i in params)
    {
        var param = params[i];
        if(param)
        {
            param = param.split("=");
            if(param[0]) conditions[param[0]] = param[1];
        }                
    }
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function selectStock(i){
	if(i == 0){
		document.getElementById('ifrmContent').src = 'http://vnexpress.net/User/ck/hcms/HCMStockSmall.asp';
		document.getElementById('lbl0').className = 'activeStock';
		document.getElementById('lbl1').className = 'deactiveStock';
		document.getElementById('info0').style.display = '';
		document.getElementById('info1').style.display = 'none';
	}
	else{
		document.getElementById('ifrmContent').src = 'http://vnexpress.net/User/ck/hns/HNStockSmall.asp';
		document.getElementById('lbl1').className = 'activeStock';
		document.getElementById('lbl0').className = 'deactiveStock';
		document.getElementById('info0').style.display = 'none';
		document.getElementById('info1').style.display = '';
	}
}

