// JavaScript Document
(function($){
 
    //Attach this new method to jQuery
    $.fn.extend({ 
         
        //This is where you write your plugin's name
        CenterInPage: function() {
 
            //Iterate over the current set of matched elements
            return this.each(function() {
             			$(this).css("position","absolute");
						
						var mywidths=$(this).css("width");
						
						var mywidth=parseInt(mywidths.substring(0,mywidths.length-2));
						var myheights=$(this).css("height");
						var myheight=parseInt(myheights.substring(0,myheights.length-2));
						var screen_width=screen.width;
						var screen_height=screen.height;
						var newleft=(screen_width/2)-(mywidth/2);
						var newtop=(screen_height/2)-(myheight/2)-55;
						$(this).css("left",newleft);
						$(this).css("top",newtop);
//						alert("left:"+ mywidth);
//						alert("top:"+ myheight);
            
            });
        }
    });
     
//pass jQuery to the function, 
//So that we will able to use any valid Javascript variable name 
//to replace "$" SIGN. But, we'll stick to $ (I like dollar sign: ) )       
})(jQuery);
