


/* clock */

function clockrock()
{
	if (!document.layers&&!document.all&&!document.getElementById)
	
		return

		var Digital=new Date()
		var year=Digital.getYear()
 		var month=Digital.getMonth()
 			if(month==0) month="Jan";
			if(month==1) month="Feb";
			if(month==2) month="Mar";
			if(month==3) month="Apr";
			if(month==4) month="May";
			if(month==5) month="Jun";
			if(month==6) month="Jul";  
			if(month==7) month="Aug";  
			if(month==8) month="Sep";  
			if(month==9) month="Oct";        
			if(month==10) month="Nov";  
			if(month==11) month="Dec";  
    	
		var date=Digital.getDate() 
		var day=Digital.getDay() 
			if(day==1) day="Mon";
			if(day==2) day="Tue";
			if(day==3) day="Wed";
			if(day==4) day="Thu";
			if(day==5) day="Fri";
			if(day==6) day="Sat";
			if(day==0) day="Sun"; 
		var hours=Digital.getHours()
		var minutes=Digital.getMinutes()
		var seconds=Digital.getSeconds()

		var dn="PM"
			if (hours<12) dn="AM"
			if (hours>12) hours=hours-12
			if (hours==0) hours=12

			if (minutes<=9) minutes="0"+minutes
			if (seconds<=9) seconds="0"+seconds

		myclock=""+hours+":"+minutes+":" +seconds+" "+dn+" "+day+", "+month+" "+date+" "+year+"&nbsp;&nbsp;&nbsp;&nbsp;"
		
		if (document.layers)
		{
			document.layers.liveclock.document.write(myclock)
			document.layers.liveclock.document.close()
		}
		else if (document.all)
			liveclock.innerHTML=myclock
		else if (document.getElementById)
			document.getElementById("liveclock").innerHTML=myclock
	
		setTimeout("clockrock()",1000)
	
 }


	
/* END clock */








/* Pop window */

function go_openwindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

/* END Pop window */







/* confirm link warning */

function confirmLink(theLink, text){

    var is_confirmed = confirm(text);

    return is_confirmed;

} 

/* End confirmation link warning */







/* Check/uncheck tables */

function setCheckboxes(the_form, do_check) {

    var elts      = document.forms[the_form].elements['page_id[]'];
    var elts_cnt  = elts.length;

    for (var i = 0; i < elts_cnt; i++) {
        elts[i].checked = do_check;
    } 
	// end for

    return true;

} 

/* End Check/uncheck tables */

	
	
	
	


/* Sets table color background on click */

function setPointer(theRow, theAction, theDefaultColor, thePointerColor, theMarkColor) {

    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) {
        if (theAction == 'out') {
            newColor = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor = (thePointerColor != '')
                     ? thePointerColor
                     : theDefaultColor;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
	
} 

/* Sets table color background on click */










/* find object */

function findObj(n, d) { 
	
	var p,i,x;  
  
	if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	
	if(!(x=d[n])&&d.all) x=d.all[n]; 
	
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	
	if(!x && document.getElementById) x=document.getElementById(n); 
	
	return x;
	
}

/* end	*/







