$(document).ready(function() {
	
	$('div.copy').mouseover(function() {
		$('#copy-dialog').css("display","block");
		$('div.other').css("display","none");
		return false;
	}); 
	
	$('div.copy').mouseout(function() {
		$('#copy-dialog').css("display","none");
		$('div.other').css("display","block");
		return false;
	}); 

/*	
	    jQuery.fn.centerScreen = function(loaded) {
                var obj = this;
                if(!loaded) {
                        obj.css('top', $(window).height()/2-this.height()/2);
                        obj.css('left', $(window).width()/2-this.width()/2);
                        $(window).resize(function()
						{ obj.centerScreen(!loaded); 
						});
				} else {
					obj.stop();
					obj.animate({ top: $(window).height()/2-this.height()/2, left: $(window).width()/2-this.width()/2}, 200, 'linear');
                }
        } 
		
	jQuery.fn.center = function (absolute) {
		return this.each(function () {
			var t = jQuery(this);
			//	$('my-element')
		
	
			t.css({
				position:    absolute ? 'absolute' : 'fixed', 
				left:        '50%', 
				top:        '50%', 
				zIndex:        '99'
			}).css({
				marginLeft:    '-' + (t.outerWidth() / 2) + 'px', 
				marginTop:    '-' + (t.outerHeight() / 2) + 'px'
			});

			if (absolute) {

			
			
				t.css({
					marginTop:    parseInt(t.css('marginTop'), 10) + jQuery(window).scrollTop(), 
					marginLeft:    parseInt(t.css('marginLeft'), 10) + jQuery(window).scrollLeft()

				});
			}
		});
	}; 
*/

	//$('#my-element img').css({display: 'none'});
        //
	//$("#tittle").css({display: 'none'});
	//$("#tittle").fadeIn(2000); //.fadeTo(2000, 1).fadeOut(2000);
	align();
});








function align() {
	

        //console.log("notCompleted");
               var myImg = $('#my-element img');

        //console.log();
	/*$('#my-element').centerScreen();*/
	if (myImg[0].complete) {

	                              
	var imageH = $('#my-element img').height();
	var elementH = $('#my-element').height();
	
//	console.log('width'+$('#my-element img').width());
	//	console.log(elementH);
	
        	if ( (imageH!=0) ) {

        	//	console.log('elementH'+elementH);
        //		console.log('imageH'+imageH);
        //		console.log('topMargin:'+((elementH-imageH) / 2));
        		$('#my-element img').css({marginTop: ((elementH-imageH) / 2) + 'px'});
        //		console.log("ok");
        		$('#my-element img').css({display: 'inline'});
        
        	}
	
         }
         
         setTimeout("align();",100);

          

}