function addJsCssByLink(type,url)
{
var doc=document;
if(type="js")
{
var link=doc.createElement("script");
link.setAttribute("type", "text/javascript");
link.setAttribute("src", url);
var heads = doc.getElementsByTagName("head");
if(heads.length)
heads[0].appendChild(link);
else
doc.documentElement.appendChild(link);
}
if(type="css")
{
var link=doc.createElement("link");
link.setAttribute("rel", "stylesheet");
link.setAttribute("type", "text/css");
link.setAttribute("href", url);
var heads = doc.getElementsByTagName("head");
if(heads.length)
heads[0].appendChild(link);
else
doc.documentElement.appendChild(link);
}
}