
try  {  
    document.domain='dangdang.com';
}
catch(err) {}

String.prototype.trim=function()
{
    return this.replace(/(\s*$)|(^\s*)/g, '');
}

window.onerror=function()
{
    return true;
}
function JSLoad(url, container, type, defer, language, title)
{

    if(container == undefined || container == null) container = this;

    // setup container
    if(typeof container.write == "undefined")
        if(typeof container.document != "undefined")
            container = container.document;
        else throw "Invalid container. Unable to load [" + url + "]";


    if(type == undefined || type == null)
    {
        type = '';


        if(language == undefined || language == null)
        {
            language = undefined;
            type = "text/javascript";
        }
    }


    if(language == undefined || language == null) language = "JavaScript";

    // set title
    if(title == undefined || title == null) title = '';

    // set defer
    if(defer == undefined) defer = false;


    var script = container.createElement("script");
    script.defer = defer;
    script.language = language;
    script.title = title;
    script.type = type;
    script.src = url;


    var head = container.getElementsByTagName("head")[0];
    head.appendChild(script);
}

function $(element) {
    if (typeof element == 'string')
        element = document.getElementById(element);
    return element;
}


var currTId = null;
var currDId = null;
function mouseOver(obj,tag0,tag1,id)
{
    if( currTId!=null)
    {
        if($(currTId)) $(currTId).style.display="block";
        if($(currDId)) $(currDId).style.display="none";
    }

    var Tid = tag0 + id;
    var Did = tag1 + id;

    if($(Tid)) $(Tid).style.display="none";
    if($(Did)) $(Did).style.display="block";

    currTId = Tid;
    currDId = Did;
}

function mouseOver2(obj,tag0,tag1,id){
    if(RTId!=null){
        if($(RTId)) $(RTId).style.display="block";
        if($(RDId)) $(RDId).style.display="none";
    }

    var Tid = tag0+id;
    var Did = tag1+id;

    if($(Tid)) $(Tid).style.display = "none";
    if($(Did)) $(Did).style.display = "block";

    RTId = Tid;
    RDId = Did;
}
