
//Erase/Set/Read Language Cookie
function setFontSizeOnLoad () {	
	setFontSize(ReadCookie('userFontSize'));
	//alert(ReadCookie('userFontSize'));
}
function ReadCookie(cookieName) {
	var theCookie=""+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=="") return ""; 
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length; 
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
function setFontSize (sUserSelectedFontSize) {
	eraseCookie()
	document.getElementById('setFontClass').className = sUserSelectedFontSize;
	document.cookie = "userFontSize="+sUserSelectedFontSize+";path=/";
}
function eraseCookie() {
	document.cookie = 'userFontSize=""; path=/; expires= 1)';
	document.cookie = 'userFontSize=""; expires= 1)';
}

// **************************
// Init the tabs
function init_tabs() {
    // Check if needs to hide the tabs without text
    var edit = false;
    var show = true;
    if ($('#tabs li input').size() > 0) edit = true;
    if (!edit) {
        show = false;
        $('#tabs li a').each(function () {
            if ($(this).text().replace(/[\s\xA0]+/g, '').trim() == "") {
                $(this).parent().css('display', 'none');
            } else {
                show = true;
            }
        });
    }

    $(".tab_content").hide(); //Hide all content
    if (show) {
        $("#tabs li:first").addClass("active").show(); //Activate first tab
        $(".tab_content:first").show(); //Show first tab content


        //On Click Event
        $("#tabs li").click(function () {

            $("#tabs li").removeClass("active"); //Remove any "active" class
            $(this).addClass("active"); //Add "active" class to selected tab
            $(".tab_content").hide(); //Hide all tab content

            var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
            $(activeTab).fadeIn(); //Fade in the active ID content
            return false;
        });
    } else {
        $('#tabs').css('display', 'none');
        $('#tab_container').css('display', 'none');
    }
}
// end of Init the products tabs
//****************************
