
str1="defishop nippon-seiki co jp";

function rewrite( x) {
   first = true;
   str = new String();

   for( i = 0; i < x.length; i++) {
       if ( x.charAt( i) == " ") {
           if ( first == true) {
               str = str + "@";
               first = false;
           } else {
               str = str + ".";
           }
       } else {
           str = str + x.charAt( i);
       }
   }
   return str;
}

function mailto(){
	location.href = 'mailto:' + rewrite(str1);
}
