this.author = "William Ochetski Hellas";
this.version = 1.0;
this.name = "JSWindow";

/* base functions */

this.$ = function() {
	if( document.getElementById( arguments[0] ) != "undefined" )
		return document.getElementById( arguments[0] );
	return false;
};

this.$$ = function() {
	// require Info
	var e = ( arguments[0] ) ? arguments[0] : event;
	return ( Info.nsp ) ? e.target : e.srcElement;
};

this.$cele = function() {
	try{
		return document.createElement( arguments[0] );
	} catch( e ) {
		return false;
	}
};

this.$rele = function() {
	try{
		return $( arguments[0] ).parentNode.removeChild( $( arguments[0] ) );
	} catch( e ) {
		return false;
	}
};

this.$tag = function() {
	return document.getElementsByTagName( arguments[0] );
};

this.$css = function() {
	this.objs = arguments[1].split( ";" );
	for( var i = 0; i < this.objs.length; i++ ) {
		if( this.objs[i] == null || this.objs[i] == "" )
			continue;
		this.sobjs = this.objs[i].split( ":" );
		eval( "arguments[0].style." + this.sobjs[0] + " = '" + this.sobjs[1] + "';" );
	}
	return;
};

this.$style = function() {
	
};

this.$include = function() {
	eval();
};

/* objects */

this._ = new function _() {
	this.author = window.author;
	this.version = 1.0;
	this.name = this.constructor.name;
	this.entities = {
		'chars' : new Array(
			'&','à','á','â','ã','ä','å','æ','ç','è',
			'é','ê','ë','ì','í','î','ï','ð','ñ','ò',
			'ó','ô','õ','ö','ø','ù','ú','û','ü','ý',
			'þ','ÿ','À','Á','Â','Ã','Ä','Å','Æ','Ç',
			'È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ',
			'Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü',
			'Ý','Þ','€','\"','ß','<','>','¢','£','¤',
			'¥','¦','§','¨','©','ª','«','¬','­','®',
			'¯','°','±','²','³','´','µ','¶','·','¸',
			'¹','º','»','¼','½','¾'
		),
		'entities' : new Array(
			'amp','agrave','aacute','acirc','atilde','auml','aring','aelig','ccedil','egrave',
			'eacute','ecirc','euml','igrave','iacute','icirc','iuml','eth','ntilde','ograve',
			'oacute','ocirc','otilde','ouml','oslash','ugrave','uacute','ucirc','uuml','yacute',
			'thorn','yuml','Agrave','Aacute','Acirc','Atilde','Auml','Aring','AElig','Ccedil',
			'Egrave','Eacute','Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde',
			'Ograve','Oacute','Ocirc','Otilde','Ouml','Oslash','Ugrave','Uacute','Ucirc','Uuml',
			'Yacute','THORN','euro','quot','szlig','lt','gt','cent','pound','curren',
			'yen','brvbar','sect','uml','copy','ordf','laquo','not','shy','reg',
			'macr','deg','plusmn','sup2','sup3','acute','micro','para','middot','cedil',
			'sup1','ordm','raquo','frac14','frac12','frac34'
		)
	};
	String.prototype.htmlEntities = function() {
		var _string = this;
		for( var i = 0; i < _.entities['chars'].length; i++ ) {
			var _regexp = new RegExp();
			_regexp.compile( _.entities['chars'][i], 'g' );
			_string = _string.replace( _regexp, '&' + _.entities['entities'][i] + ';' );
		}
		return _string;
	};
	String.prototype.htmlEntitiesDecode = function() {
		var _string = this;
		for( var i = 0; i < _.entities['entities'].length; i++ ) {
			var _regexp = new RegExp();
			_regexp.compile( '&' + _.entities['entities'][i] + ';', 'g' );
			_string = _string.replace( _regexp, _.entities['chars'][i] );
		}
		return _string;
	};
	String.prototype.htmlEntitiesKill = function() {
		var _string = this;
		for( var i = 0; i < _.entities['chars'].length; i++ ) {
			var _regexp = new RegExp();
			_regexp.compile( _.entities['chars'][i], 'g' );
			_string = _string.replace( _regexp, _.entities['entities'][i].replace( /(.){1}(.*)/g, '$1' ) );
		}
		return _string;
	};
	String.prototype.isInArray = function() {
		var _string = this;
		var _result = false;
		for( var i = 0; i < arguments[0].length; i++ ) {
			if( _string == arguments[0][i] ) {
				_restult = true;
				break;
			}
		}
		return _result;
	};
	Object.prototype.css = function() {
		var _object = this;
		var _objs = arguments[0].split( ";" );
		for( var i = 0; i <_objs.length; i++ ) {
			if( _objs[i] == null || _objs[i] == "" )
				continue;
			_objs = _objs[i].split( ":" );
			eval( "this.style." + _objs[0] + " = '" + _objs[1] + "';" );
		}
		return;
	};
	Object.prototype.inn = function() {
		var _object = this;
		_object.innerHTML = arguments[0];
		return;
	};
};

