$nyms=jQuery.noConflict();



// FORM AUTOVALUES
$nyms(document).ready(function(){

	function populateElement(selector, defvalue) {
		$nyms(selector).focus(function() {
			if ($nyms(selector).val() == 'Website') {
				$nyms(selector).val('http://');
			} else if ($nyms(selector).val() == defvalue) {
				$nyms(selector).val('');
			}
		});

		$nyms(selector).blur(function() {
				if ($nyms.trim($nyms(selector).val()) == '') {
						$nyms(selector).val(defvalue);
				}
		});
	};

	$nyms('form').find('input[type="text"], input[type="password"], textarea').each(function() {
				populateElement($nyms(this), $nyms(this).val());
			}
	);





	$nyms('.add-comment-button').click( function() { 
	
			show_add_comment(this);
			
		} );




});

//



var show_add_comment=function(controller) 
{			
	var node = $nyms(controller).parents('.post').find('.add-commentbox');

	if(node.css('display') == 'none')
	{
		
		node.animate({height:'show',opacity:'show'}, 'slow');

		$nyms.scrollTo( node, 1000 );

	}
	else
	{
	
		node.animate({height:'hide',opacity:'hide'}, 'slow');

	}

}


	var flashvars = {};
	var params = {};
	var attributes = {wmode:'transparent'};

swfobject.embedSWF(_site_path+"/LT-160x160.swf", "logo", "160", "160", "9.0.0",flashvars,params,attributes);







  $nyms(function() {

    var galleries = $nyms('.ad-gallery').adGallery(
	{
	animate_first_image:true,	
	effect:'fade'	
	}
	);
    
	$nyms('#switch-effect').change(
      function() {
        galleries[0].settings.effect = $nyms(this).val();
        return false;
      }
    );
    $nyms('#toggle-slideshow').click(
      function() {
        galleries[0].slideshow.toggle();
        return false;
      }
    );
  });
