// Coded by AJAY
function LoadGFontsajay(){
			aj = [];
			var main = document.getElementsByTagName( "body" )[0];
            var x = main.getElementsByTagName('*');
			
            for(var i=0; i < x.length; i++)
            {
                var tagName = main.getElementsByTagName('*').item(i).nodeName;
                var tagObj = main.getElementsByTagName('*').item(i);
				var Fname= main.getElementsByTagName('*').item(i).style.fontFamily;
				
				if(Fname!=''){
				Fname=Fname.replace(/["']{1}/gi,"");
				aj.push(Fname);
				}
			}
	var aj = aj.unique();
	var detectFontforPage=['Cantarell','Cardo','Crimson Text','Cuprum','Droid Sans','Droid Sans Mono','Droid Serif','IM Fell English','Inconsolata','Josefin Sans Std Light','Lobster','Molengo','Neucha','Neuton','Nobile','OFL Sorts Mill Goudy TT','Old Standard TT','PT Sans','Philosopher','Reenie Beanie','Tangerine','Vollkorn','Yanone Kaffeesatz'];
	
	var aj = aj.intersect(detectFontforPage);
//Call Google Fonts ---->
	WebFontConfig = {
        google: { families: aj }
      };
      (function() {
        var wf = document.createElement('script');
        wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
            '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
        wf.type = 'text/javascript';
        wf.async = 'true';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(wf, s);
      })();
}

Array.prototype.intersect =
  function() {
    if (!arguments.length)
      return [];
    var a1 = this;
    var a = a2 = null;
    var n = 0;
    while(n < arguments.length) {
      a = [];
      a2 = arguments[n];
      var l = a1.length;
      var l2 = a2.length;
      for(var i=0; i<l; i++) {
        for(var j=0; j<l2; j++) {
          if (a1[i] === a2[j])
            a.push(a1[i]);
        }
      }
      a1 = a;
      n++;
    }
    return a.unique();
  };

// Get the union of n arrays
Array.prototype.union =
  function() {
    var a = [].concat(this);
    var l = arguments.length;
    for(var i=0; i<l; i++) {
      a = a.concat(arguments[i]);
    }
    return a.unique();
  };

// Return new array with duplicate values removed
Array.prototype.unique =
  function() {
    var a = [];
    var l = this.length;
    for(var i=0; i<l; i++) {
      for(var j=i+1; j<l; j++) {
        // If this[i] is found later in the array
        if (this[i] === this[j])
          j = ++i;
      }
      a.push(this[i]);
    }
    return a;
  };


