function activateMenu(nav) {

    /* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) {  
				
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");  
        
        for (var i=0; i<lis.length; i++) {
        	
           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){            	
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {	                  
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() {                   
                   this.lastChild.style.display="none";
                }
            }
        }
    }
}
/*
 * (C) Copyright 2006 Rits. All rights reserved.
 * Use is subject to license terms.
 */

/**
 * Cross-Browser DHTML library
 *
 * @author Michael Foster
 * @author Juciano Araujo
 * @version 3.15.2
 */

/* version */
var xVersion='3.15.2',xNN4,xOp7,xOp5or6,xIE4Up,xIE4,xIE5,xMac,xUA=navigator.userAgent.toLowerCase();
if (window.opera){
	xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
	if (!xOp7) 
		xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
} else if (document.all && xUA.indexOf('msie')!=-1) {
	xIE4Up=parseInt(navigator.appVersion)>=4;
	xIE4=xUA.indexOf('msie 4')!=-1;
	xIE5=xUA.indexOf('msie 5')!=-1;
} else if (document.layers) {
	xNN4=true;
}
xMac=xUA.indexOf('mac')!=-1;

/**
  * Get element by Id
  *
  * @param string Element name
  * @return object Element object
  */
function xGetElementById(e) {
	if(typeof(e)!='string') 
		return e;
	if(document.getElementById) 
		e=document.getElementById(e);
	else if(document.all) 
		e=document.all[e];
	else 
		e=null;
	return e;
}

/**
  * Get parent
  *
  * @param string Element name
  * @param boolean Node
  * @return object Parent object
  */
function xParent(e,bNode){
	if (!(e=xGetElementById(e))) return null;
	var p=null;
	if (!bNode && xDef(e.offsetParent)) p=e.offsetParent;
	else if (xDef(e.parentNode)) p=e.parentNode;
	else if (xDef(e.parentElement)) p=e.parentElement;
	return p;
}

/**
  * Verifies if defined
  * 
  * @param mixed
  * @return boolean
  */
function xDef() {
	for(var i=0; i<arguments.length; ++i){
		if(typeof(arguments[i])=='undefined') 
			return false;
	}
	return true;
}

/**
  * Verifies if string
  *
  * @param mixed
  * @return boolean
  */
function xStr(s) {
	for(var i=0; i<arguments.length; ++i){
		if(typeof(arguments[i])!='string') 
			return false;
	}
	return true;
}

/**
  * Verifies if number
  *
  * @param mixed
  * @return boolean
  */
function xNum(n) {
	for(var i=0; i<arguments.length; ++i){
		if(typeof(arguments[i])!='number') 
			return false;
	}
	return true;
}

/**
  * Shows element
  *
  * @param string Element name
  */
function xShow(e) {
	if(!(e=xGetElementById(e))) 
		return;
	if(e.style && xDef(e.style.visibility)) 
		e.style.visibility='visible';
}

/**
  * Hides element
  *
  * @param string Element name
  */
function xHide(e) {
	if(!(e=xGetElementById(e))) 
		return;
	if(e.style && xDef(e.style.visibility)) 
		e.style.visibility='hidden';
}

/**
  * Sets z index
  *
  * @param string Element name
  * @param int Z index
  * @return int Z index
  */
function xZIndex(e,uZ) {
	if(!(e=xGetElementById(e))) 
		return 0;
	if(e.style && xDef(e.style.zIndex)) {
		if(xNum(uZ)) 
			e.style.zIndex=uZ;
		uZ=parseInt(e.style.zIndex);
	}
	return uZ;
}

/**
  * Sets element color
  *
  * @param string Element name
  * @param string Color
  * @return string Color
  */
function xColor(e,sColor) {
	if(!(e=xGetElementById(e))) 
		return '';
	var c='';
	if(e.style && xDef(e.style.color)) {
		if(xStr(sColor)) 
			e.style.color=sColor;
		c=e.style.color;
	}
	return c;
}

/**
  * Sets element background
  *
  * @param string Element name
  * @param string Color
  * @param string Image url
  * @return string Background
  */
function xBackground(e,sColor,sImage) {
	if(!(e=xGetElementById(e))) 
		return '';
	var bg='';
	if(e.style) {
		if(xStr(sColor)) {
			if(!xOp5or6) 
				e.style.backgroundColor=sColor;
			else e.style.background=sColor;
		}
		if(xStr(sImage)) 
			e.style.backgroundImage=(sImage!='')? 'url('+sImage+')' : null;
		if(!xOp5or6) 
			bg=e.style.backgroundColor;
		else 
			bg=e.style.background;
	}
	return bg;
}

/**
  * Move element
  *
  * @param string Element name
  * @param int X
  * @param int Y
  */
function xMoveTo(e,iX,iY) {
	xLeft(e,iX);
	xTop(e,iY);
}

/**
  * Sets element left position
  *
  * @param string Element name
  * @param int X
  * @return int X
  */
function xLeft(e,iX) {
	if(!(e=xGetElementById(e))) 
		return 0;
	var css=xDef(e.style);
	if (css && xStr(e.style.left)) {
		if(xNum(iX)) 
			e.style.left=iX+'px';
		else {
			iX=parseInt(e.style.left);
			if(isNaN(iX)) 
				iX=0;
		}
	} else if(css && xDef(e.style.pixelLeft)) {
		if(xNum(iX)) 
			e.style.pixelLeft=iX;
		else 
			iX=e.style.pixelLeft;
	}
	return iX;
}

/**
  * Sets element top position
  *
  * @param string Element name
  * @param int Y
  * @return int Y
  */
function xTop(e,iY) {
	if(!(e=xGetElementById(e))) 
		return 0;
	var css=xDef(e.style);
	if(css && xStr(e.style.top)) {
		if(xNum(iY)) 
			e.style.top=iY+'px';
		else {
			iY=parseInt(e.style.top);
			if(isNaN(iY)) 
				iY=0;
		}
	} else if(css && xDef(e.style.pixelTop)) {
		if(xNum(iY)) 
			e.style.pixelTop=iY;
		else 
			iY=e.style.pixelTop;
	}
	return iY;
}

/**
  * Gets page X
  *
  * @param string Element name
  * @return int X
  */
function xPageX(e) {
	if (!(e=xGetElementById(e))) 
		return 0;
	var x = 0;
	while (e) {
		if (xDef(e.offsetLeft)) 
			x += e.offsetLeft;
		e = xDef(e.offsetParent) ? e.offsetParent : null;
	}
	return x;
}

/**
  * Gets page Y
  *
  * @param string Element name
  * @return int Y
  */
function xPageY(e) {
	if (!(e=xGetElementById(e))) 
		return 0;
	var y = 0;
	while (e) {
		if (xDef(e.offsetTop)) 
			y += e.offsetTop;
		e = xDef(e.offsetParent) ? e.offsetParent : null;
	}
	//  if (xOp7) return y - document.body.offsetTop; // v3.14, temporary hack for opera bug 130324
	return y;
}

/**
  * Gets offset left
  *
  * @param string Element name
  * @return int Offset
  */
function xOffsetLeft(e) {
	if (!(e=xGetElementById(e))) 
		return 0;
	if (xDef(e.offsetLeft)) 
		return e.offsetLeft;
	else return 0;
}

/**
  * Gets offset top
  *
  * @param string Element name
  * @return int Offset
  */
function xOffsetTop(e) {
	if (!(e=xGetElementById(e))) 
		return 0;
	if (xDef(e.offsetTop)) 
		return e.offsetTop;
	else return 0;
}

/**
  * Scrolls to left
  *
  * @param string Element name
  * @return int Offset
  */
function xScrollLeft(e) {
	var offset=0;
	if (!(e=xGetElementById(e))) {
		if(document.documentElement && document.documentElement.scrollLeft) 
			offset=document.documentElement.scrollLeft;
		else if(document.body && xDef(document.body.scrollLeft)) 
			offset=document.body.scrollLeft;
	} else { 
		if (xNum(e.scrollLeft)) 
			offset = e.scrollLeft; 
	}
	return offset;
}

/**
  * Scrolls to top
  *
  * @param string Element name
  * @return int Offset
  */
function xScrollTop(e) {
	var offset=0;
	if (!(e=xGetElementById(e))) {
		if(document.documentElement && document.documentElement.scrollTop) 
			offset=document.documentElement.scrollTop;
		else if(document.body && xDef(document.body.scrollTop)) 
			offset=document.body.scrollTop;
	} else { 
		if (xNum(e.scrollTop)) 
			offset = e.scrollTop; 
	}
	return offset;
}

/**
  * Checks if has point
  *
  * @param string Element name
  * @param int Left
  * @param int Top
  * @param int Clip top
  * @param int Clip right
  * @param int Clip bottom
  * @param int Clip left
  * @return boolean
  */
function xHasPoint(ele, iLeft, iTop, iClpT, iClpR, iClpB, iClpL) {
	if (!xNum(iClpT)){
		iClpT=iClpR=iClpB=iClpL=0;
	} else if (!xNum(iClpR)){
		iClpR=iClpB=iClpL=iClpT;
	} else if (!xNum(iClpB)){
		iClpL=iClpR; iClpB=iClpT;
	}
	var thisX = xPageX(ele), thisY = xPageY(ele);
	return (iLeft >= thisX + iClpL && iLeft <= thisX + xWidth(ele) - iClpR && iTop >=thisY + iClpT && iTop <= thisY + xHeight(ele) - iClpB );
}

/**
  * Resizes element
  *
  * @param string Element name
  * @param int Width
  * @param int Height
  */
function xResizeTo(e,uW,uH) {
	xWidth(e,uW);
	xHeight(e,uH);
}

/**
  * Sets element width
  *
  * @param string Element name
  * @param int Width
  * @return int Width
  */
function xWidth(e,uW) {
	if(!(e=xGetElementById(e))) 
		return 0;
	if (xNum(uW)) {
		if (uW<0) 
			uW = 0;
		else 
			uW=Math.round(uW);
	} else 
		uW=-1;
	var css=xDef(e.style);
	if(css && xDef(e.offsetWidth) && xStr(e.style.width)) {
		if(uW>=0) 
			xSetCW(e, uW);
		uW=e.offsetWidth;
	} else if(css && xDef(e.style.pixelWidth)) {
		if(uW>=0) 
			e.style.pixelWidth=uW;
		uW=e.style.pixelWidth;
	}
	return uW;
}

/**
  * Sets element height
  *
  * @param string Element name
  * @param int Height
  * @return int Height
  */
function xHeight(e,uH) {
	if(!(e=xGetElementById(e))) 
		return 0;
	if (xNum(uH)) {
		if (uH<0) 
			uH = 0;
		else 
			uH=Math.round(uH);
	} else 
		uH=-1;
	var css=xDef(e.style);
	if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {
		if(uH>=0) 
			xSetCH(e, uH);
		uH=e.offsetHeight;
	} else if(css && xDef(e.style.pixelHeight)) {
		if(uH>=0) 
			e.style.pixelHeight=uH;
		uH=e.style.pixelHeight;
	}
	return uH;
}

/**
  * Gets computed style
  *
  * @param string Element name
  * @param string Property
  * @return int Computed style
  */
function xGetCS(ele,sP){
	return parseInt(document.defaultView.getComputedStyle(ele,'').getPropertyValue(sP));
}

/**
  * Sets CS Width
  *
  * @param string Element name
  * @param int Width  
  */
function xSetCW(ele,uW){
	var pl=0,pr=0,bl=0,br=0;
	if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
		pl=xGetCS(ele,'padding-left');
		pr=xGetCS(ele,'padding-right');
		bl=xGetCS(ele,'border-left-width');
		br=xGetCS(ele,'border-right-width');
	}else if(xDef(ele.currentStyle,document.compatMode)){
		if(document.compatMode=='CSS1Compat'){
			pl=parseInt(ele.currentStyle.paddingLeft);
			pr=parseInt(ele.currentStyle.paddingRight);
			bl=parseInt(ele.currentStyle.borderLeftWidth);
			br=parseInt(ele.currentStyle.borderRightWidth);
		}
	} else if(xDef(ele.offsetWidth,ele.style.width)){ // ?
		ele.style.width=uW+'px';
		pl=ele.offsetWidth-uW;
	}
	if(isNaN(pl)) 
		pl=0; 
	if(isNaN(pr)) 
		pr=0; 
	if(isNaN(bl)) 
		bl=0; 
	if(isNaN(br)) 
		br=0;
		
	var cssW=uW-(pl+pr+bl+br);
	if(isNaN(cssW)||cssW<0) 
		return;
	else 
		ele.style.width=cssW+'px';
}