this.Info = new function Info() {
	this.author = window.author;
	this.version = 1.0;
	this.name = this.constructor.name;
	this.win = ( ( navigator.userAgent.toLowerCase().indexOf( "win" ) != -1 ) || ( navigator.userAgent.toLowerCase().indexOf( "16bit" ) != -1 ) );
	this.iep = document.all;
	this.nsp = document.getElementById && !document.all;
	this.ie = ( navigator.appName.match( "Internet Explorer" ) ) ? true : false;
	this.ff = ( navigator.appName.match( "Firefox" ) ) ? true : false;
	this.op = ( navigator.appName.match( "Opera" ) ) ? true : false;
	this.MinH = function() {
		return ( this.ie ) ? document.documentElement.clientHeight : window.innerHeight;
	};
	this.MinW = function() {
		return ( this.ie ) ? document.documentElement.clientWidth : window.innerWidth;
	};
	this.MaxH = function() {
		return document.body.offsetHeight;
	};
	this.MaxW = function() {
		return document.body.offsetWidth;
	};
	this.Scroll = function() {
		return [ ( ( this.iep ) ? document.documentElement.scrollHeight : document.body.scrollHeight ), ( ( this.iep ) ? document.documentElement.scrollWidth : document.body.scrollWidth ) ];
	};
	this.ScrollN = function() {
		return [ ( ( this.iep ) ? document.documentElement.scrollTop : document.body.scrollTop ), ( ( this.iep ) ? document.documentElement.scrollLeft : document.body.scrollLeft ) ];
	};
};

this.Geist = new function Geist() {
	//require Info
	this.author = window.author;
	this.version = 2.2;
	this.name = this.constructor.name;
	this.id = "Geist";
	this.Open = function() {
		this.html = document.getElementsByTagName( "html" ).item(0);
		this.body = document.getElementsByTagName( "body" ).item(0);
		this.obj = $cele( "div" );
		this.obj.setAttribute( "id", this.id + arguments[0] );
		this.body.insertBefore( this.obj, this.body.lastChild );
		document.getElementsByTagName( "body" ).item( 0 ).style.overflowY = "hidden";
		$( this.id + arguments[0] ).style.height = Info.Scroll()[0] + "px";
		$( this.id + arguments[0] ).style.width = Info.Scroll()[1] + "px";
		$( this.id + arguments[0] ).style.top = Info.ScrollN()[0] + "px";
		this.alpha = ( Info.ie ) ? "filter:alpha( opacity = 1 );" : "opacity:.01;";
		$css( $( this.id + arguments[0] ),
			this.alpha +
			"color:#fff;"+
			"background:#000 url(img/laden.gif) center no-repeat;"+
			"left:0;"+
			"position:absolute;"+
			"top:0;"+
			"zIndex:2000;"
		);
	};
	this.Close = function() {
		if( $( this.id + arguments[0] ) ) {
			document.getElementsByTagName( "body" ).item( 0 ).style.overflowY = "auto";
			$rele( this.id + arguments[0] );
			return true;
		} else	
			return false;
	};
};

