// page created by create_referer_parse_js
	var seInfo = new Array()
	
	// Object constructor
	function seInfoRecord(se, delim1, delim2, searchVar, startVar, recPerPage) {
	   this.se = se;
	   this.delim1 = delim1;
	   this.delim2 = delim2;
	   this.searchVar = searchVar;
	   this.startVar = startVar;
	   this.recPerPage = recPerPage;
	}
	
	
		seInfo[0] = new seInfoRecord('1stblaze.com', '?', '&', 'kwd:query:xml_kwd', '', '')
	
		seInfo[1] = new seInfoRecord('altavista.com', '?', '&', 'q', 'stq', '10')
	
		seInfo[2] = new seInfoRecord('aol.com', '?', '&', 'query', 'page', '1')
	
		seInfo[3] = new seInfoRecord('ask.co.uk', '?', '&', 'q', 'b', '10')
	
		seInfo[4] = new seInfoRecord('att.net', '?', '&', 'qry', 'base', '10')
	
		seInfo[5] = new seInfoRecord('comcast.net', '?', '&', 'query', 'base', '10')
	
		seInfo[6] = new seInfoRecord('cometsystems.com', '?', '&', 'qry', 'start', '10')
	
		seInfo[7] = new seInfoRecord('cs.com', '?', '&', 'query', 'first', '10')
	
		seInfo[8] = new seInfoRecord('dogpile.com', '?', '&', 'qkw', 'top', '1')
	
		seInfo[9] = new seInfoRecord('earthlink.net', '?', '&', 'q', 'start', '10')
	
		seInfo[10] = new seInfoRecord('excite.com', '?', '&', 'qkw', 'top', '1')
	
		seInfo[11] = new seInfoRecord('getfound.com', '?', '&', 'MT', 'DB', '10')
	
		seInfo[12] = new seInfoRecord('getitandgo.com', '?', '&', 'terms', '', '1')
	
		seInfo[13] = new seInfoRecord('google.ca', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[14] = new seInfoRecord('google.co.in', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[15] = new seInfoRecord('google.co.nz', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[16] = new seInfoRecord('google.co.uk', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[17] = new seInfoRecord('google.com', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[18] = new seInfoRecord('google.com.au', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[19] = new seInfoRecord('google.com.mx', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[20] = new seInfoRecord('google.de', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[21] = new seInfoRecord('google.fr', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[22] = new seInfoRecord('google.it', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[23] = new seInfoRecord('google.nl', '?', '&', 'q:as_q', 'start', '10')
	
		seInfo[24] = new seInfoRecord('infospace.com', '?', '&', 'qkw', 'top', '1')
	
		seInfo[25] = new seInfoRecord('iwon.com', '?', '&', 'searchfor', 'fr', '10')
	
		seInfo[26] = new seInfoRecord('kd.mysearch.myway.com', '?', '&', 'searchfor', 'fr', '10')
	
		seInfo[27] = new seInfoRecord('metacrawler.com', '?', '&', 'qkw', 'top', '1')
	
		seInfo[28] = new seInfoRecord('msn.com', '?', '&', 'q', 'pn', '1')
	
		seInfo[29] = new seInfoRecord('mysearch.com', '?', '&', 'searchfor', 'fr', '10')
	
		seInfo[30] = new seInfoRecord('myway.com', '?', '&', 'searchfor', 'fr', '10')
	
		seInfo[31] = new seInfoRecord('mywebsearch.com', '?', '&', 'searchfor', 'fr', '10')
	
		seInfo[32] = new seInfoRecord('netscape.com', '?', '&', 'query', 'start', '10')
	
		seInfo[33] = new seInfoRecord('teoma.com', '?', '&', 'q', 'page', '1')
	
		seInfo[34] = new seInfoRecord('yahoo.com', '?', '&', 'p:va:vp', 'b', '20')
	
		seInfo[35] = new seInfoRecord('aolsearch.aol.com', '?', '&', 'query', 'page', '1')
	
		seInfo[36] = new seInfoRecord('mysearch.myway.com', '?', '&', 'searchfor', 'fr', '10')
	
		seInfo[37] = new seInfoRecord('home.bellsouth.net', '?', '&', 'string', 'start', '10')
	
		seInfo[38] = new seInfoRecord('google.com.ph', '?', '&', 'q:as_q', 'start', '10')
	
	
	function extractPage(URL){
		var SE = extractSE(URL);
		var page = '';
		for(var i = 0; i < seInfo.length; i++){
			if(seInfo[i].se == SE){
				URL = URL.replace(seInfo[i].delim1, seInfo[i].delim2);
				if(URL.indexOf(seInfo[i].delim2 + seInfo[i].startVar + '=') > -1){
					var matchOffset = seInfo[i].delim2 + seInfo[i].startVar + '=';
					matchOffset = matchOffset.length;
					page = URL.substr(URL.indexOf(seInfo[i].delim2 + seInfo[i].startVar + '=') + matchOffset)
					
					if(page.indexOf(seInfo[i].delim2) == -1){ // end of query string so page variable ready
						page = page / seInfo[i].recPerPage;
					}else{ //strip off irrelevant querystring variables
						page = page.substring(0, page.indexOf(seInfo[i].delim2)) / seInfo[i].recPerPage
					}
					
					if(page < 1 || isNaN(page) == 1){
						return 1;
					}else{
						if(seInfo[i].recPerPage == 1){
							return page; // don't add since page 1 is page 1
						}else{
							return page + 1; //add 1 since start=20 is actually page 3
						}
					}
				}else{// no match found so return 1 as page
					return 1;
				}
			}
		}
		return 1; // no se matched so return 1 as page
	}
	
	function extractKeywords(URL){
		var SE = extractSE(URL);
		var keywords = '';
		var searchVar = '';
		for(var i = 0; i < seInfo.length; i++){
			if(seInfo[i].se == SE){
				URL = URL.replace(seInfo[i].delim1, seInfo[i].delim2);
				searchVarArray = seInfo[i].searchVar.split(':');
				for(var i = 0; i < searchVarArray.length; i++){
					if(URL.indexOf(seInfo[i].delim2 + searchVarArray[i] + '=') > -1){
						searchVar = searchVarArray[i]
					}
				}
				if(searchVar == ''){
					return '';
				}
				if(URL.indexOf(seInfo[i].delim2 + searchVar + '=') > -1){
					var matchOffset = seInfo[i].delim2 + searchVar + '=';
					matchOffset = matchOffset.length;
					keywords = URL.substr(URL.indexOf(seInfo[i].delim2 + searchVar + '=') + matchOffset)
					
					if(keywords.indexOf(seInfo[i].delim2) > -1){ // strip off irrelevant querystring variables
						keywords = keywords.substring(0, keywords.indexOf(seInfo[i].delim2))
					}
					
					keywords = Trim(keywords);
					keywords = unescape(keywords);
					keywords = keywords.replace(/&/g, '%26');
					keywords = keywords.replace(/,/g, ' ');
					keywords = keywords.replace(/\++/g, ' ');
					keywords = keywords.replace(/\s+/g, '+');
					
					return keywords;
					
				}else{ // no match found so return - as keywords
					return '';
				}
			}
		}
		return ''; // no se matched so return - as page
	}
	
	function extractSE(URL){
		if(URL.indexOf('\/\/') == -1){
			return '';
		}
		var SE = URL.substr(URL.indexOf('\/\/') + 2);
		if(SE.indexOf('\/') > -1){
			SE = SE.substring(0, SE.indexOf('\/'));
		}
		if(SE.indexOf('www.') == 0){
			SE = SE.substr(4);
		}
		if(SE.indexOf('search.') == 0){
			SE = SE.substr(7);
		}
		return SE;
	}