/**
  * Sets CS Height
  *
  * @param string Element name
  * @param int Height  
  */
function xSetCH(ele,uH){
	var pt=0,pb=0,bt=0,bb=0;
	if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
		pt=xGetCS(ele,'padding-top');
		pb=xGetCS(ele,'padding-bottom');
		bt=xGetCS(ele,'border-top-width');
		bb=xGetCS(ele,'border-bottom-width');
	} else if(xDef(ele.currentStyle,document.compatMode)){
		if(document.compatMode=='CSS1Compat'){
			pt=parseInt(ele.currentStyle.paddingTop);
			pb=parseInt(ele.currentStyle.paddingBottom);
			bt=parseInt(ele.currentStyle.borderTopWidth);
			bb=parseInt(ele.currentStyle.borderBottomWidth);
		}
	} else if(xDef(ele.offsetHeight,ele.style.height)){ // ?
		ele.style.height=uH+'px';
		pt=ele.offsetHeight-uH;
	}
	
	if(isNaN(pt)) 
		pt=0; 
	if(isNaN(pb)) 
		pb=0; 
	if(isNaN(bt)) 
		bt=0; 
	if(isNaN(bb)) 
		bb=0;
	var cssH=uH-(pt+pb+bt+bb);
	if(isNaN(cssH)||cssH<0) 
		return;
	else 
		ele.style.height=cssH+'px';
}