this.PopWin = new function PopWin() {
	// require Info
	// require Geist
	this.author = window.author;
	this.version = 1.1;
	this.name = this.constructor.name;
	this.id = "PopWin";
	this._opened = false;
	this.Open = function() {
		if( this._opened === false ) {
			Geist.Open( this.id );
			this._win = $cele( "span" );
			this._win.setAttribute( "id", this.id );
			this._body = $tag( "body" ).item(0);
			this._html = $tag( "html" ).item(0);
			this._body.insertBefore( this._win, this._body.firstChild );
			$( this.id ).innerHTML = '<div id="PopWinText"></div>' + ( ( arguments[0][1] == 'success' || arguments[0][1] == 'error' ) ? '' : '<div class="box"><a href="javascript:PopWin.Close();" id="' + this.id + 'PopWinTaste" class="PopWinTaste">fechar</a></div>' );
			if( $( this.id + 'PopWinTaste' ) )
				$( this.id + 'PopWinTaste' ).focus();
			$( this.id ).firstChild.innerHTML = arguments[0][0];
			if( arguments[0][1] != "" &&  arguments[0][1] != null ) {
				$( this.id ).firstChild.className = ( arguments[0][1] == "ok" ) ? "success" : arguments[0][1];
			}
			this._opened = true;
			this.Position();
			//$( Geist.id + this.id ).setAttribute( 'onclick', 'PopWin.Close();' );
		}
		return;
	};
	this.Close = function() {
		if( this._opened === true ) {
			Geist.Close( this.id );
			$rele( this.id );
			this._opened = false;
		}
		return;
	};
	this.Do = function() {
		if( this._opened === false )
			this.Open( arguments );
		else if( this._opened === true )
			this.Close( arguments );
		else
			return false;
		return;
	};
	this.Position = function() {
		var WinHeight = Info.MinH();
		var WinWidth = Info.MinW();
		if( $( this.id ) ) {
			$( this.id ).style.top = ( ( WinHeight - $( this.id ).offsetHeight ) / 2 ) + this._html.scrollTop + "px";
			//$( this.id ).style.left = ( this.Body.offsetWidth - $( this.id ).offsetWidth ) / 2 + "px";
			$( this.id ).style.left = ( ( WinWidth - $( this.id ).offsetWidth ) / 2 ) + this._html.scrollLeft + "px";
		}
		return;
	};
};

this.Fade = new function Fade() {
	this.author = window.author;
	this.version = 2.0;
	this.name = this.constructor.name;
	this.Do = function() {
		if( !arguments[0] || typeof arguments[1] == "undefined" || typeof arguments[2] == "undefined" || typeof arguments[3] == "undefined" )
			return;
		var str = arguments[0];
		var red = arguments[1];
		var green = arguments[2];
		var blue = arguments[3];
		var rr = 255;
		var gg = 255;
		var bb = 255;
		if( typeof str.fadeTime != 'undefined' )
			clearTimeout( str.fadeTime );
		if( red == rr && green == gg && blue == bb ) {
			str.style.backgroundColor = ( 'rgb( ' + rr + ', ' + gg + ', ' + bb + ' )' );
			return;
		}
		var newred = red + Math.floor( ( rr - red ) / 10 );
		var newgreen = green + Math.floor( ( gg - green ) / 10 );
		var newblue = blue + Math.floor( ( bb - blue ) / 10 );
		str.style.backgroundColor = 'rgb( ' + newred + ', ' + newgreen + ', ' + newblue + ' )';
		str.fadeTime = setTimeout( function() { Fade.Do( str, newred, newgreen, newblue ); }, 60 );
	};
};

this.Error = new function Error() {
	// require Info
	this.author = window.author;
	this.version = 1.0;
	this.name = this.constructor.name;
	this.id = "window.Error";
	this.Show = function() {
		if( $( this.id ) ) {
			this.Time();
			$( this.id ).innerHTML = '<p style="padding:3px;border-bottom:1px solid #555;">' + ( ( typeof arguments[0] != "string" ) ? arguments[0][0] + ' (' + arguments[0][2] + ')<br />' + arguments[0][1] : arguments[0] ) + '</p>' + $( this.id ).innerHTML;
		} else
			this.Create( arguments[0] );
	};
	this.Create = function() {
		this.body = $tag( "body" ).item(0);
		this.box = $cele( "div" );
		this.box.setAttribute( "id", this.id );
		this.body.insertBefore( this.box, this.body.firstChild );
		this.obj = $( this.id );
		this.obj.innerHTML = '<p style="padding:3px;border-bottom:1px solid #555;">' + ( ( typeof arguments[0] != "string" ) ? arguments[0][0] + ' (' + arguments[0][2] + ')<br />' + arguments[0][1] : arguments[0] ) + '</p>';
		this.alpha = ( Info.ie ) ? "filter:alpha(opacity=80);" : "opacity:.8;";
		$css(this.obj,
			this.alpha +
			"color:#000;"+
			//"background:#fff;"+
			"border:1px solid #555;"+
			"borderBottom:0 none;"+
			"font:normal 10px verdana, sans-serif;"+
			"right:20px;"+
			"overflowX:auto;"+
			"position:absolute;"+
			"top:-1px;"+
			"width:350px;"+
			"zIndex:1000;"
		);
		this.Time();
	};
	this.Time = function() {
		if( typeof( this.time ) != "undefined" )
			clearTimeout( this.time );
		this.time = setTimeout( new Function( "$rele( '" + this.id + "' );" ), 5000 );
	};
};

