﻿function getQueryString(Val,url) {
	//thisURLparamStr = url;
	thisURLparamStr = document.location.search;
	//chop "?" off thisURLparamStr
	if (thisURLparamStr.charAt(0) == "?") thisURLparamStr = thisURLparamStr.substring(1, thisURLparamStr.length);
	returnStr = "";
	if (thisURLparamStr != "") {
		//Build array out of thisURLparamStr using "&" as delimiter
		divide1=(thisURLparamStr.split("&"))
		for (i=0; i < divide1.length; i++) {
			divide2 = divide1[i].split("=")
			if (unescape(divide2[0]) == Val) {
				returnStr = unescape(divide2[1]);
			}
		}
	}
	return returnStr;
}

function dohigh(){

  themode = getQueryString('mode');
  thetext = getQueryString('word');
  //alert(thetextarray.length);
  if(themode == 1){
	for (i=0;i<=thetextarray.length-1;i++) {
	if(thetext != ""){
		//alert(thetext );
    		var r = document.body.createTextRange();
		while(r.findText(thetext,1,2)){
	    		r.execCommand('ForeColor',false,'ff0000');
	  			r.execCommand('bold', false, null); 
	        	r.moveStart('character',thetext.length);
	        	r.moveEnd('textedit');
		}
	 }
	 }
  }else{
	  if(thetext != ""){
  	  	theArray = thetext.split(';');
	  	for(i=0;i<=theArray.length;i++){
	  	  //temptext = " " + theArray[i] + " ";
		  // case 1 space at the end of file
		  temptext = theArray[i];		  
		  
    		var r = document.body.createTextRange();
	    	while(r.findText(temptext,1,2)){
	    	   r.execCommand('ForeColor',false,'ff0000');
    		   r.execCommand('bold', false, null); 
	    	   r.moveStart('character',temptext.length);
		       r.moveEnd('textedit');		   
    		}
		 }
	  }
  }
}