/**
  * Sets clip
  *
  * @param string Element name
  * @param int Top
  * @param int Right
  * @param int Bottom
  * @param int Left
  */
function xClip(e,iTop,iRight,iBottom,iLeft) {
	if(!(e=xGetElementById(e))) 
		return;
	if(e.style) {
		if (xNum(iLeft)) 
			e.style.clip='rect('+iTop+'px '+iRight+'px '+iBottom+'px '+iLeft+'px)';
		else 
			e.style.clip='rect(0 '+parseInt(e.style.width)+'px '+parseInt(e.style.height)+'px 0)';
	}
}

/**
  * Gets client width
  *
  * @return int Width
  */
function xClientWidth() {
	var w=0;
	if(xOp5or6) w=window.innerWidth;
	else if(!window.opera && document.documentElement && document.documentElement.clientWidth)
	w=document.documentElement.clientWidth;
	else if(document.body && document.body.clientWidth)
	w=document.body.clientWidth;
	else if(xDef(window.innerWidth,window.innerHeight,document.height)) {
		w=window.innerWidth;
		if(document.height>window.innerHeight) w-=16;
	}
	return w;
}

/**
  * Gets client height
  *
  * @return int Height
  */
function xClientHeight() {
	var h=0;
	if(xOp5or6) h=window.innerHeight;
	else if(!window.opera && document.documentElement && document.documentElement.clientHeight)
	h=document.documentElement.clientHeight;
	else if(document.body && document.body.clientHeight)
	h=document.body.clientHeight;
	else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
		h=window.innerHeight;
		if(document.width>window.innerWidth) h-=16;
	}
	return h;
}

