
function fnModifyPeopleSearch()
{
	
	var pkeyword="";
	var pfname="";
	var plname="";
	var pcomptype="";
	var pcompanyname="";
	var pschool="";
	var pcountry="";
	var pcity="";
	var pmynetwork=0;
	var pindustry="";
	var psearchword="";
	

	if(document.getElementById('id_pkeyword').value)
	{
		pkeyword=document.getElementById('id_pkeyword').value;
		pkeyword=Url.encode(pkeyword);
		psearchword= psearchword+"&pkeyword="+pkeyword;
	}
	
	if(document.getElementById('id_pfname').value)
	{
		pfname=document.getElementById('id_pfname').value;
		pfname=Url.encode(pfname);
		psearchword= psearchword+"&pfname="+pfname;
	}
	
	if(document.getElementById('id_plname').value)
	{
		plname=document.getElementById('id_plname').value;
		plname=Url.encode(plname);
		psearchword= psearchword+"&plname="+plname;
	}
	
	if(document.getElementById('id_pcompanytype').value)
	{
		pcomptype=document.getElementById('id_pcompanytype').value;
		psearchword= psearchword+"&pcompanytype="+pcomptype;
	}
	
	if(pcomptype)
	{
		if(document.getElementById('id_pcompanyname').value)
		{
			pcompanyname=document.getElementById('id_pcompanyname').value;
			pcompanyname=Url.encode(pcompanyname);
			psearchword= psearchword+"&pcompanyname="+pcompanyname;
		}
	}
	
	if(document.getElementById('id_pschool').value)
	{
		pschool=document.getElementById('id_pschool').value;
		pschool=Url.encode(pschool);
		psearchword= psearchword+"&pschool="+pschool;
	}
	
	if(document.getElementById('id_pcountry').value)
	{
		pcountry=document.getElementById('id_pcountry').value;
		pcountry=Url.encode(pcountry);
		psearchword= psearchword+"&pcountry="+pcountry;
	}
	
	if(pcountry)
	{
		if(document.getElementById('id_pcity').value)
		{
			pcity=document.getElementById('id_pcity').value;
			pcity=Url.encode(pcity);
			psearchword= psearchword+"&pcity="+pcity;
		}
	}
	
	if(document.getElementById('id_pmynetwork').checked)
	{
		pmynetwork=1;
		psearchword= psearchword+"&pmynetwork="+pmynetwork;
	}
	
	if(document.getElementById('id_pindustry').value)
	{
		pindustry=document.getElementById('id_pindustry');
		
 		selected = new Array(); 
		for (var i = 0; i < pindustry.options.length; i++)
		if (pindustry.options[ i ].selected) 
		selected.push(pindustry.options[ i ].value);
		psearchword= psearchword+"&pindustry="+selected;
	}
		
			
	if(pkeyword || pfname || plname || pcompanyname || pschool || pcountry || pcity || pmynetwork || pindustry)
	{
		
		location.href = sitename+"/index.php?action=globalsearch&search=people&mps=y"+psearchword;
		return false;
	}
	else
	{
		if(pcomptype=='cp')
		{
			alert("Select at least one criteria");
			return false;	
		}
		else
		{
			
			location.href = sitename+"/index.php?action=globalsearch&search=people&mps=y&"+psearchword;
			return false;
		}
		
	}

	
}



function fnSelectCity()
{
	var pcountry="";
	pcountry=document.getElementById('id_pcountry').value;

	if(pcountry)
	{
		//document.getElementById('id_discitytxt').style.display='block';
		document.getElementById('id_dispcity').style.display='block';
		document.getElementById('id_pcity').value="";
	}
	else
	{
		//document.getElementById('id_discitytxt').style.display='none';
		document.getElementById('id_dispcity').style.display='none';
		document.getElementById('id_pcity').value="";
		
	}
		
}





