/*
	function checkQueryString(action){
		
		var rxJobs		= /(?:code|jobs|job)=([^&]+)/
		var rxKeyword	= /keyword=(\w+)/
		
		var rxNames		= /[?&](\w+)/
		var rxValues	= /=([^&]+)/
		
		if(location.search){
			
			// get matches
				var matchesJobs		= location.search.match(rxJobs)
				var matchesKeyword	= location.search.match(rxKeyword)

				console.log(matchesJobs)

			// jobs
				if(matchesJobs){
					
					var arrJobs		= matchesJobs[1].split(',')
					var firstJob	= arrJobs[0]
	
					$('#' +code+ ' .job-preview').hide()
					showJobs(arrJobs)
					
					if(arrJobs.length == 1){
						cache.previewCode = firstJob
						clickJob(cache.previewCode)
						}
					}
	
			// keyword
				else if(matchesKeyword){
					var keyword	= matchesKeyword[1]
					keywordClick(keyword)
					}
			
			}
		}
*/



	function checkQueryString(action){
		
		var rxNames		= /[?&](\w+)/
		var rxValues	= /=([^&]+)/
		
		if(location.search){
			
			// get matches
				var names		= location.search.match(rxNames)
				var values		= location.search.match(rxValues)

			// check matches
				if( !(names && values) )return
				
			// act on matches

				var name	= names[1]
				var value	= values[1].replace(/\+/g, ' ')
				
				switch(name){
					
					case 'job' :
					case 'jobs' :
					case 'code' :
						var jobs		= value.split(',')
						var firstJob	= jobs[0]
						$('#' +code+ ' .job-preview').hide()
						showJobs(jobs)
						if(jobs.length == 1){
							cache.previewCode = firstJob
							clickJob(cache.previewCode)
							}
						break;
					
					case 'searchKeyword':
					case 'keyword':
						var keyword	= value
						keywordClick(keyword)
						break;
					
					case 'searchDomain':
					case 'domain':
						var keywords = value.split(' ')
						console.log(keywords)
						domainClick(keywords[0], keywords[1])
						break;
					
					}
			}
		}
