//DD Tab Menu- Script rewritten April 27th, 07: http://www.dynamicdrive.com
//**Updated Feb 23rd, 08): Adds ability for menu to revert back to default selected tab when mouse moves out of menu
var ddtabmenu={disabletablinks:false,snap2original:[true,300],currentpageurl:window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,""),definemenu:function(a,b){this[a+"-menuitems"]=null;this[a+"-dselected"]=-1;this.addEvent(window,function(){ddtabmenu.init(a,b)},"load")},showsubmenu:function(b,a){var c=this[b+"-menuitems"];this.clearrevert2default(b);for(i=0;i<c.length;i++){c[i].className="";if(typeof c[i].hasSubContent!="undefined"){document.getElementById(c[i].getAttribute("rel")).style.display="none"}}a.className="current";if(typeof a.hasSubContent!="undefined"){document.getElementById(a.getAttribute("rel")).style.display="block"}},isSelected:function(a){var a=a.replace("http://"+a.hostname,"").replace(/^\//,"");return(ddtabmenu.currentpageurl==a)},isContained:function(a,b){var b=window.event||b;var d=b.relatedTarget||((b.type=="mouseover")?b.fromElement:b.toElement);while(d&&d!=a){try{d=d.parentNode}catch(b){d=a}}if(d==a){return true}else{return false}},revert2default:function(a,b,c){if(!ddtabmenu.isContained(a,b,c)){window["hidetimer_"+b]=setTimeout(function(){ddtabmenu.showsubmenu(b,ddtabmenu[b+"-dselected"])},ddtabmenu.snap2original[1])}},clearrevert2default:function(a){if(typeof window["hidetimer_"+a]!="undefined"){clearTimeout(window["hidetimer_"+a])}},addEvent:function(b,c,a){var a=(window.addEventListener)?a:"on"+a;if(b.addEventListener){b.addEventListener(a,c,false)}else{if(b.attachEvent){b.attachEvent(a,c)}}},init:function(c,d){var f=document.getElementById(c).getElementsByTagName("a");this[c+"-menuitems"]=f;for(var a=0;a<f.length;a++){if(f[a].getAttribute("rel")){this[c+"-menuitems"][a].hasSubContent=true;if(ddtabmenu.disabletablinks){f[a].onclick=function(){return false}}if(ddtabmenu.snap2original[0]==true){var e=document.getElementById(f[a].getAttribute("rel"));f[a].onmouseout=function(g){ddtabmenu.revert2default(e,c,g)};e.onmouseover=function(){ddtabmenu.clearrevert2default(c)};e.onmouseout=function(g){ddtabmenu.revert2default(this,c,g)}}}else{f[a].onmouseout=function(g){this.className="";if(ddtabmenu.snap2original[0]==true){ddtabmenu.revert2default(this,c,g)}}}f[a].onmouseover=function(){ddtabmenu.showsubmenu(c,this)};if(d=="auto"&&typeof b=="undefined"&&this.isSelected(f[a].href)){ddtabmenu.showsubmenu(c,f[a]);this[c+"-dselected"]=f[a];var b=true}else{if(parseInt(d)==a){ddtabmenu.showsubmenu(c,f[a]);this[c+"-dselected"]=f[a]}}}}};

/* get symbol */
function getSym(type, contract, limit, dich, url) {
    $.getJSON('../quotes/load_sym.php', {
        type: type,
        limit: limit,
        contract: contract
    }, function (result) {
        var html = "";
        for (var i = 0; i < url.length; i++) {
            html += '<li><a title="Tháng ' + result[i] + '" href="http://data.giacaphe.vn/charts/file/' + url[i] + "?_=" + Math.random() + '" class="thickbox"> Tháng ' + result[i] + '</a></li>';
        }
        if (html != "") {
            $(dich).html("<ul><li class='chart_icon'>Biểu đồ</li>" + html + "</ul>");
            $(dich + " li:last").addClass("last");
            tb_init(dich + ' a.thickbox');
        }
    });
}

/* quote process */
function ajaxUpdateQuotes(eType, eDiv, eIndex, eChange) { 
/*	eType: Kiểu dữ liệu lấy (string)
	eDiv: Các bảng được chọn (Array)
	eIndex: Các chỉ số cần lấy (Array)
	eChange: Các chỉ số cần thay đổi (Array)
*/
	
    $.ajax({
        type: "GET",
        url: "../quotes/get_quotes.php",
        cache: false,
        data: "type=" + eType,
        success: function (data) {
			data = data.replace(/<(span)[^>]*>[^<]*(<\/span>)/ig, "");
            var tables = data.split('#');
			//alert(tables);
            for (var i = 0; i < eDiv.length; i++) {
				
                var rows = tables[i].split('~');
                for (var j = 1; j < rows.length; j++) {
                    var cols = rows[j-1].split('|');
					//$('span#'+eDiv+'_tradetime').html(cols[15]);
					
                    for (k = 0; k < eIndex.length; k++) {
                        $(eDiv[i] + " tr:eq(" + j + ") " + "td:eq(" + k + ")").text(cols[eIndex[k]]);
                    }
                    for (var eC = 0; eC < eChange.length; eC++) {
                        var eClass = ($(eDiv[i] + " tr:eq(" + j + ") " + "td:eq(" + eChange[eC] + ")").text()[0] == '-') ? 'pdown' : (($(eDiv[i] + " tr:eq(" + j + ") " + "td:eq(" + eChange[eC] + ")").text()[0] == '+') ? 'pup' : '');
                        $(eDiv[i] + " tr:eq(" + j + ") " + "td:eq(" + eChange[eC] + ")").addClass(eClass);
                    }
                }
				$('span#'+eDiv[i]+'_tradetime').html(cols[15]);
            }
		
        }
    });
}

// search text hint
$(document).ready(function() {
	// When a link is clicked
	$("a.tab").hover(function() {

		// switch all tabs off
		$(".active").removeClass("active");

		// switch this tab on
		$(this).addClass("active");

		// slide all content up
		$(".tab_content").css("display", "none");
		// slide this content up
		var content_show = $(this).attr("rel");
		$("#" + content_show).css("display", "block");

	});
	$("a.tab").click(function() {
		return false;
	});
});

// resize entry image
function ResizeImages(selector, maxWidth) {
	//$('.story-small img').each(function() {
		
    $(selector + " img").each(function () {
		
		var iwidth = $(this).width();    // Current image width
    	var iheight = $(this).height();  // Current image height
		var i_height = Math.round((maxWidth/iwidth)*iheight);
		
        if (iwidth > maxWidth) {
			
			//var h1 = Math.round((maxWidth/$(this).width())*$(this).height());
			$(this).attr("height", i_height);
			$(this).attr("width", maxWidth);
			$(this).removeAttr("class")
            $(this).css("height",i_height+"px");
            $(this).css("width",maxWidth+"px");
			
            //$(this).attr('width', maxWidth);
            //$(this).attr('height', h1);
        }
    });
}

/* menu script */
$(function(){

    $("ul.dropdown li").hover(function(){
    
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    
    }, function(){
    
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    
    });
    
    $("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");

});

/* end menu */

$(document).ready(function(){
	$(".category_item .more_post").css("display","none");
	$(".category_item").hover(function(){
		$(this).children(".more_post").css("display","block");
	}, function(){
		$(this).children(".more_post").css("display","none");
	});
});

$(window).bind("load", function() {
	$('#vuongtx_eco610').html('<img src="http://opi.yahoo.com/online?u=vuongtx_eco610&amp;m=g&amp;t=1&amp;l=us" alt="Trần Xuân Vượng" height="16" width="64">');
	$('#nguyenvinhdaklak').html('<img src="http://opi.yahoo.com/online?u=nguyenvinhdaklak&amp;m=g&amp;t=1&amp;l=us" alt="Nguyễn Vịnh" height="16" width="64">');
	$('#levietvinh').html('<img src="http://opi.yahoo.com/online?u=levietvinh&amp;m=g&amp;t=1" alt="Kinh Vu!" width="64" height="16" />');
	$('#poorman_hcm').html('<img src="http://opi.yahoo.com/online?u=poorman_hcm&amp;m=g&amp;t=1" alt="Phạm Vỹ" width="64" height="16" />');
	$('#iso8x').html('<img src="http://opi.yahoo.com/online?u=coi_y5&amp;m=g&amp;t=1" alt="Thịnh còi" width="64" height="16" />');
	$('#hang113347').html('<img src="http://opi.yahoo.com/online?u=hang113347&amp;m=g&amp;t=1" alt="Thịnh còi" width="64" height="16" />');
});

/***********************************************
* IFrame SSI script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids = ["viethien", "subscribe", "lhcf"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide = "yes"

var getFFVersion = navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight = parseFloat(getFFVersion) >= 0.1 ? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function dyniframesize() {
    var dyniframe = new Array()
    for (i = 0; i < iframeids.length; i++) {
        if (document.getElementById) { //begin resizing iframe procedure
            dyniframe[dyniframe.length] = document.getElementById(iframeids[i]);
            if (dyniframe[i] && !window.opera) {
                dyniframe[i].style.display = "block"
                if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight) //ns6 syntax
                dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight + FFextraHeight;
                else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight) //ie5+ syntax
                dyniframe[i].height = dyniframe[i].Document.body.scrollHeight;
            }
        }
        //reveal iframe for lower end browsers? (see var above):
        if ((document.all || document.getElementById) && iframehide == "no") {
            var tempobj = document.all ? document.all[iframeids[i]] : document.getElementById(iframeids[i])
            tempobj.style.display = "block"
        }
    }
}

if (window.addEventListener) window.addEventListener("load", dyniframesize, false)
else if (window.attachEvent) window.attachEvent("onload", dyniframesize)
else
window.onload = dyniframesize


function bookmark()
{
	bookmarkurl="http://giacaphe.com"
	bookmarktitle="Y5cafe: Thông tin thị trường cà phê"
	if (document.all)
	window.external.AddFavorite(bookmarkurl,bookmarktitle)
	else if (window.sidebar) // firefox
	window.sidebar.addPanel(bookmarktitle, bookmarkurl, "");
}

// go top 
(function () {
    function goTop(a, t) {
        a = a || 0.1;
        t = t || 16;
        var x1 = 0;
        var y1 = 0;
        var x2 = 0;
        var y2 = 0;
        var x3 = 0;
        var y3 = 0;
        if (document.documentElement) {
            x1 = document.documentElement.scrollLeft || 0;
            y1 = document.documentElement.scrollTop || 0;
        }
        if (document.body) {
            x2 = document.body.scrollLeft || 0;
            y2 = document.body.scrollTop || 0;
        }
        var x3 = window.scrollX || 0;
        var y3 = window.scrollY || 0;
        var x = Math.max(x1, Math.max(x2, x3));
        var y = Math.max(y1, Math.max(y2, y3));
        var speed = 1 + a;
        window.scrollTo(Math.floor(x / speed), Math.floor(y / speed));
        if (x > 0 || y > 0) {
            var f = "Y5JS.goTop(" + a + ", " + t + ")";
            window.setTimeout(f, t);
        }
    }
    window['Y5JS'] = {};
    window['Y5JS']['$'] = $;
    window['Y5JS']['goTop'] = goTop;
})();

//add 10.01.2011
//$(document).bind("contextmenu",function(a){return false});$(function(){$.extend($.fn.disableTextSelect=function(){return this.each(function(){if($.browser.mozilla){$(this).css("MozUserSelect","none")}else{if($.browser.msie){$(this).bind("selectstart",function(){return false})}else{$(this).mousedown(function(){return false})}}})});$(".entry").disableTextSelect()});

//add 10.12.2011
//(function(){function a(m,n){m=m||0.1;n=n||16;var d=0;var l=0;var c=0;var j=0;var b=0;var h=0;if(document.documentElement){d=document.documentElement.scrollLeft||0;l=document.documentElement.scrollTop||0}if(document.body){c=document.body.scrollLeft||0;j=document.body.scrollTop||0}var b=window.scrollX||0;var h=window.scrollY||0;var k=Math.max(d,Math.max(c,b));var i=Math.max(l,Math.max(j,h));var e=1+m;window.scrollTo(Math.floor(k/e),Math.floor(i/e));if(k>0||i>0){var g="Y5JS.goTop("+m+", "+n+")";window.setTimeout(g,n)}}window.Y5JS={};window.Y5JS["$"]=$;window.Y5JS["goTop"]=a})();

//$(document).ready(function() {
//	$('.toolTip').hover(
//		function() {
//		this.tip = this.title;
//		$(this).append(
//			'<div class="toolTipWrapper">'
//				+'<div class="toolTipTop"></div>'
//				+'<div class="toolTipMid">'
//					+this.tip
//				+'</div>'
//			+'</div>'
//		);
//		this.title = "";
//		this.width = $(this).width();
//		$(this).find('.toolTipWrapper').css({left:this.width-22})
//		$('.toolTipWrapper').fadeIn(300);
//	},
//	function() {
//		$('.toolTipWrapper').fadeOut(100);
//		$(this).children().remove();
//			this.title = this.tip;
//		}
//	);
//});


/* Scroll top */
//var scrolltotop={
//	//startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control
//	//scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top).
//	setting: {startline:100, scrollto: 0, scrollduration:600, fadeduration:[500, 100]},
//	controlHTML: '<a href="#" id="back-to-top" title="Trở về đầu trang">Trở lên trên</a>', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol"
//	
//	controlattrs: {offsetx:5, offsety:5}, //offset of control relative to right/ bottom of window corner
//	anchorkeyword: '#back-to-top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links
//
//	state: {isvisible:false, shouldvisible:false},
//
//	scrollup:function(){
//		if (!this.cssfixedsupport) //if control is positioned using JavaScript
//			this.$control.css({opacity:0}) //hide control immediately after clicking it
//		var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto)
//		if (typeof dest=="string" && jQuery('#'+dest).length==1) //check element set by string exists
//			dest=jQuery('#'+dest).offset().top
//		else
//			dest=0
//		this.$body.animate({scrollTop: dest}, this.setting.scrollduration);
//	},
//
//	keepfixed:function(){
//		var $window=jQuery(window)
//		var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx
//		var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety
//		this.$control.css({left:controlx+'px', top:controly+'px'})
//	},
//
//	togglecontrol:function(){
//		var scrolltop=jQuery(window).scrollTop()
//		if (!this.cssfixedsupport)
//			this.keepfixed()
//		this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false
//		if (this.state.shouldvisible && !this.state.isvisible){
//			this.$control.stop().animate({opacity:1}, this.setting.fadeduration[0])
//			this.state.isvisible=true
//		}
//		else if (this.state.shouldvisible==false && this.state.isvisible){
//			this.$control.stop().animate({opacity:0}, this.setting.fadeduration[1])
//			this.state.isvisible=false
//		}
//	},
//	
//	init:function(){
//		jQuery(document).ready(function($){
//			var mainobj=scrolltotop
//			var iebrws=document.all
//			mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
//			mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
//			mainobj.$control=$('<div id="topcontrol">'+mainobj.controlHTML+'</div>')
//				.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, opacity:0, cursor:'pointer'})
//				.attr({title:'Scroll Back to Top'})
//				.click(function(){mainobj.scrollup(); return false})
//				.appendTo('body')
//			if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
//				mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
//			mainobj.togglecontrol()
//			$('a[href="' + mainobj.anchorkeyword +'"]').click(function(){
//				mainobj.scrollup()
//				return false
//			})
//			$(window).bind('scroll resize', function(e){
//				mainobj.togglecontrol()
//			})
//		})
//	}
//}
//
//scrolltotop.init()
//
//
//
///*********************/
function getScrollY() {
    scrOfY = 0;
    if( typeof( window.pageYOffset ) == "number" ) {
        scrOfY = window.pageYOffset;
    } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        scrOfY = document.body.scrollTop;
    } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        scrOfY = document.documentElement.scrollTop;
    }
    return scrOfY;
}

