function EnBac_Widget()
{
    this.base_url = 'http://enbac.com/';
    this.host = 'http://static.enbac.com/';
    //this.host = 'http://192.168.17.108/dev.enbac.com/';
    this.script_folder = this.host + 'widget/';
	this.rand_limit = 4;

	this.Shuffle = function(v){
		for(var j, x, i = v.length; i; j = parseInt(Math.random() * i), x = v[--i], v[i] = v[j], v[j] = x);
		return v;
	}

	var url = window.location.href.toLowerCase();

	this.utm='?utm_source=dt_hanghieuadm&utm_medium=box&utm_content=hanghieu&utm_campaign=dantri';
	this.link_more = 'http://enbac.com/c333/Goc-hang-hieu'+this.utm;
    this.CreateStyleSheet = function()
    {
        var css = '.title_eb1 {display:block; height:30px; overflow:hidden}.title_eb1 a {font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold; color:#004ca8; text-decoration:none;}.title_eb1 a:hover {color:#FF6600}';

		css += '.eb_top_name{ font-family:"Times New Roman", Times, serif;font-size:20px;padding:7px 0;font-weight:bold;color:#fce600;}';

		css += '#EnBac_Dantri_Hanghieu_120_Content .enbac_bottom1 {height:18px; width:108px; padding-top:1px} #EnBac_Dantri_Hanghieu_120_Content .enbac_bottom1 a,#EnBac_Dantri_Hanghieu_120_Content .enbac_bottom1 a:link, #EnBac_Dantri_Hanghieu_120_Content .enbac_bottom1 a:visited {text-decoration:none;color:#d3e9ff; font-family:Arial, Helvetica, sans-serif; font-size:11px}#EnBac_Dantri_Hanghieu_120_Content .enbac_bottom1 a:hover {text-decoration:none; color:#fcff00;font-family:Arial, Helvetica, sans-serif; font-size:11px}';

        var style = document.createElement('style');
        style.type = 'text/css';
        var head = document.getElementsByTagName('head')[0];
        head.appendChild(style);
        if(style.styleSheet)  // IE
            style.styleSheet.cssText = css;
        else  // other browserss
            style.appendChild(document.createTextNode(css));
    }

    this.InitScript = function()
    {
        var output = '';

		output += '<div align="center" style="width:118px; height:596px; border: 1px solid #2c2c2c;background-color:#000000"><div style="height:16px;"><a href="http://admicro.vn'+this.utm+'" target="_blank"><img src="' + this.script_folder + 'data/upload/dantri_top_hanghieu_120.gif" width="118" height="15" border="0" style="border:none;margin:0;padding:0" /></a></div>';

		output += '<div align="center"><div class="eb_top_name">HÀNG HIỆU</div><div id="EnBac_Dantri_Hanghieu_120_Item" style="width:118px;margin:0;padding:0" align="center"></div></div>'

		output += '<div class="enbac_bottom1" style="background:#000000;margin-top:3px" align="center"><a href="http://enbac.com/post_add.html'+this.utm+'" target="_blank"><img src="' + this.script_folder + 'data/upload/dantri_icon_hanghieu.gif"  border="none" align="absbottom" style="border:none" /> Liên hệ quảng cáo</a></div></div>';

		try{
		     if(document.getElementById('EnBac_Dantri_Hanghieu_120_Content')){
			document.getElementById('EnBac_Dantri_Hanghieu_120_Content').innerHTML = output;
		     }
		}
		catch (e){
                        //Do nothing?
        }



        this.CreateStyleSheet();
    }

    this.OnLoaded = function(data, methodName)
    {
        var json = eval(data);

        var output = '';
        var image_url = '';
		var item_link = '';
        
		
		


    	json.Items = this.Shuffle(json.Items);
		json.Items.length = (this.rand_limit > json.Items.length  ) ? json.Items.length : this.rand_limit;

		for (var i = 0; i < json.Items.length; i++)
        {
			var price = json.Items[i].Price;
			var numberText = '';
			var numberTextAll = '';
			priceType = price.split(' ');

			priceAllNumber = parseInt(priceType[0]);
			if (priceType[1] == '&euro;')
			{
				priceAllNumber = priceAllNumber*24200;
			}
			if (priceType[1] == '$')
			{
				priceAllNumber = priceAllNumber*18000;
			}
			json.Items[i].Price = this.numberFormat(priceAllNumber,0,',','.')+' VNĐ';

			image_url = '';
            if (json.Items[i].Image != '')
            {
				image_url = json.Items[i].Image;
            }
            else
            {
				image_url = this.script_folder+'data/upload/no-images-69x53.jpg';
            }
           
			
			item_link = this.base_url+json.Items[i].Link+this.utm;
			
			output += '<div id="enbac_item_'+json.Items[i].id+'" style="background:#fff;margin:0px 3px;  margin-top:3px;padding-top:1px"><div style="background:url(\''+image_url+'\') center 50% no-repeat;"><a href="'+item_link+'" target="_blank" style="border:none;margin:0;padding:0"><img src="'+this.script_folder+'data/upload/spacer.gif" width="106" height="112" border="0" alt="'+json.Items[i].Title+'" title="'+json.Items[i].Title+'" style="border:none;margin:0;padding:0" /></a></div><div style="color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:12px; height:14px; font-weight:bold;width:118px; overflow:hidden;" align="center">'+json.Items[i].Price+'</div></div>';

			
        }
		try{
		     if(document.getElementById('EnBac_Dantri_Hanghieu_120_Item')){
			document.getElementById('EnBac_Dantri_Hanghieu_120_Item').innerHTML = output;
		     }
		}
		catch (e){
                        //Do nothing?
        }

    }
	this.numberFormat = function( number, decimals, dec_point, thousands_sep )
	{

		var n = number, prec = decimals;
		n = !isFinite(+n) ? 0 : +n;
		prec = !isFinite(+prec) ? 0 : Math.abs(prec);
		var sep = (typeof thousands_sep == "undefined") ? ',' : thousands_sep;
		var dec = (typeof dec_point == "undefined") ? '.' : dec_point;

		var s = (prec > 0) ? n.toFixed(prec) : Math.round(n).toFixed(prec); //fix for IE parseFloat(0.55).toFixed(0) = 0;

		var abs = Math.abs(n).toFixed(prec);
		var _, i;

		if (abs >= 1000) {
			_ = abs.split(/\D/);
			i = _[0].length % 3 || 3;

			_[0] = s.slice(0,i + (n < 0)) +
				  _[0].slice(i).replace(/(\d{3})/g, sep+'$1');

			s = _.join(dec);
		} else {
			s = s.replace('.', dec);
		}

		return s;
	}
}

