//toggle on dashboard
$(document).ready(function(){
	try{
	    $("#infoEntrepreneur").hide();
	    
		$("#lnkEnrepreneur").click(function(){
			$("#infoEntrepreneur").slideToggle(20);
		});
	}catch(e){ }
	
	
	//dashboard	
    function commonFun(eventId, Container){	
    	var val= false;	
    			$(Container).hide();		
    	$(eventId).click(function(){	
    		if(val==false ){
    		$(Container).slideDown(50, function(){ val = true; });
    		}
    		if(val==true){
    		$(Container).slideUp(50, function(){ val = false;  });
    		}
    	});			
    			
    	$("html").click(function(){	
    		if(val==true){
    		$(Container).slideUp(50, function(){ val = false;  });
    		}
    	});
    }
	//dashboard	end
    commonFun("#lnkDashLeft","#divDashLeftCont" )
    commonFun("#lnkHeaderSearch","#divHeaderSearchCont" )		
    commonFun("#btnForUpdate","#idForUpdate" )	
    commonFun("#lnkDropContr1","#divDropContr1" )	
    commonFun("#lnkDropContr2","#divDropContr2" )
    commonFun("#lnkDropContr3","#divDropContr3" )	
    commonFun("#lnkDropContr4","#divDropContr4" )
    commonFun("#btnForRating","#idForRating" )
    commonFun("#lnkFollowCompany","#divFollowCompany" )
    commonFun("#txtTeamRole", "#instrBoxFortxtTeamRole");
	commonFun("#btnForShowAll","#idForShowAll" )	
	commonFun("#anchorForSort","#idForSort" )
	commonFun("#btnForSortBy","#idForSortBy" )
	commonFun("#btnForTagsAll","#idForTagsAll" )
	commonFun("#btnForReward","#idForReward" )
});

//success messagebox function
function closeMessageBox ()
{
 document.getElementById('idForMsgSuccess').style.display = 'none';	
}

//toggle on connections
$(document).ready(function(){

	$("#lnkYouMayLike").click(function(){
	    $("#idYouMayLike").slideToggle("slow");
		$(this).toggleClass("plus");
	});
	
	$("#lnkMatchingInterest").click(function(){
	    $("#idMatchingInterest").slideToggle("slow");
		$(this).toggleClass("plus");
	});

});

//mouseover and out

function switchOverRowClasses(rowId)
{
	document.getElementById(rowId).className = 'mHover';
	document.getElementById('container'+rowId).style.display ='';
	
}

function switchOutRowClasses(rowId)
{
	document.getElementById(rowId).className = '';
	document.getElementById('container'+rowId).style.display ='none';	
}
	
//my connections
$(document).ready(function(){

	$("#inptSearchMyConn").focus(function(){
	    $("#divSearchMyConn").slideDown("slow");
	});
	
		$("#inptSearchMyConn").blur(function(){
	    $("#divSearchMyConn").slideUp("slow");
	});

});

// Registration_memberprofile.php
$(document).ready(function(){

function focusBlur(eventId, Container){

$(eventId).focus(function(){	 
	$(Container).removeClass("bxInner hidden");	
	$(Container).addClass("bxInner");	 
	});
	
$(eventId).blur(function(){
	$(Container).removeClass("bxInner");
	$(Container).addClass("bxInner hidden");
	});

}


focusBlur("#txtHeadline", "#instrBoxForHeadline");
focusBlur("#txtTags", "#instrBoxForTags");

});


//challenges_myapplications_messages.php

function onHoverShowSublinks (rowId)
{
	document.getElementById('lnik-'+rowId).style.display ='';
}

function onOutHideSublinks(rowId)
{
	document.getElementById('lnik-'+rowId).style.display ='none';	
}
	
// Header Search common
function changeHdrSearch (num)
{
	if (num ==1)
	{	document.getElementById('lnkHeaderSearch').innerHTML ='Solution';}
	
	if (num ==2)
	{	document.getElementById('lnkHeaderSearch').innerHTML ='Funds';}
	
	if (num ==3)
	{	document.getElementById('lnkHeaderSearch').innerHTML ='Services';}
	
	if (num ==4)
	{	document.getElementById('lnkHeaderSearch').innerHTML ='Members';}
	
	if (num ==5)
	{	document.getElementById('lnkHeaderSearch').innerHTML ='Company';}
	
	if (num ==6)
	{	document.getElementById('lnkHeaderSearch').innerHTML ='Requests';}
	
	if (num ==7)
	{	document.getElementById('lnkHeaderSearch').innerHTML ='Challenges';}
	
	if (num ==8)
	{	document.getElementById('lnkHeaderSearch').innerHTML ='Events';}
	
}

