			function isEmpty(str){
				if (str == ""){ return true;} return false;
				
			}
			
			
			
			function archive_find(l, cur_cat){
				
			
				//set url
				siteurl = 'http://truffle.com/';
				//change location to archive
				if (l == 'fr'){
					siteurl = siteurl + 'fr/';
				}
				//clear errors
				
				errorDivMsgID = document.getElementById("search-msg_" + cur_cat);	
				errorDivMsgID.style.display = 'none';
				errorDivMsgID.innerHTML = '';
				
				//clear values
				archive_company = "";
				archive_year = "";
				
				//getsearchform values
				
				//year
				archive_year = document.getElementById('archive_year_' + cur_cat);
				year = archive_year.options[archive_year.selectedIndex].value;
				
				//company/cat
				archive_company = document.getElementById('archiveby_company_' + cur_cat);
				cat = archive_company.options[archive_company.selectedIndex].value;
				
				//split cat
				var cat_ar = cat.split(",");
				//cat_ar[0] - ID
				//cat_ar[1] - SLUG
				
				
				
				//check for URL's to change localtion to
				if (isEmpty(cat) && isEmpty(year)){
					//both empty ask search field
					
					errorDivMsgID.style.display = '';
					errorDivMsgID.innerHTML = 'Please select year or company to search';		
					
				}
				
				//display URL base on wht's being called
				//year only


				if (isEmpty(cat)   && !isEmpty(year) ){
						//emty cat == true, not empty year == true
						//year only
						
						
						//check if it's a newsletter
						if (cur_cat ){
							document.location.href= siteurl + year + '?cat=' + cur_cat;	
						}else{
							document.location.href= siteurl + year
						}
						
				}	
				
				
				if (isEmpty(year)   && !isEmpty(cat) ){
						//emty year == true, not empty cat == true
						//cat only
					document.location.href= siteurl + '/category/archives/' + cat_ar[1];
				}

				
				if (!isEmpty(cat)  && !isEmpty(year)){
					//all have selected values

					document.location.href= siteurl + year + '?cat=' + cat_ar[0];
				}
				
					
				
			
			}//end of function archive_newsletter
			
		
