// JavaScript Document
//GLOBAIS
/************** FLOATBOX ************************/

fbPageOptions = {
	theme:          'black'    ,// 'auto'|'black'|'white'|'blue'|'yellow'|'red'|'custom'
	padding:         5       ,// pixels
	panelPadding:    5        ,// pixels
	outerBorder:     1        ,// pixels
	innerBorder:     0        ,// pixels
	overlayOpacity:  55       ,// 0-100
	controlOpacity:  60       ,// 0-100
	autoSizeImages:  true     ,// true|false
	autoSizeOther:   false    ,// true|false
	resizeImages:    true     ,// true|false
	resizeOther:     false    ,// true|false
	resizeTool:     'cursor'  ,// 'cursor'|'topleft'|'both'
	infoPos:        'tl'      ,// 'tl'|'tc'|'tr'|'bl'|'bc'|'br'
	controlPos:     'tr'      ,// 'tl'|'tr'|'bl'|'br'
	boxLeft:        'auto'    ,// 'auto'|pixels|'[-]xx%'
	boxTop:         'auto'    ,// 'auto'|pixels|'[-]xx%'
	shadowType:     'drop'    ,// 'drop'|'halo'|'none'
	shadowSize:      8        ,// 8|12|16|24
	enableDrag:      true     ,// true|false
	showCaption:     true     ,// true|false
	showItemNumber:  false     ,// true|false
	showClose:       true     ,// true|false
	hideFlash:       true     ,// true|false
	hideJava:        true     ,// true|false
	disableScroll:   true    ,// true|false
	autoGallery:     false    ,// true|false
	preloadAll:      true     ,// true|false
	enableCookies:   false    ,// true|false
	cookieScope:    'site'    ,// 'site'|'folder'
	language:       'pt'    ,// 'auto'|'en'|... (see the languages folder)
	graphicsType:   'auto'    ,// 'auto'|'international'|'english'
	urlGraphics:    'images/floatbox/graphics/'   ,// change this if you install in another folder
	urlLanguages:   'images/floatbox/languages/' // change this if you install in another folder
};
/************** FIM FLOATBOX ************************/

var ok = "no";

//FIM DE GLOBAIS
function validate(field) {
	var valid = "0123456789.+"
	var temp;
	ok = "yes";
	for (var i=0; i<field.value.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if (valid.indexOf(temp) == "-1") ok = "no";
	}
	if (ok == "no") {
	alert("Introdução de valor(es) errado(s)! ");
	field.focus();
	field.select();
	   }
}

function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}