// Show All status change
function changeShowAllStatus (id,text)
{
	document.getElementById(id).innerHTML =text;
	
	/*if (num ==1)
	{	document.getElementById('btnForShowAll').innerHTML ='Show All';}
	
	if (num ==2)
	{	document.getElementById('btnForShowAll').innerHTML ='Show Read';}
	
	if (num ==3)
	{	document.getElementById('btnForShowAll').innerHTML ='Show Unread';}
	*/
	
}

// Sort by rewards
function sortByReward (id,text)
{
	document.getElementById(id).innerHTML =text;
}


// Sort by application Document
function documentSortBy (id,text)
{
	document.getElementById(id).innerHTML =text;
}


// Header login popup
function showLoginPopOnHeader()
{
	if ( document.getElementById('divHdrLoginPop').style.display =='none')
	{
		$("#divHdrLoginPop").slideDown(50);
		//document.getElementById('divHdrLoginPop').style.display ='';
	}
	else
	{
		$("#divHdrLoginPop").slideUp(50);
		//document.getElementById('divHdrLoginPop').style.display ='none';
	}
}

//Header about innovent
$(document).ready(function(){
    function headerFun(eventId, Container){	
    	var val= false;	
    			$(Container).hide();			
    			
    	$(eventId).click(function(){	
    		if(val==false ){
    		$(Container).slideDown(50, function(){ val = true; });
    		$(eventId).removeClass("arr");	
    	    $(eventId).addClass("arr arrAct");	 
    		}
    		if(val==true){
    		$(Container).slideUp(50, function(){ val = false;  });
    		$(eventId).removeClass("arr arrAct");	
    	    $(eventId).addClass("arr");	 
    		}
    		
    	});			
    			
    	$("html").click(function(){	
    		if(val==true){
        		$(Container).slideUp(50, function(){ val = false;  });
        		$(eventId).removeClass("arr arrAct");	
        	    $(eventId).addClass("arr");	 
    		}
    	});
    }
    headerFun("#lnkAbtEnnovent","#divAbtEnnovent" )
    headerFun("#lnkWelcomePeter","#divWelcomePeter" )
    headerFun("#lnkmemberbox","#divMemberArea" )
});


//search pages

function onHoverSearchLnks (rowId)
{
	document.getElementById('dvLnk-'+rowId).style.display ='';
	document.getElementById(rowId).className ='imgLSearch srchBgGray';
}

function onOutSearchLnks(rowId)
{
	document.getElementById('dvLnk-'+rowId).style.display ='none';
	document.getElementById(rowId).className ='imgLSearch';
}

function onHoverSearchLnksFeatured (rowId)
{
	document.getElementById('dvLnk-'+rowId).style.display ='';
	document.getElementById('dvLnkF-'+rowId).style.display ='none';
	//document.getElementById(rowId).className ='imgLSearch srchBgGray';
}

function onOutSearchLnksFeatured (rowId)
{
	document.getElementById('dvLnk-'+rowId).style.display ='none';
	document.getElementById('dvLnkF-'+rowId).style.display ='';
	//document.getElementById(rowId).className ='imgLSearch';
}

	
//toggle on left panel search
$(document).ready(function(){
	$("#lnkSearchLeft1").click(function(){
	    $("#divSearchLeft1").slideToggle("slow");
		$(this).toggleClass("plus");
		if(document.getElementById('liSearchLeft1'))
		{
			if ( document.getElementById('liSearchLeft1').className == 'bdrBN' )
			{ document.getElementById('liSearchLeft1').className = '' }
			else
			{document.getElementById('liSearchLeft1').className = 'bdrBN'}			
		}

	});
	
	
	$("#lnkSearchLeft2").click(function(){
        $("#divSearchLeft2").slideToggle("slow");
    	$(this).toggleClass("plus");
    	if(document.getElementById('liSearchLeft2'))
    	{
        	if ( document.getElementById('liSearchLeft2').className == 'bdrBN' )
        	{ document.getElementById('liSearchLeft2').className = '' }
        	else
        	{document.getElementById('liSearchLeft2').className = 'bdrBN'}    		
    	}

	});
		
		
    $("#lnkSearchLeft3").click(function(){
        $("#divSearchLeft3").slideToggle("slow");
        $(this).toggleClass("plus");
        if(document.getElementById('liSearchLeft3'))
        {
            if ( document.getElementById('liSearchLeft3').className == 'bdrBN' )
            { document.getElementById('liSearchLeft3').className = '' }
            else
            {document.getElementById('liSearchLeft3').className = 'bdrBN'}        	
        }

	});
			
			
	$("#lnkSearchLeft4").click(function(){
	    $("#divSearchLeft4").slideToggle("slow");
		$(this).toggleClass("plus");
		if(document.getElementById('liSearchLeft4'))
		{
			if ( document.getElementById('liSearchLeft4').className == 'bdrBN' )
			{ document.getElementById('liSearchLeft4').className = '' }
			else
			{document.getElementById('liSearchLeft4').className = 'bdrBN'}			
		}

	});
				
				
	$("#lnkSearchLeft5").click(function(){
	    $("#divSearchLeft5").slideToggle("slow");
		$(this).toggleClass("plus");
		if(document.getElementById('liSearchLeft5'))
		{
			if ( document.getElementById('liSearchLeft5').className == 'bdrBN' )
			{ document.getElementById('liSearchLeft5').className = '' }
			else
			{document.getElementById('liSearchLeft5').className = 'bdrBN'}			
		}

	});
						
						
	$("#lnkSearchLeft6").click(function(){
	    $("#divSearchLeft6").slideToggle("slow");
		$(this).toggleClass("plus");
		if(document.getElementById('liSearchLeft6'))
		{
			if ( document.getElementById('liSearchLeft6').className == 'bdrBN' )
			{ document.getElementById('liSearchLeft6').className = '' }
			else
			{document.getElementById('liSearchLeft6').className = 'bdrBN'}			
		}

	});
});