/**
  * Sets inner html
  *
  * @param string Element name
  * @param string Html
  * @return string Html
  */
function xInnerHtml(e, sHtml) {
	if(!(e=xGetElementById(e))) 
		return '';
	if (xStr(e.innerHTML)) {
		if (xStr(sHtml)) 
			e.innerHTML = sHtml;
		else 
			return e.innerHTML;
	}
}

/**
  * Displays element
  *
  * @param string Element name
  */
function xDisplay(e) {
	if(!(e=xGetElementById(e))) 
		return;
	if(e.style && xDef(e.style.display)) 
		e.style.display = 'inline';
}

/**
  * Changes element display
  *
  * @param string Element name
  */
function xChangeDisplay(e) {
	if(!(e=xGetElementById(e))) 
		return;
	if(e.style && xDef(e.style.display)) {
		if(e.style.display == 'none')
			e.style.display = 'inline';
		else
			e.style.display = 'none';
	}
}

/**
  * Hides an element
  *
  * @param string Element name
  */
function xNoDisplay(e) {
	if(!(e=xGetElementById(e))) 
		return;
	if(e.style && xDef(e.style.display)) 
		e.style.display='none';
}

/**
  * Changes Image source
  *
  * @param string Element name
  * @param string Image src
  */
function xChangeImageSrc(e, source) {
	if(!(e=xGetElementById(e))) 
		return;
	if(e.src) 
		e.src=source;
}

/**
  * Displays element
  *
  * @param string Element name
  */
function xDisplayPos(e, e2, x, y) {
	if(!(e=xGetElementById(e)))
	return;

	if(e.style && xDef(e.style.display))
	e.style.display='';

	var left = xPageX(e2) + x;
	var top = xPageY(e2) + y;

	xLeft(e, left);
	xTop(e, top)
}/*
 * (C) Copyright 2006 Rits. All rights reserved.
 * Use is subject to license terms.
 */

/**
 * Flash library
 *
 * @author Juciano Araujo
 * @version 0.1
 */

/* flash version */
var flashVersion = 6;

/* flash release version */
var flashRelease = "6,0,67,0";

/**
  * Detects if is flash compatible
  *
  * @return boolean
  */
function isFlashCompatible() {
	var pluginVersion;
	if(navigator.plugins && navigator.mimeTypes.length){
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");		
		for (var i = 0; i < words.length; ++i) {
			if (isNaN(parseInt(words[i])))
				continue;
			pluginVersion = words[i];
		}
	}else{
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			for (var i=3; axo!=null; i++) {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
				pluginVersion = i;
			}
		}catch(e){
		}
	}
	
	return pluginVersion >= flashVersion;
}

/**
  * Writes the flash code
  * 
  * @param string swf
  * @param string flashVarString
  * @param int width
  * @param int height
  * @param string bgcolor
  * @param string menu
  * @param string mode
  * @param string q
  * @param string id
  */
