<!--

//for mouseovers
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// for printer friendly page
function changeref()
{
//alert(document.getElementById('myHref').href.indexOf("?"));
if (document.getElementById('myHref').href.indexOf("?")>0)
	{
		var str=document.getElementById('myHref').href.toLowerCase();
    if (str.indexOf("body.aspx")>0) 
    	{
    		var strparent =parent.document.URL.toLowerCase();
      document.getElementById('myHref').href =strparent.replace("body.aspx","blank.aspx");
      }          
    else
     	{
    	document.getElementById('myHref').href =parent.document.URL + '&master=blank';
    	}
	}
    return;
}

	letterexp = /([a-z][0-9]|[a-z])/i;
	var sm_reEmpty = /^\s*$/;
	var sm_reLeading = /^(\s+)/i;
	var sm_reEnding = /(\s+)$/i;	
	var sm_reInteger = /^\d+$/;
	var sm_reComma = /(,)/g;	
	function sm_Trim(s) {
		var mystr = s;
		var myArr = sm_reEmpty.exec(mystr);
		if (myArr != null) {
			return "";
		}
		var myArr = sm_reLeading.exec(mystr);
		if (myArr != null) {
			if (RegExp.rightContext) {
				mystr = RegExp.rightContext;
			} else {
				mystr = mystr.substring(RegExp.$1.length, mystr.length);
			}
		}
		myArr = sm_reEnding.exec(mystr);
		if (myArr != null) {
			if (RegExp.leftContext) {
				mystr = RegExp.leftContext;
			} else {
				mystr = mystr.substring(0, (mystr.length - RegExp.$1.length));
			}
		}
		return mystr;
	}
	function hasLetter(str) {
		return letterexp.test(str)
	}		
	function checkform(form,element,required) {		
		var strAlertMsg = "";	
		var strTest = "";
		var bRequired = required;
		var strSearchText = form[element].value;	
		strSearchText = sm_Trim(strSearchText);
		if(strSearchText.length == 0){
			if(bRequired){				
				strAlertMsg += "* " + form[element+"_required"].value + "\n";					
			}
		}else{		
			if (!hasLetter(strSearchText)) { 
				strAlertMsg += "* " + "Invalid search; your search query contained invalid values." + "\n";				
				form[element].focus(); 				 
			} else {							
				strTest = modify_search(strSearchText); 	
				strTest = sm_Trim(strTest);					
				if(!strTest.length) { 					
					strAlertMsg += "* " + "Invalid search; your search query contained ignored words. \n Try changing some of the words in your search query." + "\n";	
					form[element].focus(); 					
				} else {
					form[element].value = strTest; 							
				}				
			}
		}	
		if(strAlertMsg.length){
			alert(strAlertMsg);	
			return false;		
		}
		return true;
	}		
	function remove_noise(phrase) { 	
		//dimensionalizing variables 	 
		array_phrase = new Array(); 
		array_pruned = new Array(); 	
		var noisearray = new Array ("about","1","after","2","all","also","3","am","an","4","and","5","another","6","any","7","are","8","as","9","at","0","be","$","because","been","before","being","between","both","but","by","came","can","come","could","did","do","each","for","from","get","got","has","had","he","have","her","here","him","himself","his","how","if","in","into","is","it","like","make","many","me","might","more","most","much","must","my","never","now","of","on","only","or","other","our","out","over","said","same","see","should","since","some","still","such","take","than","that","the","their","them","then","there","these","they","this","those","through","to","too","under","up","very","was","way","we","well","were","what","where","which","while","who","with","would","you","your","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","."); 	
		var array_pruned_length = 0; 
		var counter = 0; 
		var counter1 = 0; 
		var counter2 = 0; 	
		var length = 0; 
		var noise_array_counter = 0; 
		var search_phrase = ""; 
		var phrase1 = ""; 
		var temp_string = "";
		var arrSearchPhrases = "";
		var strSearchPhrases = "";
		phrase1 = phrase;	
		
		//spliting the search phrase into an array 
		array_pruned = phrase.split(" ");
		array_pruned_length = array_pruned.length;		
		for(counter=0;counter < array_pruned_length;counter++) {		
			noisearrayElement = array_pruned[counter].toLowerCase();	 
			counter2 = 0;
			counter1 = 0;		
			for (counter1=0;counter1 < noisearray.length;counter1++) {						
				if(noisearrayElement == noisearray[counter1]) {							
					search_phrase = array_pruned[counter];
					search_phrase_mid_position = " " + array_pruned[counter] + " ";					
					search_phrase_first_position = array_pruned[counter] + " ";		
					search_phrase_last_position = " " + array_pruned[counter];				
					counter2 = phrase.indexOf(search_phrase,0); 
					counter3 = phrase.indexOf(search_phrase_mid_position,0);
					counter4 = phrase.indexOf(search_phrase_first_position,0);
					counter5 = phrase.indexOf(search_phrase_last_position,0);				
					if(counter2 >= 0 || counter3 >= 0 || counter4 >= 0 || counter5 >= 0){	
						if(counter2 >= 0){					
							temp_string = new RegExp(search_phrase);								
						}
						if(counter3 >= 0 || counter5 >= 0){
							temp_string = new RegExp(search_phrase_last_position);	
						}
						if(counter4 >= 0){
							temp_string = new RegExp(search_phrase_first_position);	
						}						
						phrase = phrase.replace(temp_string,"");										
					}					
				} 
			} 
		}	
		return phrase;	
	} 	
	function modify_search(phrase){						
		strphrase = phrase.replace(sm_reComma," ");				
		var modifiedPhrase = "";
		var strSearchPhrases = "";
		var strSQOriginalPhrase = "";				
		var searchPhraseRegExp = /['"][^'"]*['"]/g;
		searchTest = searchPhraseRegExp.test(strphrase);		
		if(searchTest){
			arrSearchPhrases = strphrase.match(searchPhraseRegExp);	
			var i = 0;
			for(i=0;i < arrSearchPhrases.length;i++){		
				array_SearchPhrase = new Array(); 
				removeQuotes = /['"]/g;	
				strOriginalPhrase = arrSearchPhrases[i];
				searchPhraseValue = arrSearchPhrases[i];				
				searchPhraseValue = searchPhraseValue.replace(removeQuotes,"");					
				//Split search phrase		
				array_SearchPhrase = searchPhraseValue.split(" ");		
				var s = 0;
				var strModifiedSearchPhrase = "";
				for(s=0;s < array_SearchPhrase.length;s++){
					strSearchPhrase = remove_noise(array_SearchPhrase[s]);					
					if(strSearchPhrase.length > 0){
						if(strModifiedSearchPhrase.length > 0){
							strModifiedSearchPhrase += " " + strSearchPhrase;
						}else{
							strModifiedSearchPhrase += strSearchPhrase;
						}
					}
				}				
				RegExpSearchPhrase = new RegExp(strOriginalPhrase);
				strphrase = strphrase.replace(RegExpSearchPhrase,"");	
				if(strModifiedSearchPhrase.length){
					searchPhraseValue = '"' + searchPhraseValue + '"';					
					strSearchPhrases += " " + searchPhraseValue;											
				}
			}
		}	
		if(strphrase.length){			
			strphrase = remove_noise(strphrase);
			strphrase = sm_Trim(strphrase);
		}
		modifiedPhrase = strphrase + strSearchPhrases;
		return modifiedPhrase;
	}		
--> 

