
(function($){

})(this.jQuery);

 $.fn.winopen = function(options) {
	var defaults = {
		left: 50,
		top: 50,
		width: 350,
		height: 150,
		menubar:'no',
		toolbar:'no',
		location:'no',
		status:'yes',
		resizable:'yes',
		scrollbars:'no'
	}
	// Extend our default options with those provided.
	var opts = $.extend(defaults, options);	
	
	var winoptions = "left=" + opts['left'] + ",top=" + opts['top'] + ",width=" + opts['width'] + ",height=" + opts['height'] + ",menubar=" + opts['menubar'] + ",toolbar=" + opts['toolbar'] + ",location=" + opts['location'] + ",status=" + opts['status'] + ",resizable=" + opts['resizable'] + ",scrollbars=" + opts['scrollbars'];
	
	$(this).click(function() {
		window.open ($(this).attr("href"),"_blank",winoptions);	
		return false;
	});
 }

window.log = function(){
  log.history = log.history || [];   
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);



