﻿/***************************/
//@Author: Adrian "yEnS" Mato Gondelle
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/

//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;

/* dynamic functions start here */

/*
var popupStatus = 0;

//loading popup with jQuery magic!
function loadPopup(PopupDiv,BackgroundPopUp){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$(BackgroundPopUp).fadeIn("slow");
		$(PopupDiv).fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup(PopupDiv,BackgroundPopUp){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$(BackgroundPopUp).fadeOut("slow");
		$(PopupDiv).fadeOut("slow");
		popupStatus = 0;
	}
}

//centering popup
function centerPopup(PopupDiv,BackgroundPopUp){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $(PopupDiv).height();
	var popupWidth = $(PopupDiv).width();
	//centering
	$(PopupDiv).css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$(BackgroundPopUp).css({
		"height": windowHeight
	});
	
}*/

/* dynamic function end here */

	/*function validate()
	{
		
		//$(document).ready(
						  
// function(){
	
	//LOADING POPUP
	//Click the button event!
		var success= false;
		var i = 0;
		var j = 0;
		var count = document.getElementById("participantCount").value;
		var roleCount = document.getElementById("roleCount").value;
		var success2= true;
		var name ='';
		var role1= false;
		var role2= false;
		var role3= false;
		var role4= false;
		var assessment = true;
		
		
		
		for(i=0; i<count; i++)
		{	
			var tempsuccess= false;
			var temp = "participant" + i;
			
			
			
			if(document.getElementById(temp).checked)
			{
					success = true;
					for(j=0;j<roleCount;j++)
					{
						var temp2 = i+"role" + j;
						
						if(document.getElementById(temp2).checked)
						{
							tempsuccess = true;
							if(j == 0)
								role1 = true;
							if(j == 1)
								role2 = true;
							if(j == 2)
								role3 = true;
							if(j == 3)
								role4 = true;
						}
						
					}
					if (!tempsuccess)
					{	
						var nameid= 'name'+i;
					
						 name = name +  document.getElementById(nameid).innerHTML +'\n ';
						
					
					}
			
					if(!tempsuccess)
					{
						success2=false;
					}	
			}
			
		} // end of for Loop
		if(document.getElementById('assessment').value == "-1")
		{
			
			
			assessment = false;
		}
		if ((success) && (success2) && (role1) && (role2) && (role3) && (role4) && (assessment))
		{
			
			return true;
		}
		else
		{	
			 if (!assessment)
			{
				
				centerPopup("#Contact2","#backgroundPopup2");
				//load popup
				loadPopup("#Contact2","#backgroundPopup2");
				$("#popupContactClose2").click(function(){
				disablePopup("#Contact2","#backgroundPopup2");
				});
			//Click out event!
			$("#backgroundPopup2").click(function(){
				disablePopup("#Contact2");
			});
			//Press Escape event!
			$(document).keypress(function(e){
				if(e.keyCode==27 && popupStatus==1){
				disablePopup("#Contact2");
					}
				});	
			}
	  		 else if (!success2)
			{
				
				alert("Select a Participant");
				/* centerPopup("#popupContact","#backgroundPopup");
				//load popup
				loadPopup("#popupContact","#backgroundPopup");
				$("#popupContactClose").click(function(){
				disablePopup("#popupContact","#backgroundPopup");
				});
			//Click out event!
			$("#backgroundPopup").click(function(){
				disablePopup("#popupContact");
			});
			//Press Escape event!
			$(document).keypress(function(e){
				if(e.keyCode==27 && popupStatus==1){
				disablePopup("#popupContact");
					}
				});	
			}
			else
			{
				 centerPopup("#popupContact4","#backgroundPopup4");
				//load popup
				loadPopup("#popupContact4","#backgroundPopup4");
				$("#popupContactClose4").click(function(){
				disablePopup("#popupContact4","#backgroundPopup4");
				});
			//Click out event!
			$("#backgroundPopup4").click(function(){
				disablePopup("#popupContact4");
			});
			//Press Escape event!
			$(document).keypress(function(e){
				if(e.keyCode==27 && popupStatus==1){
				disablePopup("#popupContact4");
					}
				});	
			}
		
				
						
		}
			
		return false;		
			
			
	}*/
		
		
		
	
	
	  //});
	
		

var popupStatus = 0;

//loading popup with jQuery magic!
function loadPopup(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupContact").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupContact").fadeOut("slow");
		popupStatus = 0;
	}
}

//centering popup
function centerPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact").height();
	var popupWidth = $("#popupContact").width();
	//centering
	$("#popupContact").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2nd Immge Pop up+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var popupStatus2 = 0;

