﻿function toggleVisibility(obj) {
    var el = document.getElementById(obj);	
    el.style.display = (el.style.display != 'none' ? 'none' : '' );
}
function textboxMultilineMaxNumber(txt,maxLen){   
    try{   
        if(txt.value.length > (maxLen-1))return false;   
    }catch(e){   
    }   
}   
function popup(url,name,width,height){

    var params  = 'width='+width;
        params += ', height='+height;

    window.open(url,name,params);
}

/* CALENDAR */
function dateChanged(calendar) {
    if (calendar.dateClicked) {
      var y = calendar.date.getFullYear();
      var m = calendar.date.getMonth(); 
      var d = calendar.date.getDate();  
      CallDateClicker(y,m,d);
    }
};

function dateIsSpecial(year, month, day) {
    if (SearchArray(SpecialDays, day + '/' + (month+1) + '/' + year) > -1)
        return true;
    else
        return false;
};

function SearchArray(arr, value){
    for (i=0;i<arr.length;i++){
        if (arr[i] == value){
            return i;            
        }
    }
    return -1;
}

function CompareDays(eday,position,curday){
    if (eday != curday){
        return -1;
    }else{
        return position;
    }  
}

function dateStatusHandler(date, y, m, d) {
    if (dateIsSpecial(y, date.getMonth(), d)) return 'special';
    else return false;
}