var left_w=155;
var left_h=120;
var center_w=740;
var center_h=85;

/* == FUNCTIONS FOR DOCUMENT == */
/*                              */



function getCateLink(cid)
{
    var strLink = '';
    for(j=0; j<menu_fid.length; j++) 
    {
        if(menu_fid[j] == cid)
        {
            strLink = menu_path[j];
            j = menu_path + 1;
        }
    }
    return strLink;
}

function showHref(id, str, css)
{
    var lnk = getCateLink(id);
    lnk = '<a class="' + css + '" href="/' + lnk + '.xinh" >' + str + '</a>';
    document.write(lnk);
}

function showLinkObject(cid, prefixlink, nlink, obj, css)
{
    var lnk = getCateLink(cid);
    lnk = '<a class="' + css + '" href="' + prefixlink + lnk + '/' +  nlink + '.xinh" >' + obj + '</a>';
    document.write(lnk);
}

function showNewsTitle(cid, nlink, css, title)
{
    if(css != '' ) css = ' class = "' + css + '"';
    var clink = getCateLink(cid);
    clink = "/" + clink + "/" + nlink + '.xinh';
    document.write('<a href="' + clink + '" ' + css + '>' + title + '</a>');
}

function showShortNewsTitle(nlink, css, title, maxch)
{
    if(css != '' ) css = ' class = "' + css + '"';
    title = cutString(title, maxch);
    nlink = nlink + '.xinh';
    document.write('<a href="' + nlink + '" ' + css + '>' + title + '</a>');
}

function cutString(input, maxCharacter)
{
    var pos = maxCharacter;
    if(pos > input.length ) pos = input.length;
    
	//input = input.substring(0,maxCharacter);
    if(pos >= maxCharacter)
    {
        input = input.substring(0,pos);
        var str = new Array();
        str = input.split(' ');
        input='';
        
        for(i=0;i<str.length-1;i++)
        {
            input = input + str[i].replace(' ','') + ' ';
        }
        
        input = input.substring(0,input.length-1) + '...';
    }
    return input;
}

function showNewsShort(input, maxCharacter)
{
    //input = input.replace(' ','');
    if(input != '')
    document.write(cutString(input, maxCharacter));
    else document.write('&nbsp;');
}

function processString(divId, maxCharacter)
{
    var strInput = document.getElementById(divId).innerHTML;
    strInput = cutString(strInput, maxCharacter);
    document.getElementById(divId).innerHTML = strInput;
}

function processTitle(divId, maxch, cid, nlink, css, title)
{
    var strOutput = 'abc Tiêu đề test thử';
//    if(css != '' ) css = ' class = "' + css + '"';
//    var clink = getCateLink(cid);
//    if(maxch > 0) title = cutString(title, maxch);
//    clink = "/" + clink + "/" + nlink + '.xinh';
//    strOutput = '<a href="' + clink + '" ' + css + '>' + title + '</a>');    
    document.getElementById(divId).innerHTML = strOutput;
}

function showImage(image, cid, link, css)
{
    var clink = getCateLink(cid);
    clink = '/' + clink + '/' + link + '.xinh';
    //class="' + css + '"
    
    image = image.replace(' ','');
    image = image.replace('&lt;','<');
    image = image.replace('&gt;','>');
    image = image.replace('<br>','');
    image = image.replace('<br />','');
    if(image != '')
    {
        image = image.replace('<img','<img class="' + css + ' " ');
        clink = '<a href="' + clink + '" >' + image + '</a> ';
    }
    else { clink = '<img src="/Images/dominomedia.gif" class="' + css + '"  />';}
    document.write(clink);
}

function writeNewsImage(divId, css, cid, nlink)
{
    var clink = getCateLink(cid);
    clink = '/' + clink + '/' + link + '.xinh';    
    image = document.getElementById(divId).innerHTML;
    image = image.replace(' ','');
    image = image.replace('&lt;','<');
    image = image.replace('&gt;','>');
    image = image.replace('<br>','');
    image = image.replace('<br />','');
    if(image != '')
    {
        image = image.replace('<img','<img class="' + css + ' " ');
        clink = '<a href="' + clink + '" >' + image + '</a> ';
    }
    else { clink = '<img src="/Images/dominomedia.gif" class="' + css + '"  />';}
    document.getElementById(divId).innerHTML = clink;
}


