function Zangdom(){
}

Zangdom.createElement=function(tagName){
 return document.createElement(tagName);
}

Zangdom.getAppendableStyleSheet=function(){
 if(document.styleSheets && document.styleSheets.length>0){
  var ssDom=document.styleSheets[document.styleSheets.length-1];
 }else{
  var ssDom=Zangdom.createElement('style');
  document.getElementsByTagName('head')[0].appendChild(ssDom);
 }
 return ssDom;
}

Zangdom.appendStyle=function(selector,cssRule){
 var ssDom=this.getAppendableStyleSheet();
 var newCSSSelector=selector;
 var newCSSRule=cssRule;
 if(ssDom.addRule){
  ssDom.addRule(newCSSSelector,newCSSRule);
 }else if(ssDom.insertRule){
  ssDom.insertRule(newCSSSelector+" { "+newCSSRule+" }",ssDom.cssRules.length);
 }
}
