function jQum(id){
    var el = document.getElementById(id);

    el.addClass = function(class_name)
    {
        var classes = this.className.split(/\s/);
        classes.push(class_name);
        var new_class = classes.join("");
        this.className = new_class;
    }

    el.removeClass = function(class_name)
    {
        var classes = this.className.split(/\s/);
        var new_classes = new Array();

        for (var i in classes)
        {
            if (classes[i] != class_name)
                new_classes.push(classes[i]);
        }
        var new_class = new_classes.join("");
        this.className = new_class;
    }

    return el;
}

function x(n)
{
/*	document.getElementById('product_tab_'+n);*/

	for (i=0; i<10; i++)
	{
			if (document.getElementById('product_tab_'+i)) jQum('product_tab_'+i).removeClass('product_tab_active');
	}

	jQum('product_tab_'+n).addClass('product_tab_active');

	for (i=0; i<10; i++)
	{
			if (document.getElementById('gk_product_tab_'+i)) jQum('gk_product_tab_'+i).removeClass('invisible');
	}

	for (i=0; i<10; i++)
	{
			if (document.getElementById('gk_product_tab_'+i)) jQum('gk_product_tab_'+i).addClass('invisible');
	}

	jQum('gk_product_tab_'+n).removeClass('invisible');


	
	
/*		$$('#gk_product_tabs li').each(function(el, i){
			el.addEvent("click", function(e){
				$$('.gk_product_tab').addClass('gk_unvisible');
				$$('.gk_product_tab')[i].removeClass('gk_unvisible');
				$$('#gk_product_tabs li').setProperty('class', '');
				$$('#gk_product_tabs li')[i].setProperty('class', 'gk_product_tab_active');
			});
		});*/

}

function set_c()
{
		var objSel = document.getElementById("setting_val");
		
		for (var i=0; i < objSel.options.length; i++)
  	{
			if (document.getElementById('cp_'+i)) jQum('cp_'+i).removeClass('cp_invis');
			if (document.getElementById('bp_'+i)) jQum('bp_'+i).removeClass('cp_invis');
		}
		
		for (var i=0; i < objSel.options.length; i++)
  	{
			if (document.getElementById('cp_'+i)) jQum('cp_'+i).addClass('cp_invis');
			if (document.getElementById('bp_'+i)) jQum('bp_'+i).addClass('cp_invis');
		}
		
		for (var i=0; i < objSel.options.length; i++)
  	{
			if (objSel.options[i].selected)
			{
			 	//alert (objSel.options[i].value);
				if (document.getElementById('cp_'+i)) jQum('cp_'+i).removeClass('cp_invis');
				if (document.getElementById('bp_'+i)) jQum('bp_'+i).removeClass('cp_invis');
			}
  	}

}




