
function select_option(group, item)
{
	$("#products_options_" + group).val(item);
	$(".products_options_" + group).removeClass("active");
	$("#product_option_" + item).addClass("active");	
}

var div_scroll1 = new TextScroll('div_scroll1', 'scroller', 'scroll_up', 'scroll_down');


$(document).ready(function () {

      $(".dynatext").each(function (i) {
		text = $(this).html().replace("&amp;", "%26");
		color = $(this).css("color");
		size = parseFloat($(this).css("fontSize"));
		$(this).html("<img src=\"font?text=" + text + "&size=" + size + "&color=" + color + "\" onmouseover=\"this.src='font?text=" + text + "&size=" + size + "&color=orange'\" onmouseout=\"this.src='font?text=" + text + "&size=" + size + "&color=" + color + "'\"  />");
      });
/*

	Cufon.replace('.dynatext',{
		hover: { color: 'orange' }
	});
*/
});

var scroll_count = 0;
function scroll(cnt)
{
	scroll_count = scroll_count + cnt;
	//document.getElementById('scroller').scrollTop = scroll_count;
	$("#scroller").animate({scrollTop: scroll_count}, 1000);

}


/*
$(document).ready(function(){


	$("a.dynatext").hover(
		function () {
			text = $(this).text();
			alert(text);
		}, 
		function () {
		
		}
	);

});
*/



function TextScroll(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 5;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

{
        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {
                div_up_obj.setAttribute("onmouseover", scrollname + ".scrollUp();")
                div_up_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")

div_dn_obj.setAttribute("onmouseover", scrollname + ".scrollDown();")
                div_dn_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")
            }
        }
    }

this.stopScroll = function() {
        clearTimeout(this.timeoutID);
    }

this.scrollUp = function() {
        if (this.div_obj) {
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
        }
    }

this.scrollDown = function() {
        if (this.div_obj) {
            this.scrollCursor += this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
        }
    }

this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
    }
}

