function valida(){

	if(document.form1.nom.value == 'digite seu nome' || document.form1.ema.value == 'digite seu email'){
		alert("Digite seu nome e email.")
	}
	else{	
		document.form1.submit(); 
	}
}


set = function(field, val1, val2)
{
    if (field.value == val1) field.value = val2;
}



/* BLANK_IT: ADD TARGET="_BLANK" TO LINKS
 * WHEN PROVIDING ONE ARGUMENT, APPLIES TO ALL CLASSES WITH THAT NAME,
 * OTHERWISE, APPLIES TO ALL CLASSES WITH THE CLASS "_BLANK"
 */
blank_it = function(){
	if( !document.getElementsByTagName ){ return; }
	c = ( arguments.length == 1 )? arguments[0] : '_blank';
	t = document.getElementsByTagName('A');
	for( i = 0; i < t.length; i++ ){ if( t[i].className.indexOf(c) != -1 ){ t[i].target = "_blank"; } }
}

target_it = function(){
	if( !document.getElementsByTagName ){ return; }
	t = document.getElementsByTagName('A');
	total_links = t.length;
	for( i = 0; i < total_links; i++ ){
		if( t[i].className.indexOf('_blank') != -1 ){ t[i].target = "_blank"; }
		else if( t[i].className.indexOf('_top') != -1 ){ t[i].target = "_top"; }
		else if( t[i].className.indexOf('_self') != -1 ){ t[i].target = "_self"; }
	}
}

/* ADDON_EVENT: ADDS EVENTS TO AN ELEMENT
 * el: AN FORM ELEMENT
 * ev: AN VALID EVENT AS STRING
 * fnt: A FUNCTION
 */
addon_event = function( el, ev, fnt ){
	if( !el || !ev || typeof(fnt) != 'function' ){ return; }
	fn = ( el[ev] )? el[ev] : function(){};
	el[ev] = function(){ fn.apply(this, []); fnt.apply(this, []); }
}

/* HILITE_INPUT: ADD EFFECT FOCUS/BLUR TO THE SPECIFIED ELEMENT
 * el: AN FORM ELEMENT
 * bgf: ONFOCUS BACKGROUND COLOR
 * bgb: ONBLUR BACKGROUND COLOR
 */
hilite_input = function( el, bgf, bgb ){
	if( !el ){ return; }
	if( !el.style ){ return; }
	v = ['text', 'password'];
	if( el.tagName == 'INPUT' && !in_array(el.type, v) ){ return; }
	switch(el.tagName){
		case 'TEXTAREA':
		case 'SELECT':
		case 'INPUT':
			addon_event( el, 'onfocus', function(){ el.style.backgroundColor = bgf; } );
			addon_event( el, 'onblur', function(){ el.style.backgroundColor = bgb; } );
			break;
		default: return;
	}
}

/* HILITE_FORM: ADD EFFECT FOCUS/BLUR TO THE SPECIFIED FORM
 * el: AN FORM
 * bgf: ONFOCUS BACKGROUND COLOR
 * bgb: ONBLUR BACKGROUND COLOR
 */
 hilite_form = function( el, bgf, bgb ){
 	if( !el ){ return; }
	if( el.tagName != 'FORM' ){ return; }
	for( i = 0; i < el.elements.length; i++){ hilite_input( el.elements[i], bgf, bgb ); }
}

/* HILITE_TABLE: HIGHLIGHTS TABLE ROWS IF CLASS ISN'T NOHILITE
 */
hilite_table = function( id, on, out ){
	if( !document.getElementById && !document.getElementsByTagName ){ return; }
	table = document.getElementById( id );
	if( !table ){ return; }
	rows = table.getElementsByTagName('tr');
	for( i = 0; i < rows.length; i++ ){
		r = rows[i];
		if( r.className != 'nohilite' ){
			overfunc = get_source(r.onmouseover, 'this.style.backgroundColor = "' + on + '";');
			r.onmouseover = overfunc;
			outfunc = get_source(r.onmouseout, 'this.style.backgroundColor = "' + out + '";');
			r.onmouseout = outfunc;
		}
	}
}

/* IS_NUMBER: CHECKS IF THE ARGUMENT IS A NUMBER
 */
is_number = function(n){ return !isNaN( new Number(n) ); }

/* IS_INTEGER: CHECKS IF THE ARGUMENT IS AN INTEGER NUMBER
 */
is_integer = function(n){ if(isNaN(n)){return false;}; return ( parseInt(n) == n ); }
 
