﻿//domready
// Lista de dispositivos a serem redirecionados para versão mobile
// utilizand o userAgent para verificação
var devices = new Array('nokia','iphone','blackberry','sony','lg','htc_tattoo','samsung','symbian','symbianos','elaine','palm','series60','windows ce','android','obigo','netfront','openwave','mobilexplorer','operamini');
var userAgent = navigator.userAgent.toLowerCase();
var url_mobile = 'http://www.piraja.com.br/Mobile/';
var verificaWWW= /[www]/; 

mobiDetect = function(userAgent, devices) {
	for(var i = 0; i < devices.length; i++) {
		if (userAgent.search(devices[i]) > -1) {
			   return true;
		}
	}
	return false;
}

if(verificaWWW.test(location.host)===false)
{
		// verifica a redireciona caso seja um dispositivo mobile
		if (mobiDetect(userAgent, devices))
		{
			window.location.href = url_mobile;

		}		
			window.location.href ='http://www.piraja.com.br';
}

var Piraja;

(function () {

		$(function () {

			// verifica a redireciona caso seja um dispositivo mobile
			if (mobiDetect(userAgent, devices))
				window.location.href = url_mobile;
				
				//instanciando Application na variável global Piraja;
				Piraja = new Application("container");

                $('input[type=checkbox],input[type=radio]').prettyCheckboxes({
                    checkboxWidth: 23, // The width of your custom checkbox
                    checkboxHeight: 23, // The height of your custom checkbox
                    className: 'prettyCheckboxHome' // The classname of your custom checkbox
                });
		});
	})();

 
