// search box js

/* this functions changes the search criteria 
 * and highlights the selected criteria with the search knob pointing towards it
 * arguement 1: search by(search criteria)
 * created: 24 sept 08
 * author: Rupesh Agarwal
 */
function changeSearchBy(sb)
{	
	document.frmSearch.searchBy.value = sb; //change the search by criteria	
	document.getElementById('searchKnob').className = "searchSelectKnob " + sb; //turn the search knob
	
	// highlight the selected search criteria
	if(sb == "songs"){
		document.getElementById('searchByUsers').className = "searchSelectTitle";
		document.getElementById('searchBySongs').className = "searchSelectTitle on";
		document.getElementById('searchByAlbums').className = "searchSelectTitle";
	}
	else if(sb == "albums"){
		document.getElementById('searchByUsers').className = "searchSelectTitle";
		document.getElementById('searchBySongs').className = "searchSelectTitle";
		document.getElementById('searchByAlbums').className = "searchSelectTitle on";
	}
	else{
		document.getElementById('searchByUsers').className = "searchSelectTitle on";
		document.getElementById('searchBySongs').className = "searchSelectTitle";
		document.getElementById('searchByAlbums').className = "searchSelectTitle";
	}
}


/* this functions changes the number of pages to be display for the search
 * arguement 1: change flag..  + to increase, - to decrease
 * created: 24 sept 08
 * author: Rupesh Agarwal
 */
function changePagesDisplay(ch)
{
	var pd = document.frmSearch.pagesDisplay;
	if(ch == '+'){
		if(pd.value == 10){
			pd.value = 25;
		}
		else if(pd.value == 25){
			pd.value = 50;
		}
		else if(pd.value == 50){
			pd.value = 100;
		}
	}
	else if(ch == '-'){
		if(pd.value == 100){
			pd.value = 50;
		}
		else if(pd.value == 50){
			pd.value = 25;
		}
		else if(pd.value == 25){
			pd.value = 10;
		}
	}
	document.getElementById('pagesDisplayValue').className = "pagesDisplay pagesDisplay" + pd.value;
}