function writeFlash(swf,flashVarString,w,h,bgcolor,menu,mode,q,id) {
  if (isFlashCompatible()) {
     document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
     +'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+flashRelease+'" '
     +'width="'+w+'" height="'+h+'" id="'+id+'" align="" />'
     +'<param name="movie" value="'+swf+'" />'
     +'<param name="menu" value="'+menu+'" /> '
     +'<param name="quality" value="'+q+'" /> '
     +'<param name="wmode" value="'+mode+'" /> '
     +'<param name="bgcolor" value="'+bgcolor+'" /> '
     +'<param name="flashvars" value="'+flashVarString+'" /> '
     +'<embed src="'+swf+'" flashvars="'+flashVarString+'" menu="'+menu+'" quality="'+q+'" wmode="'+mode+'" '
     +' bgcolor="'+bgcolor+'"  width="'+w+'" height="'+h+'" name="'+swf+'" '
     +' align=""  type="application/x-shockwave-flash" '
     +' pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object> ');     
  } else {
     //behaviour for if there is no flash player
     document.write('You require Flash Player '+flashVersion+' or later to use this site. ');
     document.write('<em><a href="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">');
     document.write('Click here to install it now.</a></em>');

     //this can be replaced by anything you want
     //e.g. document.location.replace("text.html");
  }
}
/*
 * (C) Copyright 2006 Rits. All rights reserved.
 * Use is subject to license terms.
 */

/**
 * Form validation library
 *
 * @author Juciano Araujo
 * @version 0.1
 */

/**
  * Verifies if it's empty
  *
  * @param strin Value to be tested
  * @return boolean
  */
function isEmpty(value) {
	return ((value == null) || (value.length == 0));
}

/**
  * Verifies if it's whitespaces only
  *
  * @param strin Value to be tested
  * @return boolean
  */
function isWhitespace(value) {
	if(isEmpty(value)) return true;
	
	for(i=0; i<value.length; i++) {
		if(value.charAt(i) != ' ') {
			return false;
		}
	}
	return true;
}

/**
  * Verifies if it's a number
  *
  * @param strin Value to be tested
  * @return boolean
  */
function isNumber(value) {
	if(isEmpty(value)) return false;

	var reg = new RegExp('^[0-9]{1,15}(\,[0-9]{1,2}){0,1}$');
	if(value.match(reg))
		return true;
	return false;
}

/**
  * Verifies if it's digits only
  *
  * @param strin Value to be tested
  * @return boolean
  */
function isDigits(value) {
	if(isEmpty(value)) return false;

	var reg = new RegExp('^[0-9]+$');
	if(value.match(reg))
		return true;
	return false;
}

/**
  * Verifies if it's a phone
  *
  * @param strin Value to be tested
  * @return boolean
  */
function isPhone(value) {
	if(isEmpty(value)) return false;
	
	var reg = new RegExp('^[0-9]{3,4}[\-]{1}[0-9]{4}$');
	if(value.match(reg))
		return true;
	if(isDigits(value) && (value.length == 7 || value.length == 8))
		return true;
	return false;
}

/**
  * Verifies if it's a CEP
  *
  * @param strin Value to be tested
  * @return boolean
  */
function isCep(value) {
	if(isEmpty(value)) return false;
	
	var reg = new RegExp('^[0-9]{5}[\-]{1}[0-9]{3}$');
	if(value.match(reg))
		return true;
	if(isDigits(value) && value.length == 8)
		return true;
	return false;
}

/**
  * Verifies if it's a email
  *
  * @param strin Value to be tested
  * @return boolean
  */
function isEmail(value) {
	if(isEmpty(value)) return false;
	var reg = new RegExp('^([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[.]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$');
	if(value.match(reg))
		return true;
	return false;
}

/**
  * Verifies if it's a URL
  *
  * @param strin Value to be tested
  * @return boolean
  */
function isUrl(value) {
	if(isEmpty(value)) return false;

	var reg = new RegExp('^(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~])*[^\.\,\)\(\s]$');
	if(value.match(reg))
		return true;
	return false;
}

/**
  * Verifies if it's a date
  *
  * @param strin Value to be tested
  * @return boolean
  */
function isDate(value) {
	if(isEmpty(value)) return false;
	var reg = new RegExp('^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4}$');
	var data;
	var a_data;
	if(value.match(reg)) {
		a_data = value.split('/');
	} else {
		reg = new RegExp('^[0-9]{1,2}\-[0-9]{1,2}\-[0-9]{4}$');
		if(value.match(reg)) {
			a_data = value.split('-');
		} else {
			return false;
		}
	}
	a_data[0] = parseInt(a_data[0]);
	a_data[1] = parseInt(a_data[1]) - 1;
	a_data[2] = parseInt(a_data[2]);
	data = new Date(a_data[2],a_data[1],a_data[0]);
	if(data.getMonth() == a_data[1])
		return true;
	return false;
}
/*
 * (C) Copyright 2006 CCCCorp. All rights reserved.
 * Use is subject to license terms.
 */

