
function swapImg(obj, path, name)
{
	obj.src = "./img/" + path + name;
}

function swapCmnImg(obj, path, name)
{
	obj.src = "/img/" + path + name;
}


// PHPのhtmlspecialchars
function htmlspecialchars(ch) {
    ch = ch.replace(/&/g,"&amp;") ;
    ch = ch.replace(/"/g,"&quot;") ;
    ch = ch.replace(/'/g,"&#039;") ;
    ch = ch.replace(/</g,"&lt;") ;
    ch = ch.replace(/>/g,"&gt;") ;
    return ch ;
} 
// PHPのhtmlspecialchars_decode
function htmlspecialchars_decode(ch) {
    ch = ch.replace(/&amp;/g, "&") ;
    ch = ch.replace(/&quot;/g, '"') ;
    ch = ch.replace(/&#039;/g, "'") ;
    ch = ch.replace(/&lt;/g, "<") ;
    ch = ch.replace(/&gt;/g, ">") ;
    return ch ;
} 
