    (function(jQuery){
         jQuery.fn.content = function(params) {
            var defaultValues =
            {
                backgroundColor    :'#333',
                backgroundOpacity 	:'0.3',
                closeTag        	:'#close',
                closeTag2        	:'#close2',
                screenBg   	   	: true,
                expireDate     	: 1
            };

            var config = jQuery.extend(defaultValues, params);

            return this.each (
                function() {
                    var obje = jQuery(this);
                    jQuery(obje).css({
                       'position': 'absolute',
                       'z-index' : '9999'
                    });

                   cookieCheck(defaultValues.expireDate);

                   function cookieCheck(expireDate) {
                        if((jQuery.cookie('consoft_wpopup')== 0 || jQuery.cookie('consoft_wpopup')== null || expireDate == 0) && jQuery.cookie('consoft_wpopup_already') != 1) {
				if(expireDate > 0) {
	                            jQuery.cookie('consoft_wpopup','1',{expires: expireDate});
				} else {
	                            jQuery.cookie('consoft_wpopup','0',{expires: expireDate});
				}
                            wpopupView();
                        }                        
                    }

                    function wpopupView() {
                        window.body_width  = jQuery('body').width();
                        window.body_height = jQuery('body').height();
                        window.document.height = jQuery(document).height();
                        if(body_width <= document.height ) {
                            body_width = document.height;
                        }
                        jQuery('body').append('<div id="wpopup_screen" style="width:' + body_width + 'px; height:' + body_height + 'px; position:absolute; top:0; left:0; background:' + defaultValues.backgroundColor + '; display:none; z-index:9998;"></div>');
                        jQuery('#wpopup_screen').fadeTo('fast',defaultValues.backgroundOpacity);
                        jQuery(obje).find('#content').delay(200).fadeIn('fast');
			   jQuery('#wpopup').show();
                        setPosition();
                    }

                    function setPosition() {
                        horizontalAlign();
                        verticalAlign();
                        jQuery(obje).delay(250).fadeIn('slow');
                    }

                    function horizontalAlign() {
                      jQuery(obje).css({
                            'left':'50%',
                            'margin-left':-680/2
                        });
                    }

                    function verticalAlign() {
                            jQuery(obje).css({
                                'top':'50%',
                                'margin-top':-400/2
                            });
                    }

                    jQuery(defaultValues.closeTag).click(function(){
			   jQuery.cookie('consoft_wpopup_already','1',{expires: 365});
                        popupClose();
                    });

                    jQuery(defaultValues.closeTag2).click(function(){
			   jQuery.cookie('consoft_wpopup_already','1',{expires: 365});
                        popupClose();
                    });

		      if(defaultValues.screenBg) {
                            jQuery('#wpopup_screen').live('click',function(){
                            	popupClose();
				});
		      }

                    function popupClose() {			   
                        jQuery(obje).find('#content').delay(100).slideUp('fast');
                        jQuery('#wpopup_screen').delay(0).fadeOut('fast');
			   jQuery('#wpopup').hide();
                        jQuery('#wpopup_screen').remove();
                    }
                }
            );
        };
    })(jQuery);


