function url2cmd(url) {
    if (!url.match(/^http:\/\/(?:www\.|)youtube\.com\/watch\?v=([a-zA-Z0-9_\-]+)/)) {
        pne_url2a(url);
        return;
    }
    var id = RegExp.$1;

    // ページの場所を判別
//   var urlcheck = String(document.location);
//   if (urlcheck.match(/page_h_prof|page_f_home|page_c_home/)) {
    var width = 410;
    var height = 340;
//   } else {
//    var width = 530;
//    var height = 415;
//   }
    // 判別終わり

    main(id, width, height);
}

function main(id, width, height) {
    if (!id.match(/^[a-zA-Z0-9_\-]+$/)) {
        return;
    }
    if (!width) width = 0; else width = parseInt(width);
    if (!height) height = 0; else height = parseInt(height);
    if (width <= 0 || width > 530) {
        width = 530;
    }
    if (height <= 0 || height > 415) {
        height = 415;
    }

    var html = '<object width="'
            + width
            + '" height="'
            + height
            + '"><param  name="movie" value="http://www.youtube.com/v/'
            + id
            + '&fmt=18&hl=ja&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01"></param>'
	    + '<param name="allowFullScreen" value="true"></param>'
	    + '<param name="allowscriptaccess" value="always"></param>'
	    + '<param name="wmode" value="transparent"></param>'
	    + '<embed wmode="transparent" src="http://www.youtube.com/v/'
            + id
            + '&fmt=18&hl=ja&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01" '
	    + 'type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'
            + width
            + '" height="'
            + height
            + '"></embed></object>';
    document.write(html);
}

