﻿//    var tag = document.createElement("script");
//    tag.type="text/javascript";
//    tag.src = "/js/prototype.js";
//    document.body.appendChild(tag);

    function getSamplePlayerCode(ProductName, BrandName, Width, Height) {
        new Ajax.Request('/Tools/Tools.aspx?method=getSamplePlayerCode?pname='+ ProductName + '&bname=' + BrandName + '&width=' + Width + '&height=' + Height,
        {     
            asynchronous:'false',
            method:'get',     
            onSuccess: function(transport)
              {
                return transport.responseText;
              },     
            onFailure: function(transport){ 
                alert('Something went wrong... '+ transport.ResponseXML) 
              }   
        }); 
    }

    function createPlayer(Id,b,e,w,h) {
        if (!h) {h=80;}if(!w){w=150;}
        
        try{
            el = document.getElementById(Id);
            if (el) {
                var code = '<embed src="http://www.noiseon.com/Resources/mp3player.swf" width="'+w+'" height="'+h+'" bgcolor="#FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="file=http://www.noiseon.com/tools/getplaylist.aspx?name='+b+'t13u'+e+'&lightcolor=0xCC0066&backcolor=0x000000&frontcolor=0xFFFFFF&displayheight=0" />';
                
                newobj=document.createElement("div");
                newobj.innerHTML=code;
                while (el.childNodes[0]) {el.removeChild(el.childNodes[0]);}
                el.appendChild(newobj);
                noiseonlink=document.createElement("a");
                noiseonlink.setAttribute("style", "text-decoration:none; border:0; color:#ffbb77; text-align:left; ");
                noiseonlink.setAttribute("dir", "ltr");
                noiseonlink.innerHTML="powered by <img src='http://www.noiseon.com/resources/images/website/Logo2.gif' style='border:0;' height='30px' />";
                noiseonlink.href="http://www.noiseon.com";
                el.appendChild(noiseonlink);
                
            };
        }catch (ex) {/*alert(ex.description);*/}
        return;
    }