jQuery(function($){
    var upprev_closed = false;
    var upprev_hidden = true;
    $(window).scroll(function() {
        var lastScreen;
        if ($("#page_wrap").length > 0)
            lastScreen = getScrollY() + $(window).height() < $("#page_wrap").offset().top * 1 ? false : true;
        else
            lastScreen = getScrollY() + $(window).height() < $(document).height() * 1 ? false : true;
        if (lastScreen && !upprev_closed) {
            $("#upprev_box").stop().animate({right:"0px"});
            upprev_hidden = false;
        }
        else if (upprev_closed && getScrollY() == 0) {
            upprev_closed = false;
        }
        else if (!upprev_hidden) {
            upprev_hidden = true;
            $("#upprev_box").stop().animate({right:"-400px"});
        }
    });
    $("#upprev_close").click(function() {
        $("#upprev_box").stop().animate({right:"-400px"});
        upprev_closed = true;
        upprev_hidden = true;
    });
});

/**
 * Lấy bảng giá rút gọn 
 * Since 20/01/2012 by @cunhat
 */
$.fn.extend({
    bindMiniQuotes: function (eDiv,js) {
            $(eDiv+" .last").text(js.Last);
            $(eDiv+" .change").text(js.Change);
			
			js.Change = js.Change.replace("+", ""); 
			
			$(eDiv+" #quote_status").removeClass('quote_up quote_down');
			
			//var mau = (js.Change > 0) ? 'quote_up' : 'quote_down';
			 if (js.Change > 0) {
				 $("#quote_status").addClass("quote_up");
			 } else if (js.Change < 0) {
				 $("#quote_status").addClass("quote_down");
			 } else {
				 $("#quote_status").addClass("quote_not");
			 }
			 
			 //$(eDiv+" #quote_status").addClass(mau);
			
            $(eDiv+" .pctchange").text('(' + js.PtcChange + '%)');

			$(".clock").text(js.Time);
			$("#open").text(js.Open);
			$("#prev").text(js.Previous);
			$("#high").text(js.High);
			$("#low").text(js.Low);
			$("#month_id").text(js.Month)
    },
    parseJsonToMiniQuote: function (path, eDiv, sid, token) {
        $.ajax({
            url: path,
            type: 'GET',
            data: 'sid=' + sid + '&token=' + token,
            success: function (data) {
                if (data.length > 0) {
                    var json = $.parseJSON(data);
                    $.fn.bindMiniQuotes(eDiv,json);
                }
            }
        });
    }
});

