this.tooltip = function(){	

	/* CONFIG */		

		xOffset = 10;

		yOffset = 20;		

		// these 2 variable determine popup's distance from the cursor

		// you might want to adjust to get the right result		

	/* END CONFIG */		

	$("a.tooltip").hover(function(e){											  

		this.t = this.title;

		this.title = "";									  

		$("body").append("<p id='tooltip'>"+ this.t +"</p>");

		$("#tooltip")

			.css("top",(e.pageY - xOffset) + "px")

			.css("left",(e.pageX + yOffset) + "px")

			.fadeIn("fast");		

    },

	function(){

		this.title = this.t;		

		$("#tooltip").remove();

    });	

	$("a.tooltip").mousemove(function(e){

		$("#tooltip")

			.css("top",(e.pageY - xOffset) + "px")

			.css("left",(e.pageX + yOffset) + "px");

	});		

	

	// area

	$("area.tooltip").hover(function(e){											  

		this.t = this.title;

		this.title = "";									  

		$("body").append("<p id='tooltip'>"+ this.t +"</p>");

		$("#tooltip")

			.css("top",(e.pageY - xOffset) + "px")

			.css("left",(e.pageX + yOffset) + "px")

			.fadeIn("fast");		

    },

	function(){

		this.title = this.t;		

		$("#tooltip").remove();

    });	

	$("area.tooltip").mousemove(function(e){

		$("#tooltip")

			.css("top",(e.pageY - xOffset) + "px")

			.css("left",(e.pageX + yOffset) + "px");

	});		

		

};









function setEmailImage(emailNum,zwidth,zheight) {

$(function(){

var theSRC;

theSRC = "img/email" + emailNum + ".png";

$("#exampleEmail").attr({ src: theSRC, alt: "Example Email" , width: zwidth , height: zheight });



});

}

function setButtonImage(emailNum) {

$(function(){

var theSRC;

var theDIV;

theDIV = "#btn" + emailNum ;

theSRC = "img/btn-" + emailNum + "1.png";

$("#btn1").attr({ src: "img/btn-12.png" });

$("#btn2").attr({ src: "img/btn-22.png" });

$("#btn3").attr({ src: "img/btn-32.png" });

$("#btn4").attr({ src: "img/btn-42.png" });

$("#btn5").attr({ src: "img/btn-52.png" });



$(theDIV).attr({ src: theSRC });



});

}

$(function(){



	tooltip(); // start Tooltip

	// add drag and drop functionality to #box1

	$("#divFlowchartInformer").easydrag();

	$("#divFlowchartUser").easydrag();

	$("#divFlowchart").easydrag();

	$("#divExample1").easydrag();

	$("#divExample2").easydrag();

	$("#divExample3").easydrag();

	$("#divExample4").easydrag();

	$("#divEmail1").easydrag();

	$("#divEmail2").easydrag();

	$("#divEmail3").easydrag();

	$("#divEmail4").easydrag();

	$("#divEmail5").easydrag();

	$("#divWhatShouldIWrite").easydrag();

 	$("#divHowItWorks").easydrag();

	$("#divFreePackage").easydrag();

	$("#divStarPackage").easydrag();



	$("#divFlowchartInformer").mousedown( function() { setZorder("#divFlowchartInformer");} );

	$("#divFlowchartUser").mousedown( function() { setZorder("#divFlowchartUser");} );

	$("#divFlowchart").mousedown( function() { setZorder("#divFlowchart");} );

	$("#divExample1").mousedown( function() { setZorder("#divExample1");} );

	$("#divExample2").mousedown( function() { setZorder("#divExample2");} );

	$("#divExample3").mousedown( function() { setZorder("#divExample3");} );

	$("#divExample4").mousedown( function() { setZorder("#divExample3");} );



	$("#divEmail1").mousedown( function() { setZorder("#divEmail1");} );

	$("#divEmail2").mousedown( function() { setZorder("#divEmail2");} );

	$("#divEmail3").mousedown( function() { setZorder("#divEmail3");} );

	$("#divEmail4").mousedown( function() { setZorder("#divEmail4");} );

	$("#divEmail5").mousedown( function() { setZorder("#divEmail5");} );

	$("#divWhatShouldIWrite").mousedown( function() { setZorder("#divWhatShouldIWrite");} );

	$("#divFreePackage").mousedown( function() { setZorder("#divFreePackage");} );

	$("#divHowItWorks").mousedown( function() { setZorder("#divHowItWorks");} );

	$("#divStarPackage").mousedown( function() { setZorder("#divStarPackage");} );

});



function setZorder(theDIV) {

$(function(){



	$("#divWhatShouldIWrite").css("z-index","5000"); 

 	$("#divHowItWorks").css("z-index","5000"); 

	$("#divFreePackage").css("z-index","5000"); 

	$("#divStarPackage").css("z-index","5000"); 

	$("#divFlowchartInformer").css("z-index","5000"); 

	$("#divFlowchartUser").css("z-index","5000"); 

	$("#divFlowchart").css("z-index","5000"); 

	$("#divExample1").css("z-index","5000"); 

	$("#divExample2").css("z-index","5000"); 

	$("#divExample3").css("z-index","5000"); 

	$("#divExample4").css("z-index","5000"); 

	$("#divEmail1").css("z-index","5000"); 

	$("#divEmail2").css("z-index","5000"); 

	$("#divEmail3").css("z-index","5000"); 

	$("#divEmail4").css("z-index","5000"); 

	$("#divEmail5").css("z-index","5000"); 

	$(theDIV).css("z-index","99999");

});

}





function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}