/**
 * Utility library
 *
 * @author Juciano Araujo
 * @version 0.1
 */

var undefined;

/**
  * Submits a form
  *
  * @param string Fuseaction
  * @param object Form object
  */
function formSubmit (go, form) {
	if(go != '') {
		form.go.value = go;
	}

	form.submit();
}

/**
  * Cancels a form
  */
function formCancel() {
	if (window.history.length) {
		history.back();
	} else if (window.opener && !window.opener.closed) {
		self.close();
	}
}

/**
  * Gets a cookie
  *
  * @param string Cookie name
  * @return string Cookie value
  */
function getCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ((!start) && (name != document.cookie.substring( 0, name.length))) {
		return null;
	}
	if (start == -1) return null;
	var end = document.cookie.indexOf(";", len);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len, end));
}

/**
  * Sets a cookie
  *
  * @param string Cookie name
  * @param string Cookie value
  */
function setCookie(name, value, expires, path, domain, secure) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	/*
	if the expires variable is set, make the correct
	expires time, the current script below will set
	it for x number of days, to make it for hours,
	delete * 24, for minutes, delete * 60 * 24
	*/
	if (expires) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}

/**
  * Removes a cookie
  *
  * @param string Cookie name
  */
// this deletes the cookie when called
function delCookie( name, path, domain ) {
	if (getCookie(name)) {
		document.cookie = name + "=" +
		( ( path ) ? ";path=" + path : "") +
		( ( domain ) ? ";domain=" + domain : "" ) +
		";expires=Thu, 01-Jan-1970 00:00:01 GMT";
	}
}

/**
  * Sets the windows status
  *
  * @param string Message
  */
function setStatus(message) {
	window.status = message;
}

/**
  * Updates parent
  */
function updateParent() {
	if (window.opener && !window.opener.closed) {
		window.opener.location.href = window.opener.document.URL;
	}
	self.close();
}

/**
  * Opens a popup window
  *
  * @param string url
  * @param int width
  * @param int height
  * @param boolean scroll
  * @param string name
  */
function hrefPopup(url, width, height, scroll, name) {

   var win  = null;
   var winl = (screen.width - width)/2;
   var wint = (screen.height - height)/2;

   settings = 'height='+height+',width='+width+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=yes'

   if (name == '') {
      name = '_window';
   }

   win = window.open (''+url+'', ''+name+'', settings);
   if (parseInt(navigator.appVersion) >= 4) {
      win.window.focus();
   }
}

/**
  * Reloads a window
  */
function reload() {
	window.location.reload();
}

/**
  * Sets a refresh
  *
  * @param int time
  */
function refresh(time) {
	setTimeout("reload()", time);
}

/**
  * Counts the number of chars in input
  *
  * @param object Field
  * @param object Count Field
  * @param int Maximum number of chars
  */
function textCounter(field, countfield, maxlimit) {
   if (field.value.length > maxlimit) {
      field.value = field.value.substring(0, maxlimit);
   } else {
      countfield.value = maxlimit - field.value.length;
   }
}

/**
  * Changes array of checkbox
  *
  * @param object Checkbox
  * @param object Form
  * @param string Field name
  */
function changeCheck(check, form, name) {
	var field = form.elements[name];
	if(!field) return;
	if(!field.length) {
		field.checked = check.checked;
	} else {
		for(var i=0; i<field.length; i++) {
			field[i].checked = check.checked;
		}
	}
}

function anyChecked(form, name, msg) {
	var field = form.elements[name];
	if(!field) return;
	if(!field.length) {
		if(field.checked) {
			return true;
		}
	} else {
		for(var i=0; i<field.length; i++) {
			if(field[i].checked) {
				return true;
			}
		}
	}

	if(msg.length) {
		alert(msg);
	}
	return false;

}

function selected(name) {
	var select = xGetElementById(name);
	return select.options[select.selectedIndex].value;
}

function list_limit(select) {
	var limit = select.options[select.selectedIndex].value;
	var url = location.href;

	if(url.indexOf('&limit=') != -1) {
		url = url.replace(/limit=[0-9]*/, 'limit=' + limit);
	} else {
		url = url + '&limit=' + limit;
	}
	location.href = url;
}

