var commentArray = new Array();
commentArray[ 'rdemail' ] = 'PCメールアドレス';
commentArray[ 'e' ] = 'ケータイメールアドレス';

$(function() {

	$( '[name="rdemail"], [name="e"]', 'div#offmag-area' ).each( function() {
		$( this ).val( getObjName( this ) ).addClass( 'pus' );
	});

	$( '[name="rdemail"], [name="e"]', 'div#offmag-area' ).focus( function() {
		$( this ).removeClass( 'pus' ).addClass( 'act' );
		if( $( this ).val() == getObjName( this ) ) {
			$( this ).val( '' );
		}
	});

	$( '[name="rdemail"], [name="e"]', 'div#offmag-area' ).blur( function() {
		if( ! $( this ).val() ) {
			$( this ).removeClass( 'act' ).addClass( 'pus' ).val( getObjName( this ) );
		}
	});

	$( ':submit' ).click( function() {
		var obj = $( '[type="text"]', $( this ).parent() );
		var objValue = obj.val();
		if( ( objValue == getObjName( obj ) ) || ( ! objValue ) ) {
			return false;
		}
	});
	
});

function getObjName( objInput ) {
	return commentArray[ $( objInput ).attr( 'name' ) ]
}

$(function() {
	var ybtitle = $( "title" ).html();
	$( ".yahoo-bookmark" ).click( function(){
		window.open( 'http://bookmarks.yahoo.co.jp/bookmarklet/showpopup?t=' + encodeURIComponent( ybtitle ) + '&u=' + encodeURIComponent(window.location.href) + '&opener=bm&ei=UTF-8','popup','width=550px,height=480px,status=1,location=0,resizable=1,scrollbars=0,left=100,top=50',0 );
		return false;
	});
});
