// JavaScript Document

var ua = navigator.userAgent



function inter()

{

if(ua.toLowerCase().indexOf('msie')>-1){return 'msie'}

if(ua.toLowerCase().indexOf('firefox')>-1){return 2}

if(ua.toLowerCase().indexOf('chrome')>-1){return 'chrome'}

if(ua.toLowerCase().indexOf('safari')>-1){return 'safari'}

return 0

}

var app=inter()
var appver
var b=navigator.userAgent;

if (/MSIE (\d+\.\d+);/.test(b)){ //test for MSIE x.x;

 var version=new Number(RegExp.$1) // capture x.x portion and store as a number

 appver=version

 }

if (/Firefox(\/\d+\.\d+)/.test(b)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);

 var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number

 appver=ffversion

}
//////////////////////////////////////////////////////////////////////////////////////////

//detect version of browser

$(document).ready(function(){
if(app=='msie' && appver<8.0){
			$('#blog').css({'top':'-140px','position':'absolute'})
		}



   $("a.button").mouseover(function()

									{ 

									var movey=$(this).parent().find("ul.menu-list").height()

									$(this).parent().find(".hideit").animate({'height':movey+35},{queue:false, duration:800, easing: 'easeOutBounce'})

									

									var element=document.getElementById(this.parentNode.id)

									if(element.childNodes.length>1){$(this).css({'color':'#a90359'})}

									$(this).parent().hover(function() { },function()

																		{

																		$(this).parent().find('a.button').css({'color':'#20252e'})

																		$(this).parent().find(".hideit").animate({'height':0},{queue:false, duration:800, easing: 'easeOutBounce'});

																	

																		});  

  

        							});

   

 $('#fb').mouseover(function(){$(this).animate({marginTop:'0px'},300)})

 $('#fb').mouseout(function(){$(this).animate({marginTop:'15px'},500)})

 $('#tw').mouseover(function(){$(this).animate({marginTop:'0px'},300)})

 $('#tw').mouseout(function(){$(this).animate({marginTop:'15px'},500)})


var clicked1=true

	

	$('.button1').bind('click',function(btn){

				btn.preventDefault()

				var top=-135

				if(app=='MSIE' && appver<8.0){

					top=-140

				}

				else if(app=='MSIE' || app=='FF'){

						top=-135

					}

				var height=$('.blogbdy').height()

				var extraheight=parseInt($('.blogbdy').css('padding-top'))

				height=height+(extraheight*2)			

				if(clicked1==true){

					clicked1=false

					$('#blog').animate({'top':top+height+'px'})

					$(btn.target).css('background','url(http://www.nicolemariesbeautysite.com/bridal-hair-images/form-btn-ovr.png)')

				}

				else if(clicked1==false){

					clicked1=true

					$('#blog').animate({'top':top+'px'})

					$(btn.target).css('background','url(http://www.nicolemariesbeautysite.com/bridal-hair-images/form-btn.png)')

				}

	})
   

   

});



	