function list_search(form) {

	var search = xGetElementById('SEARCH');
	var ssel = form.elements['SEARCH_SELECT[]'];
	var schk = form.elements['SEARCH_CHECK[]'];

	var url = location.href;

	if(search) {
		if(url.indexOf('&search=') != -1) {
			url = url.replace(/search=[^&]*/, 'search=' + escape(search.value));
		} else {
			url = url + '&search=' + escape(search.value);
		}

		if(ssel) {
			if(ssel.selectedIndex != undefined) {
				if(url.indexOf('&ssel1=') != -1) {
					url = url.replace(/ssel1=[^&]*/, 'ssel1=' + ssel.options[ssel.selectedIndex].value);
				} else {
					url = url + '&ssel1=' + ssel.options[ssel.selectedIndex].value;
				}
			} else {

				for(var i=0; i<ssel.length; i++) {
					if(url.indexOf('&ssel' + (i+1) + '=') != -1) {
						url = url.replace("&ssel"+(i+1)+'=', '&ssel0=');
						url = url.replace(/ssel0=[^&]*/, 'ssel' + (i+1) + '=' + ssel[i].options[ssel[i].selectedIndex].value);
					} else {
						url = url + '&ssel' + (i+1) + '=' + ssel[i].options[ssel[i].selectedIndex].value;
					}
				}
			}
		}

		if(schk) {
			if(!schk.length) {
				if(url.indexOf('&schk1=') != -1) {
					url = url.replace(/schk1=[^&]*/, (schk.checked ? 'schk1=' + schk.value : ''));
				} else {
					url = url + (schk.checked ? '&schk1=' + schk.value : '');
				}
			} else {

				for(var i=0; i<schk.length; i++) {
					if(url.indexOf('&schk' + (i+1) + '=') != -1) {
						url = url.replace("&schk"+(i+1)+'=', '&schk0=');
						url = url.replace(/schk0=[^&]*/, (schk[i].checked ? 'schk' + (i+1) + '=' + schk[i].value : ''));
					} else {
						url = url + (schk[i].checked ? '&schk' + (i+1) + '=' + schk[i].value : '');
					}
				}
			}
		}

	}
	location.href = url;
}

function list_search_default(form) {

	var ssel = form.elements['SEARCH_SELECT[]'];
	var schk = form.elements['SEARCH_CHECK[]'];
	var stex = form.elements['SEARCH_TEXT[]'];

	var url = location.href;

	if(form.elements['URL']) {
		url = form.elements['URL'].value;
	}
	if(ssel) {
		if(ssel.selectedIndex != undefined) {
			if(url.indexOf('&ssel1=') != -1) {
				url = url.replace(/ssel1=[^&]*/, 'ssel1=' + ssel.options[ssel.selectedIndex].value);
			} else {
				url = url + '&ssel1=' + ssel.options[ssel.selectedIndex].value;
			}
		} else {

			for(var i=0; i<ssel.length; i++) {
				if(url.indexOf('&ssel' + (i+1) + '=') != -1) {
					url = url.replace("&ssel"+(i+1)+'=', '&ssel0=');
					url = url.replace(/ssel0=[^&]*/, 'ssel' + (i+1) + '=' + ssel[i].options[ssel[i].selectedIndex].value);
				} else {

					url = url + '&ssel' + (i+1) + '=' + ssel[i].options[ssel[i].selectedIndex].value;
				}
			}
		}
	}

	if(schk) {
		if(!schk.length) {
			if(url.indexOf('&schk1=') != -1) {
				url = url.replace(/schk1=[^&]*/, (schk.checked ? 'schk1=' + schk.value : ''));
			} else {
				url = url + (schk.checked ? '&schk1=' + schk.value : '');
			}
		} else {

			for(var i=0; i<schk.length; i++) {
				if(url.indexOf('&schk' + (i+1) + '=') != -1) {
					url = url.replace("&schk"+(i+1)+'=', '&schk0=');
					url = url.replace(/schk0=[^&]*/, (schk[i].checked ? 'schk' + (i+1) + '=' + schk[i].value : ''));
				} else {
					url = url + (schk[i].checked ? '&schk' + (i+1) + '=' + schk[i].value : '');
				}
			}
		}
	}
	if(stex) {

		if(!stex.length) {
			if(url.indexOf('&stex1=') != -1) {
				url = url.replace(/stex1=[^&]*/, 'stex1=' + escape(stex.value));
			} else {
				url = url + '&stex1=' + escape(stex.value);
			}
		} else {
			for(var i=0; i<stex.length; i++) {
				if(url.indexOf('&stex' + (i+1) + '=') != -1) {
					url = url.replace("&stex"+(i+1)+'=', '&stex0=');
					url = url.replace(/stex0=[^&]*/, 'stex' + (i+1) + '=' + escape(stex[i].value));
				} else {
					url = url + '&stex' + (i+1) + '=' + stex[i].value;
				}
			}
		}
	}

	location.href = url;
}