this.Cookie = new function Cookie() {
	this.author = window.author;
	this.version = 1.0;
	this.name = this.constructor.name;
	this.Set = function() {
		this._name = arguments[0];
		this._value = arguments[1];
		this._days = arguments[2];
		this._today = new Date();
		this._expire = new Date();
		if( this._days == null || this._days == 0 )
			this._days = 1;
		this._expire.setTime( this._today.getTime() + 3600000 * 24 * this._days );
		document.cookie = this._name + '=' + escape( this._value ) + ';expires=' + this._expire.toGMTString();
	};
	this.Get = function() {
		this._name = arguments[0];
		this._cookies = '' + document.cookie;
		this._result = this._cookies.indexOf( this._name );
		if( this._result == -1 || this._name == '' )
			return ''; 
		this._result1 = this._cookies.indexOf( ';', this._result );
		if( this._result1 == -1 )
			this._result1 = this._cookies.length; 
		return unescape( this._cookies.substring( this._result + this._name.length + 1, this._result1 ) );
	};
	this.Del = function() {
		this._name = arguments[0];
		this._date = new Date();
		this._date.setTime( this._date.getTime() - 1 );
		document.cookie = this._name + '=; expires=' + this._date.toGMTString(); 
	};
};

this.BB = new function BB() {
	// require Info
	this.author = window.author;
	this.version = 2.0;
	this.name = this.constructor.name;
	this.Tag = function( areaId, openerTag, closerTag ) {
		if( Info.ie && Info.win )
			this.TagIE( areaId, openerTag, closerTag );
		else
			this.TagNS( areaId, closerTag, openerTag );
		return;
	};
	this.TagIE = function( areaId, openerTag, closerTag, innerData ) {
		var txtArea = $( areaId );
		var aSelection = document.selection.createRange().text;
		var range = txtArea.createTextRange();
		if( aSelection ) {
			if( innerData != "" && typeof( innerData ) != "undefined" ) {
				document.selection.createRange().text = aSelection + openerTag + innerData + closerTag;
			} else {
				document.selection.createRange().text = openerTag + aSelection + closerTag;
			}
			txtArea.focus();
			range.move( 'textedit' );
			range.select();
		} else {
			var oldStringLength = range.text.length + openerTag.length;
			if( innerData != "" && typeof( innerData ) != "undefined" ) {
				txtArea.value += openerTag + innerData + closerTag;
			} else {
				txtArea.value += openerTag + closerTag;
			}
			txtArea.focus();
			range.move( 'character', oldStringLength );
			range.collapse( false );
			range.select();
		}
		return;
	};
	this.TagNS = function( areaId, openerTag, closerTag, innerData ) {
		var txtArea = $( areaId );
		if ( txtArea.selectionEnd && ( txtArea.selectionEnd - txtArea.selectionStart > 0 ) ) {
			var preString = ( txtArea.value ).substring( 0, txtArea.selectionStart );
			if( innerData != "" && typeof( innerData ) != "undefined" ) {
				var newString = ( txtArea.value ).substring( txtArea.selectionStart,txtArea.selectionEnd ) + openerTag + innerData + closerTag;
			} else {
				var newString = openerTag + ( txtArea.value ).substring( txtArea.selectionStart,txtArea.selectionEnd ) + closerTag;
			}
			var postString = ( txtArea.value ).substring( txtArea.selectionEnd );
			txtArea.value = preString + newString + postString;
			txtArea.focus();
		} else {
			var offset = txtArea.selectionStart;
			var preString = ( txtArea.value ).substring( 0, offset );
			if( innerData != "" && typeof( innerData ) != "undefined" ) {
				var newString = openerTag + innerData + closerTag;
			} else {
				var newString = openerTag + closerTag;
			}
			var postString = ( txtArea.value ).substring( offset );
			txtArea.value = preString + newString + postString;
			txtArea.selectionStart = offset + openerTag.length;
			txtArea.selectionEnd = offset + openerTag.length;
			txtArea.focus();
		}
		return;
	};
};


