/*Function added for Search */
	function QuickLink(Asset_Value_Name)
	{
		if (typeof document.forms[0].hidPageNum == 'object') 
		{
			document.forms[0].hidPageNum.value = '1';
		}
		var strQuickLink="";
		var strFilterMainAttributeID="";
		var objhidSearch = document.getElementById('hidSearch');
		for(var i=0; i < strSubCatArray.length; i++)
		{
			if (Asset_Value_Name == strSubCatArray[i][2])
			{
			
				for (var j=0; j < strSubCatArray.length; j++)
				{
					
					if (strSubCatArray[i][0] == strSubCatArray[j][3] )
					{
						strQuickLink =  strSubCatArray[j][1]  ;
							
					}					
				}
				
				if (strQuickLink=="")
				{
					strQuickLink =	strSubCatArray[i][1];
					strFilterMainAttributeID="," + GetMainAttributeId(strSubCatArray[i][1]);
				}
				else
				{
					strQuickLink =	strQuickLink + "~" + strSubCatArray[i][1] ; 
				}
					
			}
		}
		strFilterMainAttributeID="," + GetMainAttributeId(strQuickLink)
		
		
		if(strFilterMainAttributeID!='')
		{
			document.getElementById('hidFilterMainAttributeID').value=strFilterMainAttributeID
		}
		else
		{
			document.getElementById('hidFilterMainAttributeID').value=document.getElementById('hidMainSearchId').value
		}
		document.getElementById('hidYearMainAttributeID').value=document.getElementById('hidYearMainSearchId').value
		
		//SubmitForm()	
		
		document.getElementById('hidDyComps_Selected_Values_Name').value = Asset_Value_Name
			
		document.getElementById('hidDyComps_Selected_Values').value = strQuickLink;
		document.getElementById('hidFilterMainAttributeID').value=strFilterMainAttributeID
		document.getElementById('hidBeatsId').value=GetBeatsID()
		document.getElementById('hidSourceId').value=GetSourceID()
		objhidSearch.value = "True";	
		window.document.forms[0].submit();		
	}