/**
 * Lấy bảng giá đầy đủ
 * Since 21/01/2012 by @cunhat
 */
$.fn.extend({
	
	currencyFormat: function(str) {
			
			str = parseFloat(str).toFixed(2);
//            this.each( function( i ) {
//				this.value = parseFloat(this.value).toFixed(2);
//                $(this).change( function( e ){
//                    if( isNaN( parseFloat( this.value ) ) ) return;
//                    this.value = parseFloat(this.value).toFixed(2);
//                });
//            });
            return str; //for chaining
	},
    
	bindData: function (id, js, format) {

		$("#" + id + " tr:eq td:eq(2)", "#" + id + " tr:eq td:eq(3)").removeClass();

        for (var j = 0; j < js.length; j++) {
			
            $("#" + id + " tr:eq(" + (j + 1) + ") td:eq(0)").text(js[j].Month);
			
            //$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(1)").text(js[j].Last);
			
			$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(1)").text(format ? $.fn.currencyFormat(js[j].Last) : js[j].Last);// Sua o day
			
            //$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(2)").text(js[j].Change);
			$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(2)").text(format ? $.fn.currencyFormat(js[j].Change) : js[j].Change);
			
			if(js[j].Change > 0) {
				$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(2)").addClass("pup");
				$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(3)").addClass("pctup");
			} else if(js[j].Change < 0) {
				$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(2)").addClass("pdown");
				$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(3)").addClass("pctdown");
			}
            
			//$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(3)").text(js[j].PtcChange);
			//$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(3)").text(format ? $.fn.currencyFormat(js[j].PtcChange) : js[j].PtcChange);
			$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(3)").text($.fn.currencyFormat(js[j].PtcChange));
            $("#" + id + " tr:eq(" + (j + 1) + ") td:eq(4)").text(js[j].Volume);
			
            //$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(5)").text(js[j].High);
			$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(5)").text(format ? $.fn.currencyFormat(js[j].High) : js[j].High);
			
            //$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(6)").text(js[j].Low);
			$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(6)").text(format ? $.fn.currencyFormat(js[j].Low) : js[j].Low);
			
            //$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(7)").text(js[j].Open);
			$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(7)").text(format ? $.fn.currencyFormat(js[j].Open) : js[j].Open);
			
            //$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(8)").text(js[j].Previous);
			$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(8)").text(format ? $.fn.currencyFormat(js[j].Previous) : js[j].Previous);
			
            $("#" + id + " tr:eq(" + (j + 1) + ") td:eq(9)").text(js[j].OpInt);
			
			$("#" + id + " tr:eq(" + (j + 1) + ") td:eq(10)").html('<a class="icon_chart" href="http://giacaphe.com/bieu-do-ca-phe-truc-tuyen/?ky_han='+encodeURI(js[j].Name)+'" title="Xem biểu đồ"> </a>');
        }
    },
    updateQuotes: function (filename, path, eDiv, sid, token, timeUpdate, format) {
        $.ajax({
            url: path,
            type: 'GET',
            data: 'sid=' + sid + '&token=' + token + "&file=" + filename,

            success: function (data) {
				
				var dtsReturn = data.split("||");
				
				if(timeUpdate != 'no') {
					$(timeUpdate).html(dtsReturn[0]);
				}
					
                    var json = $.parseJSON(dtsReturn[1]);
                    $.fn.bindData(eDiv, json, format);
            }
        });
    }
});