function goToPage(pg)
{
    var clink = '';
    clink = PAGE_FOLDER > 0 ? getCateLink(PAGE_FOLDER) : getCateLink(0);
    clink = '/' + clink + '/trang' + pg + '.xinh';
    document.location.href = clink;
    return false;
}

function goToPageSearch(pg, cid, extract, s)
{
    var clink = '';
    clink = PAGE_FOLDER > 0 ? getCateLink(PAGE_FOLDER) : getCateLink(0);
    clink = '/Home/Search/?p=' + pg + '&r=' + cid + '&a=' + extract + '&s=' + s;
    document.location.href = clink;
    //return false;
}

/*                              */
/* ======= END FUNCTION ======= */
 
function addCartXinhXinh(cid, plink, quantity)
{
    var clink = getCateLink_pro(cid);
    if(location.port != "") 
        location.href='http://' + location.hostname + ":" + location.port + '/dat-hang/'+clink+'/'+quantity+'/'+ plink + '.xinh';
    else
      location.href='http://' + location.hostname + '/dat-hang/'+clink+'/'+quantity+'/'+ plink + '.xinh';
}

function addCart(pid, quantity, us)
{
    if(location.port != "") 
        location.href='http://' + location.hostname + ":" + location.port + '/Store/AddtoCart.aspx?us='+us+'&I='+pid+'&Q='+quantity;
    else
      location.href='http://' + location.hostname  + '/Store/AddtoCart.aspx?us='+us+'&I='+pid+'&Q='+quantity;

}

function removeHTMLTags(id){
 	if(document.getElementById && document.getElementById(id)){
 		var strInputCode = document.getElementById(id).innerHTML;
 	 	strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
 		 	return (p1 == "lt")? "<" : ">";
 		});
 		var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
 		document.write(strTagStrippedText);
 	}	
}
 	

function expandcollapse(obj,row,imgid)
{
    var div = document.getElementById(obj);        
                                        
    if (div.style.display == "none")
    {
        div.style.display = "inline";  
        document.getElementById('imgupdown'+imgid).src="/Lib/Img/UP.gif"; 
                    
    }
    else
    {
        div.style.display = "none";           
        document.getElementById('imgupdown'+imgid).src="/Lib/Img/DOW.gif";  
    }
} 



function Flashwrite(url,w,h,id,bg,vars)
{
    var str="";
    if(w!="") str+= "width='"+w+"'";
    if(h!="") str += "height='"+h+"'";
    var flashStr=
    "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
    "<param name='allowScriptAccess' value='always' />"+
    "<param name='movie' value='"+url+"' />"+
    "<param name='FlashVars' value='"+vars+"' />"+
    "<param name='wmode' value='transparent' />"+
    "<param name='menu' value='false' />"+
    "<param name='quality' value='high' />"+
    "<embed src='"+url+"' FlashVars='"+vars+"' wmode='transparent' menu='false' quality='high' " + str + " allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
    "</object>";
    document.write(flashStr);
}

function LogoFlash(url,w,h,id,bg,vars)
{
    var str="";
    if(w!="") str+= "width='"+w+"'";
    if(h!="") str += "height='"+h+"'";
    var flashStr=
    "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
    "<param name='allowScriptAccess' value='always' />"+
    "<param name='movie' value='"+url+"' />"+
    "<param name='FlashVars' value='"+vars+"' />"+
    "<param name='wmode' value='transparent' />"+
    "<param name='menu' value='false' />"+
    "<param name='quality' value='high' />"+
    "<embed src='"+url+"' FlashVars='"+vars+"' wmode='transparent' menu='false' quality='high' " + str + " allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
    "</object>";
    return flashStr;
}

function showLogo(path, file, link, pos, w, h, css)
{
    var size='';
    if(w!="") size += "width='"+w+"'";
    //if(h!="") size += "height='"+h+"'";;
    if(css != '') css = ' class="' + css + '" ';
    if(file != null && file != '')
    {
        var extend = file.substring(file.length-3,file.length);
        if(extend == 'swf' || extend == 'SWF')
        {
            Flashwrite(path+file,w,h);
        }
        else
        {
            document.write('<a href="' + link + '" target="_blank"><img src="' + path + file + '" alt="" title="" ' + size + css +  ' border=0></a>');
        }
    }
}

