//<!--
sfHover = function() {
    if (!document.getElementsByTagName) return false;
    var sfEls =document.getElementById("nav").getElementsByTagName("li");
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=" sfhover";
            //this.style.zIndex=8200; //this line added to force flyout to be above relatively positioned stuff in IE
        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
}

if (window.attachEvent) window.attachEvent("onload", sfHover); 

/*sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);*/

// -->


/***** below functions written for prototying starts *****/
function hideshowemaildiv(strid)
{
		if(document.getElementById(strid).style.display == '')
		{
			document.getElementById(strid).style.display = 'none';
		}
		else
		{
			document.getElementById('id_divTopVideoComment').style.display = 'none';
			document.getElementById(strid).style.display = '';
			document.getElementById(strid).innerHTML = document.getElementById('id_divTopArticleEmail').innerHTML;
		}
}


function hideshowvideodiv(strid)
{
		if(document.getElementById(strid).style.display == '')
		{
			document.getElementById(strid).style.display = 'none';
		}
		else
		{
			document.getElementById('id_divTopArticleEmail').style.display = 'none';
			document.getElementById(strid).style.display = '';
			document.getElementById(strid).innerHTML = document.getElementById('id_divTopVideoComment').innerHTML;
		}
}




function hideshowemaildiv2(strid , strhidecontentid )
{
		hidecontent(strhidecontentid);
		if(document.getElementById(strid).style.display == '')
		{
			document.getElementById(strid).style.display = 'none';
		}
		else
		{
			document.getElementById('id_divTopVideoComment').style.display = 'none';
			document.getElementById(strid).style.display = '';
			document.getElementById(strid).innerHTML = document.getElementById('id_divTopArticleEmail').innerHTML;
		}
}


function hideshowvideodiv2(strid, strhidecontentid)
{
		hidecontent(strhidecontentid);

		if(document.getElementById(strid).style.display == '')
		{
			document.getElementById(strid).style.display = 'none';
		}
		else
		{
			document.getElementById('id_divTopArticleEmail').style.display = 'none';
			document.getElementById(strid).style.display = '';
			document.getElementById(strid).innerHTML = document.getElementById('id_divTopVideoComment').innerHTML;
		}
}


function hidecontent(strhidecontentid)
{
	document.getElementById(strhidecontentid).style.display = 'none';
}


function manageprofilepagecontent(fuse)
{
	//default displaying idea content
	var strelementid = 'ideacontent';

	var strcopyofideacontent = document.getElementById('ideacontent').innerHTML;

	if(fuse == 'personal')
		var strelementid = 'personalcontent';
	else if(fuse == 'interest')
		var strelementid = 'interestcontent';
	else if(fuse == 'blog')
		var strelementid = 'blogcontent';
	
	if(fuse != 'ideas')
	{
		document.getElementById('ideacontent').style.display = 'none';
		document.getElementById('showcontent').innerHTML = document.getElementById(strelementid).innerHTML;
	}
	else
	{
		document.getElementById('showcontent').innerHTML = '';
		document.getElementById('ideacontent').style.display = '';
		
	}

	//
}


function fnShowRaters()
{
		if(document.getElementById('id_Rater').style.display == '')
		{
			document.getElementById('id_Rater').style.display = 'none';
		}
		else
		{
			document.getElementById('id_Rater').style.display = '';
		}
}

function fnSearchNav()
{    
	strErrorMessage = "";
	var strKeyword;
	
	strKeyword 	 = document.frmSearch.id_txtsearchkeyword.value;
	
	if (strKeyword == "")
	{
		strErrorMessage = strErrorMessage + " Enter Search Keyword.";
	}
	
	if (strErrorMessage == "")
	{   
		document.frmSearch.action = "../index.php";
		document.frmSearch.submit();
		return true;
	}
	else
	{
		alert(strErrorMessage);
		return false;
	}
}


function fnSearchIdea()
{    
	 
	strErrorMessage = "";
	intTheme 	 = document.frmSearch.cmb_themes.value;
	strCountry 	 = document.frmSearch.cmb_country.value;
	intInstitute = document.frmSearch.id_cmb_institutes.value;
	intLanguage  = document.frmSearch.id_cmb_language.value;
	strUserName  = document.frmSearch.id_txtSearchName.value;
	strKeyword 	 = document.frmSearch.id_txtsearchkeyword.value;
	
	if (intTheme == "" && strCountry == "" && intInstitute == "" && intLanguage == "" && strKeyword == "" && strUserName == "")
	{
		strErrorMessage = "";
		strErrorMessage = strErrorMessage + " Select at lease one option for Search.\n";
		strErrorMessage = strErrorMessage + " OR Enter Search Keyword.";
	}
	if (strErrorMessage == "")
	{   
		document.frmSearch.action = "../index.php?fuse=listideas";
		document.frmSearch.submit();
		return true;
	}
	else
	{
		alert(strErrorMessage);
		return false;
	}
}

function fnSearchAllIdea()
{    
	strErrorMessage = "";
	strKeyword 	 = document.frmSearch.id_txtsearchkeyword.value;
	if (strKeyword == "")
	{
		strErrorMessage = strErrorMessage + " Enter Search Keyword.";
	}
	if (strErrorMessage == "")
	{   
		document.frmSearch.action = "../index.php?fuse=listideas";
		document.frmSearch.submit();
		return true;
	}
	else
	{
		alert(strErrorMessage);
		return false;
	}
}

function fnSearchNetwork()
{    
	 
	strErrorMessage = "";
	intRegion 	 = document.frmSearch.cmb_country.value;
	intInterest	 = document.frmSearch.cmb_themes.value;
	strEmail  = document.frmSearch.id_txtsearchemail.value;
	intInstitute = document.frmSearch.id_cmb_institutes.value;
	intLanguage  = document.frmSearch.id_cmb_language.value;
	strUserName  = document.frmSearch.id_txtSearchName.value;
	strKeyword 	 = document.frmSearch.id_txtsearchkeyword.value;
	
	if (intRegion == "" && intInterest == "" && strEmail == "" && intInstitute == "" && intLanguage == "" && strKeyword == "" && strUserName == "")
	{
		strErrorMessage = "";
		strErrorMessage = strErrorMessage + " Select at lease one option for Search.\n";
		strErrorMessage = strErrorMessage + " OR Enter Search Keyword.";
	}
	if (strErrorMessage == "")
	{   
		document.frmSearch.action = "../index.php?fuse=listcontact";
		document.frmSearch.submit();
		return true;
	}
	else
	{
		alert(strErrorMessage);
		return false;
	}
}

function fnChnageImage(intFlag)
{
	if(intFlag == 1)
	{
		document.getElementById('btnSearch').src = "img/marketplace/button_submit-on.gif";
	}
	else
	{
		document.getElementById('btnSearch').src = "img/marketplace/button_submit.gif";
	}
//	img/marketplace/button_submit-on.gif
}

/***** below functions written for prototying ends *****/