function changeSrchLinkClass (num)
{
	 document.getElementById('lnkArea'+ num).className = 'bulGreen';
	
	}



// Search pop up
function showPopSearchPage(id)
{
	try{
	document.getElementById('pop'+id).style.display ='';
	document.getElementById('li'+id).className ='activeLi';
	}catch(e){ }
}
function closePopSearchPage(id)
{
	try{
	document.getElementById('pop'+id).style.display ='none';
	document.getElementById('li'+id).className ='';
	}catch(e){ }
}

// share link popup
function showSareLinkPop()
{
	if ( document.getElementById('divSharePop').style.display =='none')
	{
		$("#divSharePop").slideDown(50);
	}
	else
	{
		$("#divSharePop").slideUp(50);
	}
	
	
}

// event calender
$(document).ready(function(){
	
function calenderCallNewFun(eventId, Container){	
	
	var val= false;	
			$(Container).hide();			
			
	$(eventId).click(function(){	
		

		if(val==false ){
		$(Container).slideDown(50, function(){ val = true; });
		}
		if(val==true){
		$(Container).slideUp(50, function(){ val = false;  });
		}
		
	});			
			
	$("html").click(function(){	
		

	
		if(val==true){
		$(Container).slideUp(50, function(){ val = false;  });
		}
		
	});
	
}
calenderCallNewFun("#lnkEventCall2","#divEventCall2" )

});	


//Index page Featured Solutions
function switchFeaturedRecords(num)
{	

   var totalRecords = 3; /* Here i have assumed total static records to be 3 in number */
	 if ( typeof switchFeaturedRecords.counter == 'undefined' )
	 {
                switchFeaturedRecords.counter = 1;
     }
	 
		if ( num == 1 && switchFeaturedRecords.counter < totalRecords )
		{
		  document.getElementById('featRecord' + switchFeaturedRecords.counter).style.display = 'none';
		  switchFeaturedRecords.counter = switchFeaturedRecords.counter + num;
		  document.getElementById('featRecord' + switchFeaturedRecords.counter).style.display = '';
		}
		
		if (num == -1 && switchFeaturedRecords.counter != 1 && switchFeaturedRecords.counter <= totalRecords )
		{
			document.getElementById('featRecord' + switchFeaturedRecords.counter).style.display = 'none';
			switchFeaturedRecords.counter = switchFeaturedRecords.counter + num;
			document.getElementById('featRecord' + switchFeaturedRecords.counter).style.display = '';			
			}

}

//featuresNew pages Right part

function onHoverFeatureRgtLnks (rowId)
{
	document.getElementById('dvLnk-'+rowId).style.display ='';
	document.getElementById(rowId).className ='spacerRgt feaBgGray';
	
}

function onOutFeatureRgtLnks(rowId)
{
	document.getElementById('dvLnk-'+rowId).style.display ='none';
	document.getElementById(rowId).className ='spacerRgt';
	}
	
//featuresNew pages Left part

function onHoverFeatureLftLnks (rowId)
{
	document.getElementById('dvLnk-'+rowId).style.display ='';
	document.getElementById(rowId).className ='leftPrt feaBgGray';
	
}

function onOutFeatureLftLnks(rowId)
{
	document.getElementById('dvLnk-'+rowId).style.display ='none';
	document.getElementById(rowId).className ='leftPrt';
	}
	
	
function doConfirm(msg){
	var answer = confirm(msg)
    if (answer){
        return true; 
    }   
    return false; 
}