function showHaftLogo(path, file, link, pos, w, h)
{
    var size='';
    if(w!="") size += "width='"+w+"'";
    //if(h!="") size += "height='"+h+"'";;
    if(file != null && file != '')
    {
        var extend = file.substring(file.length-3,file.length);
        if(extend == 'swf' || extend == 'SWF')
        {
            Flashwrite(path+file,w,h);
        }
        else
        {
            document.write('<a href="' + link + '"><img src="' + path + file + '" alt="" title="" ' + size + ' border=0></a>');
        }
    }
}

function showLogoNews(path, file, link, pos, w, h)
{
    var size='';
    if(w!="") size+= "width='"+w+"'";
    if(h!="") size += "height='"+h+"'";;
    if(file != null && file != '')
    {
        var extend = file.substring(file.length-4,3);
        if(extend == 'swf' || extend == 'SWF')
        {
            document.write('<table cellpadding="0" cellspacing="1" border="0" with="1"><tr><td>' + LogoFlash(path+file,w,h) + '</td></tr></table>');
        }
        else
        {
            document.write('<table cellpadding="0" cellspacing="1" border="0" with="1"><tr><td><a href="' + link + '"><img src="' + path + file + '" alt="" title="" ' + size + ' border=0></a></td></tr></table>');
        }
    }
}

function showLogoItem(cid, path, file, link, css, pos, w, h)
{
    var size='';
    var style = '';
    if(w!="") size+= "width='"+w+"' ";
    if(h!="") size += "height='"+h+"' ";
    if(css!="") style =' class="'+css+'" ';
    if(file != null && file != '')
    {
        var extend = file.substring(file.length-4,3);
        if(extend == 'swf' || extend == 'SWF')
        {
            document.write('<table cellpadding="0" cellspacing="1" border="0" with="1"><tr><td>' + LogoFlash(path+file,w,h) + '</td></tr></table>');
        }
        else
        {
            document.write('<table cellpadding="0" cellspacing="1" border="0" with="1"><tr><td><a href="' + link + '"><img src="' + path + file + '" alt="" title="" ' + size + style + ' border=0></a></td></tr></table>');
        }
    }
}


function showLogoNewsDetail(path, file, link, pos, w, h)
{
    var size='';
    if(w!="") size+= "width='"+w+"'";
    if(h!="") size += "height='"+h+"'";;
    if(file == null || file == '')
    {
        path="/Libraries/Images/";
        file="Nophoto.jpg";
    }
    var extend = file.substring(file.length-4,3);
    if(extend == 'swf' || extend == 'SWF')
    {
        document.write('<table cellpadding="0" cellspacing="1" border="0" with="1"><tr><td valign=middle align=center>' + LogoFlash(path+file,w,h) + '</td></tr></table>');
    }
    else
    {
        document.write('<table cellpadding="0" cellspacing="1" border="0" with="1"><tr><td valign=middle align=center><a href="' + link + '" ><img src="' + path + file + '" alt="" title="" ' + size + ' class=imgdetail></a></td></tr></table>');
        //onmouseover="displayLargerImg()" onmouseout="hiddenLargerImg()"
        //<div id="dimg" style=" width:500px; height:500px; border:solid 1px #eaeaea; padding:5px; display:none; overview:visible"><img src="' + path + file + '" width=480 height=480 alt="" /></div>
    }
}

function displayLargerImg()
{
    if(document.getElementById('dimg').style.display=='none')
        document.getElementById('dimg').style.display='block';
}
function hiddenLargerImg()
{
    if(document.getElementById('dimg').style.display='block')
        document.getElementById('dimg').style.display='none';
}

