	function hoverTab(tabData){
		tabData.style.backgroundPosition = " 0% -50px";
		tabData.style.lineHeight = "24px";
	}
	
	function outTab(tabData){
		tabData.style.backgroundPosition = " 0% -25px";
	}
	
	function executeTab(tabData){
		tabData.className = "tabactive";
		tabData.style.backgroundPosition = " 0% -0px";
		tabData.onmouseover=function(){};
		tabData.onmouseout=function(){};
	}
	
	function showTabData(idForDisplay){
		var tabFeatured = document.getElementById('tab-featured'); 
		var tabToprated = document.getElementById('tab-toprated');
		var tabMostview = document.getElementById('tab-mostview');
		
		var featuretab = document.getElementById('featuretab');
		var topratedtab = document.getElementById('topratedtab');
		var mostviewedtab = document.getElementById('mostviewedtab');
		
		tabFeatured.style.display = "none";
		tabToprated.style.display = "none";
		tabMostview.style.display = "none";
		 
		featuretab.className = "";
		topratedtab.className = "";
		mostviewedtab.className = "";
		
		featuretab.style.backgroundPosition = " 0% -25px";
		topratedtab.style.backgroundPosition = " 0% -25px";
		mostviewedtab.style.backgroundPosition = " 0% -25px";
		
		featuretab.onmouseover=function(){hoverTab(this);}
		topratedtab.onmouseover=function(){hoverTab(this);}
		mostviewedtab.onmouseover=function(){hoverTab(this);}
		
		featuretab.onmouseout=function(){outTab(this);}
		topratedtab.onmouseout=function(){outTab(this);}
		mostviewedtab.onmouseout=function(){outTab(this);}
		
		if (idForDisplay == "featured"){
			tabFeatured.style.display = "block";
			executeTab(featuretab);
		}
		else if(idForDisplay == "toprated"){
			tabToprated.style.display = "block";
			executeTab(topratedtab);
		}
		else if(idForDisplay == "mostview"){
			tabMostview.style.display = "block";
			executeTab(mostviewedtab);
		}

 	}

    function switch_tab(idForDisplay){

        var tabInteract=document.getElementById('interact');
        var tabShare=document.getElementById('share');
        var tabComment=document.getElementById('comment');

        var Interact=document.getElementById('tinteract');
        var Share=document.getElementById('tshare');
        var Comment=document.getElementById('tcomment');

        tabInteract.style.display = "none";
        tabShare.style.display = "none";
        tabComment.style.display = "none";

        Interact.className = "";
        Share.className = "";
        Comment.className = "";

        if (idForDisplay == "interact"){
			tabInteract.style.display = "block";
            Interact.className = "selected_tab";
		}
		else if(idForDisplay == "share"){
			tabShare.style.display = "block";
            Share.className = "selected_tab";
		}
		else if(idForDisplay == "comment"){
			tabComment.style.display = "block";
            Comment.className = "selected_tab";
		}
    }


    function showtab(idForDisplay, lid){

        var tabfeatured=document.getElementById('featured');
        var tabrecently=document.getElementById('recently_c');
        var tabviewed=document.getElementById('viewed');
        var tabchannels=document.getElementById('channels');

        var featured=document.getElementById('featuredt');
        var recently=document.getElementById('recentlyt');
        var viewed=document.getElementById('viewedt');
        var channels=document.getElementById('channelst');

        tabfeatured.style.display = "none";
        tabrecently.style.display = "none";
        tabviewed.style.display = "none";
        tabchannels.style.display = "none";

        featured.className = "";
        recently.className = "";
        viewed.className = "";
        channels.className = "";

        if (idForDisplay == "featured"){
			tabfeatured.style.display = "block";
            featured.className = "selected_tab_index";

		}
		else if(idForDisplay == "recently"){
			tabrecently.style.display = "block";
            recently.className = "selected_tab_index";
		}
		else if(idForDisplay == "viewed"){
			tabviewed.style.display = "block";
            viewed.className = "selected_tab_index";
		}
        else if(idForDisplay == "channels"){
			tabchannels.style.display = "block";
            channels.className = "selected_tab_index";
		}
        $f('splash').play(lid);
    }

function setCookie(c_name,value,expiredays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}

function getCookie(c_name)
{
    if (document.cookie.length>0)
      {
      c_start=document.cookie.indexOf(c_name + "=");
      if (c_start!=-1)
        {
        c_start=c_start + c_name.length+1;
        c_end=document.cookie.indexOf(";",c_start);
        if (c_end==-1) c_end=document.cookie.length;
        return unescape(document.cookie.substring(c_start,c_end));
        }
      }
    return "";
}