






var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	
	closeWin();
		
	type = type.toLowerCase();
	
	if (type == "fullscreen"){
		strWidth = screen.availWidth;
		strHeight = screen.availHeight;
	}
	var tools="";
	if (type == "standard") tools = "resizable,toolbar=no,location=no,scrollbars=yes,menubar=no,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console" || type == "fullscreen") tools = "resizable,toolbar=yes,menubar=yes,location=no,scrollbars=yes,width="+strWidth+",height="+strHeight+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

function doPopUp(e)
{
//set defaults - if nothing in rel attrib, these will be used
var t1 = "standard";
var w1 = "640";
var h1 = "700";
//look for parameters
attribs = this.rel.split(" ");
if (attribs[1]!=null) {t1 = attribs[1];}
if (attribs[2]!=null) {w1 = attribs[2];}
if (attribs[3]!=null) {h1 = attribs[3];}
//call the popup script
popUpWin(this.href,t1,w1,h1);
//cancel the default link action if pop-up activated
if (window.event) 
	{
	window.event.returnValue = false;
	window.event.cancelBubble = true;
	} 
else if (e) 
	{
	e.stopPropagation();
	e.preventDefault();
	}
}

function findPopUps()
{
var popups = document.getElementsByTagName("a");
for (i=0;i<popups.length;i++)
	{
	if (popups[i].rel.indexOf("popup")!=-1)
		{
		// attach popup behaviour
		popups[i].onclick = doPopUp;
		// add popup indicator

		}
	}
}



addEvent(window, 'load', findPopUps, false);


function addEvent(elm, evType, fn, useCapture){if(elm.addEventListener){elm.addEventListener(evType, fn, useCapture);return true;}else if (elm.attachEvent){var r = elm.attachEvent('on' + evType, fn);return r;}else{elm['on' + evType] = fn;}}



var ie4 = false; 

if(document.all) { 
	ie4 = true; 
}
	
function getObject(id) { 
	if (ie4) { 
		return document.all[id]; 
	} else { 
		return document.getElementById(id); 
	} 
}

function Expand_It(divId) {
    var e = getObject(divId);
    if(e.style.display == 'none') {
        e.style.display = 'block';
        return(false);
    } else {
        e.style.display = 'none';
        return(false);
    }

}



var ie4 = false; 

if(document.all) { 
	ie4 = true; 
}
	
function getObject(id) { 
	if (ie4) { 
		return document.all[id]; 
	} else { 
		return document.getElementById(id); 
	} 
}

function ShowDivOnly(divId0, divId1, divId2, divId3, divId4, divId5, divId6, divId7, divId8, divId9) {
    var m = getObject(divId0);
    var p = getObject(divId1);
    var o = getObject(divId2);
    var r = getObject(divId3);
    var s = getObject(divId4);
    var t = getObject(divId5);
    var u = getObject(divId6);
    var v = getObject(divId7);
    var w = getObject(divId8);    
	var x = getObject(divId9);



    if(m.style.display == 'none') {

        m.style.display = 'block';
        p.style.display = 'none';
        o.style.display = 'none';
        r.style.display = 'none';
        s.style.display = 'none';
        t.style.display = 'none';
        u.style.display = 'none';
        v.style.display = 'none';
        w.style.display = 'none';
        x.style.display = 'none';
        return(false);
    } else {

        m.style.display = 'none';
        p.style.display = 'none';
        o.style.display = 'none';
        r.style.display = 'none';
        s.style.display = 'none';
        t.style.display = 'none';
        u.style.display = 'none';
        v.style.display = 'none';
        w.style.display = 'none';
        x.style.display = 'none';
        return(false);
    }

}


// start build calander script
function buildCal(m, y, cM, cH, cDW, cD, brdr){
var mn=['January','February','March','April','May','June','July','August','September','October','November','December'];
var dim=[31,0,31,30,31,30,31,31,30,31,30,31];

var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st

var todaydate=new Date() //DD added
var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate() : 0 //DD added

dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
var t='<div class="'+cM+'"><table class="'+cM+'" cols="7" cellpadding="0" border="'+brdr+'" cellspacing="0"><tr align="center">';
t+='<td colspan="7" align="center" class="'+cH+'">'+mn[m-1]+' - '+y+'</td></tr><tr align="center">';
for(s=0;s<7;s++)t+='<td class="'+cDW+'">'+"SMTWTFS".substr(s,1)+'</td>';
t+='</tr><tr align="center">';
for(i=1;i<=42;i++){
var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))? i-oD.od+1 : '&nbsp;';
if (x==scanfortoday) //DD added
x='<span id="today">'+x+'</span>' //DD added
t+='<td class="'+cD+'">'+x+'</td>';
if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">';
}
return t+='</tr></table></div>';
}

// end build calander script






















