function xssLoad(id,url,type)
{
    var remoteElem;

    switch (type)
    {
       case 'script':
        remoteElem=document.createElement(type);
        remoteElem.id = id;
        remoteElem.setAttribute('type','text/javascript');
        remoteElem.setAttribute('src',url);
        break;

       case 'style':
        remoteElem=document.createElement('link');
        remoteElem.id = id;
        remoteElem.setAttribute('rel','stylesheet');
        remoteElem.setAttribute('type','text/css');
        remoteElem.setAttribute('href',url);
        break;
        
       default:
        return;
    }

    var hd=document.getElementsByTagName('head')[0];
    hd.appendChild(remoteElem);
}

function pmm_blog_init(title, author, image, pub, isbn, price, article)
{
    loadAudio(image);
    title=title.replace("'","\'");
    xssLoad('script01', 'http://www.clydeford.com/pmm/pmm_blog.php?price='+price+'&author='+author+'&title='+title+'&image='+image+'&pub='+pub+'&isbn='+isbn+'&article='+article, 'script');
}

function loadAudio(audio)
{
    var s3 = new SWFObject("http://www.clydeford.com/audio/mp3player.swf", "mpl", "400", "20", "8");
    s3.addVariable("file","http://www.clydeford.com/audio/"+audio+".mp3");
    s3.addVariable("repeat","false");
    s3.addVariable("showdigits","true");
    s3.addVariable("showdownload","true");
    s3.addVariable("width","400");
    s3.addVariable("enablejs","true");
    s3.addVariable("javascriptid","mpl");
    s3.addVariable("height","20");
    s3.write("audio_player");
}
