/// GLOBAL VARIABLES
var $container = $('#container');
//var isocontainer = '#container'
//var filename = location.pathname.substr(location.pathname.lastIndexOf("/")+1,location.pathname.length).slice(0, -5);
//var filename = location.pathname.slice(0,location.pathname.indexOf('/')+1)
//.substr(location.pathname.lastIndexOf("/")+1,location.pathname.length).slice(0, -5);

var filename = document.location.pathname
//document.location.href.replace('', '');


var hashGrab = window.location.hash.replace('#', '');   //var hashGrab = window.location.hash.substr(1);
var colors = ["#f26532", "#ee3a43", "#89d4df", "#7ac142", "#00a261", "#0055a5"];
var buyLoaded = 0
var expandedBox = []
	


       
       
		
/// GLOBAL FUNCTIONS

  if(navigator.platform == 'iPad') //|| navigator.platform == 'iPhone' || navigator.platform == 'iPod')
{
var iPadY = 0

    $(document).click(function(e) {
    
    iPadY = $('body').offset().top;
    

    });
    
    }
function toggleball() {
  
  if(navigator.platform == 'iPad') //|| navigator.platform == 'iPhone' || navigator.platform == 'iPod')
{
$("#loading").css("top", iPadY);
//    $('body').prepend(""+iPadY);


}



  $('#loading').toggle();
    
}




function overflowhack() {  
		$('#container').css('overflow', 'visible');

		};
		
		
$.fn.shareCheck = function(){
if ($('#sharefloat').hasClass('expanded')){
$('#sharefloat').delay(100).fadeOut(500).removeClass('expanded');
} };

/// add onTop
function eventResize() {

//$('.element').removeClass('ontop');
$('.element').each(function(){

  var position = $(this).data('isotope-item-position');
  //console.log('item position is x: ' + position.x + ', y: ' + position.y  );
 // var ypox = position.y + 'test2'
 // $(this).addClass('test');
 // 		$(this).addClass(ypox);
  if (position.length > 0){

  if (position.y < 300){
		$(this).addClass('ontop');
	} else {
	
			$(this).removeClass('ontop');

	}
	}
  
/*	var _t = $(this);
	var position = _t.position();
	_t.addClass('' +position.top+ '');
	if (position.top < 300){
		_t.addClass('ontop');
	}
	if (position.top > 300){
		_t.removeClass('ontop');
	}
	
	*/
	
	
	
	});

}














