$(function(){
	$("#menu li").hover(
		function(){
		    $(this).find("ul").show();
		  }, 
		  function(){
		    $(this).find("ul").hide();
		  }
	);
    $("div.cli-destaque").each(function(index,element){
		if(index%2){
			$(this).qtip({
			      content: $(this).find("div.hide").html(),
			      style: {
			        padding: 5,
			        background: '#ffffff url(img/cli-light.jpg) 5px 5px no-repeat',
			        border: {
			          width: 10,
			          color: '#ff8a00'
			        },
			        color: '#666',
			        textAlign: 'left',
			        tip: 'rightMiddle',
			        width: {
			          max: 400
			        }
			      },
			      hide: { when: 'mouseleave', fixed: true },
			      position: {
			        corner: {
			           target: 'leftMiddle',
			           tooltip: 'rightMiddle'
			        }
			      }
			});
		}else{
			$(this).qtip({
			      content: $(this).find("div.hide").html(),
			      style: {
			        padding: 5,
			        background: '#ffffff url(img/cli-light.jpg) 5px 5px no-repeat',
			        border: {
			          width: 10,
			          color: '#ff8a00'
			        },
			        color: '#666',
			        textAlign: 'left',
			        tip: 'leftMiddle',
			        width: {
			          max: 400
			        }
			      },
			      hide: { when: 'mouseleave', fixed: true },
			      position: {
			        corner: {
			           target: 'rightMiddle',
			           tooltip: 'leftMiddle'
			        }
			      }
			});
		}
    });
	
	
	$("a.FormCredenciamentoProfissionalADD").click(function(){
		var size=$("table.FormCredenciamentoProfissional tr").size();
		$("table.FormCredenciamentoProfissional").append("<tr><td style=\"vertical-align:top\"><input name=\"data[FormCredenciamentoProfissional]["+size+"][nome]\" value=\"Nome\" type=\"text\" maxlength=\"20\" class=\"text-236\" onblur=\"if(this.value==''){this.value='Nome'}\" onfocus=\"if(this.value=='Nome'){this.value=''}\" /></td><td style=\"vertical-align:top\"><input name=\"data[FormCredenciamentoProfissional]["+size+"][funcao]\" value=\"Função\" type=\"text\" maxlength=\"20\" class=\"text-236\" onblur=\"if(this.value==''){this.value='Função'}\" onfocus=\"if(this.value=='Função'){this.value=''}\" /></td></tr>");
		$("a.FormCredenciamentoProfissionalDelete").show();
	
	});
	var size=$("table.FormCredenciamentoProfissional tr").size();
	if(size==1){$("a.FormCredenciamentoProfissionalDelete").hide()}

	$("a.FormCredenciamentoProfissionalDelete").click(function(){
		var size=$("table.FormCredenciamentoProfissional tr").size();
		if(size>1){
			$("table.FormCredenciamentoProfissional tr:last").remove();
			if(size==2){$("a.FormCredenciamentoProfissionalDelete").hide()}
		}
	});	
});

