
;(function($,window,document,undefined){
var pluginName='xbanner',
defaults={
format:"220x150",
classTags:null
};
function Plugin(element,options){
this.element=element;
this.options=$.extend({},defaults,options);
this._defaults=defaults;
this._name=pluginName;
this.init();
}
Plugin.prototype.init=function(){
var placeTags=$(this.element).children(this.options.classTags),
countTags=$(this.element).children(this.options.classTags).size();
if(countTags>0){
$.get('http://www.xagena.net/banner/adv_1.php?callback=?',{
l:countTags,
f:this.options.format,
k:this.options.keywords
},function(data){
//console.log(data);
$.each(data,function(index,value){
$(placeTags[index]).html(value.src);
})
},'json');
}
};
$.fn[pluginName]=function(options){
return this.each(function(){
if(!$.data(this,'plugin_'+pluginName)){
$.data(this,'plugin_'+pluginName,new Plugin(this,options));
}
});
}
})(jQuery,window,document);
var is={
ie:navigator.appName=='Microsoft Internet Explorer',
java:navigator.javaEnabled(),
ns:navigator.appName=='Netscape',
ua:navigator.userAgent.toLowerCase(),
version:parseFloat(navigator.appVersion.substr(21))||
parseFloat(navigator.appVersion),
win:navigator.platform=='Win32'
}
is.mac=is.ua.indexOf('mac')>=0;
if(is.ua.indexOf('opera')>=0){
is.ie=is.ns=false;
is.opera=true;
}
if(is.ua.indexOf('gecko')>=0){
is.ie=is.ns=false;
is.gecko=true;
}