this.Ajax = new function Ajax() {
	// require Geist
	// require Error
	// alters PopWin
	this.author = window.author;
	this.version = 2.3;
	this.name = this.constructor.name;
	this.Execute = false;
	this.XMLRun = false;
	this.Img = new Array();
	this.sxmlObj = new Array( 'Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP' );
	this.Loading = function() {
		/*
			readyState = 1
			* Explorer: twice
			* Mozilla: twice
			* Safari: once
			* Opera: once
		*/
		var out = arguments[0];
		if( this.Img[out] ) {
			Geist.Open( "Ajax" );
			this.Img[out] = false;
		}
		//this.Helem[out].innerHTML = "...";
		return;
	};
	this.Loaded = function() {
		/*
			readyState = 2
			* Explorer: once
			* Mozilla: once
			* Safari: once
			* Opera: none
		*/
		var out = arguments[0];
		//this.Helem[out].innerHTML = "...";
		return;
	};
	this.Interactive = function() {
		/*
			readyState = 3
			* Explorer: once
			* Mozilla: once
			* Safari: once
			* Opera: once
		*/
		var out = arguments[0];
		//this.Helem[out].innerHTML = "...";
		return;
	};
	this.Complete = function() {
		/*
			readyState = 4
			* Explorer: once
			* Mozilla: once
			* Safari: once
			* Opera: once
		*/
		var out = arguments[0];
		var HelemNN = this.Helem[out].nodeName.toLowerCase();
		if( this.Hajax[out].responseText == "NULL" )
			return;
		if( HelemNN == "input" || HelemNN == "select" || HelemNN == "option" ) {
			if( this.JustAdd[out] === true ) {
				this.Helem[out].value += this.Hajax[out].responseText;
			} else if( this.JustAdd[out] === false ) {
				this.Helem[out].value = this.Hajax[out].responseText + this.Helem[out].value;
			} else {
				this.Helem[out].innerHTML = "&nbsp;";
				this.Helem[out].value = this.Hajax[out].responseText;
			}
		} else if( HelemNN == "img" ) {
			this.Helem[out].src = this.Hajax[out].responseText;
		} else {
			if( this.JustAdd[out] === true ) {
				this.Helem[out].innerHTML += this.Hajax[out].responseText;
			} else if( this.JustAdd[out] === false ) {
				this.Helem[out].innerHTML = this.Hajax[out].responseText + this.Helem[out].innerHTML;
			} else {
				this.Helem[out].innerHTML = this.Hajax[out].responseText;
			}
		}
		if( $( 'PopWin' ) ) PopWin.Position();
		return;
	};
	this.Run = function() {
		var out = arguments[0];
		return;
		if( this.Hajax[out].responseText.match( /(<script>)([\r\n\t.]+)(<\/script>)/g ) )
			eval( this.Hajax[out].responseText.replace( /^(([\r\n\t.]+)<script>)([\r\n\t.]+)(<\/script>([\r\n\t.]+))$/g, "$3" ) );
		else if( this.Hajax[out].responseText.match( "\<javascript\>" ) || this.Execute === true )
			eval( this.Hajax[out].responseText.replace( /(<javascript>|\r|\n|\t)/g, "" ) );
		this.Execute = false;
		return;
	};
	this.XMLNode = function() {
		var out = arguments[0];
		var XML = this.Hajax[out].responseXML;
		//this.Helem[out].innerHTML = XML;
		this.XMLRun = false;
		return;
	};
	this.Error = function() {
		var out = arguments[0];
		var AjaxError = "Ajax error: " + this.Hajax[out].status + " - " + this.Hajax[out].statusText + ".";
		Error.Show( AjaxError );
		return;
	};
	this.Init = function() {
		try {
			var AjaxRqst = new XMLHttpRequest();
		} catch( e ) {
			for( var i = 0, j = this.sxmlObj.length; i < j; i++ ) {
				try{
					var AjaxRqst = new ActiveXObject( this.sxmlObj[i] );
					break;
				} catch( e ) {
					var AjaxRqst = null;
				}
			}
		}
		return AjaxRqst;
	};
	this.encodeURL = function() {
		var varArray = arguments[0].split( "&" );
		for( var i = 0; i < varArray.length; i++ ) {
			urlVars = varArray[i].split( "=" );
			if( urlVars[0].indexOf( "amp;" ) != -1 )
				urlVars[0] = urlVars[0].substring( 4 );
			varArray[i] = this.encGet( urlVars[0], urlVars[1] );
		}
		return varArray.join( "&" );
	};
	this.encGet = function() {
		return encodeURIComponent( arguments[0] ) + ( ( arguments[1] ) ? "=" + encodeURIComponent( arguments[1] ) : "" );
	};
	this.setGet = function() {
		if( this.PostURL.length < 3 )
			this.PostURL = arguments[0] + "=" + arguments[1];
		else
			this.PostURL += "&" + arguments[0] + "=" + arguments[1];
	};
	this.Load = function() {
		var out = arguments[1];
		if( !this.JustAdd ) this.JustAdd = new Array();
		this.JustAdd[out] = ( arguments[3] === true ) ? true : ( arguments[3] === false ) ? false : null;
		this.Img[out] = ( arguments[4] === false ) ? false : true;
		if( typeof( this.Helem ) == "undefined" )
			this.Helem = new Array();
		if( typeof( this.Hajax ) == "undefined" )
			this.Hajax = new Array();
		if( $( out ) ) {
			this.Helem[out] = $( out );
			this.Hajax[out] = this.Init();
			var self = this;
			this.Hajax[out].onreadystatechange = function() {
				switch( self.Hajax[out].readyState ) {
					case 0:
						self.Uninitialized( out );
					case 1:
						self.Loading( out );
					break;
					case 2:
						self.Loaded( out );
					break;
					case 3:
						self.Interactive( out );
					break;
					case 4:
						if( self.Hajax[out].status == 200 )
							if( self.Execute === true )
								self.Run( out );
							else if( self.Hajax[out].responseText.match( /\<(java)?script/g ) ) {
								self.Run( out );
								if( self.XMLRun === true )
									self.XMLNodes( out );
								else
									self.Complete( out );
							} else
								if( self.XMLRun === true )
									self.XMLNodes( out );
								else
									self.Complete( out );
						else
							self.Error( out );
						Geist.Close( "Ajax" );
					break;
				}
			};
			this.PostURL = this.encodeURL( arguments[0] );
			this.setGet( "rndtime", new Date().getTime() );
			this.Hajax[out].open( "GET", arguments[2] + "?" + this.PostURL, true );
			this.Hajax[out].setRequestHeader( "Cache-Control", "no-store, no-cache, must-revalidate" );
			this.Hajax[out].setRequestHeader( "Cache-Control", "post-check=0, pre-check=0" );
			this.Hajax[out].setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" );
			this.Hajax[out].setRequestHeader( "Pragma", "no-cache" );
			this.Hajax[out].send( null );
		}
		return;
	};
};






