
/* home college conference standings */
function changeStandings() {
    cgender = document.standings.cgender.value;
    conferenceId = document.standings.conferenceId.value;
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_mini_conferenceStandings&submits=true&cgender=' + cgender + '&conferenceId=' + conferenceId,
		cache: false,
		success: function(html){
            id = 'conference_standings';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}
/*  college home mini scores */
function changeScoress() {
	changeScores(false);
}
function changeScores(isDD) {
    gender = document.scores.gender.value;
    conferenceId = document.scores.conferenceId.value;
    week = document.scores.week.value;
    if (!isDD) {date = document.scores.date.value;week="";} else {date = "";}
    $.ajax({
			url: '/?option=com_ajax&task=module&command=tds_mini_college_scores&submits=true&gender=' + gender + '&conferenceId=' + conferenceId + '&date=' + date + '&week=' + week + '&isDD=' + isDD,
		cache: false,
		success: function(html){
            id = 'scoresResults';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}
/*  college details - article tab */
function changeArticlePage(page) {
    collegeId = document.articles.collegeId.value;
    gender = document.articles.gender.value;
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_clg_college_details&collegeId=' + collegeId + '&gender=' + gender + '&tab=articles&submit=true&page=' + page,
		cache: false,
		success: function(html){
            id = 'user1';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}
/*  college details - scores table */
function changeScoresPage(pn) {
    collegeId = document.scores.collegeId.value;
    gender = document.scores.gender.value;
    
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_clg_college_details&collegeId=' + collegeId + '&gender=' + gender + '&scores=true&pn=' + pn,
		cache: false,
		success: function(html){
            id = 'scores';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}
/*  college conference details - article tab */
function changeConferenceArticlePage(page) {
//	alert(page);
    conferenceId = document.articles.conferenceId.value;
    gender = document.articles.gender.value;
    
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_clg_conference_details&conferenceId=' + conferenceId + '&gender=' + gender + '&tab=articles&submit=true&page=' + page,
		cache: false,
		success: function(html){
            id = 'user2';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}
/* blogs */
var ids=new Array('blog1','blog2','blog3','blog4');
function switchid(id){hideallids(); showdiv(id);}
function hideallids(){for (var i=0;i<ids.length;i++){hidediv(ids[i]);}}
function hidediv(id) {
    if (document.getElementById && document.getElementById(id) && document.getElementById(id).style) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
	else if (document.all.id && document.all.id.style) {document.all.id.style.display = 'none';}}}
	function showdiv(id) {if (document.getElementById && document.getElementById(id)) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else if (document.all.id) {document.all.id.style.display = 'block';}}}
function doRed(obj) {
   var linkList = document.getElementById("blogNavigation").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected"; obj.idName = "current";}
function doBlack(obj) {
   var linkList = document.getElementById("blogNavigation").getElementsByTagName("a");
   obj.className = "";}

 /* home hot products */
var hotproductIDS=new Array('pd1','pd2');
function switchproductid(id){hideallidshotproduct(); showdiv(id);}
function hideallidshotproduct(){for (var i=0;i<hotproductIDS.length;i++){hidedivhotproduct(hotproductIDS[i]);}}
function hidedivhotproduct(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showdiv( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}

function doRedHotProduct(obj) {
   var linkList = document.getElementById("navigationHotProducts").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}

function doBlackHotProduct(obj) {
   var linkList = document.getElementById("navigationHotProducts").getElementsByTagName("a");
   obj.className = "";}
   
 /* right hot products */
var hotproductIDS=new Array('pd1','pd2');
function switchproductid(id){hideallidshotproduct(); showdiv(id);}
function hideallidshotproduct(){for (var i=0;i<hotproductIDS.length;i++){hidedivhotproduct(hotproductIDS[i]);}}
function hidedivhotproduct(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showdiv( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}
function doRedRightHotProduct(obj) {
   var linkList = document.getElementById("rightNavigationHotProducts").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}
function doBlackRightHotProduct(obj) {
   var linkList = document.getElementById("rightNavigationHotProducts").getElementsByTagName("a");
   obj.className = "";}


/* new top100 */
var top100IDS=new Array('t1','t2','t3','t4');
function switchid100(id){hideallids100(); showdiv(id);}
function hideallids100(){for (var i=0;i<top100IDS.length;i++){hidediv100(top100IDS[i]);}}
function hidediv100(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showdiv( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}

function doRed100(obj) {
   var linkList = document.getElementById("topNavigation").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}

function doBlack100(obj) {
   var linkList = document.getElementById("topNavigation").getElementsByTagName("a");
   obj.className = "";}

/* club home teamrank */
var top10TeamRankIds=new Array('c1','c2');
function switchTeamRankId(id){hideallidsTeamRank(); showdiv(id);}
function hideallidsTeamRank(){for (var i=0;i<top10TeamRankIds.length;i++){hidedivTeamRank(top10TeamRankIds[i]);}}
function hidedivTeamRank(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showdiv( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}
function doRedTeamRank10(obj) {
   var linkList = document.getElementById("top10TeamRankNavigation").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}
function doBlackTeamRank10(obj) {
   var linkList = document.getElementById("top10TeamRankNavigation").getElementsByTagName("a");
   obj.className = "";}

 /* usfc home roster */
var rosterIDS=new Array('rs1','rs2');
function switchrosterid(id){hideallidsroster(); showdiv(id);}
function hideallidsroster(){for (var i=0;i<rosterIDS.length;i++){hidedivroster(rosterIDS[i]);}}
function hidedivroster(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showdiv( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}
function doRedRoster(obj) {
   var linkList = document.getElementById("navigationUsfcRoster").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}
function doBlackRoster(obj) {
   var linkList = document.getElementById("navigationUsfcRoster").getElementsByTagName("a");
   obj.className = "";}


function enableMenu(menuId, selected, category, categorySelected)
{
	$(menuId).hover(
	function(){
		$(this).find('ul').show(); 
		$(this).addClass('lihover'); 
		$(this).find('a').css('color','#002277');
		if (!categorySelected) { 
			$(category).removeClass('top_row');
			$(category).addClass('top_row_on');
		}
		}, 
	function(){
		$(this).find('ul').hide();
		$(this).removeClass('lihover');
		$(this).find('a').css('color',selected?'#002277':'#ffffff');
		if (!categorySelected) {
			$(category).removeClass('top_row_on');
			$(category).addClass('top_row');
		} 
	}
	); 
}
/*
function doYellow(divId,selected)
{
	$(divId)(
		function(){
			$(this).removeClass('h_title');
			$(this).removeClass('h_title_yw');
			},
		function(){
			$(this).removeClass('h_title_yw');
			$(this).removeClass('h_title');
			}
	)
}
*/
/* home college tournament bracket */
var topbracketIDS=new Array('bracket1','bracket2');

function switchBracket(id){hideallB(); showB(id);}
function hideallB(){for (var i=0;i<topbracketIDS.length;i++){hideB(topbracketIDS[i]);}}
function hideB(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showB( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}
function doRedBracket(obj) {
   var linkList = document.getElementById("topBracket").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}
function doBlackBracket(obj) {
   var linkList = document.getElementById("topBracket").getElementsByTagName("a");
   obj.className = "";}
   
/* home college tournament bracket */
function changeBracket() {
    gender = document.bracket.gender.value;
    bracket = document.bracket.bracket.value;
    
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_clg_home_tournament_bracket&submits=true&gender=' + gender + '&bracket=' + bracket,
		cache: false,
		success: function(html){
            id = 'bracketResults';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}

/* home new featured article module */

function positionOverlay(tabnr) {
		//functii de calcul pentru text-overlay
	inaltime = $("#mod_tab"+tabnr+" #over_2 h3").height() + $("#mod_tab"+tabnr+" #over_2 div").height() + 26;
	inaltime_text = inaltime +"px";
//	top_text = (-inaltime-26) + "px";
	top_text = (-inaltime) + "px";
	$("#mod_tab"+tabnr+" #over_1").css({top:top_text, height:inaltime_text});
}

function calc(modtab)
{
	switch (modtab){
		case 'stories':	tabnr = 1; break; 
		case 'videos':	tabnr = 3; break;
		case 'rankings':tabnr = 2; break;
		case 'discover':tabnr = 4; break;
		case 'popular':tabnr = 4;  break;
	}

	inaltime = $("#mod_tab"+tabnr+" #over_2 h3").height() + $("#mod_tab"+tabnr+" #over_2 div").height() + 26;
	inaltime_text = inaltime +"px";
//	top_text = (-inaltime-26) + "px";
	top_text = (-inaltime) + "px";
	$("#mod_tab"+tabnr+" #over_1").css({top:top_text, height:inaltime_text});
	//alert('tab: '+tabnr+' h: '+inaltime);
	/*$("#mod_tab"+tabnr+" #over_1").css({height:inaltime_text});
	$("#mod_tab"+tabnr+" #over_1").animate({"top":top_text},10);*/
}

function showFeaturedNews(topId,sectionid,isvideo,modtab) {
	
	//alert('/?option=com_ajax&task=module&command=tds_featured_article&topId=' + topId + '&sectionid=' + sectionid + '&isvideo=' + isvideo);
	$('#featured_items_'+modtab+' .carotier').removeClass('featured_carot_active');
	$('#featured_items_'+modtab+' .carotier').addClass('featured_carot');
	
	$('.c'+topId).addClass('featured_carot_active');
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_featured_article&isClick=1&topId=' + topId + '&sectionid=' + sectionid + '&isvideo=' + isvideo + '&modtab=' + modtab,
		cache: false,
		success: function(html){
			id = 'featured_top_' + modtab;
			//alert(id);
//			alert('tab: '+tabnr+' h: '+inaltime);
			
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
			setTimeout('calc("'+modtab+'")',0);
			//
      }
    });
	
	/**/
	
}
/* home new featured article module */
var topfeaturedtabIDS=new Array('mod_tab1','mod_tab2','mod_tab3','mod_tab4');
var	player = null;

function switchFeaturedTab(id){hideallF(); showF(id);resetallT();activateT(id);}
function stateListener(obj) { 
    currentState = obj.newstate; 
    var tmp = document.getElementById("statId");
    if (tmp) { tmp.innerHTML = "state: " + currentState; }
}

function hideallF(){
	for (var i=0;i<topfeaturedtabIDS.length;i++)
		{hideF(topfeaturedtabIDS[i]);
		}
	//player=document.getElementById('thePlayer');
	//zplayer = player.id;
	//player.sendEvent('STOP');
}
function resetallT(){for (var i=1;i<=topfeaturedtabIDS.length;i++){
	tabid="featured_tab_"+i;document.getElementById(tabid).className='featured_tab';
	separatorid = "featured_separator_"+i;document.getElementById(separatorid).className='featured_tab_separator';}}
	
function activateT(id){
	var tabnr=id.substring(id.length-1,id.length);
	tabid="featured_tab_"+tabnr;document.getElementById(tabid).className='featured_tab_selected';
	separatorid = "featured_separator_"+tabnr;document.getElementById(separatorid).className='featured_tab_separator_selected';
	//alert (tabnr);
		//functii de calcul pentru text-overlay
	inaltime = $("#mod_tab"+tabnr+" #over_2 h3").height() + $("#mod_tab"+tabnr+" #over_2 div").height() + 26;
	inaltime_text = inaltime +"px";
//	top_text = (-inaltime-26) + "px";
	top_text = (-inaltime) + "px";
	$("#mod_tab"+tabnr+" #over_1").css({top:top_text, height:inaltime_text});
	}
	
function hideF(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showF(id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}
function doRedFeaturedTab(obj) {
   var linkList = document.getElementById("mod_tab").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}
function doBlackFeaturedTab(obj) {
   var linkList = document.getElementById("mod_tab").getElementsByTagName("a");
   obj.className = "";}
   
/* home ptw player update */
function changePlayerUpdate(page) {
	playerId = document.update.playerId.value;
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_ptw_mini_update&submits=true&pn=' + page + '&playerId=' + playerId,
		cache: false,
		success: function(html){
            id = 'ptw_update';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}   
/* trm home featured tournaments */
function changeFeaturedTournaments(page) {	
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_trm_featured_tournaments&submits=true&pn=' + page,
	
		cache: false,
		success: function(html){
            id = 'featured';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}    
/* product showcase home featured companies */
function changeFeaturedCompanies(page,name,categoryId) {	
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_tech_featured_products&submits=true&name=' + name + '&categoryId=' + categoryId + '&pn=' + page,
	
		cache: false,
		success: function(html){
            id = 'featured';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}   
/* club home mini commitments */
function changeClgCommitments(page,section) {
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_mini_commitments&submits=true&pn=' + page + '&mod_section=' + section,
		cache: false,
		success: function(html){
            id = 'clg_commitments';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}
/* corner kick comment form */
function sendCornerKickEmail() {
    email = document.corneremail.email.value;
    name = document.corneremail.name.value;
    text = document.corneremail.text.value;
    category = document.corneremail.category.value;
    videoId = document.corneremail.videoId.value;
    videoName = document.corneremail.videoName.value;
//	alert('/?option=com_ajax&task=module&command=tds_corner_kick&submits=true&email=' + email + '&name=' + name + '&text=' + text + '&category=' + category + '&videoId = ' + videoId + '&videoName=' + videoName);
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_corner_kick&submits=true&email=' + email + '&name=' + name + '&text=' + text + '&category=' + category + '&videoId = ' + videoId + '&videoName=' + videoName,
		cache: false,
		success: function(html){
            id = 'corner_form';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}   
/* TDS Live pre-event landing page - collect emails */
function changeCollectEmails() {
    email = document.collect_emails.email.value;
    email2 = document.collect_emails.email_2.value;	
   // alert(email);
    $.ajax({
		url: '/?option=com_ajax&task=module&command=tds_collect_emails&submits=true&email=' + email + '&email_2=' + email2,
	
		cache: false,
		success: function(html){
            id = 'collectEmails';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}

/* live banners */

var liveBcid = 0;
var liveBdebug = false;
var liveBtimeout = 30000;
var liveBhas = false; 

function Fnarray() 
{ 
    this.funcs = new Array(); 
} 

Fnarray.prototype.add = function(f)
{
	if (liveBdebug) alert('liveb add');
	if( typeof f != "function" )
	{
		f = new Function(f);
	}
	this.funcs[this.funcs.length] = f;
}

Fnarray.prototype.execute = function()
{
	if (liveBdebug) alert('liveb execute');
	if (liveBdebug) alert(this.funcs.length);
	for( var i = 0 ; i < this.funcs.length ; i++ )
	{
		if (liveBdebug) alert("exec " + this.funcs[i]);
		this.funcs[i]();
	}
	setTimeout("liveBf.getClient()", liveBtimeout);
}

Fnarray.prototype.getClient = function()
{
	if (liveBdebug) alert('liveb getClient');
	$.ajax({
		url: '/index.php?option=com_ajax&task=module&command=banners&action=getClient',
		cache: false,
		success: function(html){
		    eval(html);
		    liveBf.execute();
		}
	});
}

Fnarray.prototype.start = function()
{
	// load a new client
	if (liveBdebug) alert('liveb start');
	setTimeout("liveBf.getClient()", liveBtimeout);
}

Fnarray.prototype.reload = function(id,catid)
{
	if (liveBdebug) alert('liveb reload ' + liveBcid);
	$.ajax({
		url: '/index.php?option=com_ajax&task=module&command=banners&action=getBanner&catid=' + catid + '&cid=' + liveBcid,
		cache: false,
		success: function(html){
		    if (document.getElementById) {
		            document.getElementById(id).innerHTML = html;
		    }
		    else {
		            if (document.layers) { // Netscape 4
		                    document.id.innerHTML = html;
		            }
		            else { // IE 4
		                    document.all.id.innerHTML = html;
		            }
		    }
		}
	});
}

Fnarray.prototype.reload_logos = function(id)
{
	if (liveBdebug) alert('liveb reload logos ' + liveBcid);
	$.ajax({
		url: '/index.php?option=com_ajax&task=module&command=tds_TdsLive_sponsors&ajax=true',
		cache: false,
		success: function(html){
		    if (document.getElementById) {
		            document.getElementById(id).innerHTML = html;
		    }
		    else {
		            if (document.layers) { // Netscape 4
		                    document.id.innerHTML = html;
		            }
		            else { // IE 4
		                    document.all.id.innerHTML = html;
		            }
		    }
		}
	});
}

var liveBf = new Fnarray();

/* world cup blogs */
function showWCBlog() {
    nid = document.wcblogs.nid.value;
    $.ajax({
		url: '/index.php?option=com_ajax&task=module&command=wc_blogs&show_blog=true&nid=' + nid,
		cache: false,
		success: function(html){
            id = 'wc_blogs';
            if (document.getElementById) {
                document.getElementById(id).innerHTML = html;
            }
            else {
                if (document.layers) { // Netscape 4
                        document.id.innerHTML = html;
                }
                else { // IE 4
                        document.all.id.innerHTML = html;
                }
            }
      }
    });
}
/* right world cup results */
var wcIDS=new Array('g1','g2','g3','g4','g5','g6','g7','g8');
function switchwcid(id){hideallidswc(); showdivwc(id);}
function hideallidswc(){for (var i=0;i<wcIDS.length;i++){hidedivwc(wcIDS[i]);}}
function hidedivwc(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showdivwc( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}
function doRedRightWorldCup(obj) {
   var linkList = document.getElementById("rightNavigationWorldCup").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}
function doBlackRightWorldCup(obj) {
   var linkList = document.getElementById("rightNavigationWorldCup").getElementsByTagName("a");
   obj.className = "";}

/* ptw home college top100 */
var topClgIDS=new Array('tc1','tc2','tc3','tc4');
function switchClgId100(id){hideallClgIds100(); showClgDiv100(id);}
function hideallClgIds100(){for (var i=0;i<topClgIDS.length;i++){hideClgDiv100(topClgIDS[i]);}}
function hideClgDiv100(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showClgDiv100( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}

function doClgRed100(obj) {
   var linkList = document.getElementById("topClgNavigation").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}

function doClgBlack100(obj) {
   var linkList = document.getElementById("topClgNavigation").getElementsByTagName("a");
   obj.className = "";}
   
 /* ptw home search module */
var ptwSearchIDS=new Array('ps1','ps2');
function switchptwsearchId(id){hideallidsptwsearch(); showdiv(id);}
function hideallidsptwsearch(){for (var i=0;i<ptwSearchIDS.length;i++){hidedivptwsearch(ptwSearchIDS[i]);}}
function hidedivptwsearch(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showdiv( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}

function doRedPtwsSarch(obj) {
   var linkList = document.getElementById("navigationPtwSearch").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}

function doBlackPtwsSarch(obj) {
   var linkList = document.getElementById("navigationPtwSearch").getElementsByTagName("a");
   obj.className = "";}  

/* homepage players to watch top 100 module */
var homePtwTop100IDS=new Array('m1','m2');
function switchHomePtwTop100IDS(id){hideallidsHomePtwTop100(); showdivHomePtwTop100(id);}
function hideallidsHomePtwTop100(){
	//alert('1');
	for (var i=0;i<homePtwTop100IDS.length;i++){hidedivHomePtwTop100(homePtwTop100IDS[i]);}
	//alert('2');
	}
function hidedivHomePtwTop100(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showdivHomePtwTop100( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}

function doRedHomePtwTop100(obj) {
   var linkList = document.getElementById("top100HomeNavigation").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}
function doBlackHomePtwTop100(obj) {
   var linkList = document.getElementById("top100HomeNavigation").getElementsByTagName("a");
   obj.className = "";}
   
/* ============================ */

var ptwtab100IDS=new Array('ptw1','ptw2','ptw3','ptw4');
function switchidptwtab(id){hideallidsptwtab();showdivptwtab(id);}
function hideallidsptwtab(){for (var i=0;i<ptwtab100IDS.length;i++){hidediv100ptwtab(ptwtab100IDS[i]);}}
function hidediv100ptwtab(id) {
    if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showdivptwtab( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}

function doRed100PtwTab(obj) {
   var linkList = document.getElementById("topPTWHomeNavigation").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}

function doBlack100PtwTab(obj) {
   var linkList = document.getElementById("topPTWHomeNavigation").getElementsByTagName("a");
   obj.className = "";}
/* ========================== */
var clgtab100IDS=new Array('clg1','clg2','clg3','clg4');
function switchidclgtab(id){hideallidsclgtab(); showdivclgtab(id);}
function hideallidsclgtab(){for (var i=0;i<clgtab100IDS.length;i++){hidediv100clgtab(clgtab100IDS[i]);}}
function hidediv100clgtab(id) {
    if (document.getElementById) {document.getElementById(id).style.display = 'none';}
    else {if (document.layers) {document.id.display = 'none';}
    else {document.all.id.style.display = 'none';}}}
function showdivclgtab( id) {if (document.getElementById) {document.getElementById(id).style.display = 'block';}
    else {if (document.layers) {document.id.display = 'block';}
    else {document.all.id.style.display = 'block';}}}

function doRed100ClgTab(obj) {
   var linkList = document.getElementById("topCLGHomeNavigation").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {linkList[i].className = "";}
   obj.className = "selected";}

function doBlack100ClgTab(obj) {
   var linkList = document.getElementById("topCLGHomeNavigation").getElementsByTagName("a");
   obj.className = "";}