function ValidateSearch()
	{
	
	
		var strSearchText_Value = document.getElementById("objContainerControl_objTemplateContainerControl_objSearch_txtSearch").value;
		var strCategoryCombo_Index = document.getElementById("objContainerControl_objTemplateContainerControl_objSearch_comSearch_0").selectedIndex;
		//var strSubCategoryCombo_Index = document.getElementById("objContainerControl_objTemplateContainerControl_objSearch_comSearch_1").selectedIndex;
		var objhidDivActive = document.getElementById('hidDivActive')
		if (strSearchText_Value == "<enter keyword(s)>" || strSearchText_Value == "") 
		{		
			if (objhidDivActive.value == 'Keywords')
			{
				alert("Please enter the keyword for search");
				return false;		
			}			
			else if (objhidDivActive.value == 'Advance')
			{
				if (strCategoryCombo_Index == 0)
				{	
					alert("Please enter the keyword for search");
					return false;		
				}
			}
		}			
		
		//Added for Issue 9436
		var ObjSearch = document.getElementById("hidSearchFlag");
		if (typeof(ObjSearch) == 'object') {ObjSearch.value = 1;}
		//End for Issue 9436
		
		SubmitForm();
		document.forms[0].submit();		
		return false;
		
		
	}
	function categoryComboChange(com1,com2,tnmFilterTable,tnmFilterTable2)
	{
		var CombTableId = "objContainerControl_objTemplateContainerControl_objSearch_tblSearchCombos"
		var CombTable =document.getElementById(CombTableId);
		var Com1 = document.getElementById(com1); 
		var Com2 = document.getElementById(com2);
		var TnmFilterTable = document.getElementById(tnmFilterTable); 
		var TnmFilterTable2= document.getElementById(tnmFilterTable2);
		
		var DisplayMod = document.getElementById('hidDisplayMod').value;
		var objhidDyComps_IDs = document.getElementById('hidDyComps_ClientID').value;
		var arrobjhidDyComps_IDs = objhidDyComps_IDs.split("~");

		var objhidDyFilterTable_IDs = document.getElementById('hidDyFilterTable_ClientID').value;
		var arrobjhidDyFilterTable_IDs = objhidDyFilterTable_IDs.split("~");

		if (Com2 != null)
		{
			if (DisplayMod == 'grayed')
			{
				if ( Com2.disabled == true )
				{
					Com2.disabled = false;				
				}
				else if ( Com2.disabled == false )
				{
					if (Com1.selectedIndex == 0 )
					{	
						var Com1_ID = parseInt(com1.substring(com1.length-1,com1.length)) + 1 ;
						var i;
						for(i=Com1_ID;i<arrobjhidDyComps_IDs.length;i++)
						{
							var tmpSelect =document.getElementById(arrobjhidDyComps_IDs[i]);
							var tmpFilterTable = document.getElementById(arrobjhidDyFilterTable_IDs[i]);
							tmpSelect.selectedIndex = 0;
							tmpSelect.disabled = true;						
						}
						if(typeof(CombTable) =='object')
						{
							CombTable.className = "SearchFilterTable"
						}
						return;
					}
					else
					{
						var Com1_ID = parseInt(com1.substring(com1.length-1,com1.length)) + 2 ;
						var i;
						for(i=Com1_ID;i<arrobjhidDyComps_IDs.length;i++)
						{
							var tmpSelect =document.getElementById(arrobjhidDyComps_IDs[i]);
							var tmpFilterTable = document.getElementById(arrobjhidDyFilterTable_IDs[i]);
							tmpSelect.selectedIndex = 0;
							tmpSelect.disabled = true;						
						}
						if(typeof(CombTable) =='object')
						{
							CombTable.className = "SearchFilterTableBorder"
						}
					}
				}
			}
			else if (DisplayMod == 'hide')
			{	
				if( TnmFilterTable2.style.display == 'none'  )
				{
					TnmFilterTable2.style.display = 'block';
				}
				else if( TnmFilterTable2.style.display == 'block' || TnmFilterTable2.style.display == '')
				{
					if (Com1.selectedIndex == 0 )
					{	
						var Com1_ID = parseInt(com1.substring(com1.length-1,com1.length)) + 1 ;
						var i;
						for(i=Com1_ID;i<arrobjhidDyComps_IDs.length;i++)
						{
							var tmpSelect =document.getElementById(arrobjhidDyComps_IDs[i]);
							var tmpFilterTable = document.getElementById(arrobjhidDyFilterTable_IDs[i]);
							tmpSelect.selectedIndex = 0;
							tmpFilterTable.style.display = 'none';						
						}
						if(typeof(CombTable) =='object')
						{
							CombTable.className = "SearchFilterTable"
						}
						return;
					}
					else
					{
						var Com1_ID = parseInt(com1.substring(com1.length-1,com1.length)) + 2 ;
						var i;
						for(i=Com1_ID;i<arrobjhidDyComps_IDs.length;i++)
						{
							var tmpSelect =document.getElementById(arrobjhidDyComps_IDs[i]);
							var tmpFilterTable = document.getElementById(arrobjhidDyFilterTable_IDs[i]);
							tmpSelect.selectedIndex = 0;
							tmpFilterTable.style.display = 'none';						
						}
						if(typeof(CombTable) =='object')
						{
							CombTable.className = "SearchFilterTableBorder"
						}
					}
				}
			}
		}

		var objCategory = document.getElementById(com1);
		var strGroupID = "0"
		var strChildAttributeGroupID
		if(typeof(objCategory) =='object')
		{
			var strCategory=objCategory.options[objCategory.selectedIndex].text;
			var nCategory=objCategory.options[objCategory.selectedIndex].value;
			var x=0;
			if(typeof(CombTable) =='object')
			{	if(nCategory != 0)
				{
					CombTable.className = "SearchFilterTableBorder"
				}else
				{
					CombTable.className = "SearchFilterTable"
				}
			}
			Com2.options.length=0;
			Com2.options[0]=new Option("--Show All--", "0");
			if (DisplayMod == 'grayed')
			{
				Com2.disabled = true;
			}
			else if (DisplayMod == 'hide')
			{
				TnmFilterTable2.style.display = 'none'
			}
			if( Com2 != null)
			{
				for(var i=0; i<strSubCatArray.length ;i++)
				{	

					if(nCategory==0)
					{
					}
					else
					{
						if(nCategory==strSubCatArray[i][1])
						{
							for(var j=0; j<strSubCatArray.length ;j++)
							{ 
								if(strSubCatArray[i][3] == strSubCatArray[j][0])
								{
									if (DisplayMod == 'grayed')
									{
										Com2.disabled = false;
									}
									else if (DisplayMod == 'hide')
									{
										TnmFilterTable2.style.display = 'block'
									}
									strChildAttributeGroupID= strSubCatArray[j][3]									
									x=x+1;
									Com2.options[x] = new Option(strSubCatArray[j][2],strSubCatArray[j][1]); 
								}
							}
						}
					}
				}
			}
			
		}
		
		
	}
	
	function PopulateFilters()
	{	
		var objhidSearchText_ID=''
		var CombTableId = "objContainerControl_objTemplateContainerControl_objSearch_tblSearchCombos"
		var CombTable =document.getElementById(CombTableId);
		objhidSearchText_ID = document.getElementById('hidSearchText_ClientID');
		var strSearchText_Value =document.getElementById('hidSearchText_Values').value;
		if (objhidSearchText_ID.value!=	'')
		{
			document.getElementById(objhidSearchText_ID.value).value=strSearchText_Value;
				
		}
		var FilterSelectedValues = "";
		var YearFilterSelectedValue = "";
		if (typeof(document.getElementById('hidDyComps_Selected_Values')) =='object')
		{			
			FilterSelectedValues = document.getElementById('hidDyComps_Selected_Values').value;
		}
		
		if ( document.getElementById('hidYearAttributeID') != null)
		{
			 YearFilterSelectedValue  = document.getElementById('hidYearAttributeID').value;
		}
		
				
		if (FilterSelectedValues != "")
		{
			/*fix for issue 9908 and 10183 starts*/
			var arrFilterSelectedValues = FilterSelectedValues.split("~");
			var objhidDyComps_IDs = document.getElementById('hidDyComps_ClientID').value; 
			var arrobjhidDyComps_IDs = objhidDyComps_IDs.split("~");
			var objhidDyFilterTable_IDs = document.getElementById('hidDyFilterTable_ClientID').value;
			var arrobjhidDyFilterTable_IDs = objhidDyFilterTable_IDs.split("~");
					
			if (document.getElementById('hidAlsoFoundVisited') != null)
			{
				if(document.getElementById('hidAlsoFoundVisited').value == "1")
				{					
					document.getElementById('hidAlsoFoundVisited').value = "0";
					FilterSelectedValues="";
					var objCombo1 = document.getElementById(arrobjhidDyComps_IDs[0]);
					var objCombo2 = document.getElementById(arrobjhidDyComps_IDs[1]);
					var objCombo3 = document.getElementById(arrobjhidDyComps_IDs[2]);
						
					if(typeof(arrFilterSelectedValues) == 'object')
					{
						var firstFilterName = '';						
						var secondFilterName = '';						
						var thirdFilterName = '';
						var firstIndex = '-1';
						var secondIndex = '-1';												
						var thirdIndex = '-1';												
						
						if( arrFilterSelectedValues.length == 3)
						{																									
							firstFilterName = document.getElementById('Search_First_Filter_Name').value;						
							secondFilterName = document.getElementById('Search_Second_Filter_Name').value;								
							thirdFilterName = document.getElementById('Search_Third_Filter_Name').value;							
							
							//fill first combo and get selected index
							for (var combo1Index =0; combo1Index< objCombo1.options.length ; combo1Index++)
							{
								if (objCombo1.options[combo1Index].text==firstFilterName)
								{
									FillCategory(objCombo1.options[combo1Index].value,document.getElementById(arrobjhidDyComps_IDs[0]));
									firstIndex=combo1Index;
									FilterSelectedValues = objCombo1.options[combo1Index].value;
									break;
								}	
							}
							
							//fill second combo and get selected index
							for(var i=0; i<strSubCatArray.length ;i++)
							{
								if(objCombo1.options[firstIndex].value == strSubCatArray[i][1])
								{
									for(var j=0; j<strSubCatArray.length ;j++)
									{
										if(strSubCatArray[j][2] == secondFilterName && strSubCatArray[j][0] == strSubCatArray[i][3])
										{
											FillSubcategory("1",strSubCatArray[i][1],strSubCatArray[j][1],document.getElementById(arrobjhidDyComps_IDs[1]),document.getElementById(arrobjhidDyFilterTable_IDs[1]));
											secondIndex=objCombo2.selectedIndex;
											FilterSelectedValues = FilterSelectedValues + "~" + strSubCatArray[j][1];
											break;
										}
									}
									if(secondIndex>-1)
									{
										break;
									}
								}
							}
							
							//fill third combo and get selected index
							for(var i=0; i<strSubCatArray.length ;i++)
							{
								if(objCombo2.options[secondIndex].value == strSubCatArray[i][1])
								{
									for(var j=0; j<strSubCatArray.length ;j++)
									{
										if(strSubCatArray[j][2] == thirdFilterName && strSubCatArray[j][0] == strSubCatArray[i][3])
										{
											FillSubcategory("2",strSubCatArray[i][1],strSubCatArray[j][1],document.getElementById(arrobjhidDyComps_IDs[2]),document.getElementById(arrobjhidDyFilterTable_IDs[2]));
											thirdIndex=objCombo3.selectedIndex;
											FilterSelectedValues = FilterSelectedValues + "~" + strSubCatArray[j][1];
											break;
										}
									}
									if(thirdIndex>-1)
									{
										FillSubcategory("3",objCombo3.options[thirdIndex].value,arrFilterSelectedValues[3],document.getElementById(arrobjhidDyComps_IDs[3]),document.getElementById(arrobjhidDyFilterTable_IDs[3]));
										break;
									}
								}
							}
						}			
						else if( arrFilterSelectedValues.length == 2)
						{							
							firstFilterName = document.getElementById('Search_First_Filter_Name').value;						
							secondFilterName = document.getElementById('Search_Second_Filter_Name').value;								
							
							//fill first combo and get selected index
							for (var combo1Index =0; combo1Index< objCombo1.options.length ; combo1Index++)
							{
								if (objCombo1.options[combo1Index].text==firstFilterName)
								{
									FillCategory(objCombo1.options[combo1Index].value,document.getElementById(arrobjhidDyComps_IDs[0]));
									firstIndex=combo1Index;
									FilterSelectedValues = objCombo1.options[combo1Index].value;
									break;
								}	
							}
							
							//fill second combo and get selected index
							for(var i=0; i<strSubCatArray.length ;i++)
							{
								if(objCombo1.options[firstIndex].value == strSubCatArray[i][1])
								{
									for(var j=0; j<strSubCatArray.length ;j++)
									{
										if(strSubCatArray[j][2] == secondFilterName && strSubCatArray[j][0] == strSubCatArray[i][3])
										{
											FillSubcategory("1",strSubCatArray[i][1],strSubCatArray[j][1],document.getElementById(arrobjhidDyComps_IDs[1]),document.getElementById(arrobjhidDyFilterTable_IDs[1]));
											secondIndex=objCombo2.selectedIndex;
											FilterSelectedValues = FilterSelectedValues + "~" + strSubCatArray[j][1];
											break;
										}
									}									
									if(secondIndex>-1)
									{										
										FillSubcategory("2",objCombo2.options[secondIndex].value,arrFilterSelectedValues[2],document.getElementById(arrobjhidDyComps_IDs[2]),document.getElementById(arrobjhidDyFilterTable_IDs[2]));
										break;
									}
								}
							}			
						}
						else if( arrFilterSelectedValues.length == 1)
						{							
							firstFilterName = document.getElementById('Search_First_Filter_Name').value;						
							
							//fill first combo and get selected index
							for (var combo1Index =0; combo1Index< objCombo1.options.length ; combo1Index++)
							{
								if (objCombo1.options[combo1Index].text==firstFilterName)
								{
									FillCategory(objCombo1.options[combo1Index].value,document.getElementById(arrobjhidDyComps_IDs[0]));
									firstIndex=combo1Index;
									FilterSelectedValues = objCombo1.options[combo1Index].value;
									break;
								}	
							}							
							FillSubcategory("1",objCombo1.options[firstIndex].value,arrFilterSelectedValues[1],document.getElementById(arrobjhidDyComps_IDs[1]),document.getElementById(arrobjhidDyFilterTable_IDs[1]));
						}
						if (typeof(document.getElementById('hidDyComps_Selected_Values')) =='object')
						{			
							document.getElementById('hidDyComps_Selected_Values').value=FilterSelectedValues;
						}						
					}
					else
					{
					}
				}
				else
				{
					//also found is not visited
					if(typeof(CombTable) =='object')
					{
						CombTable.className = "SearchFilterTableBorder"
					}
						
					var i=0;
					for (i = 0 ; i< arrFilterSelectedValues.length ; i++)
					{
						if (i==0)
						{	
							FillCategory(arrFilterSelectedValues[i],document.getElementById(arrobjhidDyComps_IDs[i]));
						}
						if(arrFilterSelectedValues[i] == '0')
						{	
							break;	
						}
						else //populate filters.....
						{
							FillSubcategory(i+1,parseInt(arrFilterSelectedValues[i]),parseInt(arrFilterSelectedValues[i+1]),document.getElementById(arrobjhidDyComps_IDs[i+1]),document.getElementById(arrobjhidDyFilterTable_IDs[i+1]));
						}
					}
				}							
			}			
		}	
		else if (FilterSelectedValues == "")
		{
			var objhidDyComps_IDs = document.getElementById('hidDyComps_ClientID').value; 
			var arrobjhidDyComps_IDs = objhidDyComps_IDs.split("~");
			if (document.getElementById(arrobjhidDyComps_IDs[0]) != null)
			{
				document.getElementById(arrobjhidDyComps_IDs[0]).selectedIndex = 0;
			}
		}
		
		
		if (YearFilterSelectedValue != "" )
		{
			if (document.getElementById('hidYearFilter_ClinetID').value != '')
			{
				var objYearFilter = document.getElementById(document.getElementById('hidYearFilter_ClinetID').value);
				if (objYearFilter != null)
				{
					if (objYearFilter != '')
					{
						for(var i=0; i< objYearFilter.length;i++)
						{
							if(objYearFilter.options[i].value == YearFilterSelectedValue)
							{
								objYearFilter.selectedIndex=i;							
							}
						}			
					}		
				}
			}
		}
		else
		{
			if (document.getElementById('hidYearFilter_ClinetID').value != '')
			{
				var objYearFilter = document.getElementById(document.getElementById('hidYearFilter_ClinetID').value);
				if (objYearFilter != null)
				{
					if (objYearFilter != '')
					{
						objYearFilter.selectedIndex=0;							
					}		
				}
			}
		}
		var objhidDivActive = document.getElementById('hidDivActive');
		showDiv(objhidDivActive.value)
	}	
	
	function FillCategory(nCategory,objCategory)
	{	
		for (var i =0; i< objCategory.options.length ; i++)
		{
			if (objCategory.options[i].value==nCategory)
			{
				objCategory.selectedIndex = i;		
			}	
		}
	}	
	
	function FillSubcategory(i,nCategory,nCategory2,objSubCategory,objFilterTable)
	{			
		var strGroupID = "0"
		var strChildAttributeGroupID	
		if (objSubCategory != null &&  objFilterTable != null)
		{
			var x=0;
			var SelectedIndex = 0;
			var DisplayMod = document.getElementById('hidDisplayMod').value;
			objSubCategory.options.length=0;
			objSubCategory.options[0]=new Option("--Show All--", "0");
			if (DisplayMod == 'grayed')
			{
				objSubCategory.disabled = true;
			}
			else if (DisplayMod == 'hide')
			{
				objFilterTable.style.display = 'none'
			}
			if(typeof objSubCategory == 'object')
			{
				for(var i=0; i<strSubCatArray.length ;i++)
				{	

					if(nCategory==0)
					{
					}
					else
					{
						if(nCategory==strSubCatArray[i][1])
						{						
							for(var j=0; j<strSubCatArray.length ;j++)
							{ 
								if(strSubCatArray[i][3] == strSubCatArray[j][0])
								{
									if (DisplayMod == 'grayed')
									{
										objSubCategory.disabled = false;
									}
									else if (DisplayMod == 'hide')
									{
										objFilterTable.style.display = 'block'
									}								
									x=x+1;
									objSubCategory.options[x] = new Option(strSubCatArray[j][2],strSubCatArray[j][1]); 
									if(parseInt(strSubCatArray[j][1])== nCategory2 )
									{	
										SelectedIndex = x;
									}
								}
							}													
						}
					}
				}			
				objSubCategory.selectedIndex = SelectedIndex;			
			}	
		}	
	}
	/* Comment for SubmitForm()  function 

	If you want to changed "defaultText" within <FreeKeywordSearch> tag in "Core.XML", 
	than you have to change the "strSearchText_Value" value in this function accordingly.
	*/

	function SubmitForm()
	{
	
		if (typeof document.forms[0].hidPageNum == 'object') 
		{
			document.forms[0].hidPageNum.value = '1';
		}
		
		if (typeof document.forms[0].hidAssetTypeChanged == 'object') 
		{
		
			document.forms[0].hidAssetTypeChanged.value = "true";	
		}
		
		
		var objhidSearch = document.getElementById('hidSearch');
		var objhidSearchText_ID = document.getElementById('hidSearchText_ClientID');
		var objhidDyComps_IDs = document.getElementById('hidDyComps_ClientID').value; 
		
		if (objhidSearchText_ID.value!=	'')
		{
			var strSearchText_Value = document.getElementById(objhidSearchText_ID.value).value;
			if (strSearchText_Value =='')
			{
				strSearchText_Value = "<enter keyword(s)>";
			}
			if (strSearchText_Value != "<enter keyword(s)>")
			{
				document.getElementById('hidSearchText_Values').value = strSearchText_Value;
			}
			else
			{
				document.getElementById('hidSearchText_Values').value="";
			}
		}
		else
		{
			document.getElementById('hidSearchText_Values').value = '';
		}
		//alert(document.getElementById('hidSearchText_Values').value)
		var strSearchFilters = '';
		var strYearFilter = ''; 
		var strSearchFilterText='';
		var strFilterMainAttributeID=''
		var strYearMainAttributeID=''
		if(objhidDyComps_IDs!='')
		{
			var arrobjhidDyComps_IDs = objhidDyComps_IDs.split("~");
			var i;
			for(i=0;i<arrobjhidDyComps_IDs.length;i++)
			{
				var tmpSelect =document.getElementById(arrobjhidDyComps_IDs[i]);
				if (typeof(tmpSelect) =='object')
				{
					if (tmpSelect.selectedIndex > 0 )
					{
						if (strSearchFilters =="")
						{	
							strSearchFilters = tmpSelect.options[tmpSelect.selectedIndex].value ;	
							
						}
						else
						{	
							strSearchFilters = strSearchFilters + '~' + tmpSelect.options[tmpSelect.selectedIndex].value ;			
						}
						
						strSearchFilterText = tmpSelect.options[tmpSelect.selectedIndex].value ;
						
					}
				}
			}
		}
		
		if (document.getElementById('hidYearFilter_ClinetID').value != '')
		{
			var objYearFilter = document.getElementById(document.getElementById('hidYearFilter_ClinetID').value);
			if (objYearFilter != null)
			{	
				if (objYearFilter.options[objYearFilter.selectedIndex].value != 0) 
				{
					strYearFilter =objYearFilter.options[objYearFilter.selectedIndex].value ;
					strYearMainAttributeID=document.getElementById('hidYearMainSearchId').value;
				}
			}
		}
		
		
		
		if(objhidDyComps_IDs!='')
		{
			var arrobjhidDyComps_IDs = objhidDyComps_IDs.split("~");
			var i;
			
			for(i=0;i<arrobjhidDyComps_IDs.length;i++)
			{
				var tmpSelect =document.getElementById(arrobjhidDyComps_IDs[i]);
				
				if (typeof(tmpSelect) =='object')
				{
					if (tmpSelect.selectedIndex > 0 )
					{
						if (strFilterMainAttributeID =="")
						{	
							strFilterMainAttributeID =  ',' +GetMainAttributeId(tmpSelect.options[tmpSelect.selectedIndex].value)		
						}
						else
						{	
							strFilterMainAttributeID =  strFilterMainAttributeID + ',' + GetMainAttributeId(tmpSelect.options[tmpSelect.selectedIndex].value)
						}
					}
				}
			}
		}
		
		if(strFilterMainAttributeID!='')
		{
			document.getElementById('hidFilterMainAttributeID').value=strFilterMainAttributeID
		}
		else
		{
			document.getElementById('hidFilterMainAttributeID').value=document.getElementById('hidMainSearchId').value
		}
		if(strYearMainAttributeID!='')
		{
			document.getElementById('hidYearMainAttributeID').value=strYearMainAttributeID
		}
		else
		{
			document.getElementById('hidYearMainAttributeID').value=document.getElementById('hidYearMainSearchId').value
		}
		
		if (strSearchFilterText!='')
		{
			document.getElementById('hidDyComps_Selected_Values_Id').value = strSearchFilterText			
		}

		if (GetAttributeValueName(strSearchFilterText)!='')
		{
			document.getElementById('hidDyComps_Selected_Values_Name').value = GetAttributeValueName(strSearchFilterText)
		}
		
		document.getElementById('hidDyComps_Selected_Values_Name').value = GetAttributeValueName(strSearchFilterText)
		document.getElementById('hidDyComps_Selected_Values').value = strSearchFilters;
		document.getElementById('hidYearAttributeID').value=strYearFilter;
		document.getElementById('hidBeatsId').value=GetBeatsID()
		document.getElementById('hidSourceId').value=GetSourceID()
		//debugger
		
		if (strSearchFilters != ''  || strSearchText_Value != '<enter keyword(s)>' || strYearFilter != '')
		{
			objhidSearch.value = "True";	
			document.getElementById('hidSesionChange').value='true'		
		}
	}
	
	
	function GetAttributeValueName(AttributeValueID)
	{	
		var strAttributeValueName = ''
		for(var i=0; i < strSubCatArray.length; i++)
			{
				if (AttributeValueID == strSubCatArray[i][1])
				{
				
					strAttributeValueName = strSubCatArray[i][2]
				}
			}
			return strAttributeValueName
	}
	
	

	
	function catchKeyPressSearch(code) 
			{			
				if( code == '13') 
				{
					//ValidateSearch();
					SubmitForm()
					
				}
			}
			
			function catchKeyPressSearchKey(code)
			{
		
				if( code == '13') 
				{
					ValidateSearch();
				}
			}
			
			// for issue 9934 starts
			function catchKeyPressSearchCombo(e) 
			{		
			e = e || window.event;
				var code = e.keyCode || e.which || e.charCode ;
				if( code == '13') 
				{							
					ValidateSearch();
					return false;		
				}				
			}
			// for issue 9934 starts
			
	function GetMainAttributeId(AttributeValueIDs)
	{
	
		var strMainAttributeIds=''
	    if (AttributeValueIDs.length > 0)
		{		
			var arrAttributeValueIDs = AttributeValueIDs.split("~");
			if (arrAttributeValueIDs.length >0)
			{
				for(var i=0; i < arrAttributeValueIDs.length; i++)
				{
					for(var j=0; j < strSubCatArray.length; j++)
					{
						if (strSubCatArray[j][1]== arrAttributeValueIDs[i])
						{
							
							for(var k=0; k < strSubCatArray.length; k++)
							{
								if (strSubCatArray[k][0]== strSubCatArray[j][3])
								{
									
									if(strMainAttributeIds=='')
									{
										strMainAttributeIds = strSubCatArray[k][4]
										
									}
									
							
								}
							}
												
						}
					}
				}
			}
		}	
	   
		return strMainAttributeIds
	}
	
	function YearComboChange(objID)
	{
		var objFrmName =  'window.document.forms[0]';
		if (typeof document.getElementById('hidYear') == 'object')
				document.getElementById('hidYear').value	=objID.value
			
	}
	
	function RefinedResults(Attribute_Value_id,Attribute_Value_Name)
	{
		var strFilterMainAttributeID=''
		var strYearMainAttributeID=''
	    if (typeof document.forms[0].hidPageNum == 'object') 
		{
			document.forms[0].hidPageNum.value = '1';
		}
		var strQuickLink="";
		var objhidSearch = document.getElementById('hidSearch');
		for(var i=0; i < strSubCatArray.length; i++)
		{
			if (Attribute_Value_id == strSubCatArray[i][1])
			{
				document.getElementById('hidYearAttributeID').value = "";
				for (var j=0; j < strSubCatArray.length; j++)
				{
					if (strSubCatArray[i][0] == strSubCatArray[j][3] )
					{
						
						for (var k=0; k < strSubCatArray.length; k++)
						{
							if (strSubCatArray[j][0] == strSubCatArray[k][3] )
							{
								if( strQuickLink == '')
								{
									
									strQuickLink = strSubCatArray[k][1];
									strFilterMainAttributeID = "," +GetMainAttributeId(strSubCatArray[k][1])	
									
								}
								else
								{
									strQuickLink =  strSubCatArray[k][1] + "~" + strQuickLink ;
									strFilterMainAttributeID = strFilterMainAttributeID +"," + GetMainAttributeId(strSubCatArray[k][1])		
									
								}
							}					
						}
						
						if( strQuickLink == '')
						{
							strQuickLink = strSubCatArray[j][1];
							strFilterMainAttributeID = GetMainAttributeId(strSubCatArray[j][1])		
						}
						else
						{
							strQuickLink =  strSubCatArray[j][1] + "~" + strQuickLink ;
							strFilterMainAttributeID = strFilterMainAttributeID +"," + GetMainAttributeId(strSubCatArray[j][1])		
						}
					}					
				}
				
				if (strQuickLink=="")
				{
					strQuickLink =	strSubCatArray[i][1];
					strFilterMainAttributeID= "," +GetMainAttributeId(strSubCatArray[i][1]);		
				}
				else
				{
					strQuickLink =	strQuickLink + "~" + strSubCatArray[i][1] ; 
					strFilterMainAttributeID= strFilterMainAttributeID + "," + GetMainAttributeId(strSubCatArray[i][1]);		
				}				
			}
		}	
		if (document.getElementById('hidYearFilter_ClinetID').value != '')
		{
			var objYearFilter = document.getElementById(document.getElementById('hidYearFilter_ClinetID').value);
			if (objYearFilter != null)
			{
				if (objYearFilter != '')
				{
					for(var i=0; i< objYearFilter.length;i++)
					{
						if(objYearFilter.options[i].value == Attribute_Value_id)
						{
							strQuickLink='';
							document.getElementById('hidYearAttributeID').value=Attribute_Value_id;		
							strYearMainAttributeID	=document.getElementById('hidYearMainSearchId').value;				
						}
					}			
				}		
			}
		}
		if (strQuickLink == '')
		{
			for(var i=0; i < strSubCatArray.length; i++)
			{
				if (Attribute_Value_Name == strSubCatArray[i][2])
				{
				
					for (var j=0; j < strSubCatArray.length; j++)
					{
						
						if (strSubCatArray[i][0] == strSubCatArray[j][3] )
						{
							strQuickLink =  strSubCatArray[j][1]  ;
							strFilterMainAttributeID="," +GetMainAttributeId(strSubCatArray[j][1])	
						}					
					}
					
					if (strQuickLink=="")
					{
						strQuickLink =	strSubCatArray[i][1];
						strFilterMainAttributeID = "," +GetMainAttributeId(strSubCatArray[i][1])		
					}
					else
					{
						strQuickLink =	strQuickLink + "~" + strSubCatArray[i][1] ; 
						strFilterMainAttributeID = strFilterMainAttributeID + "," + GetMainAttributeId(strSubCatArray[i][1])	
					}
						
				}
		}
		
		}
		document.getElementById('hidDyComps_Selected_Values_Name').value = Attribute_Value_Name
		document.getElementById('hidDyComps_Selected_Values_Id').value = Attribute_Value_id
		document.getElementById('hidFilterMainAttributeID').value=strFilterMainAttributeID
		document.getElementById('hidYearMainAttributeID').value=strYearMainAttributeID
		document.getElementById('hidDyComps_Selected_Values').value = strQuickLink;
		document.getElementById('hidBeatsId').value=GetBeatsID()
		document.getElementById('hidSourceId').value=GetSourceID()
		
		objhidSearch.value = "True";	
		window.document.forms[0].submit();		
	}
	
	
	function CheckAttributeId(AttributeValueIDs)
	{
	var returnValue
		var strMainAttributeIds=''
	    if (AttributeValueIDs.length > 0)
		{		
			var arrAttributeValueIDs = AttributeValueIDs.split(",");
			if (arrAttributeValueIDs.length >0)
			{
				for(var i=0; i < arrAttributeValueIDs.length; i++)
				{
					for(var j=0; j < strSubCatArray.length; j++)
					{	if (arrAttributeValueIDs[i]!= '')
						{	//alert(strSubCatArray[j][4] + '  '+ arrAttributeValueIDs[i])
							if (strSubCatArray[j][4] == arrAttributeValueIDs[i])
							{
								//alert(1)
								return true		
							}
						}
					}
				}
				return false
			}
		}	
	   
		
	}
	
	/* Comment for NarrowResults() function
			/*Start -- Added to fix issue NewsM00001117*/
		function NarrowResults(AssetType)
		{	
			var objFrm = window.document.forms[0];
			if (typeof document.forms[0].hidPageNum == 'object') 
			{
				objFrm.hidPageNum.value = '1';
			}
			var strURL='';
			// changes made for the Issue No 9544
			if (typeof(document.getElementById('Search_Values_Name')) == 'object')
			{
				if (document.getElementById('Search_Values_Name') != null)
				document.getElementById('hidDyComps_Selected_Values_Name').value = document.getElementById('Search_Values_Name').value;
			}
			if (typeof(document.getElementById('Search_Values_Id')) == 'object')
			{
				if (document.getElementById('Search_Values_Id') != null)
				document.getElementById('hidDyComps_Selected_Values_Id').value = document.getElementById('Search_Values_Id').value;
			}
			if (typeof(document.getElementById('hidFilterRifineID')) == 'object')
			{
				if (document.getElementById('hidFilterRifineID') != null)
				document.getElementById('hidFilterMainAttributeID').value=document.getElementById('hidFilterRifineID').value;
			}
			if (typeof(document.getElementById('hidYearRifineID')) == 'object')
			{
				if (document.getElementById('hidYearRifineID') != null)
				document.getElementById('hidYearMainAttributeID').value=document.getElementById('hidYearRifineID').value;
			}		
				
			// changes made for the Issue No 9544 end
			
			//changes for issue 9908 and 10183 starts			
			getFiltersSelected();
			//changes for issue 9908 and 10183 ends
			if (AssetType==document.getElementById('hidFirstRifineAsset').value)
			{
				document.getElementById('hidFilterMainAttributeID').value=document.getElementById('hidFirstFilterRifineID').value
			}
			
			
			
				
			if(AssetType == "Video")
			{
				
					if (typeof document.forms[0].hidAssetTypeChanged == 'object' && typeof document.forms[0].hidAssetTypeSelected == 'object') 
					{
						objFrm.hidAssetTypeChanged.value = "true";	
						objFrm.hidAssetTypeSelected.value = 1
						strURL="../Asset/VideoLibrary.aspx?hidAssetType=1"
					}
					else
					{
						strURL="../Asset/VideoLibrary.aspx?hidAssetType=1&hidAssetTypeSelected=1&hidAssetTypeChanged=true"
					}
				
			}
			else if(AssetType == "Stills")
			{
				
					if (typeof document.forms[0].hidAssetTypeChanged == 'object' && typeof document.forms[0].hidAssetTypeSelected == 'object') 
					{
						objFrm.hidAssetTypeChanged.value = "true";
						objFrm.hidAssetTypeSelected.value = 3
						strURL="../Asset/StillLibrary.aspx?hidAssetType=3"
					}
					else
					{
						strURL="../Asset/StillLibrary.aspx?hidAssetType=3&hidAssetTypeSelected=3&hidAssetTypeChanged=true"
					}
			
			}
			else if(AssetType == "Audio")
			{
				
					if (typeof document.forms[0].hidAssetTypeChanged == 'object' && typeof document.forms[0].hidAssetTypeSelected == 'object') 
					{
						objFrm.hidAssetTypeChanged.value = "true";	
						objFrm.hidAssetTypeSelected.value = 2
						strURL="../Asset/AudioLibrary.aspx?hidAssetType=2"
					}
					else
					{
						strURL="../Asset/AudioLibrary.aspx?hidAssetType=2&hidAssetTypeSelected=2&hidAssetTypeChanged=true"
					}
			
			}
			else if(AssetType == "Document")
			{
				
					if (typeof document.forms[0].hidAssetTypeChanged == 'object' && typeof document.forms[0].hidAssetTypeSelected == 'object')  
					{
						objFrm.hidAssetTypeChanged.value = "true";
						objFrm.hidAssetTypeSelected.value = 4
						strURL="../Asset/DocumentLibrary.aspx?hidAssetType=4"
					}
					else
					{
						strURL="../Asset/DocumentLibrary.aspx?hidAssetType=4&hidAssetTypeSelected=4&hidAssetTypeChanged=true"
					}
				
			}
			else if(AssetType == "Stories")
			{
			
					strURL="../Story/StoryListing.aspx"
				
				
			}		
			
			else if(AssetType == "Stories-1")
			{
			
					strURL="../Story/EmbargoedContentStories.aspx"			
				
			}	
			
			if (strURL !='')
			{
				document.forms[0].action=strURL;
				document.forms[0].submit();
			}
			
			
		}
		/*End -- Added to fix issue NewsM00001117*/
		
	//start function added for issue 9908 and 10183
	function getFiltersSelected()
	{			
		var FilterSelectedValues = "";		
		var objhidDyComps_IDs = document.getElementById('hidDyComps_ClientID').value;
		var arrobjhidDyComps_IDs = objhidDyComps_IDs.split("~");
			
		FilterSelectedValues = document.getElementById('hidDyComps_Selected_Values').value;
		
		document.getElementById('hidAlsoFoundVisited').value = "1";
		
		if (FilterSelectedValues != "")
		{			
			var arrFilterSelectedValues = FilterSelectedValues.split("~");
			if(typeof(arrFilterSelectedValues) == 'object')
			{		
				var objcombo1=document.getElementById(arrobjhidDyComps_IDs[0]);
				var objcombo2=document.getElementById(arrobjhidDyComps_IDs[1]);
				var objcombo3=document.getElementById(arrobjhidDyComps_IDs[2]);			
				if( arrFilterSelectedValues.length == 3)
				{				
					//if 2 level filter is selected starts
					document.getElementById('Search_First_Filter_Name').value=objcombo1.options[objcombo1.selectedIndex].text;												
					document.getElementById('Search_Second_Filter_Name').value=objcombo2.options[objcombo2.selectedIndex].text;												
					document.getElementById('Search_Third_Filter_Name').value=objcombo3.options[objcombo3.selectedIndex].text;												
				}			
				else if( arrFilterSelectedValues.length == 2)
				{				
					//if 3 level filter is selected starts
					document.getElementById('Search_First_Filter_Name').value=objcombo1.options[objcombo1.selectedIndex].text;												
					document.getElementById('Search_Second_Filter_Name').value=objcombo2.options[objcombo2.selectedIndex].text;												
				}
				else if( arrFilterSelectedValues.length == 1)
				{				
					//if 1 filter is selected starts
					document.getElementById('Search_First_Filter_Name').value=objcombo1.options[objcombo1.selectedIndex].text;
				}
			}			
		}		
	}
	//end of function added for issue 9908 and 10183
	function sort_by(source,nextsource,linkval,ImgPath)
			{
				if (typeof document.forms[0].hidPageNum == 'object') 
				{
					document.forms[0].hidPageNum.value = '1';
				}
				var objhidSearch = document.getElementById('hidSearch');
				
				
				if (typeof document.forms[0].hidAssetTypeChanged == 'object') 
				{
					document.forms[0].hidAssetTypeChanged.value = "true";
				}
				
				
				document.getElementById('hidDyComps_Selected_Values_Name').value = document.getElementById('Search_Values_Name').value;
				
				/*Start -- Commented to fix Issue NewsM00001120 and 10045*/
				//document.getElementById('hidDyComps_Selected_Values_Id').value = document.getElementById('Search_Values_Id').value;
				/*End -- Commented to fix Issue NewsM00001120  and 10045*/
			
				/*Start -- Commented to fix Issue 9908 and 10183*/		
				//document.getElementById('hidDyComps_Selected_Values').value = document.getElementById('hidFilterValues').value;
				/*End -- Commented to fix Issue 9908  and 10183*/
				document.getElementById('hidYearAttributeID').value = document.getElementById('hidYearValues').value;
				document.getElementById('hidFilterMainAttributeID').value=document.getElementById('hidFilterRifineID').value;
				document.getElementById('hidYearMainAttributeID').value=document.getElementById('hidYearRifineID').value;
				document.getElementById('hidBeatsId').value=GetBeatsID()
				document.getElementById('hidSourceId').value=GetSourceID()
			
				try
				{
					var strImagePath = source.src;
				    strImagePath = strImagePath.substring(strImagePath.lastIndexOf("/")+1);
				    
					if(linkval == 'relevance')
					{
										
						if(strImagePath == 'Button_Relevance-on.gif')
						{							
							
							source.src = ImgPath + "Button_Relevance-off.gif";
						}
						else
						{
							source.src = ImgPath + "Button_Relevance-on.gif";
							
						}
						document.getElementById('hidSortType').value="relevance";	
						
						objhidSearch.value = "True";
										
						window.document.forms[0].submit();
					}
					else
					{
						
						if(strImagePath == 'Button_MostRecent-on.gif')
						{
							
							source.src = ImgPath + "Button_MostRecent-off.gif";
						}
						else
						{
							
							source.src =  ImgPath + "Button_MostRecent-on.gif";
						}
						
						document.getElementById('hidSortType').value="date";	
						objhidSearch.value = "True";	
						window.document.forms[0].submit();
					}
					
					return false; 
				}
				catch(ex)
				{
				
				}
			}
			function capture_spell_check_val(spell_check_name)
					{
						try
						{
							/*changes for issue 10036 starts*/
							if( document.getElementById('Search_Values_Name')!=null && document.getElementById('Search_Values_Name').value!=null)
							{
								document.getElementById('hidDyComps_Selected_Values_Name').value = document.getElementById('Search_Values_Name').value;
							}
							if( document.getElementById('Search_Values_Id')!=null && document.getElementById('Search_Values_Id').value!=null)
							{
								document.getElementById('hidDyComps_Selected_Values_Id').value = document.getElementById('Search_Values_Id').value;
							}
							document.getElementById('hidSearchText_Values').value=spell_check_name;
							if( document.getElementById('hidFilterRifineID')!=null && document.getElementById('hidFilterRifineID').value!=null)
							{
								document.getElementById('hidFilterMainAttributeID').value=document.getElementById('hidFilterRifineID').value;
							}
							if( document.getElementById('hidYearRifineID')!=null && document.getElementById('hidYearRifineID').value!=null)
							{
								document.getElementById('hidYearMainAttributeID').value=document.getElementById('hidYearRifineID').value;
							}
							/*changes for issue 10036 starts*/
							document.getElementById('hidBeatsId').value=GetBeatsID()
							document.getElementById('hidSourceId').value=GetSourceID()
							window.document.forms[0].submit();
						
						}
						catch(ex)
						{
						
						}
					}
					
			function ToggleRefineResultsList(Count)
			{
				var strImgId
				
				var strDivRefineResults = "objContainerControl_objTemplateContainerControl_objRefineResults_"
				//alert(document.getElementById("divMoreAndMoreVertical_" + Count).style.display)
				if(document.getElementById("divMoreVertical_" + Count).style.display =="block")
				{
					document.getElementById("divLessVertical_" + Count).style.display = "block";
					document.getElementById("divMoreVertical_" + Count).style.display = "none";
				}
				else
				{
					document.getElementById("divLessVertical_"+Count).style.display = "none";
					document.getElementById("divMoreVertical_"+Count).style.display = "block";
				}
				
				
			}
			
			function ToggleRefineResults(imgObj,ImgPath)
			{
				var strImgId = imgObj.id;
				var strDivRefineResults = strImgId.replace( "img", "div");

				//if MINUS is clicked
				if(document.getElementById(strDivRefineResults).style.display =="block")
				{
					document.getElementById(strDivRefineResults).style.display = "none";
					imgObj.src =  ImgPath + "img_plus.gif";
				}
				else
				{
					//if PLUS is clicked
					document.getElementById(strDivRefineResults).style.display = "block";
					imgObj.src = ImgPath + "img_minus.gif";
				}
			}
			
			
			/* Comment for checkSearchTextbox() function 

			If you want to changed "defaultText" within <FreeKeywordSearch> tag in "Core.XML", 
			than you have to change the "s" value in this function accordingly.
			Parameter : id
				values ("TextBox id")
			
			Parameter : status 
				values ("setFocus" or "lostFocus" or "buttonClick")
			*/
			function checkSearchTextbox(id,status)
			{
				var objTxt=document.getElementById(id);
				if(objTxt != null)
				{
					var s = objTxt.value.replace(/^s+/,"").replace(/s+$/,"");
					if(status == "setFocus")
					{
						if(s == "<enter keyword(s)>" || s == "<Please enter search text>")
						{
							objTxt.value = "";	
							return false;
						}
					}
					else if(status == "lostFocus")
					{
						s = objTxt.value.replace(/\s+/g,"");
						if(s.length == 0 || s == "*" || s=="<EnterKeyword(s)>" || s=="<Pleaseentersearchtext>")
						{
							objTxt.value = "<enter keyword(s)>";
							return false;
						}
					}
					else if(status == "buttonClick")
					{
						//remove all the spaces from text
						s = objTxt.value.replace(/\s+/g,"");
						if(s.length == 0 || s == "*" || s=="<EnterKeyword(s)>" || s=="<Pleaseentersearchtext>")
						{
							objTxt.value = "<Please enter search text>";
							return false;
						}
					}
					return true;
				}
			}
			
			
			/*Start -- Added to fix Issue 9432 */
			function previousPage()
			{
				if (typeof(document.getElementById('Search_Values_Name')) == 'object')
				{
					if (document.getElementById('Search_Values_Name') != null)
					document.getElementById('hidDyComps_Selected_Values_Name').value = document.getElementById('Search_Values_Name').value;
				}
				if (typeof(document.getElementById('Search_Values_Id')) == 'object')
				{
					if (document.getElementById('Search_Values_Id') != null)
					document.getElementById('hidDyComps_Selected_Values_Id').value = document.getElementById('Search_Values_Id').value;
				}
				if (typeof(document.getElementById('hidFilterRifineID')) == 'object')
				{
					if (document.getElementById('hidFilterRifineID') != null)
					document.getElementById('hidFilterMainAttributeID').value=document.getElementById('hidFilterRifineID').value;
				}
				if (typeof(document.getElementById('hidYearRifineID')) == 'object')
				{
					if (document.getElementById('hidYearRifineID') != null)
					document.getElementById('hidYearMainAttributeID').value=document.getElementById('hidYearRifineID').value;
				}	
				window.document.forms[0].hidPageNum.value= parseInt(window.document.forms[0].hidPageNum.value,10) - 1;
				setPostBack();
				window.document.forms[0].submit();
			}

			function NextPage()
			{
				if (typeof(document.getElementById('Search_Values_Name')) == 'object')
				{
					if (document.getElementById('Search_Values_Name') != null)
					document.getElementById('hidDyComps_Selected_Values_Name').value = document.getElementById('Search_Values_Name').value;
				}
				if (typeof(document.getElementById('Search_Values_Id')) == 'object')
				{
					if (document.getElementById('Search_Values_Id') != null)
					document.getElementById('hidDyComps_Selected_Values_Id').value = document.getElementById('Search_Values_Id').value;
				}
				if (typeof(document.getElementById('hidFilterRifineID')) == 'object')
				{
					if (document.getElementById('hidFilterRifineID') != null)
					document.getElementById('hidFilterMainAttributeID').value=document.getElementById('hidFilterRifineID').value;
				}
				if (typeof(document.getElementById('hidYearRifineID')) == 'object')
				{
					if (document.getElementById('hidYearRifineID') != null)
					document.getElementById('hidYearMainAttributeID').value=document.getElementById('hidYearRifineID').value;
				}		
				window.document.forms[0].hidPageNum.value= parseInt(window.document.forms[0].hidPageNum.value,10) + 1; 
				setPostBack(); 
				window.document.forms[0].submit();
			}
			/*End -- Added to fix Issue 9432 */
			
			
			/*Start -- Commented to fix Issue 9432*/
			/*function previousPage()
			{
				document.getElementById('hidFilterMainAttributeID').value=document.getElementById('hidFilterRifineID').value;
				document.getElementById('hidYearMainAttributeID').value=document.getElementById('hidYearRifineID').value;
				document.getElementById('hidBeatsId').value=GetBeatsID()
				document.getElementById('hidSourceId').value=GetSourceID()
				window.document.forms[0].hidPageNum.value= parseInt(window.document.forms[0].hidPageNum.value,10) - 1;
				setPostBack();
				window.document.forms[0].submit();
			}

			function NextPage()
			{
				document.getElementById('hidFilterMainAttributeID').value=document.getElementById('hidFilterRifineID').value;
				document.getElementById('hidYearMainAttributeID').value=document.getElementById('hidYearRifineID').value;				
				document.getElementById('hidBeatsId').value=GetBeatsID()
				document.getElementById('hidSourceId').value=GetSourceID()
				window.document.forms[0].hidPageNum.value= parseInt(window.document.forms[0].hidPageNum.value,10) + 1; 
				setPostBack(); 
				window.document.forms[0].submit();
			}*/
			/*End -- Commented to fix Issue 9432*/
			
			function GetBeatsID()
			{
				var strBeatsId=""
				//var strBeatsId=18  //For testing changes value 8,18,33 for adidas
				//Write your code here for fatch beats id from dropdown
				return strBeatsId
			}
			
			function GetSourceID()
			{
				var strSourceId=""
				//var strSourceId="1203" //for testing
				//Write your code here for fatch source id from dropdown
				return strSourceId
			}
			
			function showDiv(DivType,strClickFrom)
			{			
				var objtextDivId = document.getElementById('textDivId');
				var objcatDivId  = document.getElementById('catDivId');
				var objbtn1DivId  = document.getElementById('btn1DivId');
				
				var objkeywordId  = document.getElementById('keyword');
				var objCategoryId  = document.getElementById('Category');
				var objAdvanceId  = document.getElementById('Advance');
				
						
				var objkeywordtdId  = document.getElementById('keywordtd');
				var objCategorytdId  = document.getElementById('Categorytd');
				var objAdvancetdId  = document.getElementById('Advancetd');
				
				var objhidDyComps_IDs = document.getElementById('hidDyComps_ClientID').value; 
				
				if(objhidDyComps_IDs!='')
				{
					var arrobjhidDyComps_IDs = objhidDyComps_IDs.split("~");
				}
				
				var objhidDyFilterTable_IDs = document.getElementById('hidDyFilterTable_ClientID').value;
				if(objhidDyFilterTable_IDs !='')
				{
					
					var arrobjhidDyFilterTable_IDs = objhidDyFilterTable_IDs.split("~");
				}
				
				var objhidSearchText_ID = document.getElementById('hidSearchText_ClientID');
				var objhidDivActive = document.getElementById('hidDivActive');
				objhidDivActive.value=DivType;
				
				if (DivType=='Keywords')
				{
					objtextDivId.style.display = 'block';
					//objbtn1DivId.style.display = 'block';
					objcatDivId.style.display = 'none';
					objkeywordId.className="SearchLinkActive"
					objCategoryId.className="SearchLink"
					objAdvanceId.className="SearchLink"
					
					objkeywordtdId.className="SearchLinkActivetd"
					objCategorytdId.className="SearchLinktd"
					objAdvancetdId.className="SearchLinktd"
					
					if(strClickFrom	== 'Link')
					{
						var tmpSelect =document.getElementById(arrobjhidDyComps_IDs[0]);
						if(tmpSelect.selectedIndex != 0)
						{
							if (typeof(tmpSelect) =='object')
							{
								tmpSelect.selectedIndex=0 
							}
							categoryComboChange(arrobjhidDyComps_IDs[0],arrobjhidDyComps_IDs[1],arrobjhidDyFilterTable_IDs[0],arrobjhidDyFilterTable_IDs[1])
						}
					}
					
				}
				else if (DivType=='Category')
				{
					objtextDivId.style.display = 'none';
					objcatDivId.style.display = 'block';
					objbtn1DivId.style.display = 'none';
					objkeywordId.className="SearchLink"
					objCategoryId.className="SearchLinkActive"
					objAdvanceId.className="SearchLink"
					
					objkeywordtdId.className="SearchLinktd"
					objCategorytdId.className="SearchLinkActivetd"
					objAdvancetdId.className="SearchLinktd"
					
					if (objhidSearchText_ID.value!=	'')
					{
						document.getElementById(objhidSearchText_ID.value).value = "<enter keyword(s)>";
					}
					
				}
				else if(DivType=='Advance')
				{
					objtextDivId.style.display = 'block';
					//objbtn1DivId.style.display = 'none';
					objcatDivId.style.display = 'block';
					//objkeywordId.className="SearchLink"
					//objCategoryId.className="SearchLink"
					objAdvanceId.className="SearchLinkActive"
					
					//objkeywordtdId.className="SearchLinktd"
					//objCategorytdId.className="SearchLinktd"
					objAdvancetdId.className="SearchLinkActivetd"
					
					if(strClickFrom	== 'Link')
					{
						var tmpSelect =document.getElementById(arrobjhidDyComps_IDs[0]);
						if(tmpSelect.selectedIndex != 0)
						{
							if (typeof(tmpSelect) =='object')
							{
								tmpSelect.selectedIndex=0 
							}
							categoryComboChange(arrobjhidDyComps_IDs[0],arrobjhidDyComps_IDs[1],arrobjhidDyFilterTable_IDs[0],arrobjhidDyFilterTable_IDs[1])
						}
					}
					if(strClickFrom	== 'Link')
					{
					if (objhidSearchText_ID.value!=	'')
					{
						document.getElementById(objhidSearchText_ID.value).value = "<enter keyword(s)>";
					}
					}
					
				}
				else
				{
				
					objtextDivId.style.display = 'block';
					//objbtn1DivId.style.display = 'block';
					objcatDivId.style.display = 'none';
					//objkeywordId.className="SearchLinkActive"
					//objCategoryId.className="SearchLink"
					objAdvanceId.className="SearchLink"
					
						
					//objkeywordtdId.className="SearchLinkActivetd"
					//objCategorytdId.className="SearchLinktd"
					objAdvancetdId.className="SearchLinktd"
				}
			}
/*Function added for Search ends here*/