function toCss(key, value) {
    var p = '', css = '';
    if (value) {
      if (!/^[A-Z]/g.test(key)) {
        /[A-Z]/g.test(key) ? key = key.replace(/[A-Z]/g, function (e) { 
          return '-' + e.toLowerCase(); 
        }) : key;
      } else {
        var temp = '';
        while(/^[A-Z]/.test(key)) {
          temp += key.substr(0,1);
          key = key.substr(1);
        }

        key = '-'+temp.toLowerCase()+'-' + key.replace(/[A-Z]/g, function (e) { 
          return '-' + e.toLowerCase(); 
        });
      }

      css = key + ": " + value + ";";
    }
    return css;
  }
/**
     * convert object key/value to css property if value not null
    */
convert object key/value to css property if value not null
convert object key / value to css property if value not null
function toCss(key, value) {
    var p = '', css = '';
    if (value) {
      if (!/^[A-Z]/g.test(key)) {
        /[A-Z]/g.test(key) ? key = key.replace(/[A-Z]/g, function (e) { 
          return '-' + e.toLowerCase(); 
        }) : key;
      } else {
        var temp = '';
        while(/^[A-Z]/.test(key)) {
          temp += key.substr(0,1);
          key = key.substr(1);
        }
        key = '-'+temp.toLowerCase()+'-' + key.replace(/[A-Z]/g, function (e) { 
          return '-' + e.toLowerCase(); 
        });
      }
      css = key + ": " + value + ";";
    }
    return css;
  }
function toCss ( key , value ) { var p = '' , css = '' ; if ( value ) { if ( ! / ^[A-Z] / g . test ( key ) ) { / [A-Z] / g . test ( key ) ? key = key . replace ( / [A-Z] / g , function ( e ) { return '-' + e . toLowerCase ( ) ; } ) : key ; } else { var temp = '' ; while ( / ^[A-Z] / . test ( key ) ) { temp += key . substr ( 0 , 1 ) ; key = key . substr ( 1 ) ; } key = '-' + temp . toLowerCase ( ) + '-' + key . replace ( / [A-Z] / g , function ( e ) { return '-' + e . toLowerCase ( ) ; } ) ; } css = key + ": " + value + ";" ; } return css ; }
convert object key/value to css property if value not null
convert object key / value to css property if value not null