function list_orderby(name) {
	var url = location.href;

	if(url.indexOf('&order=') != -1) {
		url = url.replace(/order=[^&]*/, 'order=' + escape(name));
	} else {
		url = url + '&order=' + escape(name);
	}

	location.href = url;
}

function OpenFile( fileUrl ) {
	window.top.opener.SetUrl( fileUrl ) ;
	window.top.close() ;
	window.top.opener.focus() ;
}

function preloadImages() {
	var d=document; if(d.images){ if(!d.p) d.p=new Array();
	var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
/*
* (C) Copyright 2006 CCCCorp. All rights reserved.
* Use is subject to license terms.
*/

/**
* Ajax library
*
* @author Juciano Araujo
* @version 0.1
*/

function xmlHttpObject() {
	var xmlobj;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlobj = new XMLHttpRequest();
	} catch (e) {
		// Internet Explorer
		try {
			xmlobj = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e)	{
				return false;
			}
		}
	}
	return xmlobj;
}

function showOverlayAjax(elem) {

	var o1 = xGetElementById('overlayAjax'+elem);
	var o2 = xGetElementById('overlayAjaxContent'+elem);

	if(!(o1 && o2)) {

		var objBody = document.getElementsByTagName("body").item(0);

		var objOverlay = document.createElement("div");
		objOverlay.setAttribute('id','overlayAjax'+elem);
		objOverlay.style.display = 'none';
		objOverlay.style.position = 'absolute';
		objOverlay.style.background = '#000';
		objOverlay.style.zIndex = '90';
		objBody.appendChild(objOverlay);

		var objOverlayContent = document.createElement("div");
		objOverlayContent.setAttribute('id','overlayAjaxContent'+elem);
		objOverlayContent.style.display = 'none';
		objOverlayContent.style.position = 'absolute';
		objOverlayContent.style.zIndex = '100';
		objOverlayContent.innerHTML = '<table width="100%" height="100%"><tr><td align="center"><img src="/_resources/media/img/ajax-loader.gif" width="16" height="16" alt="" title="" /></td></tr></table>';
		objBody.appendChild(objOverlayContent);
	}

	Element.setWidth('overlayAjax'+elem, Element.getWidth(elem));
	Element.setHeight('overlayAjax'+elem, Element.getHeight(elem));
	Element.setTop('overlayAjax'+elem, xPageY(elem));
	Element.setLeft('overlayAjax'+elem, xPageX(elem));

	Element.setWidth('overlayAjaxContent'+elem, Element.getWidth(elem));
	Element.setHeight('overlayAjaxContent'+elem, Element.getHeight(elem));
	Element.setTop('overlayAjaxContent'+elem, xPageY(elem));
	Element.setLeft('overlayAjaxContent'+elem, xPageX(elem));

	new Effect.Appear('overlayAjax'+elem, { duration: 0.5, from: 0.0, to: 0.5 });
	new Effect.Appear('overlayAjaxContent'+elem, { duration: 0.5, from: 0.0, to: 1.0 })
}

function hideOverlayAjax(elem) {
	xNoDisplay('overlayAjaxContent'+elem);
	xNoDisplay('overlayAjax'+elem);
}

function getFormFields(obj) {
	var getstr = "?";
	for (i=0; i<obj.childNodes.length; i++) {
		if (obj.childNodes[i].tagName == "INPUT") {
			if (obj.childNodes[i].type == "text") {
				getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
			}
			if (obj.childNodes[i].type == "checkbox") {
				if (obj.childNodes[i].checked) {
					getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
				} else {
					getstr += obj.childNodes[i].name + "=&";
				}
			}
			if (obj.childNodes[i].type == "radio") {
				if (obj.childNodes[i].checked) {
					getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
				}
			}
		}
		if (obj.childNodes[i].tagName == "SELECT") {
			var sel = obj.childNodes[i];
			getstr += sel.name + "=" + sel.options[sel.selectedIndex].value + "&";
		}
	}	
	return getstr;
}
var fontSize = 12;

function changeFontSize(fontType){
	if( fontType == '+' ) {
		if(fontSize<16) fontSize += 2 ;    			 
	} else {
		if(fontSize>10) fontSize -= 2;
	}

	if( document.getElementById('contentDescription')) {
		changeFontSizeRec(fontType, document.getElementById('contentDescription'));
	}
}

function changeFontSizeRec(fontType, domElement) {		
	for(var i=0; i < domElement.childNodes.length; i++) {
		changeFontSizeRec(fontType, domElement.childNodes.item(i)) ;
	}

	if(domElement.style) {
		domElement.style.fontSize = fontSize+'px';
	}

}


