/*
    amazonの商品をあまともで検索するスクリプト
    ver 20060601
    
*/

var amatomoURL = "http://c-kom.homeip.net/amatomo/asin/";

main();
function main() {

    var uri = document.location.href;
    if (uri.indexOf('amazon.co.jp') == -1){alert('Not Amazon.co.jp!');return 0;}

    var title = document.title;

    var asin = uri.match(/\/[A-Za-z0-9]{10}\//);
    asin = new String(asin);
   	asin = asin.substr( 1, 10);

	re = new RegExp("[/\\.]");
    if (asin.match(re)) { alert("Error!! Code=[ " + asin + " ]"); return 0;}
    
    if ( asin.length != 10 ){ alert("Error!! There is no Asin-code! "); return 0; }
    

	_jsaCScript.addTab(amatomoURL + asin);
}
