/* Get radio button list value*/
function CheckOtherJobFunction(radioID, textID) {
    /*alert(document.getElementById(radioID)[0].checked);*/
    var radio = document.getElementById(radioID);
    var text = document.getElementById(textID);
    alert(radioID.value + " / " + textID.value);
    /*for (var j = 0; j < radio.length; j++) {
    if (args.value == ''){
       alert(args.value);
       }
    }*/
}

function gXRnvcvOOsXOIKU()
{
/* Munged addy code - YOU CAN EDIT COMMENT THIS TAG BETWEEN THE TWO STARS */
/* SAYS "I'm Having trouble using the events calendar " */
var AguLkxpuivmqijF=["x6e","114","x61","109","x72","x61","116","116","97","x6e","x40","x62","x69","x7a","105","110","102","x6f","x67","x72","x6f","x75","112","x2e","99","97"];
var pHEReGqOYxglSlS=[" "];
var fGsnKtxQhGuqJNJ=["x49","x27","x6d","x20","72","x61","118","105","110","103","32","x74","114","x6f","x75","x62","108","x65","32","117","115","105","x6e","x67","x20","116","x68","x65","x20","x65","118","101","x6e","x74","115","32","99","97","x6c","101","110","100","x61","x72","x20"];
document.write("<a href=\"&#x6d;&#97;&#105;&#x6c;&#x74;&#x6f;&#x3a;");
for (i=0; i<AguLkxpuivmqijF.length; i++) document.write("&#"+AguLkxpuivmqijF[i]+";");
for (i=0; i<pHEReGqOYxglSlS.length; i++) document.write(pHEReGqOYxglSlS[i]);
document.write("\">");
for (i=0; i<fGsnKtxQhGuqJNJ.length; i++) document.write("&#"+fGsnKtxQhGuqJNJ[i]+";");
document.write('</a>');
/* Munged addy code - YOU CAN EDIT COMMENT THIS TAG BETWEEN THE TWO STARS */
}

function enableDisableSearchByDatesButton(triggerPreRenderId, triggerRenderId) {
    /*enable/disable the search button in the search by dates page*/
    var dropdownList;

    dropdownList = document.getElementById(triggerRenderId)
    if(triggerPreRenderId == "ddlYears"){
        document.getElementById('btnSearchByDate').disabled = "disabled";
    }

    if (triggerPreRenderId == "ddlMonths"){
        /*alert(triggerPreRenderId + " / " + dropdownList.options(dropdownList.selectedIndex).value);*/
        if (dropdownList.options(dropdownList.selectedIndex).value > 0) {
            document.getElementById('btnSearchByDate').disabled = "";
            }
            else {
                document.getElementById('btnSearchByDate').disabled = "disabled";
        }
    }
}

function SubmitSearchByDates() {
    /*change the querystring for search by date and submit the form*/

    document.getElementById('seby').value = "date";
    document.getElementById('type').value = "new";
    document.forms[0].action = "/events/search.aspx?seby=date&type=new";
    document.forms[0].submit();
    /*alert(document.getElementById('seby').value + " / " + document.getElementById('type').value);*/
    return false;
}

function testForEnter() 
{    
if (event.keyCode == 13) 
{        
event.cancelBubble = true;
event.returnValue = false;
     }
} 

function ViewPhoto(w, h, aImage, aCaption, aSource) 
{
  h = h + 170;
  w = w + 30;
  var options = "width=" + w + ",height=" + h + ",top=190 ,left=10,";
  options += "resizable=yes,scrollbars=yes,status=no,";
  options += "menubar=no,toolbar=no,location=no,directories=no";
  
   /*sHTML = "";*/
  
  sHTML = "<html><head>";
  sHTML += "<title>Larger photo and full caption</title>";
  sHTML += "<style type='text/css'> ";
  sHTML += "body{font-family:Arial;font-size:11px;} ";
  sHTML += ".caption{font-weight:bold;padding-right:5px;} ";
  sHTML += ".source{color:#666;} ";
  sHTML += "</style>";
  sHTML += "</head>";
  sHTML += "<body>";
  sHTML += "<img src='" + aImage + "'><br/>";
  sHTML += "<span class='caption'>" + aCaption + "</span>";
  if(aSource.length >0) 
    sHTML += "<p class='source'>" + aSource +"</p>"; 
  sHTML += "<p><input type='button' onclick='window.close();' value='Close' /></p>";
  sHTML += "</body></html>";
  
  var photowindow = window.open('', 'actualphotosize', options);
  photowindow.document.write(sHTML);
  photowindow.document.close();
  photowindow.focus();
}

function resizeText(multiplier, aContainer) {
  	var children = document.getElementById(aContainer).getElementsByTagName('*');
	if(children.length > 0) {
	  	for (i=0;i<children.length;i++){
			if (children[i].style.fontSize == "" || children[i].style.fontSize == "small" || children[i].style.fontSize == "x-small") {
			    children[i].style.fontSize = "12px";
			}
			children[i].style.fontSize = parseFloat(children[i].style.fontSize) + (multiplier * 2) + "px";
		}
	} else {
		if (document.getElementById(aContainer).style.fontSize == "") {
			document.getElementById(aContainer).style.fontSize = "12px";
  		}
		document.getElementById(aContainer).style.fontSize = parseFloat(document.getElementById(aContainer).style.fontSize) + (multiplier * 0.2) + "em";
 	}
}

function ReadCookie(name)
{
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
}


function SetCookie(c_name, value, expireDays, expireHours)
{
	var exdate = new Date();
	
	exdate.setDate(exdate.getDate() + expireDays);
	exdate.setTime(exdate.getTime() + expireHours * 60 * 60 * 1000);

	document.cookie = c_name + "=" + escape(value) + 
		((expireDays == null) ? "" : ";expires=" + exdate.toGMTString()) + "; path=/";
}

/* For Article TabContainer tabbed controls (used to remember which tab was selected after page reload)*/
function SetActiveTab(sender, args) 
{
	SetCookie(sender.get_id(), sender.get_activeTabIndex(), 0, 1);
	
}


function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "parent")
     anchor.target = "_top";
 }
}

function openwin(aurl, awidth, aheight, atop, aleft) {
	winpops=window.open(aurl,'smallwindow', 'top=' + atop + ',left=' + aleft + ',width=' + awidth + ',height=' + aheight,'scrollbars=no');
	winpops.focus();
}