try{
	var url = window.location.href.toLowerCase();

	if ( url.indexOf('static.enbac.com/') > 0)
	{
		document.write('<div id="EnBac_Dantri_Hanghieu_120_Content" style="width:120px; height:600px;overflow:hidden" align="left"></div>');
	}
}
catch (e){
				//Do nothing?
}
		try{
			var enbac_dantri_hanghieu_120_600_data = new EnBac_Widget();
			enbac_dantri_hanghieu_120_600_data.InitScript();
			enbac_dantri_hanghieu_120_600_data.OnLoaded(({"Items":[{"id":"511344","Title":"Đầm Max Studio kiểu mẫu sang trọng, quý phái","Link":"Goc-hang-hieu/p511344/Dam-Max-Studio-kieu-mau-sang-trong-quy-phai.html","Link_sub":"c334/Trang-phuc","Price":"900000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/1263225008_2en_Fashion571f5f9e89a8f143a5b067d5a38930ca.gif"},{"id":"511380","Title":"Chanel , BVLGARI , GIVENCHY Món quà đặc biệt cho bạn gái","Link":"Goc-hang-hieu/p511380/Chanel-BVLGARI-GIVENCHY-Mon-qua-dac-biet-cho-ban-gai.html","Link_sub":"c338/My-pham-cao-cap","Price":"1299000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100108172614_83906377_300x300_0_0_chanel_chanel_n.jpg"},{"id":"515967","Title":"nước hoa polemic giá cực tốt mùi cực chuẩn hàng Mỹ xách tay","Link":"Goc-hang-hieu/p515967/nuoc-hoa-polemic-gia-cuc-tot-mui-cuc-chuan-hang-My-xach-tay.html","Link_sub":"c338/My-pham-cao-cap","Price":"1070000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100112091159_polemic_w.jpg"},{"id":"516145","Title":"A/X Armani Exchange Đầm vải tay ngắn phồng, cổ tim sâu","Link":"Goc-hang-hieu/p516145/A-X-Armani-Exchange-Dam-vai-tay-ngan-phong-co-tim-sau.html","Link_sub":"c334/Trang-phuc","Price":"1600000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/1263266914_2en_Fashion291dd4bfa05962880a36f858fff2795e.gif"},{"id":"517190","Title":"áo mango đính kim sa lấp lánh new 100","Link":"Goc-hang-hieu/p517190/ao-mango-dinh-kim-sa-lap-lanh-new-100.html","Link_sub":"c334/Trang-phuc","Price":"1000000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100112210818_sieuthinhanh2009122035351yju5ogqzyj8.jpeg"},{"id":"519032","Title":"Chuyên Túi Xách Kính Mát Thời Trang Hiệu ALDO. Xách tay chính hãng, mới 100 nguyên tem","Link":"Goc-hang-hieu/p519032/Chuyen-Tui-Xach-Kinh-Mat-Thoi-Trang-Hieu-ALDO-Xach-tay-chinh-hang-moi-100-nguyen-tem.html","Link_sub":"c335/Phu-kien-lam-dep","Price":"1300000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100113231020_aldo_miglianico_1.jpg"},{"id":"519749","Title":"Bán túi xách authentic YSL, Fendi, Salvatore Ferragamo và Lamarthe","Link":"Goc-hang-hieu/p519749/Ban-tui-xach-authentic-YSL-Fendi-Salvatore-Ferragamo-va-Lamarthe.html","Link_sub":"c335/Phu-kien-lam-dep","Price":"33000000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100119224527_img_2360.jpg"},{"id":"520428","Title":"HCM Áo Khoát Jean Levis Style 70507 Size M Hàng Ship USA","Link":"Goc-hang-hieu/p520428/HCM-Ao-Khoat-Jean-Levis-Style-70507-Size-M-Hang-Ship-USA.html","Link_sub":"c334/Trang-phuc","Price":"1200000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/1263478358_ly_drmartensf5cd731dd20c6ee5d6f5da312bc25d9c.gif"},{"id":"521327","Title":"Túi xách hàng hiệu từ Mỹ Express, Nine west, Guess, Fossil .Đẹp sang trọng .Nhanh tay chọn","Link":"Goc-hang-hieu/p521327/Tui-xach-hang-hieu-tu-My-Express-Nine-west-Guess-Fossil-Dep-sang-trong-Nhanh-tay-chon.html","Link_sub":"c335/Phu-kien-lam-dep","Price":"950000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100114234458_h35_express.jpg"},{"id":"521738","Title":"nhượng bán váy hiệu bebe hàng sách tay từ usa giá cực rẻ","Link":"Goc-hang-hieu/p521738/nhuong-ban-vay-hieu-bebe-hang-sach-tay-tu-usa-gia-cuc-re.html","Link_sub":"c334/Trang-phuc","Price":"1850000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100115165201_bebe2.jpg"},{"id":"521743","Title":"Guess super 50 SALES","Link":"Goc-hang-hieu/p521743/Guess-super-50-SALES.html","Link_sub":"c335/Phu-kien-lam-dep","Price":"1050000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100115163109_2010_01_15_163101.jpg"},{"id":"524577","Title":"1 đôi Bebe sport duy nhất đẹp long lanh vừa xách từ Mỹ về hôm 10 tây đây Sắm chơi tết là hết ý","Link":"Goc-hang-hieu/p524577/1-doi-Bebe-sport-duy-nhat-dep-long-lanh-vua-xach-tu-My-ve-hom-10-tay-day-Sam-choi-tet-la-het-y.html","Link_sub":"c335/Phu-kien-lam-dep","Price":"2000000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100117234142_2b.jpg"},{"id":"524706","Title":"Váy áo 100 usa bebe, ardenb, guess, f21, papaya .","Link":"Goc-hang-hieu/p524706/Vay-ao-100-usa-bebe-ardenb-guess-f21-papaya.html","Link_sub":"c334/Trang-phuc","Price":"800000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100119163032_41uudh8jppl__sl217_.jpg"},{"id":"525968","Title":"nước hoa Jean Paul Gaultier LE MALE hàng xịn xách tay đây","Link":"Goc-hang-hieu/p525968/nuoc-hoa-Jean-Paul-Gaultier-LE-MALE-hang-xin-xach-tay-day.html","Link_sub":"c335/Phu-kien-lam-dep","Price":"1000000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100118204045_h_jean_paul_gaultier_le_male.jpg"},{"id":"526087","Title":"Hàng hiệu Burberry xách tay bên mỹ,hàng thật 100 .hàng có sẵn","Link":"Goc-hang-hieu/p526087/Hang-hieu-Burberry-xach-tay-ben-my-hang-that-100-hang-co-san.html","Link_sub":"c334/Trang-phuc","Price":"2200000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100118214535_picture_676.jpg"},{"id":"527493","Title":"Nước hoa nữ hàng hiệu Chanel No.19 giá cực sốc","Link":"Goc-hang-hieu/p527493/Nuoc-hoa-nu-hang-hieu-Chanel-No-19-gia-cuc-soc.html","Link_sub":"c338/My-pham-cao-cap","Price":"2450000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100119162501_chanel_no19_mini_1261377478.jpg"},{"id":"528732","Title":"Tuí xách Nine west, Guess, xo xo, liz claiborne ha ng thật 100 xách tay tư Mĩ","Link":"Goc-hang-hieu/p528732/Tui-xach-Nine-west-Guess-xo-xo-liz-claiborne-ha-ng-that-100-xach-tay-tu-Mi.html","Link_sub":"c335/Phu-kien-lam-dep","Price":"800000 VNĐ","Image":"http://static.enbac.com/image_item/enbac_dantri_hanghieu_120_600/20100120100906_picture_148.jpg"}]}), "News_Enbac");
		}
		catch (e){
						//Do nothing?
		}