
document.onselectstart=new Function('return false');
function ds(e){return false;}
function ra(){return true;}
document.onmousedown=ds;
document.onclick=ra;

		var wrapper_name = "#wrapper";
		var warapperXloc = null;
		var fixLeftWidth = 4;
		
	
		var name = "#floatMenu";
		var menuYloc = null;

		$(function() {
			    initializeDebug();

				$("#menu_bar").show().animate({ left: '187', top: '26' }, 1);
				$("#debug").draggable(globaldragevent);
				$('#div_leftPanel').load('left_panel.html');
				$('#div_rightPanel').draggable(globaldragevent);
				$('#menu01_tip').animate({ top: '300', opacity: '0.1' }, 1);
				$('#menu01_tip').animate({ top: '-=206', opacity: '0.85' }, 1200);
		});

	

			$(document).ready(
			
			    function(){

			    	//$(document).scrollLeft(25);

						   window.setTimeout(function() 
							                { 
												warapperXloc = $(wrapper_name).offset().left + $(wrapper_name).width() + fixLeftWidth;
												//warapperXloc = parseInt($(wrapper_name).css("left").substring(0,$(wrapper_name).css("left").indexOf("px")))
												warapperXloc = parseInt(warapperXloc);
												$(name).css('left',warapperXloc);
											
												menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
												$(window).scroll(function () { 
													offset = menuYloc+$(document).scrollTop()+"px";
													$(name).animate({top:offset},{duration:500,queue:false});
													
												});
												
												$(window).resize(function(){
													warapperXloc = $(wrapper_name).offset().left + $(wrapper_name).width() + fixLeftWidth;
													warapperXloc = parseInt(warapperXloc);
													$(name).css('left',warapperXloc);

												});

						                    }, 1900);


				} 
			); 


function initializeDebug()
{
	$('#debugToggle').toggle(
      function () {
        $('#debug').show();
      },
      function () {
        $('#debug').hide();
      }
    );

}


var globaldragevent = {
		// Find original position of dragged image.
		start: function(event, ui) {

			// Show start dragged position of image.
			var Startpos = $(this).position();
			$("div#start").text("START: \nLeft: "+ Startpos.left + "\nTop: " + Startpos.top + "\nz-index: " + $(this).css('z-index') + "\nwidth: " + $(this).css('width') + "\nheight: " + $(this).css('height'));
		},

		drag: function(event, ui) {

			// Show drag position.
			var Stoppos = $(this).position();
			$("div#stop").text("STOP: \nLeft: "+ Stoppos.left + "\nTop: " + Stoppos.top + "\nz-index: " + $(this).css('z-index') + "\nwidth: " + $(this).css('width') + "\nheight: " + $(this).css('height'));
		},

		// Find position where image is dropped.
		stop: function(event, ui) {

			// Show dropped position.
			var Stoppos = $(this).position();
			$("div#stop").text("STOP: \nLeft: "+ Stoppos.left + "\nTop: " + Stoppos.top + "\nz-index: " + $(this).css('z-index') + "\nwidth: " + $(this).css('width') + "\nheight: " + $(this).css('height'));
			/* $(this).draggable( "destroy" ); */
			$(this).addClass("defaultLayer2");
		}	
}

/*
var wdth = 960; //Change this variable to match your configuration
document.body.style.zoom = screen.width/wdth;
document.Fm.TxAre.value=wdth;
*/