//// OPEN FUNCTION
function switchItem(thisItem,getLoad,scriptSrc,iD){
toggleball();

 if (!($(thisItem).hasClass('large')))  { 



$(thisItem).find(".contentbox").empty().toggle(1).load(getLoad, function(){
toggleball();
///////
if ($(thisItem).hasClass('extscript')){
var scriptArray = scriptSrc.split(/-/);
jQuery.each(scriptArray, function() {

var scriptAsClass = (this.substring(this.lastIndexOf('/') + 1)).replace('.js', '');
if (!(scriptAsClass == 'buyonline')){
		$.getScript(this, function() {$('body').addClass(scriptAsClass);});

}
else if (scriptAsClass == 'buyonline') {
$('body').addClass('getbuyonline').addClass(""+buyLoaded);
	if (buyLoaded == 0)
		{
		$.getScript(this, function() {$('body').addClass(scriptAsClass).addClass(buyLoaded);});
		buyLoaded = 1;$('body').addClass(""+buyLoaded);
		}
	}
});
}

///////////



});

$(thisItem).find('.trigger,.xbutton,.textshare').toggle(1);
$(thisItem).toggleClass('large');
if ($(thisItem).hasClass('knockoutblock')){

var colorpick = colors[Math.floor(Math.random() * colors.length)];
$(thisItem).animate( { backgroundColor: colorpick }, 1);



    if (!(jQuery.support.opacity)) {
    
    
    
    
    if (!($(thisItem).hasClass('stuckbuttons'))){

 //   $('body').prepend('test');
    
    $(thisItem).find('.xbutton>img').animate( { backgroundColor: colorpick }, 1);
    $(thisItem).find('.textshare>img').animate( { backgroundColor: colorpick }, 1);
    /// to deal with IE weak transparency we need to set the elements background color as the images background color
    }


}





} else {

       if (!(jQuery.support.opacity)) {
   $(thisItem).find('.textshare>img').animate( { backgroundColor: '#ffffff' }, 1);
       $(thisItem).find('.xbutton>img').animate( { backgroundColor: '#ffffff' }, 1);

}

}

}
var $newItems = $(thisItem);
if ($(thisItem).hasClass('ontop')){$('#container').prepend(thisItem).isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' });  }



	
		expandedBox.push($(thisItem).attr('id'));



		if (expandedBox.length >2){


		var closerId = '#' + expandedBox.shift();


		closeBox(closerId);


		}




if ($('body').hasClass('ie')){ 
if ($(thisItem).hasClass('knockoutblock')){
var cornerhack = '<img class="ieextrastuff" src="/content/images/tl.png" style="position:absolute;top:0px;left:0px;"/><img class="ieextrastuff" src="/content/images/tr.png" style="position:absolute;top:0px;right:0px;"/><img class="ieextrastuff" src="/content/images/bl.png" style="position:absolute;bottom:0px;left:0px;"/><img class="ieextrastuff" src="/content/images/br.png" style="position:absolute;bottom:0px;right:0px;"/>'
$(thisItem).append(cornerhack);
}else{
var cornerhack = '<div class="ieextrastuff" style="border-right:solid 1px #dddddd;height:auto;position:absolute;right:0px;top:12px;bottom:12px;width:1px;"></div><div class="ieextrastuff" style="border-left:solid 1px #dddddd;height:1px;position:absolute;left:0px;bottom:12px;top:12px;height:auto;"></div><div class="ieextrastuff" style="border-bottom:solid 1px #dddddd;height:1px;position:absolute;bottom:0px;left:12px;right:12px;width:auto;"></div><div class="ieextrastuff" style="border-top:solid 1px #dddddd;height:1px;position:absolute;top:0px;left:12px;right:12px;width:auto;"></div><img class="ieextrastuff" src="/content/images/tl_g.png" style="position:absolute;top:0px;left:0px;"/><img class="ieextrastuff" src="/content/images/tr_g.png" style="position:absolute;top:0px;right:0px;"/><img class="ieextrastuff" src="/content/images/bl_g.png" style="position:absolute;bottom:0px;left:0px;"/><img class="ieextrastuff" src="/content/images/br_g.png" style="position:absolute;bottom:0px;right:0px;"/>'
$(thisItem).append(cornerhack);
}
}



$('#container').isotope('reLayout');
$('#container').isotope( 'reloadItems' );
overflowhack();
eventResize();

return false;





















};









function openSwitch(thisItem, getLoad, scriptSrc, iD) {
    toggleball();

    if (!($(thisItem).hasClass('expanded'))) {


        $(thisItem).find(".contentbox").empty().load(getLoad, function () {
            toggleball();
            ///////
            if ($(thisItem).hasClass('extscript')) {
                var scriptArray = scriptSrc.split(/-/);
                jQuery.each(scriptArray, function () {

                    var scriptAsClass = (this.substring(this.lastIndexOf('/') + 1)).replace('.js', '');
                    if (!(scriptAsClass == 'buyonline')) {
                        $.getScript(this, function () {
                            $('body').addClass(scriptAsClass);
                        });

                    } else if (scriptAsClass == 'buyonline') {
                        $('body').addClass('getbuyonline').addClass("" + buyLoaded);
                        if (buyLoaded == 0) {
                            $.getScript(this, function () {
                                $('body').addClass(scriptAsClass).addClass(buyLoaded);
                            });
                            buyLoaded = 1;
                            $('body').addClass("" + buyLoaded);
                        }
                    }
                });
            }

            ///////////

        });


    }

    var $newItems = $(thisItem);
    if ($(thisItem).hasClass('ontop')) {
        $('#container').prepend(thisItem).isotope('reloadItems').isotope({
            sortBy: 'original-order'
        });
    }







    if ($('body').hasClass('ie')) {
        if ($(thisItem).hasClass('knockoutblock')) {
            var cornerhack = '<img class="ieextrastuff" src="/content/images/tl.png" style="position:absolute;top:0px;left:0px;"/><img class="ieextrastuff" src="/content/images/tr.png" style="position:absolute;top:0px;right:0px;"/><img class="ieextrastuff" src="/content/images/bl.png" style="position:absolute;bottom:0px;left:0px;"/><img class="ieextrastuff" src="/content/images/br.png" style="position:absolute;bottom:0px;right:0px;"/>'
            $(thisItem).append(cornerhack);
        } else {
            var cornerhack = '<div class="ieextrastuff" style="border-right:solid 1px #dddddd;height:auto;position:absolute;right:0px;top:12px;bottom:12px;width:1px;"></div><div class="ieextrastuff" style="border-left:solid 1px #dddddd;height:1px;position:absolute;left:0px;bottom:12px;top:12px;height:auto;"></div><div class="ieextrastuff" style="border-bottom:solid 1px #dddddd;height:1px;position:absolute;bottom:0px;left:12px;right:12px;width:auto;"></div><div class="ieextrastuff" style="border-top:solid 1px #dddddd;height:1px;position:absolute;top:0px;left:12px;right:12px;width:auto;"></div><img class="ieextrastuff" src="/content/images/tl_g.png" style="position:absolute;top:0px;left:0px;"/><img class="ieextrastuff" src="/content/images/tr_g.png" style="position:absolute;top:0px;right:0px;"/><img class="ieextrastuff" src="/content/images/bl_g.png" style="position:absolute;bottom:0px;left:0px;"/><img class="ieextrastuff" src="/content/images/br_g.png" style="position:absolute;bottom:0px;right:0px;"/>'
            $(thisItem).append(cornerhack);
        }
    }


    $('#container').isotope('reLayout');
    $('#container').isotope('reloadItems');
    overflowhack();
    eventResize();
    return false;





};
















// GENERIC BOX CLOSER
function closeBox(thebox){
		$.fn.shareCheck();

			 if ($(thebox).closest('.element').hasClass('hidden'))  { 
			 
			var $killit = $(thebox).closest('.element');
			 
			// $($killit).removeClass('element').hide().clone().appendTo('#hiddenelements');
			 			$('#container').isotope( 'remove', $killit );


			 		 $('#container').isotope('reLayout');

			 		$('#container').isotope( 'reloadItems' );
			 		
			 }

		 if ($(thebox).closest('.element').hasClass('multisize'))  { 
		 

		var $start = $(thebox).closest('.element').attr('data-startsize');
		var $end = $(thebox).closest('.element').attr('data-endsize');
		//var $test = $(thebox).closest('.element').attr('data-test');
		
		if ($(thebox).closest('.element').hasClass($end))  { 
		$(thebox).closest('.element').removeClass($end).removeClass('expanded').addClass($start);

		if ($(thebox).closest('.element').hasClass('knockoutblock'))  { 


  $(thebox).closest('.element').find(".textshare.sharebutton.knockout img").attr("src","/content/images/shareknockout.png");
        $(thebox).closest('.element').find(".xbutton.close img").attr("src","/content/images/xboxsmallknockout.png");
} else {

  $(thebox).closest('.element').find(".textshare.sharebutton img").attr("src","/content/images/sharebutton.png");
        $(thebox).closest('.element').find(".xbutton.close img").attr("src","/content/images/xboxsmall.png");

        
}



}


	}
	
	
	
	
	
 if ($(thebox).hasClass('.element'))  { 
		var $s = $(thebox);
	}	else {
		var $s = $(thebox).closest('.element');
	}
	
	
	
	
	
	

/*$('body').prepend('Array: '+expandedBox)*/

/*function removeByValue(arr, val) {
    for(var i=0; i<arr.length; i++) {
        if(arr[i] == val) {
            arr.splice(i, 1);
            break;
        }
    }
}

removeByValue(expandedBox,$s);*/

/*if ( $.inArray($s.attr('id'), expandedBox) == -1)
{
$('body').prepend('NOT IN ARRAY ');
}
else {
$('body').prepend('in array ');
}
*/



function removeByValue(arr, val) {
    for(var i=0; i<arr.length; i++) {
        if(arr[i] == val) {
            arr.splice(i, 1);
            break;
        }
    }
}


removeByValue(expandedBox,$s.attr('id'));


/*if ( $.inArray($s.attr('id'), expandedBox) == -1)
{
$('body').prepend('NOT IN ARRAY ');
}
else {
$('body').prepend('in array ');
}

*/
	
$($s).find('.ieextrastuff').remove();

		$($s).find('.contentbox,.trigger,.xbutton,.textshare').toggle();
		$($s).closest('.element').removeClass('large');
		if ($($s).hasClass('heavy')){$($s).find('.contentbox').empty();};
		/*if ($($s).hasClass('knockoutblock')){$($s).find('.contentbox').empty();};*/


	if ($($s).hasClass('knockoutblock')){
	
		/*$('body').hide();*/
		
			if ($($s).hasClass('bluesingle')){$(thebox).closest('.knockoutblock').stop(true, true).animate( { backgroundColor: '#89d4df' }, 10);}
			else if ($($s).hasClass('greensingle')){$(thebox).closest('.knockoutblock').stop(true, true).animate( { backgroundColor: '#00a261' }, 10);}
			else {$(thebox).closest('.knockoutblock').stop(true, true).animate( { backgroundColor: '#ffffff' }, 10);}
		
		
		

		
		};



		$container.isotope('reLayout');
		overflowhack();
		eventResize();
window.location.hash = '#*';


///////// check to see how many things are open, scroll up if its a reasonable good idea too.
//if (($("div.element.large").not('.isotope-hidden').length < 1) || ($("div.element").not('.isotope-hidden').length < 6)){
if ($("div.element").not('.isotope-hidden').length < 6){
		$('html,body').delay(500).animate({ scrollTop: $('body').offset(0).top -10 }, { duration: 'slow', easing: 'swing'});
}
		return false;

};

		
		
	
		function checkimages(){
		/*
		var allImages = $('img:not(.animage)').each(function(){
$(this).addClass('animage');
//var width = $('this').clientWidth;
//var height = $('this').clientHeight;
var img = $(this); // Get my img elem
var pic_real_width, pic_real_height;
$("<img/>") // Make in memory copy of image to avoid css issues
    .attr("src", $(img).attr("src"))
    .load(function() {
    $(this).addClass('notanimage');

        pic_real_width = this.width;   // Note: $(this).width() will not
        pic_real_height = this.height; // work for in memory images.
       // $('body').prepend(pic_real_width+" "+pic_real_height + "    ");
$(img).css('height',pic_real_height).css('width',pic_real_width);
    });

});

*/		
		}
/// BASIC ANIMATIONS

$(document).ready(function(){

checkimages();



if (!(jQuery.support.opacity)) {
var cornerhack = '<img class="ieextrastuff" src="/content/images/tl.png" style="position:absolute;top:0px;left:0px;"/><img class="ieextrastuff" src="/content/images/tr.png" style="position:absolute;top:0px;right:0px;"/><img class="ieextrastuff" src="/content/images/bl.png" style="position:absolute;bottom:0px;left:0px;"/><img class="ieextrastuff" src="/content/images/br.png" style="position:absolute;bottom:0px;right:0px;"/>'
   $('.billboard').append(cornerhack);
}





function isiPad(){
    return (
       // (navigator.platform.indexOf("iPhone") != -1) ||
        (navigator.platform.indexOf("iPad") != -1)
    );
}



if(isiPad()){
    //stick the footer at the bottom of the page if we're on an iPad/iPhone due to viewport/page bugs in mobile webkit
  //  if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
  //  {
   //      $("#sharefloat").css("position", "static");
  //  };


}

//if(isiPad()){$('body').hide();}

    if (jQuery.support.opacity) {

		/////is ipad
		if (!(isiPad())){


///////mouse hover animation


	    		$(".element.large, .element.infohover.large").live({
        mouseenter:
           function()
{$(this).find('.bread.knockout, .textshare.knockout, .textshare').stop(true, true).animate({"opacity": "1","filter":"0"}, 500);


},
        mouseleave:
           function()
{$(this).find('.bread.knockout, .textshare.knockout, .textshare').stop(true, true).animate({"opacity": "0","filter":"0"}, 500);

}
       }
    );
     
		
		
		
		
			$(".element.bored.large:not(.knockoutblock)").live({
        mouseenter:
           function()
{$(this).find('.bread, .textshare').stop(true, true).animate({"opacity": "1","filter":"0"}, 500);

},
        mouseleave:
           function()
{$(this).find('.bread, .textshare').stop(true, true).animate({"opacity": "0","filter":"0"}, 500);

}
       }
    );
    
    
		
		
		
		$(".element:not(.large,.isotope-hidden,.wwanim)").live({
        mouseenter:
           function()
{$(this).animate({"opacity": ".6"}, 200);},
        mouseleave:
           function()
{$(this).animate({"opacity": "1"}, 20);}
       }
    );
    
    



		$(".filteritem,.xbutton, .textshare").live({
        mouseenter:
           function()
{$(this).animate({"opacity": ".5","filter": ""}, 80);},
        mouseleave:
           function()
{$(this).animate({"opacity": "1","filter": ""}, 80);}
       }
    );
    









/*$(".xbutton").mousedown(function() {$(this).animate({"opacity": ".3","filter": ""}, 80);},function() {$(this).animate({"opacity": "1","filter": ""}, 80);});*/


/*
    
 $("#sharefloat").live({
        mouseenter:
           function()
{$(this).find('.close').stop(true, true).animate({"opacity": "1","filter": ""}, 500);},
        mouseleave:
           function()
{$(this).find('.close').stop(true, true).animate({"opacity": "0","filter": ""}, 500);}
       }
    );
    
 */

    
    
    /*

    
        		$(".element.large").live({
        mouseenter:
           function()
{$(this).find('.close').stop(true, true).animate({"opacity": "1","filter":"0"}, 500);},
        mouseleave:
           function()
{$(this).find('.close').stop(true, true).animate({"opacity": "0","filter":"0"}, 500);}
       }
    );

*/



$("div.productfade").live({
			mouseenter:function(){
			
									var fade = $('> div', this);
									if (fade.is(':animated')) {
										  fade.stop().fadeTo(500, 1);
									} else {
										  fade.fadeIn(500);
									}
			},mouseleave:
								   function(){
							var fade = $('> div', this);
							if (fade.is(':animated')) {
							  fade.stop().fadeTo(500, 0);
							} else {
							  fade.fadeOut(500);}
			},mousedown:
								   function(){
							var fade = $('> div', this);
							if (fade.is(':animated')) {
							  fade.stop().fadeTo(500, 0);
							} else {
							  fade.fadeOut(500);}
			}
								
				   
});
    
    
    
    

	
		$(".prodprice,.pressup,.pressdown,.findstore,.checkout,.buyproduct").live({
        mouseenter:
           function()
{$(this).animate({"opacity": ".6"}, 200);},
        mouseleave:
           function()
{$(this).animate({"opacity": "1"}, 20);}
       }
    );
    

//////end mouse hover animation





		}  
		/////end ipad
		
	
    

    
    
    

        } else {
        
     ///WAS AND ELSE BUT CHANGES TO INCORPORATE IPAD   
    //if ((!(jQuery.support.opacity)) ||  isiPad() )  {

//$('body').hide();




///// ie 7 transparency hack



			$("div.element.knockoutblock div.xbutton.close img").live({
        mouseenter:function()
{$(this).stop(true, true).attr('src', '/content/images/xboxsmallknockout50.png');},
        mouseleave:function()
{$(this).stop(true, true).attr('src', '/content/images/xboxsmallknockout.png');}
       });
       //this was        			$("div.element.stuckbuttons div.textshare.sharebutton.knockout img").live({

       			$("div.element.knockoutblock div.textshare.sharebutton img").live({
        mouseenter:function()
{$(this).stop(true, true).attr('src', '/content/images/shareknockout50.png');},
        mouseleave:function()
{$(this).stop(true, true).attr('src', '/content/images/shareknockout.png');}
       });
       
       
  //////AAAHHHH       
     
       		$(".filteritem,.element:not(.knockoutblock) .xbutton, .element:not(.knockoutblock) .textshare").live({
        mouseenter:
           function()
{$(this).find('img').css('-ms-filter:','"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"').css('filter','alpha(opacity=50)')},
        mouseleave:
           function()
{$(this).find('img').css('-ms-filter:','"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"').css('filter','alpha(opacity=100)')}
       }
    );
       
       
//////AAAHHHH       
     
         		$(".element.knockoutblock.large, .element.infohover.large").live({
        mouseenter:
           function()
{$(this).find('.bread.knockout').stop(true, true).fadeIn(500);


},
        mouseleave:
           function()
{$(this).find('.bread.knockout').stop(true, true).fadeOut(500);

}
       });
       



			$(".element.bored.large:not(.knockoutblock)").live({
        mouseenter:
           function()
{$(this).find('.bread').stop(true, true).fadeIn(500);

},
        mouseleave:
           function()
{$(this).find('.bread').stop(true, true).fadeOut(500);

}
       }
    );
    
    





    
    
    
    
  /*  
    $('#fancybox-wrap').live({
        mouseenter:
           function()
{$('#fancybox-close').show()},
        mouseleave:
           function()
{$('#fancybox-close').hide()}
       }
    );
    
    */
    
$("div.productfade").live({
			mouseenter:function(){
			$(this).children('img').css('visibility', 'hidden');
			$(this).children('div').css('display', 'block');
			},mouseleave:
								   function(){
			$(this).children('img').css('visibility', 'visible');
			$(this).children('div').css('display', 'none');
			},mousedown:
								   function(){
			$(this).children('img').css('visibility', 'visible');
			$(this).children('div').css('display', 'none');
			}
});



        }
        
        









     
     $("div.wwanim .trigger").live({
			mouseenter:function(){
			$(this).children('.wwanimtop').fadeIn(350);
			},mouseleave:
								   function(){
			$(this).children('.wwanimtop').fadeOut(200);

			},mousedown:
								   function(){
			$(this).children('img').css('visibility', 'visible');
			$(this).children('div').css('display', 'none');
			}
});
     
     
     
    
    
    
    

    
    
    
    
    
$container.isotope({
  itemSelector: '.element',   itemPositionDataEnabled: true,
  masonry: {
    columnWidth: 204
  }, animationOptions: {
     duration: 550,
     easing: 'linear'}, resizesContainer:true,
  visibleStyle: { opacity: 1, scale : 1 },
  hiddenStyle: { opacity: 0, scale : 0.001  } 

});
overflowhack();
eventResize();
return false;

});



    

$(".sharetoggle.no").live({


		click:function(){

								var ajaxElements = $('.sharetoggle').each(function(){
						$(this).toggleClass('yes').toggleClass('no');	
						if ($(this).hasClass('yes')){
								var src = "/content/images/sharecheckyes.jpg";
								$(this).attr("src", src);
						}
						else if ($(this).hasClass('no')){
						
							var src = "/content/images/sharecheckno.jpg";
							$(this).attr("src", src);
						}
						
					
						
						
								}	);
												
		}
});

























$(".sharetoggle1").click(function() {
	$('#sharepage').hide();	$('#sharesite').show();		
	
	/*var fillFacebook ='<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.helpineedhelp.com&amp;send=false&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=90" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:90px; z-index:100000000000;visibility:visible;display:block;" allowTransparency="true"></iframe>';
	$('#facesite').empty().html(fillFacebook);
*/

	

});

$(".sharetoggle2").click(function() {
	$('#sharesite').hide();	$('#sharepage').show();		
	
	
	var faceLoc = 'http%3A%2F%2Fwww.helpineedhelp.com/'+window.location.hash.replace('#', '')+'.html';
    var faceSrc = '//www.facebook.com/plugins/like.php?href='+faceLoc+'&amp;send=false&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=90'
	$('#faceFrame').attr("src", faceSrc);
	
});


$(".emailtoggle").live({

		click:function(){

						$(this).toggleClass('yes').toggleClass('no');
						if ($(this).hasClass('yes')){
								var src = "/content/images/sharecheckyes.jpg";
								$(this).attr("src", src);
						}
						else if ($(this).hasClass('no')){
						
							var src = "/content/images/sharecheckno.jpg";
							$(this).attr("src", src);
						}
												
		}
});




$(".shareemailrequest, .sharewebsite").live({

		click:function(){

$(".sharebottomleft,.sharetoggle,").toggle();
$('.shareoptions').toggle();

		}
});






    
    
    
    
    
    
 $(".facebookbutton.inner,.twitterbutton.inner").live({
        mouseenter:
           function()
{$(this).stop(true, true).animate({"opacity": "1"}, 300);},
        mouseleave:
           function()
{$(this).stop(true, true).animate({"opacity": "0"}, 300);}
       }
    );    
    
    

$('#sendsharemail').click(function(){
/*var eone = '';
var etwo = '';
var ethree = '';
if ($('.emailtoggle1').hasClass('yes')){  eone = 'email1@email.com' }
if ($('.emailtoggle2').hasClass('yes')){  etwo = 'email2@email.com' }
if ($('.emailtoggle3').hasClass('yes')){  ethree = 'email3@email.com' }*/


/*var mailer ='mailto: '+eone+', '+etwo+', '+ethree+', '+'?cc=help@helpineedhelp.com&subject=Help Remedies&body=Body copy body copy body copy body copy body copy body copy body copy body copy body copy body copy body copy body copy body copy body copy.'*/
      var mailer = 'mailto:penelope.eugene@gmail?cc=help@helpineedhelp.com&subject=Help Remedies&body=Dear Penelope Eugene, I personally think that you made a terrible decision when you dumped one of the founders of help®. Yes it’s true that your new boyfriend has a better jaw-line, more charisma, and oceanfront property, but your ex-boyfriend was one of the founders of help®, and help® is much more important than a jaw-line. Sincerely, A fan of help®'
window.location.href = mailer;



})


		
		

		
		


$(".imagelink").live('mousedown', function(event) { 
    $(this).fancybox({'opacity'		: true,
				'overlayShow'	: false,'hideOnContentClick' : true, 'showCloseButton':true});
    return false;       
});



$(".iframevid").live('mousedown', function(event) { 
    	$(this).fancybox({
		 'width' : 804,
		 'height' : 452,
		 'autoScale' : false,
		 'transitionIn' : 'none',
		 'transitionOut' : 'none',
		 'type' : 'iframe','overlayShow'	: false
	 });
    return false;       
});












$(".pdflink").live('mousedown', function(event) { 

$(this).fancybox({ 
'width': '70%', // or whatever 
'height': '90%', 
'autoDimensions': false, 
'content': '<embed src="'+this.href+'#nameddest=self&page=1&view=FitH, 0&zoom=80,0,0" type="application/pdf" height="100%" width="100%" />', 
'onClosed': function() { $("#fancybox-inner").empty(); }

});


return false; 


});






		
		
