/// <reference path="jquery-1.3.2-vsdoc.js" />

function OpenFullUpdate()
{
	var divCogitoFull = $('#divCogitoFull');

	divCogitoFull.css("position", 'absolute');
	divCogitoFull.show();
	
	if(document.all)
	{
		$('#tdRightBorder').height(divCogitoFull.height() - 22);
		$('#tdLeftBorder').height(divCogitoFull.height() - 122);
	}

	$('.opacity').animate({ opacity: 0.5 }, "normal");
}

function CloseCogitoFull()
{
    $('#divCogitoFull').hide();
	$('.opacity').animate({ opacity: 1 }, "normal");
}

function openLearnMore()
{
	window.open("http://www.manyworlds.com/learning_control.htm", "_blank", "width=755, height=350, scrollbars=no, resizable=no, toolbar=no, menubar=no");
}

function ShowMostPopular(authors, topics, content)
{
	var divMostPopularAuthors = document.getElementById('divMostPopularAuthors');
	var divMostPopularTopics = document.getElementById('divMostPopularTopics');
	var divMostPopularContent = document.getElementById('divMostPopularContent');
	
	var imgMostPopularAuthors = document.getElementById('imgMostPopularAuthors');
	var imgMostPopularTopics = document.getElementById('imgMostPopularTopics');
	var imgMostPopularContent = document.getElementById('imgMostPopularContent');

	divMostPopularAuthors.style.display = authors ? 'block' : 'none';
	divMostPopularTopics.style.display = topics ? 'block' : 'none';
	divMostPopularContent.style.display = content ? 'block' : 'none';

	imgMostPopularAuthors.src = authors ? 'images/most_pop_authors_on.jpg' : 'images/most_pop_authors_off.jpg';
	imgMostPopularTopics.src = topics ? 'images/most_pop_topics_on.jpg' : 'images/most_pop_topics_off.jpg';
	imgMostPopularContent.src = content ? 'images/most_pop_content_on.jpg' : 'images/most_pop_content_off.jpg';
}

function HideExplanationDiv()
{
    document.getElementById('explanationDiv').style.display='none';
}

function SwitchRecommendations()
{
    var imgRecommendation = document.getElementById('imgRecommendation');
	var imgRecCoType = document.getElementById('imgRecCoType');
	var linkRecommendation = document.getElementById('linkRecommendation');
	
	linkRecommendation.href = "../exploreco.aspx?coid=" + arrRecs[arrRecsIndex][0];
	linkRecommendation.innerHTML = arrRecs[arrRecsIndex][1];
	
	if(window.addEventListener)//Moz,NN
	{
        linkRecommendation.addEventListener('mousemove',ShowExplanationDiv,false);
        linkRecommendation.addEventListener('mouseout',HideExplanationDiv,false);
    } else //IE
    {
        linkRecommendation.attachEvent('onmousemove', ShowExplanationDiv);
        linkRecommendation.attachEvent('onmouseout', HideExplanationDiv);
    } 
    linkRecommendation.arrRecsIndex = arrRecsIndex;
	
	if (arrRecs[arrRecsIndex][2])
	{
	    imgRecommendation.style.visibility="visible";

    	imgRecommendation.src = arrRecs[arrRecsIndex][2];
	
	}
	else
	{
	    imgRecommendation.style.visibility="hidden";
	
	}

	imgRecCoType.src = arrRecs[arrRecsIndex][3];

	arrRecsIndex = arrRecsIndex < (arrRecs.length - 1) ? arrRecsIndex + 1 : 0;
}