// JavaScript Document


;(function($){
	$.pub = {
		_op:{'dataType':'page'},
        open:function(options){
			var op = $.extend(this._op,options);			
			if(!$('#pub').length>0){
				var html = new String;		
				  html += '<div id="pub"><a href="#" id="pub_close">¹Ø±Õ</a><div id="pub_content"></div></div>';	  
				  $('body').append(html);
			}
		    var box = $('#pub');		   
		    var content = $("#pub_content");
		    if(op.dataType=="page"){
		    	content.append("<iframe  frameborder='0' scrolling='no' id='pub_iframe' width='' height='' src='' ></iframe>");
		    	$('#pub_iframe').attr({width:op.width,height:op.height,src:op.data});
		    }
		    if(op.dataType=="html"){		    	
		    	$.post(op.data,{},function(data){
		    		content.append(data);
		    	});
		    }
		    
		    box.css({width:(op.width+40),height:(op.height+20)});
		    box.show().animate({bottom:'0px'},2000);
		    $.pub.add_event(box);
		    setTimeout(function(){
		    	$.pub._close(box);
		    },60000);
		},
		close:function(){
			$('#pub').animate({bottom:'-400px'},2000).hide();
		},
		_close:function(box){
			box.animate({bottom:'-400px'},2000).hide();
		},
		add_event:function(box){
			$('#pub_close').unbind().click(function(){
				$.pub.close();
			});
			$(window).unbind().scroll(function(){
                var h = document.body.scrollTop+window.screen.height-400-200;
                box.css({top:h});
			});
		}
	};
})(jQuery);




function pub(options){
if(options){
		jQuery(function(){jQuery("#bannerSmall").slideDown(800);								 
												 }) 
		}
	
function wait(){
		 setTimeout("noBanner();",3000);
		 }
function noBanner(){
	jQuery("#bannerSmall").slideUp(800);
	}
jQuery(function(){
			jQuery('#close').click(function(){
				noBanner();
				});   
			   })
	
	}