//loading popup with jQuery magic!
function loadPopup2(){
	//loads popup only if it is disabled
	if(popupStatus2==0){
		$("#backgroundPopup2").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup2").fadeIn("slow");
		$("#popupContact2").fadeIn("slow");
		popupStatus2 = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup2(){
	//disables popup only if it is enabled
	if(popupStatus2==1){
		$("#backgroundPopup2").fadeOut("slow");
		$("#popupContact2").fadeOut("slow");
		popupStatus2 = 0;
	}
}

//centering popup
function centerPopup2(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact2").height();
	var popupWidth = $("#popupContact2").width();
	//centering
	$("#popupContact2").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup2").css({
		"height": windowHeight
	});
	
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++3nd Immge Pop up+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var popupStatus3 = 0;

//loading popup with jQuery magic!
function loadPopup3(){
	//loads popup only if it is disabled
	if(popupStatus3==0){
		$("#backgroundPopup3").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup3").fadeIn("slow");
		$("#popupContact3").fadeIn("slow");
		popupStatus3 = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup3(){
	//disables popup only if it is enabled
	if(popupStatus3==1){
		$("#backgroundPopup3").fadeOut("slow");
		$("#popupContact3").fadeOut("slow");
		popupStatus3 = 0;
	}
}

//centering popup
function centerPopup3(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact3").height();
	var popupWidth = $("#popupContact3").width();
	//centering
	$("#popupContact3").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup3").css({
		"height": windowHeight
	});
	
}


var popupStatus4 = 0;

//loading popup with jQuery magic!
function loadPopup4(PracticeId){
	//loads popup only if it is disabled
	if(popupStatus4==0){
		$("#backgroundPopup" + PracticeId).css({
			"opacity": "0.7"
		});
		$("#backgroundPopup" + PracticeId).fadeIn("slow");
		$("#popupContact" + PracticeId).fadeIn("slow");
		popupStatus4 = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup4(PracticeId){
	//disables popup only if it is enabled
	if(popupStatus4==1){
		$("#backgroundPopup" + PracticeId).fadeOut("slow");
		$("#popupContact" + PracticeId).fadeOut("slow");
		popupStatus4 = 0;
	}
}

//centering popup
function centerPopup4(PracticeId){
	//request data for centering

	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
//	var windowHeight = screen.availHeight;
//	var windowHeight = screen.height;
	//alert(windowHeight);
	
	var popupHeight = $("#popupContact"+ PracticeId).height();
	var popupWidth = $("#popupContact" + PracticeId).width();
	//centering
	
	
	
	/*$("#popupContact" + PracticeId).css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});*/
	
	//only need force for IE6
	
	$("#backgroundPopup" + PracticeId).css
	 ({
		"height": windowHeight
	  });
	
}


var popupStatus9 = 0;

//loading popup with jQuery magic!
function loadPopup9(){
	//loads popup only if it is disabled
	if(popupStatus9==0){
		$("#backgroundPopup9").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup9").fadeIn("slow");
		$("#popupContact9").fadeIn("slow");
		popupStatus9 = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup9(){
	//disables popup only if it is enabled
	if(popupStatus9==1){
		$("#backgroundPopup9").fadeOut("slow");
		$("#popupContact9").fadeOut("slow");
		popupStatus9 = 0;
	}
}

//centering popup
function centerPopup9(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact9").height();
	var popupWidth = $("#popupContact9").width();
	//centering
	/*$("#popupContact9").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});*/
	//only need force for IE6
	
	$("#backgroundPopup9").css({
		"height": windowHeight
	});
	
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#stickynote").click(function(){
		//centering with css
		centerPopup();
		//load popup
		loadPopup();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose").click(function(){
		disablePopup();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup();
		}
	});

});
	
//CONTROLLING EVENTS IN jQuery for image 2  ++++++++++++++++++++++++
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#stickynote2").click(function(){
		//centering with css
		centerPopup2();
		//load popup
		loadPopup2();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose2").click(function(){
		disablePopup2();
	});
	//Click out event!
	$("#backgroundPopup2").click(function(){
		disablePopup2();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus2==1){
			disablePopup2();
		}
	});

});

//CONTROLLING EVENTS IN jQuery for image 2  ++++++++++++++++++++++++
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#stickynote3").click(function(){
		//centering with css
		centerPopup3();
		//load popup
		loadPopup3();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose3").click(function(){
		disablePopup3();
	});
	//Click out event!
	$("#backgroundPopup3").click(function(){
		disablePopup3();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus3==1){
			disablePopup3();
		}
	});

});
		
	
	$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	
	
			

	$("#Howtoread").click(function(){
		
		
		var agt=navigator.userAgent.toLowerCase();
		
		
		if(agt.indexOf("msie 6.0") != -1) // Simple Popups are showing Only for IE 6
		{
			  var msg = new DOMAlert(
			{
				title: 'Dr. Agile',
				text:'',
				/*text: '<h2>Managing Requirements using a Backlog</h2>The Product Backlog is the master list of all functionality desired in the product. The backlog is populated over the lifecycle of a project. When a project is initiated there is no comprehensive, time-consuming effort to write down all foreseeable tasks or requirements. Typically, everything obvious is captured and then allowed to grow and change as more is learned about the product and its customers.',*/
				PracticeId:6,
				
//				skin: 'default_contentArea' + ,
				width: 479,
				height: 345,
				Close:{value: true, text: 'Close',onclick: closeWindow}
				//ok: {value: true, text: 'Close' },//onclick: showValue},
				//cancel: {value: false, text: 'Close', onclick: this.close() }
			});
			msg.show();
		}
		
		else
		
			{
		//centering with css
		centerPopup9();
		//load popup
		loadPopup9();
			}
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose9").click(function(){
		disablePopup9();
	});
	//Click out event!
	$("#backgroundPopup9").click(function(){
		disablePopup9();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus9==1){
			disablePopup9();
		}
	});

});
	//CONTROLLING EVENTS IN jQuery for image 2  ++++++++++++++++++++++++