function fnModifyCompanySearch()
{
	
	var ckeyword="";
	var cindustryid=0;
	var csectorid=0;
	var ccountry="";
	var ccity="";
	var cjobcompany=0;
	var csearchword="";
	
	
	
	if(document.getElementById('id_compkeyword').value)
	{
		ckeyword=document.getElementById('id_compkeyword').value;
		ckeyword=Url.encode(ckeyword);
		csearchword= csearchword+"&compkeyword="+ckeyword;
	}
	
	if(document.getElementById('id_cindustry').value)
	{
		cindustryid=document.getElementById('id_cindustry').value;
		csearchword= csearchword+"&cindustry="+cindustryid;
	}
	
	if(document.getElementById('id_csector').value)
	{
		csectorid=document.getElementById('id_csector').value;
		csearchword= csearchword+"&csector="+csectorid;
	}
	
	
	if(ccountry=document.getElementById('id_ccountry').value)
	{
		ccountry=document.getElementById('id_ccountry').value;
		ccountry=Url.encode(ccountry);
		csearchword= csearchword+"&ccountry="+ccountry;
	}
	
	
	if(ccountry)
	{
		if(document.getElementById('id_ccity').value)
		{
			ccity=document.getElementById('id_ccity').value;
			ccity=Url.encode(ccity);
			csearchword= csearchword+"&ccity="+ccity;
		}
	}
	
	if(document.getElementById('id_cjobcompany').checked)
	{
		cjobcompany=1;
		csearchword= csearchword+"&cjobcompany=1";
	}
	
	
		
	if(ckeyword || cindustryid || csectorid || ccountry || ccity || cjobcompany)
	{
		location.href = sitename+"/index.php?action=globalsearch&search=company&mcs=y"+csearchword;
		return false;
	}
	else
	{
		alert("Select at least one criteria");
		return false;

	}

	
}






function fnSelectCompanyCity()
{
	var ccountry="";
	ccountry=document.getElementById('id_ccountry').value;

	if(ccountry)
	{
		//document.getElementById('id_disccitytxt').style.display='block';
		document.getElementById('id_disccity').style.display='block';
		document.getElementById('id_ccity').value="";
	}
	else
	{
		//document.getElementById('id_disccitytxt').style.display='none';
		document.getElementById('id_disccity').style.display='none';
		document.getElementById('id_ccity').value="";
		
	}
		
}
// For ShowHde Options Links in Global Search tpl
function fnShowHideOption(strHideDiv, strShowDiv,divdisaction)
{
	ajaxObjects[1] = new sack();
	ajaxObjects[1].requestFile = sitename+"/index.php?action=setsearchsessions&mode=ajax&ajax_action=showhidemenu&sh="+divdisaction;
	ajaxObjects[1].onCompletion = function(){
													document.getElementById(strHideDiv).style.display = "none";
													document.getElementById(strShowDiv).style.display = "";
	
													if (strHideDiv == "id_HideOptionDiv")
														document.getElementById("id_ShowHideOption").style.display = "none";
													else
														document.getElementById("id_ShowHideOption").style.display = "";
											 };
	ajaxObjects[1].runAJAX();

}


	function fnSelectChkbox(checkboxid)
	{
		
		if(document.getElementById(checkboxid).checked==true)
		{
			document.getElementById(checkboxid).checked=false;
		}
		else if(document.getElementById(checkboxid).checked==false)
		{
			document.getElementById(checkboxid).checked=true;
		}
	}
	
	
	
	function fnPlayYoutubeVideo(strContentId,strVideoId)
{
	document.getElementById("id_arrvideo_"+strContentId).style.display = "none";
	document.getElementById("id_VideoImage_"+strContentId).innerHTML = "<img src='images/big_slide_loader.gif' />";
	
	ajaxObjects[18] = new sack();
	ajaxObjects[18].requestFile = sitename+"/index.php?action=myprofile&mode=ajax&ajax_action=showvideo&id="+strVideoId;
	ajaxObjects[18].onCompletion = function(){
													document.getElementById("id_VideoImage_"+strContentId).innerHTML = "";
													document.getElementById("id_VideoImage_"+strContentId).style.display = "none";
													
													document.getElementById("id_VideoPlayer_"+strContentId).style.display = "";
													document.getElementById("id_VideoPlayer_"+strContentId).innerHTML = "<span></span>"+ajaxObjects[18].response;
													//document.getElementById("id_VideoPlayer_"+strContentId).style.width = "350px";
											 };
	ajaxObjects[18].runAJAX();
}



function fnRavePlayerVideo(intUpdateId)
{
	document.getElementById("id_VideoImage_"+intUpdateId).style.display = "none";
	document.getElementById("id_VideoPlayer_"+intUpdateId).style.display = "";
}