function showRank(rank, link)
{
    var strRank = "";
    var proRank = rank;
    strRank = '<div class="fl hit_rank"><a href="' + link + '" title="Đánh giá sản phẩm này" target="_blank">';
    if(proRank == 0) proRank = 5;
    for (i = 1; i <= (proRank / 2); i++)
    {
        strRank = strRank + "<img src='/Libraries/Images/do.gif' border='0' align='absmiddle' />";
    }
    if ((proRank % 2) != 0)
    {
        strRank = strRank + "<img src='/Libraries/Images/hong.gif' border='0' align='absmiddle' />";
    }
    for (j = ((proRank / 2) + (proRank % 2)); j <= 5; j++)
    {
        strRank = strRank + "<img src='/Libraries/Images/trang.gif' border='0' align='absmiddle' />";
    }
    strRank  = strRank + '</a></div>';
    document.write(strRank);
}
function showView(view)
{
    if(view > 0)
        document.write('<div class="fl hit_view">Có <font style="color:#ff0000; font-weight:bold" >' + view + '</font> người đã xem sản phẩm này</div>');
}

function Left(str, n)
{
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}

function Right(str, n)
{
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

function numberFormat(num,decimalNum,bolLeadingZero,bolParens,bolCommas){ 
	if (isNaN(parseInt(num))) return "0";

	var tmpNum = num;
	var iSign = num < 0 ? -1 : 1; 

	tmpNum *= Math.pow(10,decimalNum);
	tmpNum = Math.round(Math.abs(tmpNum))
	tmpNum /= Math.pow(10,decimalNum);
	tmpNum *= iSign;

	var tmpNumStr = new String(tmpNum);

	if (!bolLeadingZero && num < 1 && num > -1 && num != 0)
		if (num > 0)
			tmpNumStr = tmpNumStr.substring(1,tmpNumStr.length);
		else
			tmpNumStr = "-" + tmpNumStr.substring(2,tmpNumStr.length);
				
	if (bolCommas && (num >= 1000 || num <= -1000)) {
		var iStart = tmpNumStr.indexOf(".");
		if (iStart < 0)
			iStart = tmpNumStr.length;

		iStart -= 3;
		while (iStart >= 1) {
			tmpNumStr = tmpNumStr.substring(0,iStart) + "," + tmpNumStr.substring(iStart,tmpNumStr.length)
			iStart -= 3;
		}                       
	}
	if (bolParens && num < 0)
				tmpNumStr = "(" + tmpNumStr.substring(1,tmpNumStr.length) + ")";
	return tmpNumStr;
}
function showPrice1(price, punit)
{
	var strPrice='';
	punit = '&nbsp;' + punit;
	strPrice=numberFormat(price, 3, 0, '.', ',');
	document.write('<a href="javascript:void(0)" class="lnk_price1" >' + strPrice + punit + '</a>');
}
function showPrice(price, punit)
{
	var strPrice='';
	punit = '&nbsp;' + punit;
	strPrice=numberFormat(price, 3, 0, '.', ',');
	document.write('<a href="javascript:void(0)" class="lnk_price" >' + strPrice + punit + '</a>');
}

function showPricexx(price, punit)
{
	var strPrice='';
	punit = '&nbsp;' + punit;
	strPrice=numberFormat(price, 3, 0, '.', ',');
	document.write(strPrice + '&nbsp;'+ punit);
}

// Thành tiền
function ShowTotal(price, quantity, unit)
{
    var total;
    if(price > 0 && quantity > 0)
    {
        switch(unit)
        {
            // USD
            case vForexs[0]:
                price = price * vCosts[0];
            break;
    //        case vForexs[1]:
    //            price = price * vCosts[1];
    //        break;
    //        case vForexs[2]:
    //            price = price * vCosts[2];
    //        break;
    //        case vForexs[3]:
    //            price = price * vCosts[3];
    //        break;
    //        case vForexs[4]:
    //            price = price * vCosts[4];
    //        break;
    //        case vForexs[5]:
    //            price = price * vCosts[5];
    //        break;
    //        case vForexs[6]:
    //            price = price * vCosts[6];
    //        break;
    //        case vForexs[7]:
    //            price = price * vCosts[7];
    //        break;
    //        case vForexs[8]:
    //            price = price * vCosts[8];
    //        break;
    //        case vForexs[9]:
    //            price = price * vCosts[9];
    //        break;
            // EUR
            case vForexs[10]:
                price = price * vCosts[10];
            break;
    //        case vForexs[11]:
    //            price = price * vCosts[11];
    //        break;
            // VND
            case vForexs[12]:
            default:
                price = price;
            break;
        }
        total =  price * quantity;
    }
    else total = 0;
    var sTotalDue='';
    sTotalDue = numberFormat(total, 3, 0, '.', ',');
    document.write('<a href="javascript:void(0)" class="lnk_price" >' + sTotalDue + '&nbsp;' + unit + '</a>');
}

function showCombobox(imin, imax, selected, name)
{
	var str = '';
	str = str + '<select name=slt_' + name + ' id="'+ name +'">';
		for(i=imin; i<imax; i++)
		{
			if(i == selected)
			{
				str = str + '<option value=' + i + ' selected="selected">' + i + '</option>';
			}
			else
			{
				str = str + '<option value=' + i + ' >' + i + '</option>';
			}
		}
	str = str + '</select>';
		document.write(str);
}

//function expandcollapse(obj,row,imgid)
//{
//    var div = document.getElementById(obj);        
//                                        
//    if (div.style.display == "none")
//    {
//        div.style.display = "inline";  
//        document.getElementById('imgupdown'+imgid).src="/Libraries/Images/up.jpg"; 
//                    
//    }
//    else
//    {
//        div.style.display = "none";           
//        document.getElementById('imgupdown'+imgid).src="/Libraries/Images/down.jpg";  
//    }
//} 

function newWindow(file, window, w, h)
{
    msgWindow=open(file,window,'resizable=no,width=' + w + ', height=' + h + ',titlebar=no,toolbar=no,scrollbars=yes');
    if (msgWindow.opener == null) msgWindow.opener = self;
}

function setStyleFoObject(obj, css)
{
    document.getElementById(obj).style.className=css;
}

function showSourceNews(strSource)
{
    var strOutput = '';
    if (strSource != '')
    {        
        var ValidSharp = false;
       
        var sSource = strSource.split('#');
        if (sSource.length > 0)
        {
            strOutput += "<b>" + sSource[0] + "</b>";
        }
        if (sSource.length > 1)
        {
            strOutput += "<br /><i style='font-weight:normal;'>" + sSource[1] + "</i>";
        }
        else { strOutput = "<i>" + strSource + "</i>"; }
    }
    document.write(strOutput);
}

function active_page(obj)
{
    if(obj.className == "fl op css_go_nav")
        obj.className = "fl op css_go_nav_hover";
    else
        obj.className = "fl op css_hover";
}
function deactive_page(obj)
{
    if(obj.className == "fl op css_go_nav_hover")
        obj.className = "fl op css_go_nav";
    else 
        obj.className = "fl op css_go";
}
// Hàm phân trang
function phantrang(Page)
{
    var str = '';
    var next = 0;
    var previous = 0;
    previous = Page - 1;
    next = Page + 1;
    var clink = '';
    clink = PAGE_FOLDER > 0 ? getCateLink(PAGE_FOLDER) : getCateLink(0);
    clink = '/' + clink + '/trang';
    
    if(Page == 0 || Page == 1)
    {
        str = '<div class="fr op segment"><a class="next-page" href="' + clink + next + '.xinh" title="Trang ' + next+ '">Xem tiếp >></a></div>';
    }else if(Page > 1)
    {
        next = Page + 1;    
        str = '<div class="fr op segment"><a class="previous-page" href="' + clink + '1.xinh" title="Trang đầu" >Trang đầu</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a class="previous-page" href="' + clink + previous + '.xinh" title="Trang ' + previous + '">Trang trước</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a class="next-page" href="' + clink + next + '.xinh" title="Trang ' + next+ '">Trang sau</a></div>';
    }
    document.write(str);
}

// Ham phan doan tren phan trang
// Parameter: So trang, Trang/Doan, trang hien tai
function phandoan(NumberRow, PagePerSeg, Page)
{
    var min=1;
    var max = PagePerSeg;// min, min+1, min+2, ..., max
    var strOutput = '';
    var step = PagePerSeg;
    var seg = 0;
    var NumberPage = parseInt(NumberRow/20)+1;
    Page = Page > 0 ? Page : 1;
    if(Page % PagePerSeg == 0)
    {
        seg = parseInt(Page/PagePerSeg)-1;
    }
    else
    {
        seg = parseInt(Page/PagePerSeg);
    }
    min = parseInt(seg*step) + 1;
    max = min + step;
    var Next = parseInt(Page + 1);
    //var Prev = parseInt(Page - 1);
    //if(Page <= PagePerSeg && Page != NumberPage) Prev = 0;
    var Prev = parseInt(min - 1);
    if(Page >= NumberRow) Next = 0;
    if(max >= NumberRow) max = NumberRow+1;
    
    
    var i = 0;
    strOutput = '<div class="fr op fpage" align="right">';
    
    if(Prev > 0) // || Page < NumberPage
    {
    	strOutput += '<div class="fl op css_go_nav" onmouseover="active_page(this)" onmouseout="deactive_page(this)" onclick="goToPage(1)" title="Trang đầu">Trang đầu</div>';
		strOutput += '<div class="fl op css_go" onmouseover="active_page(this)" onmouseout="deactive_page(this)" onclick="goToPage(' + Prev + ')" title="Trang ' + Prev + '">&lt;</div>';
    }
    for(i=min;i<max;i++)
    {
        if(Page==i)
            strOutput+='<div class="fl op css_curent">'+parseInt(i)+'</div>';
        else if(Page < NumberPage) strOutput+='<div class="fl op css_go" onmouseover="active_page(this)" onmouseout="deactive_page(this)"  onclick="goToPage(' + parseInt(i) + ')" title="Trang ' + parseInt(i) + '" >' + parseInt(i) + '</div>';
    }
    if(Next > 0 && Page < NumberPage) 
    {
    	strOutput += '<div class="fl op css_go" onmouseover="active_page(this)" onmouseout="deactive_page(this)"  onclick="goToPage(' + max + ')" title="Trang '+max+'">&gt;</div>';
    	strOutput += '<div class="fl op css_go_nav" onmouseover="active_page(this)" onmouseout="deactive_page(this)"  onclick="goToPage(' + NumberPage + ')" title="Trang cuối">Trang cuối</div>';
    }
    strOutput += '</div>';
    document.write(strOutput);
}

function callPagefaqs(i, nid, dvid)
{
    ajaxpage('/Modules.aspx?param=15&nid=' + nid + '&page=' + i,dvid);
}

// Ham phan doan tren phan trang
// Parameter: So trang, Trang/Doan, trang hien tai
function segmentfaqs(NumberPage, PagePerSeg, Page, nid, dvid)
{
    var min=1;
    var max = PagePerSeg;// min, min+1, min+2, ..., max
    var strOutput = '';
    var step = PagePerSeg;
    var seg = 0;
    Page = Page > 0 ? Page : 1;
    if(Page % PagePerSeg == 0)
    {
        seg = parseInt(Page/PagePerSeg)-1;
    }
    else
    {
        seg = parseInt(Page/PagePerSeg);
    }
    min = parseInt(seg*step) + 1;
    max = min + step;
    var Next = parseInt(Page + 1);
    var Prev = parseInt(Page - 1);
    if(Page <= PagePerSeg) Prev = 0;
    if(Page >= NumberPage) Next = 0;
    if(max >= NumberPage) max = NumberPage+1;
    //  
    var i = 0;
    strOutput = '<div class="fr op fpage" align="right">';
    
    if(Prev > 0) strOutput += '<div class="fl op css_go" onmouseover="active_page(this)" onmouseout="deactive_page(this)" onclick="callPagefaqs(' + Prev + ',' + nid + ',' + dvid + ')" title="Trang trước">&lt;</div>';
    for(i=min;i<max;i++)
    {
        if(Page==i)
            strOutput+='<div class="fl op css_curent">'+parseInt(i)+'</div>';
        else strOutput+='<div class="fl op css_go" onmouseover="active_page(this)" onmouseout="deactive_page(this)"  onclick="callPagefaqs(' + parseInt(i) + ',' + nid + ',' + dvid + ')" title="Trang ' + parseInt(i) + '" >' + parseInt(i) + '</div>';
    }
    if(Next > 0) strOutput += '<div class="fl op css_go" onmouseover="active_page(this)" onmouseout="deactive_page(this)"  onclick="callPagefaqs(' + Next + ',' + nid + ',' + dvid + ')" title="Trang tiếp">&gt;</div>';
    strOutput += '</div>';
    document.write(strOutput);
}

