﻿jQuery(document).ready(function() {    
    //Title attribute3 com tip = true, cantos redondos, link inactivo

		jQuery('a.qtipTitle3[title]').qtip(
		{ 
			style: { 
				name: 'blue', 
				tip: true,
				border: {
				   width: 0,
				   radius: 4
				}
			}
		}).click(function(){
			return false;
		});
   


	// Tabs
	jQuery('#tabs').tabs();
	//$('#tabsPartners').tabs();
	
	
	//Accordion
	jQuery('.subtitMenu ul li p').hide();
    if(jQuery('.subtitMenu ul li p').length) {
        jQuery('.subtitMenu ul li p').parent().find('a:first').toggle(function(){
          jQuery(this).parent().find('p.subsubmenu').fadeIn('slow');
          
          return false;
        },function(){
            jQuery(this).parent().find('p.subsubmenu').fadeOut('slow');
            return false;
        });
    }
	
});

/***********************************************************************************************

Use the call actions in the form items that you need like the example below:

<input name="demo" type="text" value="demo" onfocus="myFocus(this);" onblur="myBlur(this);" />

***********************************************************************************************/

function myFocus(element) {
    if (element.value == element.defaultValue) {
        element.value = '';
    };
}
function myBlur(element) {
    if (element.value == '') {
        element.value = element.defaultValue;
    };
}


/*validação de email e pesquisa*/
function validationEmail() {
        if ((jQuery('.txtEmail').length)) {
            var inputValue = String($('.txtEmail').val());
            if (!inputValue.match(/^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,6}$/i)) {
                jQuery('#errorMsg').html('Insira um email válido');
                return false;
            }
            return true;
        }
    }

function validationSearch() {
    if((jQuery('.pesquisa').length)){ 
        var inputvalue = String(jQuery('.pesquisa').val());
        if((inputvalue.length < 3)){ 
            jQuery('#errorMsgSearch').html('tem que inserir pelo menos 3 caracteres');
            return false;
        }
        return true;
    }
}