function _Post( str, end_id, url_ie, get, exception, justadd ) {
	// require Error
	// require $geist
	// require check_f
	justadd = ( arguments[5] !== true ) ? false : true;
	//if( check_f( arguments[0], arguments[4] ) ) {
		_PoN = true;
		// testa campos, se não _PoN = false e erro = _PoErro
		if( _PoN === false ) {
			PopWin.Do( _PoErro, "error" );
		} else {
			if( !$( 'GeistAjax' ) ) Geist.Open( "Ajax" );
			var _PoBody = document.getElementsByTagName( 'body' ).item(0);
			var _PoFram = $cele( 'iframe' );
			_PoFram.setAttribute( 'id', '_PoFram' );
			_PoFram.setAttribute( 'name', '_PoFram' );
			_PoFram.setAttribute( 'class', 'invis' );
			_PoFram.setAttribute( 'className', 'invis' );
			if( !$( 'PoFram' ) ) _PoBody.insertBefore( _PoFram, _PoBody.firstChild );
			_PoForm = arguments[0];
			_PoForm.setAttribute( 'id', '_PoForm' );
			_PoForm.setAttribute( 'method', 'post' );
			_PoForm.setAttribute( 'target', '_PoFram' );
			_PoForm.setAttribute( 'action', arguments[2] + "?" + arguments[3] );
			_PoForm.setAttribute( 'enctype', 'multipart/form-data' );
			if( navigator.appName == 'Microsoft Internet Explorer' ) {
				_PoFram.outerHTML = _PoFram.outerHTML.replace( ">", " name='_PoFram' id='_PoFram'>" );
				_PoForm.name = '_PoForm';
				_PoForm.id = '_PoForm';
				_PoForm.action = ( arguments[2] + "?" + arguments[3] );
				_PoForm.target = '_PoFram';
				_PoForm.method = 'post';
				_PoForm.enctype = 'multipart/form-data';
			}
			_PoForm.submit();
			_PoEnded = false;
			_PoTries = 0;
			_PoTeste = function() {
				setTimeout(
					function() {
						_PoText = '';
						_PoOk = true;
						try {
							_PoText = $( '_PoFram' ).contentDocument.getElementsByTagName( 'div' ).item(0).innerHTML;
							_PoEnded = true;
						} catch( evnt ) {
							try {
								_PoText = $( '_PoFram' ).contentWindow.document.getElementsByTagName( 'div' ).item(0).innerHTML;
								_PoEnded = true;
							} catch( evnt ) {
								try {
									_PoText = $( '_PoFram' ).contentDocument.getElementsByTagName( 'body' ).item(0).childNodes.item(0).nodeValue;
									_PoEnded = true;
								} catch( evnt ) {
									try {
										_PoText = $( '_PoFram' ).contentWindow.document.getElementsByTagName( 'body' ).item(0).childNodes.item(0).nodeValue;
										_PoEnded = true;
									} catch( evnt ) {
										if( _PoTries < 10 ) {
											_PoTries++;
											_PoEnded = false;
											_PoTimed = setTimeout( "_PoTeste();", 1000 );
										} else {
											_PoText = "Seu formulário pode não ter sido enviado corretamente,<br /> por favor cheque ou tente novamente.";
											_PoOk = false;
											_PoEnded = true;
										}
									}
								}
							}
						}
						if( _PoEnded ) {
							setTimeout(
								function() {
									if( _PoOk === true ) {
										if( _PoText.replace( /(\r|\n|\t)/g, "" ).match( /(\<script\>)(.*)(\<\/script\>)/g ) )
											eval( _PoText.replace( /(\r|\n|\t)/g, "" ).replace( /^((.*)<script>)(.*)(<\/script>(.*))$/g, "$3" ) );
										if( justadd === true ) {
											$( end_id ).innerHTML += _PoText;
										} else {
											$( end_id ).innerHTML = _PoText;
										}
									} else {
										if( !$( 'PopWin' ) ) PopWin.Do( _PoText );
										Ajax.Load( LastAjax[0], LastAjax[1], LastAjax[2], LastAjax[3],LastAjax[4], LastAjax[5] );
									}
									$rele( '_PoFram' );
									if( $( 'GeistAjax' ) ) Geist.Close( "Ajax" );
								}
							, 1000 );
						}
					}
				, 4000 );
			};
			_PoTeste();
		}
	//} else { // se n validado
	//	return false;
		//PopWin.Do( "Voc&ecirc; n&atilde;o preencheu todos os campos necess&aacute;rios.", "error" );
	//}
	return;
};
/* start add do tiago */
function GetXmlHttpObject() {
	var objXMLHttp=null
	try {
		objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); //later IE
	} catch (e) {
		try {
			objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); //earlier IE
		} catch (e) {
			objXMLHttp = null;
		}
	}
	if( objXMLHttp == null ) {
		objXMLHttp=new XMLHttpRequest() //IE7, Firefox, Safari
	}
	return objXMLHttp
}
function xmlLoader(url,pars){
        var Loader = new GetXmlHttpObject();
		Loader.open("POST", url , false);
		if(pars){
			//Send the proper header information along with the request
			Loader.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			Loader.setRequestHeader("Content-length", pars.length);
			Loader.setRequestHeader("Connection", "close");
	        Loader.send(pars);
		}else{
	        Loader.send(null);      
		}
		return Loader.responseText;
}