//$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	//$("#stickynote2").click(
				  
	function showPracticeDescp(PracticeId){
		//centering with css
		var agt=navigator.userAgent.toLowerCase();
		
		
		if(agt.indexOf("msie 6.0") != -1) // Simple Popups are showing Only for IE 6
		{
		  
		  var msg = new DOMAlert(
			{
				title: 'Agile Practice',
				text:'',
				/*text: '<h2>Managing Requirements using a Backlog</h2>The Product Backlog is the master list of all functionality desired in the product. The backlog is populated over the lifecycle of a project. When a project is initiated there is no comprehensive, time-consuming effort to write down all foreseeable tasks or requirements. Typically, everything obvious is captured and then allowed to grow and change as more is learned about the product and its customers.',*/
				PracticeId:PracticeId,
				
//				skin: 'default_contentArea' + ,
				width: 475,
				height: 345,
				Close:{value: true, text: 'Close',onclick: closeWindow}
				//ok: {value: true, text: 'Close' },//onclick: showValue},
				//cancel: {value: false, text: 'Close', onclick: this.close() }
			});
			msg.show();
		  
		 // doAlert(PracticeId);
		 /* if(PracticeId == 1)
		  {
			  alert("The Product Backlog is the master list of all functionality desired in the product. The backlog is populated over the lifecycle of a project. When a project is initiated there is no comprehensive, time-consuming effort to write down all foreseeable tasks or requirements. Typically, everything obvious is captured and then allowed to grow and change as more is learned about the product and its customers.");
		  }
		  else if(PracticeId == 2)
		  {
		  alert("Working in iterations emphasizes the building of releasable software in short time periods. An iteration ranges from 1 to 4 weeks, during which the team analyzes, designs, constructs, tests, and documents a set of features. ");
		  }
		  else if(PracticeId == 3)
		  {
		  alert("All team members (developers, testers, UI, analysts …etc) participate in the estimation process. Group estimation yields more accurate estimates and ensure that the whole team have a common understanding of the features.");
		  }
		  else if(PracticeId == 4)
		  {
		  alert("The team has means by which they can stay informed, on a daily basis, about the status of the iteration. During these meetings, team members discuss what they did the day before, what they will do today and discuss any factors that might affect their progress.");
		  }
		  else if(PracticeId == 5)
		  {
		  alert("Self-organizing teams are empowered by management to make decisions on their own without waiting for management approval. When the team is given a task, accomplishing it becomes the responsibility of, not a specific person, or a specific role, but rather the whole team, collectively. The team is composed of people with all the different functional expertise needed to accomplish the assigned tasks. Management treats self-organizing teams as one entity without distinguishing between the individuals of the team.");
		  }
		  
		   */
		
		}	// end	
		else
		{
				if(PracticeId == 1)
				{
					PracticeId= PracticeId + 5;
				}
				if(PracticeId == 2)
				{
					PracticeId= PracticeId + 5;
				}
				
				if(PracticeId == 3)
				{
					PracticeId= PracticeId + 5;
				}
				
				centerPopup4(PracticeId);
				//load popup
				loadPopup4(PracticeId);
				$("#popupContactClose" + PracticeId).click(
			function(){
				disablePopup4(PracticeId);
			});
			//Click out event!
			$("#backgroundPopup" + PracticeId).click(function(){
				disablePopup4(PracticeId);
			});
			//Press Escape event!
			$(document).keypress(function(e){
				if(e.keyCode==27 && popupStatus4==1){
					disablePopup4(PracticeId);
				}
			});
		}
 }
	
					
	//CLOSING POPUP
	//Click the x event!
	








//CONTROLLING EVENTS IN jQuery
/*$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	
	
	
	
	
		
		$("#button").click
		(
		 
			function(){
				
	var participant=false;
	for(i=0; i<count; i++)
		{	
			var temp = "participant" + i;
			
		if(document.getElementById(temp).checked)
	       {
			
			participant=true;
			
		   }
		}
				//centering with css
				//alert(document.getElementById('assessment').value);
		if(document.getElementById('assessment').value == "-1")
	       { 
				centerPopup("#popupContact");
				//load popup
				loadPopup();
		   }
		   else if(!participant)
		   {
			   centerPopup("#popupContact2");
				//load popup
				loadPopup();
			   
		   }
	
		   
		  
					
		   
		}
		);*/
			
	
		
	//CLOSING POPUP
	//Click the x event!
	

//});

function setFocusOnResultsEmail()
{
document.getElementById('email2').focus();
}
function doAlert(parent,PracticeId)
		{
alert(PracticeId);

		};
		
		
		function closeWindow(sender, value)
		{
			sender.close();
			//var newMsg = new DOMAlert({skin: 'default', width: 200});
			//newMsg.show("Your response", "You pressed " + value);
		}
		
		
