			
				
				$(function(){
					var medidas = getPageSize();
				var altura = (medidas[1] >= medidas[3]) ? medidas[1] : medidas[3];
				
			if(jQuery.browser.msie && parseInt(jQuery.browser.version) == 7){
				
					$('#home_colecao,#home_flash_,#conteudo').css('height',altura);
					
				}else{
					$('#home_colecao,#home_flash_,#conteudo').css('height',altura -95);
				}
				$(window).resize(function() {
					var medidasR = getPageSize();
				var alturaR = (medidasR[1] <= medidasR[3]) ? medidasR[1] : medidasR[3];
					if(jQuery.browser.msie && parseInt(jQuery.browser.version) == 7){
				
					$('#home_colecao,#home_flash_,#conteudo').css('height',altura);
				}else{
					$('#home_colecao,#home_flash_,#conteudo').css('height',altura -95);
				}
				})
				
				/*
				 * Pagina Contato
				 */
				
					$('input[title],textarea[title]').live('focus',function() {
    					if($(this).val() == $(this).attr('title')) {
							$(this).val('').addClass('focused');	
						}
					}).live('blur',function() {
    					if($(this).val() === '') {
							$(this).val($(this).attr('title')).removeClass('focused');	
						}
					});
					/*$('input[name=telefone],input[name=celular]').live('keydown',function(){
						Mascara(this,Telefone);
						}).live('keypress',function(){
						Mascara(this,Telefone);
						}).live('keyup',function(){
						Mascara(this,Telefone);
						})*/
					$('input[name=data_nascimento]').live('keydown',function(){
						Mascara(this,Data);
						}).live('keypress',function(){
						Mascara(this,Data);
						}).live('keyup',function(){
						Mascara(this,Data);
						})
				  $('.show_modal').live('click',function() {
                        var url = (this.lang) ? this.lang : this.href;
						var title = this.title;
						
						if(url == "http://www.lepink.com.br/modal/social" || url == "http://lepink.com.br/modal/social")
						var button = {"FECHAR": function() {dialog.dialog("destroy"); }};
						else
					var button = {"FECHAR": function() {dialog.dialog("destroy"); },"ENVIAR": function() { sendFormModal($('form',dialog))}};
		
                        var dialog = $('<div style="display:none" class="dialog_container"></div>').appendTo('body');
                        // load remote content
                        dialog.load(
                                url, 
                                {},
                                function (responseText, textStatus, XMLHttpRequest) {
                                        dialog.dialog({modal:true, title:title, 
										buttons: button, resizable: false });
                                }
                        );
                        //prevent the browser to follow the link
						
                        return false;
                });
				
			});
			function sendFormModal(form){
				
				if($(form).attr('id') == 'form_cadastre_se'){
					
					$.post('/contato/enviarCadastreSe/',$(form).serialize(),function(data){
						if(data == ""){
				alert('Mensagem Enviada com Sucesso');
				$('.dialog_container').dialog('destroy');
				}else{
				alert(data);
				return false;
					}
						})
						return false;
					}
				return false;
				}
			
			function getPageSize(){

        var xScroll, yScroll;
        
        if (window.innerHeight && window.scrollMaxY) {
                xScroll = document.body.scrollWidth;
                yScroll = window.innerHeight + window.scrollMaxY;
        }
        else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
                xScroll = document.body.scrollWidth;
                yScroll = document.body.scrollHeight;
        }
        else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
                xScroll = document.body.offsetWidth;
                yScroll = document.body.offsetHeight;
        }
        
        var windowWidth, windowHeight;
        if (self.innerHeight) { // all except Explorer
                windowWidth = self.innerWidth;
                windowHeight = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                windowWidth = document.documentElement.clientWidth;
                windowHeight = document.documentElement.clientHeight;
        }
        else if (document.body) { // other Explorers
                windowWidth = document.body.clientWidth;
                windowHeight = document.body.clientHeight;
        }
        
        // for small pages with total height less then height of the viewport
        if (yScroll < windowHeight) {
                pageHeight = windowHeight;
        }
        else {
                pageHeight = yScroll;
        }
        
        // for small pages with total width less then width of the viewport
        if (xScroll < windowWidth) {
                pageWidth = windowWidth;
        }
        else {
                pageWidth = xScroll;
        }
        
      return  arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight)
        
}