function TryLogin() {
	if( !$( 'LoginMail' ).value ) {
		$( 'LoginMail' ).className = "Erro";
		$( 'LoginStatus' ).innerHTML = "Preencha os dois campos.";
		return;
	}
	if( !$('LoginPass' ).value ) {
		$( 'LoginPass' ).className = "Erro";
		$( 'LoginStatus' ).innerHTML = "Preencha os dois campos.";
		return;
	}
	var par = 'email=' + $('LoginMail').value + '&password=' + $('LoginPass').value;
	try{
		var conteudo = xmlLoader( 'http://www.wo2.com.br/home/servlet/ValidarLogin', par );
	} catch( e ) {
		var conteudo = xmlLoader( 'http://wo2.com.br/home/servlet/ValidarLogin', par );
	}
	if( conteudo ) {
		$( 'LoginMail' ).className = "Erro";
		$( 'LoginPass' ).className = "Erro";
		$( 'LoginStatus' ).innerHTML = conteudo;
	} else
		$('LoginForm').submit();
};
function TryRegister() {
	if( !$( 'CadastroNome' ).value ) {
		$( 'CadastroNome' ).className = "Erro";
		$( 'CadastroStatus' ).innerHTML = "Preencha todos os campos.";
		return;
	}
	if( !$( 'CadastroMail' ).value ) {
		$( 'CadastroMail' ).className = "Erro";
		$( 'CadastroStatus' ).innerHTML = "Preencha todos os campos.";
		return;
	}
	if( !$( 'CadastroSenha' ).value ) {
		$( 'CadastroSenha' ).className = "Erro";
		$( 'CadastroStatus' ).innerHTML = "Preencha todos os campos.";
		return;
	}
	if( !$( 'CadastroDia' ).value ) {
		$( 'CadastroDia' ).className = "Erro";
		$( 'CadastroStatus' ).innerHTML = "Preencha todos os campos.";
		return;
	}
	if( !$( 'CadastroMes' ).value ) {
		$( 'CadastroMes' ).className = "Erro";
		$( 'CadastroStatus' ).innerHTML = "Preencha todos os campos.";
		return;
	}
	if( !$( 'CadastroAno' ).value ) {
		$( 'CadastroAno' ).className = "Erro";
		$( 'CadastroStatus' ).innerHTML = "Preencha todos os campos.";
		return;
	}
	var par = '';
	par += 'usuario.nomeUsuario=' + $('CadastroNome').value;
	par += '&usuario.emailUsuario=' + $('CadastroMail').value;
	par += '&usuario.senhaUsuario=' + $('CadastroSenha').value;
	par += '&dataNascimento=' + $('CadastroDia').value + '/' + $('CadastroMes').value + '/' + $('CadastroAno').value;
	try{
		var conteudo = xmlLoader( 'http://www.wo2.com.br/home/cadastreSe.action', par );
	} catch( e ) {
		var conteudo = xmlLoader( 'http://wo2.com.br/home/cadastreSe.action', par );
	}
	if( conteudo ) {
		$('CadastroNome').className = "Erro";
		$('CadastroMail').className = "Erro";
		$('CadastroSenha').className = "Erro";
		$('CadastroStatus').innerHTML = conteudo;
	} else
		$('CadastroForm').submit();
};
/* end add do tiago */
/* events */

this.onerror = function() {
	// require Error
	// Error.Show( arguments );
	return false;
};

this.onunload = function() {
	// alters DGMMenu
	if( typeof( DGMTime ) != "undefined" )
		clearTimeout( DGMTime );
	return;
};

this.onload = function() {
	//Home.Open();
	//Jex.SlideMenu.Start();
	//Ajax.Load('CadastrarNoticia','Inhalt','ajax.php');//apenas debug
	return;
};

this.onresize = function() {
	// alters Geist
	// alters PopWin
	if( $( 'Geist' ) ) {
		Geist.Close();
		Geist.Open();
	}
	PopWin.Position();
	return;
};

this.onscroll = function() {
	// alters PopWin
	PopWin.Position();
	return;
};
 
this.ondblclick = new Function( "return false;" );

//this.oncontextmenu = new Function( "return false;" );