
	
	/*
	JavaScript Include

	Name:	 	: communited.externallink.js
	Address		: http://www.muziekschoolkrimpen.nl	
	Copyright	: Your Company Name
	Author	 	: Camiel Eggermont
	Created	 	: 2009-11-10T11:42:25

	About this JavaScript include:
	...
*/

(function(jQuery){
    if(!jQuery.communited){
        jQuery.communited = new Object();
    };
    
    jQuery.communited.externallink = function(el, options){
        // To avoid scope issues, use 'base' instead of 'this'
        // to reference this class from internal events and functions.
        var base = this;
        
        // Access to jQuery and DOM versions of element
        base.$el = jQuery(el);
        base.el = el;
        
        // Add a reverse reference to the DOM object
        base.$el.data("communited.externallink", base);
        
        base.init = function(){
            
            
            base.options = jQuery.extend({},jQuery.communited.externallink.defaultOptions, options);
            
            // Put your initialization code here
	var s=jQuery("<span class='" + base.options.cssclass + "'>" + base.options.text + "</span>");
	s.css("position", "absolute");
//	s.scrollLeft(base.$el.scrollLeft());
	s.hide();
	var h=base.$el.attr("href");
	s.click(function(){ window.open(h);return false; });
	base.$el.append(s);
	base.$el.hover(function(){jQuery(this).find(".externallink_text").css("left",base.$el.position().left + base.$el.width()).css("top",base.$el.position().top).fadeIn()}, function(){jQuery(this).find(".externallink_text").hide()});
        };
        

       base.init();
        // Sample Function, Uncomment to use
        // base.functionName = function(paramaters){
        // 
        // };
        
    };
    
    jQuery.communited.externallink.defaultOptions = {
        cssclass: "externallink_text",
        text: "<img src=\"/public/system/images/arrow-link-extern.gif\" title=\"Open in nieuw venster\" alt=\"Open in nieuw venster\"/>" /* Open in nieuw venster */
    };
    
    jQuery.fn.communited_externallink = function(options){
        return this.each(function(){
            (new jQuery.communited.externallink(this, options));
        });
    };
    
})(jQuery);