/* IS_ARRAY: CHECKS IF THE ARGUMENT IS AN ARRAY
 */
is_array = function( a ){
	r = (typeof(a) == 'object');
	if( !r ){ return false; }
	return ( a.shift && a.push && a.reverse )? true : false;
}

/* ARRAY_KEYS: RETURNS KEYS FROM SPECIFIED ARRAY
 */
array_keys = function( ar ){
	keys = [];
	for( o in ar ){ keys.push( o ); }
	return keys;
}

/* IN_ARRAY: CHECKS IF ARGUMENT 1 EXISTS ON ARGUMENT 2
 */
in_array = function( s, a ){
	if( !is_array(a) ){ return false; }
	for( o in a ){ if( a[o] == s ){ return true; } }
	return false;
}
 
 /* _E: WRITES STR ON NEW LINE
  */ 
_e = function( str ){ document.write(str + '<br />'); }

/* LABEL_IT: TURNS AN ELEMENT IN BOLD
 * id: idname as string
 */
label_it = function( id ){
	if( !document.getElementById ){ return; }
	el = document.getElementById(id);
	if( !el ){ return; }
	if( !el.style ){ return; }
	addon_event( el, 'onfocus', function(){ el.style.fontWeight = 'bold'; } );
	addon_event( el, 'onblur', function(){ el.style.fontWeight = 'normal'; } );
}

/* POP_IT: OPENS A POPUP WINDOW
 * url: page url (string)
 * name: window's name (string)
 * w: window's width (integer)
 * h: window's height (integer)
 * c: centralize window (boolean / optional)
 * s: window's scrolling (boolean / optional)
 *******************************
 * pop_it( url, name, w, h, c, s );
 */
popup_it = function(url, name, w, h){

	if( arguments.length >= 3 ){ 
		w = isNaN( arguments[2] )? (window.screen.width*0.75) : arguments[2];
	}
	
	if( arguments.length >= 4 ){ 
		h = isNaN( arguments[3] )? (window.screen.height*0.75) : arguments[3];
	}
	
	if( arguments.length == 5 ){ c = arguments[4]; }
	else{ c = false; }
	
	if(c){
		t = (window.screen.height-h)/2;
		l = (window.screen.width-w)/2;
	}else{
		t = 1;
		l = 1;
	}
	
	if( arguments.length == 6 ){ s = ( arguments[5] )? 'yes' : 'no'; }
	else{ s = 'no'; }
	
	var config = 'locationbar=0, personalbar=0, statusbar=1, status=1, menubar=0, toolbar=0, resizable=yes, scrolling=' + s + ', scrollbars=' + s + ', location=0, width=' + w + ', height=' + h + ', top=' + t + ', left=' + l;
	window.open(url, name, config);
	//return false;
}

message = function(str){
	alert(unescape(str));
}

error = function(fld, message)
{
    alert(message);
    fld.focus();
    return false;
}

get_element = function(id)
{
    doc = arguments.length == 2? arguments[1] : document;
    
    if (document.getElementById) { return doc.getElementById(id) }
    else if (document.all) { return doc.all[id]; }
    else if (document.layers) { return doc.layers[id]; }
}

hide = function()
{
    els = arguments;

    for (i = 0; i < els.length; i++) {
        el = get_element(els[i]);
        if (el) el.style.display = 'none';
    }
}

show = function()
{
    els = arguments;

    for (i = 0; i < els.length; i++) {
        el = get_element(els[i]);
        if (el) el.style.display = 'block';
    }
}

menu = function(id)
{
    el = get_element(id);

    if (!el) {return false;}

    if (el.style.display == 'none') {
        el.style.display = 'block';
    } else {
        el.style.display = 'none';
    }
}

is_email = function(email)
{
    var regex = /^[a-z0-9]+([_.-][a-z0-9]+)*@([a-z0-9]+([.-][a-z0-9]+)*)+\.[a-z]{2,}$/
    return regex.test(email);
}

checkdate = function(day, month, year)
{
    if (!day || !month || !year || day.length != 2 || month.length != 2 || year.length != 4) return false;
    
    day     = new Number(day);
    month   = new Number(month);
    year    = new Number(year);
    days    = [31,28,31,30,31,30,31,31,30,31,30,31];
    
    if (isNaN(day) || isNaN(month) || isNaN(year)) return false;

    days[1] = (new Date(year,1,29)).getDate()==29? 29 : 28; // check if is leap year
    
    if (day <= 0 || day > days[month-1] || month < 1 || month > 12) return false;
    
    return true;
}