﻿/*
CSS Browser Selector v0.4.0 (Nov 02, 2010)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u) { var ua = u.toLowerCase(), is = function (t) { return ua.indexOf(t) > -1 }, g = 'gecko', w = 'webkit', s = 'safari', o = 'opera', m = 'mobile', h = document.documentElement, b = [(!(/opera|webtv/i.test(ua)) && /msie\s(\d)/.test(ua)) ? ('ie ie' + RegExp.$1) : is('firefox/2') ? g + ' ff2' : is('firefox/3.5') ? g + ' ff3 ff3_5' : is('firefox/3.6') ? g + ' ff3 ff3_6' : is('firefox/3') ? g + ' ff3' : is('gecko/') ? g : is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.$1 : (/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.$2 : '')) : is('konqueror') ? 'konqueror' : is('blackberry') ? m + ' blackberry' : is('android') ? m + ' android' : is('chrome') ? w + ' chrome' : is('iron') ? w + ' iron' : is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.$1 : '') : is('mozilla/') ? g : '', is('j2me') ? m + ' j2me' : is('iphone') ? m + ' iphone' : is('ipod') ? m + ' ipod' : is('ipad') ? m + ' ipad' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('webtv') ? 'webtv' : is('win') ? 'win' + (is('windows nt 6.0') ? ' vista' : '') : is('freebsd') ? 'freebsd' : (is('x11') || is('linux')) ? 'linux' : '', 'js']; c = b.join(' '); h.className += ' ' + c; return c; }; css_browser_selector(navigator.userAgent);

function limparPadrao(campo) {
	if (campo.value == campo.defaultValue) {
		campo.value = ""; }
}

function escreverPadrao(campo) {
	if (campo.value == "") {
		campo.value = campo.defaultValue; }
}

function showmenu(elmnt) {
	document.getElementById(elmnt).style.display = "block";
	if($('.scroll').size() > 0){
		$(document).ready(function() {
			$('.scroll').each(function(){
				if($(this).find('.scrollbar').size() < 1) {
					html = $(this).html();
					html_append = '<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div><div class="viewport"><div class="overview">'+html+'</div></div>';
					$(this).html(html_append);
				}
				$(this).tinyscrollbar();
			});
		});
	}
}

function hidemenu(elmnt) {
	document.getElementById(elmnt).style.display = "none";
}

// para facilitar o trabalho quando for abrir popups jquery
function abresplash(divs) {
	abrir = Array();
	switch(divs) {
		case 'faleconosco':
			abrir = ['splash','fale-conosco2','fale-conosco'];
		break;
		case 'politicadeprivacidade':
			abrir = ['splash','politica-de-privacidade','politica-de-privacidade2'];
		break;
		case 'termosdeuso':
			abrir = ['splash','termos-de-uso2','termos-de-uso'];
		break;
		case 'quemsomos':
			abrir = ['splash','quem-somos2','quem-somos'];
		break;
		case 'cadastro':
			abrir = ['splash','splash2','splash3'];
		break;
		case 'esquecisenha':
			abrir = ['splash','equeci-minha-senha2','equeci-minha-senha'];
		break;
	}

	for(i=0;i<abrir.length;i++) {
		showmenu(abrir[i]);
	}
}
