var source;
function MenuOver(Menu)
{	
	Menu.style.color = "#CCCCCC";
	Menu.style.backgroundColor = "#00426C";
}

function MenuOut(Menu)
{
	Menu.style.color = "#00426C";
	Menu.style.backgroundColor = "#FFFFFF";
}

function toggle(element) 
{
    if (element.style.display == 'none') 
    {
        element.style.display = 'block';
    } 
    else 
    {
        element.style.display = 'none';
    }
}

function FactOrFiction(element, result, yes, no) 
{   
	for(var i=0; i<document.all.length;i++)
	{
		currObj =  document.all[i];
		if (currObj != null)
		{
			if (currObj.id.indexOf("1ff") > -1)
			{
				currObj.style.display = 'none';
			}
		} 
	}    
  
    if (element.style.display == 'none') 
    {
        element.style.display = 'block';
    }   
    
    if (result == 'yes')
    {
		yes.style.display = 'block';
		no.style.display = 'none';
    }
    else
    {
		yes.style.display = 'none';
		no.style.display = 'block';    
    }
}

function toggleVerse(button, element1, element2, element3, element4) 
{
    if (element1.style.display == 'none') 
    {
        element1.style.display = 'block';
        element4.style.display = 'block';
        element2.style.display = 'none';
        element3.style.display = 'none';
    } 
    else {
        element1.style.display = 'none';
        element4.style.display = 'none';
        element2.style.display = 'block';
        element3.style.display = 'block';
    }
    
    if (button.value == "English")
		button.value = "Tamil";
	else
		button.value = "English";
}

function FaqOver(text)
{
	text.style.background = '#cccccc';
}

function FaqOut(text)
{
	text.style.background = '#ffffff';
}

function LangOver(text)
{
	text.style.color = '#dddddd';
	text.style.background = '#00426C';
}

function LangOut(text)
{
	text.style.color = '#00426C';
	text.style.background = '#dddddd';
}

function Open(url)
{
	window.open();
}

/* Start :- Events popup on calendar */
function openPopup(date, desc)
{
    var popup = document.getElementById("popup");
    popup.style.display = 'block';
    
    document.getElementById("date").innerText = date;
    document.getElementById("desc").innerHTML = desc;
}

function hidePopup()
{
    var popup = document.getElementById("popup");
    popup.style.display = 'none';
}
/* End :- Events popup on calendar */

/* Start :- Quiz */
function check_answer(answer)
{
    if (answer == "teaching")
    {
        return(score);
    }
}

function ScoreQuiz()
{
    score = 0;
    var arrayOfTextBoxes = document.getElementsByTagName("input");
    for (var i=0; i<arrayOfTextBoxes.length; i++)
    {
        if (arrayOfTextBoxes[i].value != "" && arrayOfTextBoxes[i].type == "text"
            && arrayOfTextBoxes[i].name == arrayOfTextBoxes[i].value)
        {
            score++;
        }
    }
    document.getElementById("result").innerText = "<b>Your score is : </b>" + score + "/15" ;
    window.location = 'QuizResult_fillup.aspx?quiz=timothy&lang=en&score=' + score + '/15';
}

function ScoreQuiz_Arrange(a,b)
{
    score = 0;
    var arrayOfTextBoxes = document.getElementsByTagName("input");
    for (var i=0; i<arrayOfTextBoxes.length; i++)
    {
        if (arrayOfTextBoxes[i].value != "" && arrayOfTextBoxes[i].type == "text"
            && arrayOfTextBoxes[i].name == arrayOfTextBoxes[i].value)
        {
            score = score + 0.5;
        }
    }
    window.location = 'QuizResult_arrange.aspx?quiz=' + a + '&lang=' + b + '&score=' + score + '/10';
}
/* Start :- Quiz */