



function textInputOn(textInput,defaultValue){
  if(document.getElementById(textInput).value == defaultValue){
    document.getElementById(textInput).value = '';
  } 
}


function textInputOff(textInput,defaultValue){
  var textInputTime = setTimeout("if(document.getElementById('"+textInput+"').value == ''){document.getElementById('"+textInput+"').value = '"+defaultValue+"';}",280);   
}






function turnOnTextInputs(){

  try{
	  document.getElementById('keyword-input').onfocus = function(){textInputOn('keyword-input','Keyword Search');} 
	  document.getElementById('keyword-input').onblur = function(){textInputOff('keyword-input','Keyword Search');}
  }
	  catch(err){
  }  

}








function convert (string) {
  var aCode = 'a'.charCodeAt();
  var zCode = 'z'.charCodeAt();
  var ACode = 'A'.charCodeAt();
  var ZCode = 'Z'.charCodeAt();
  var result = '';
  for (var c = 0; c < string.length; c++) {
    var charCode = string.charCodeAt(c);
    if (charCode >= aCode && charCode <= zCode)
      charCode = aCode + (charCode - aCode + 13) % 26;
    else if (charCode >= ACode && charCode <= ZCode)
      charCode = ACode + (charCode - ACode + 13) % 26;
    result += String.fromCharCode(charCode);
  }
  return result;
}






function showMap(strURL, strType, strHeight, strWidth) {
var newWin = null;
 if (newWin != null && !newWin.closed)
   newWin.close();
 var strOptions="";
 if (strType=="console")
   strOptions="resizable,height="+
     strHeight+",width="+strWidth;
 if (strType=="fixed")
   strOptions="status,height="+
     strHeight+",width="+strWidth;
 if (strType=="elastic")
   strOptions="toolbar,menubar,scrollbars,"+
     "resizable,location,height="+
     strHeight+",width="+strWidth;
 newWin = window.open(strURL, 'newWin', strOptions);
 newWin.focus();
}
