﻿// JScript File
<!--

//detect whether popups are blocked
//var mine = window.open('','','width=0,height=0,left=0,top=0,scrollbars=no');
//if(mine)
//    var popupsBlocked = false;
//else
//    var popupsBlocked = true;
//mine.close();

function openInstructions()
{
    window.open("http://mhmr.ky.gov/CalendarOfEvents/Files/Instructions.pdf", "Instructions", "toolbar=no, resizable=yes, scrollbars=yes");
}

function openInstructionsAdd()
{
    window.open("http://mhmr.ky.gov/CalendarOfEvents/Files/InstructionsAdd.pdf", "AddInstructions", "toolbar=no, resizable=yes, scrollbars=yes");
}

function openInstructionsEdit()
{
    window.open("http://mhmr.ky.gov/CalendarOfEvents/Files/InstructionsEdit.pdf", "EditInstructions", "toolbar=no, resizable=yes, scrollbars=yes");
}

function selectEntity()
{
    var e = location.search.substring(1);
}

// Thanks to Jon Wetzel at 4guysfromrolla.com -- http://www.4guysfromrolla.com/webtech/082400-1.shtml
function cc()
{
 /* check for a cookie */
  if (document.cookie == "") 
  {
    /* if a cookie is not found - alert user - change cookieexists field value to false */
    alert("You need to enable JavaScript and cookies in your browser");

    /* If the user has cookies disabled, an alert will let him know that cookies need to be enabled to log on.*/ 

    document.calForm.cookieexists.value = "false"  
  } 
  
  else 
  {
   /* this sets the value to true and nothing else will happen, the user will be able to log on*/
    document.calForm.cookieexists.value = "true"
  }
}

/* DHTML textbox character counter (IE4+) script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
    http://smartwebby.com/DHTML/textbox_characters_counter.asp
*/

/*Caution : If you find that when you are trying to use more then one text box or text area the function doesn't work then check to make sure that the property maxLength of the field is spelled correctly (esp. capital L). You need to change the name of the myCounter field if you use multiple text boxes and also change the reference to it in the event onKeyUp for the respective boxes.
*/

/*Function taLimit is used for the KeyPress event for the text box or text area : When a key is pressed this function checks if the total number of characters typed equals the limit given by the property maxLength for the field. If the limit is reached then it return false thus not allowing any further key press event.
*/
function taLimit() 
{
	var taObj=event.srcElement;
	if (taObj.value.length==taObj.maxLength*1) return false;
}

/*Function taCount is used for the KeyUp event : We use this to change the value of the counter displayed and to truncate the excess characters if any (example if someone has cut and pasted the value into the field when we have allowed paste). To disable paste add the property onpaste="return false" to the field. We use the inner text property of the span element to change the counter displayed.
*/
function taCount(visCnt) 
{ 
	var taObj=event.srcElement;
	if (taObj.value.length>taObj.maxLength*1) taObj.value=taObj.value.substring(0,taObj.maxLength*1);
	if (visCnt) visCnt.innerText=taObj.maxLength-taObj.value.length;
}

//-->
