var FinalLink = "";





function LoginPopUp(URL) 
{
	day = new Date();
	id = day.getTime();
	URL = URL+"?popup=true";
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=550,height=300,left = 562.5,top = 394');");
	//eval("page" + id + ".parent = self;");
}

function QuizPopUp(URL) 
{
	day = new Date();
	id = day.getTime();
	URL = URL+"?popup=true";
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=510,height=390,left = 385,top = 327');");
	//eval("page" + id + ".parent = self;");
}

function authenticateLogin()
{
	if ($('EmployeeID').value != '') { 
	var URL = "authenticate.php";
		new Ajax.Request(URL,
		{
			method:'post',
			parameters: {
				EmployeeID: $('EmployeeID').value},
		    	onSuccess: function(transport)
		    	{
					var x = transport.responseText;
					if (x.indexOf("success") != -1) 	
					{
						if (gup('popup') == 'true')
						{
							parent.location.href="CareerDepot.html";
							if (window.opener && !window.opener.closed) {
								window.opener.location.href="CareerDepot.html";
							} 
							self.close();	
						} else {
						 	location.href ="CareerDepot.html";
						}
					} else {
						$('Error').innerHTML = x;
					}
		    	}
		});	
	} else {
		$('Error').innerHTML = "please provide your Employee ID";
	}
	return false;
}

function displayQuiz()
{
	new Ajax.Updater('DCLeft', "quiz.html", {
		method: 'get'
	}); 
}

function generateImage()
{
	var theImages = new Array();
	var theLinks = new Array();
	theImages[0] = 'http://media.monster.com/ads/caen/h/hd/2008Q1/EN/BennifitsButton.jpg';
	theImages[1] = 'http://media.monster.com/ads/caen/h/hd/2008Q1/EN/communityButton.gif';
	theImages[2] = 'http://media.monster.com/ads/caen/h/hd/2008Q1/EN/CFbutton.gif';
	theLinks[0] = 'Benefits.html';
	theLinks[1] = 'Responsibility.html';
	theLinks[2] = 'http://www.monster-career-fairs.com/?mcode=mdepotca&lang=en';
	// do not edit anything below this line

	var j = 0
	var p = theImages.length;
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
   		preBuffer[i] = new Image()
   		preBuffer[i].src = theImages[i]
	}
	var whichImage = Math.round(Math.random()*(p-1));
	document.write('<a href="'+theLinks[whichImage]+'"><img border="0" src="'+theImages[whichImage]+'"></a>');
}




function validateQuestion1()
{
	if ($('QInput1').checked == true)
	{
		$('QuestionTitle').innerHTML = "Question 2:";
		$('Question').innerHTML = "What's your background?";
		$('Answer1').innerHTML = '<input id="QInput1"  name="QInput" type="radio" value="" />I have retail industry experience<br />';
		$('Answer2').innerHTML = '<input id="QInput2"  name="QInput" type="radio" value="" />I am a tradesperson or home renovation<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enthusiast<br />';
		$('Answer3').innerHTML = '<input id="QInput3"  name="QInput" type="radio" value="" />I\'m thinking of a change in my sales career<br />';
		$('Answer4').innerHTML = '<input id="QInput4"  name="QInput" type="radio" value="" />I have transferable professional skills from<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;another industry<br />';
		$('Answer5').innerHTML = '<input id="QInput5"  name="QInput" type="radio" value="" />Varied background, but I\'ve got the right attitude<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for retail<br />';
		$('QuizButton').onclick = validateQuestion2;	
	} else {
		if ($('QInput2').checked == true)
		{
			$('QuestionContainer').innerHTML = "It sounds like retail isn't really for you.<br /><br />Retail is a demanding and challenging industry.<br /><br />You have to be passionate about making<br />a difference every day and focused on<br />team success.";
		} else {
			alert("You must select an answer before proceeding");
		}
	}
}
function validateQuestion2()
{
	if (($('QInput1').checked == true) || ($('QInput2').checked == true) || ($('QInput3').checked == true) || ($('QInput4').checked == true) || ($('QInput5').checked == true))
	{	
		$('QuestionTitle').innerHTML = "Question 3:";
		$('Question').innerHTML = "What are you looking for?";
		$('Answer1').innerHTML = '<input id="QInput1" name="QInput" type="radio" value="" />To give my sales career a makeover<br />';
		$('Answer2').innerHTML = '<input id="QInput2" name="QInput" type="radio" value="" />Provide expert advice and service<br />';
		$('Answer3').innerHTML = '<input id="QInput3" name="QInput" type="radio" value="" />A job to pay for school<br />';
		$('Answer4').innerHTML = '<input id="QInput4" name="QInput" type="radio" value="" />To expand my career as a business professional<br />';
		$('Answer5').innerHTML = '';
		$('QuizButton').onclick = validateQuestion3;
	} else {
		alert("You must select an answer before proceeding");
	}
}
function validateQuestion3()
{
	if (($('QInput1').checked == true) || ($('QInput2').checked == true) || ($('QInput3').checked == true) || ($('QInput4').checked == true))
	{	
		
		
		if ($('QInput1').checked == true) { FinalLink = "<a href='#' onclick='DisplayQuizPage(\"Showroom.html\");'>Showroom Sales & Design</a>"; } 
		if ($('QInput2').checked == true) { FinalLink = "<a href='#' onclick='DisplayQuizPage(\"Store.html\");'>Store Customer Facing & Distribution</a>"; } 
		if ($('QInput3').checked == true) { FinalLink = "<a href='#' onclick='DisplayQuizPage(\"Students.html\");'>Student</a>";} 
		if ($('QInput4').checked == true) { FinalLink = "<a href='#' onclick='DisplayQuizPage(\"Professionals.html\");'>Experienced Professional</a>";} 
		
		$('QuestionTitle').innerHTML = "Question 4:";
		$('Question').innerHTML = "Would you consider yourself a \"Do it yourselfer\"?";
		$('Answer1').innerHTML = '<input id="QInput1" name="QInput" type="radio" value="" />Yes<br />';
		$('Answer2').innerHTML = '<input id="QInput2" name="QInput" type="radio" value="" />Not Really<br />';
		$('Answer3').innerHTML = '';
		$('Answer4').innerHTML = '';
		$('Answer5').innerHTML = '';
		$('QuizButton').onclick = validateQuestion4;
	} else {
		alert("You must select an answer before proceeding");
	}
}
function validateQuestion4()
{
	if (($('QInput1').checked == true) || ($('QInput2').checked == true))
	{	
		$('Question').innerHTML = "When a challenge comes up, do you?";
		$('Answer1').innerHTML = '<input id="QInput1" name="QInput" type="radio" value="" />Jump in and fix it<br />';
		$('Answer2').innerHTML = '<input id="QInput2" name="QInput" type="radio" value="" />Do some discovery and then make<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;recommendations<br />';
		$('Answer3').innerHTML = '<input id="QInput3" name="QInput" type="radio" value="" />Investigate the cause and prevent it from<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;happening again<br />';
		$('Answer4').innerHTML = '<input id="QInput4" name="QInput" type="radio" value="" />Bring in the right people and leverage them<br />';
		$('Answer5').innerHTML = '';
		$('QuizButton').onclick = finishQuiz;
	} else {
		alert("You must select an answer before proceeding");
	}
}

function  finishQuiz()
{
	$('QuestionContainer').innerHTML = "You might want to browse through our " + FinalLink + " openings first <br /><br /> Based on your responses, these might be<br />of interest to you.";
}


var Testimonial1Short = "I began my retail career in a family owned retail lighting showroom in 1980.  I began as a part time salesperson in high school and eventually progressed to a full time position over the course of a few years.  After working in the showroom for over 12 years, I wanted to continue with a career in retail, however wanted to broaden my experience to a larger retailer with growth opportunities.";
var Testimonial1Full = "I began my retail career in a family owned retail lighting showroom in 1980.  I began as a part time salesperson in high school and eventually progressed to a full time position over the course of a few years.  After working in the showroom for over 12 years, I wanted to continue with a career in retail, however wanted to broaden my experience to a larger retailer with growth opportunities.<br /><br />I joined Aikenheads  Home Improvement Warehouse in 1992 when it first opened its doors in Canada.  I began as a sales associate within the electrical department where I could leverage off my lighting experience and quickly became promoted to department manager within 10 months.  After continued success within the department, I was promoted to Assistant Store Manager of the Woodbridge Aikenheads location.<br /><br />Home Depot acquired Aikenheads in 1994 and at that time, I retained my position as Assistant Store Manager, now for the Home Depot Canada.  In 1995 I was again promoted to the position of  Store Manager of the Stockyards store, which at the time, was the largest Home Depot store in Canada, with the second largest sales volume where I had over 300 associates working under my teams direction.  In the fall of 1996, I was invited to participate in a US/Canadian Exchange program, which was designed to trade insights and experience within the corporation.  After four months of managing a store in New Hampshire, USA, I moved back to Toronto and was promptly promoted to the District Manager position for the Eastern Ontario region.  In this position, I managed 6 stores with approximately 1500 associates.<br /><br />After a few years as a district manager, my career shifted slightly when I was promoted to a position within the Merchandising department at the Canadian Store Support Centre.  I began my merchandising career as a Divisional Product Merchant for the Paint department, and since then have held positions as the Divisional Merchandising Manager and most recently the Divisional Product Merchant for Hardware. <br /><br />My career in retail has evolved over the last decade and it has become an extremely rewarding and challenging career.  It has afforded me the opportunity to work with literally thousands of people from differing backgrounds and experiences.   Because of retail's diversity, I have been able to build upon all aspects of my business experience, including negotiating skills, appreciation and expectations of strong customer service, public speaking, mentoring, teaching, training and overall business acumen. <br /><br />Although Retail for me was never an intentional long term plan, the offerings it has afforded me over the years has continued to challenge and drive me to build a very strong career which has endless boundaries.  My retail career at Home Depot has been a rewarding experience which few other careers could match.";
var Testimonial2Short = "<strong>Tell me about your career at The Home Depot.</strong><br/>I've been with Home Depot 15 years now. I started as an associate in the Ellesmere store in the seasonal department, and I worked in pretty much every department in that store in my first three years. I learned a lot about products throughout the store. I was then promoted to lumber and building materials DS in the Morningside store. When Tool Rental opened, I became the DS in the tool rental. After a short time I became the trainer for Home Depot Tool Rentals, opening up Tool Rentals from British Columbia to Nova Scotia. I opened up about 45 tool rental centres in total. Three years later, I became the Tool Rental &amp; PRO Merchant Assistant. In 2006 I moved to Merchandising as a merchant assistant in flooring. ";
var Testimonial2Full = "<strong>Tell me about your career at The Home Depot.</strong><br/>I've been with Home Depot 15 years now. I started as an associate in the Ellesmere store in the seasonal department, and I worked in pretty much every department in that store in my first three years. I learned a lot about products throughout the store. I was then promoted to lumber and building materials DS in the Morningside store. When Tool Rental opened, I became the DS in the tool rental. After a short time I became the trainer for Home Depot Tool Rentals, opening up Tool Rentals from British Columbia to Nova Scotia. I opened up about 45 tool rental centres in total. Three years later, I became the Tool Rental &amp; PRO Merchant Assistant. In 2006 I moved to Merchandising as a merchant assistant in flooring.<br /><br />Beginning in May, I will embark on a new position in E-Commerce as an Inventory and Fulfillment specialist. That's one of the great things about this company, there's always opportunity for change, advancement & learning.<br /><br /><strong>Why work for The Home Depot?</strong><br />It's fun and you certainly feel that you are an integral part of moving the organization forward. It's also gratifying on many levels. In my current role, that means getting the right product at the right price for a customer, providing world class customer service, and assisting customers with completing a project.<br /><br />From the day I started at Home Depot, I never thought I was selling products to customers - I always assist customers with their projects. To be able to assist people in getting their projects done is, in my opinion, something to feel good about. You are helping customers to improve their environment and you are making your job far more interesting.<br /><br /><strong>What lessons have you learned working here?</strong><br />You learn great people skills. Everything you do, you have to work with people. For instance, when working with customer, aligning yourself with the direction they want to go, and moving at their speed. Sometimes you need to facilitate, sometimes you need to take the lead. So working with people is what you learn the most, and working with so many people you have to be adaptable.<br /><br /><strong>What tips do you have for associates for getting the most enjoyment out of their jobs?</strong><br />Keep an open mind and a positive attitude would be the very first thing. Putting customers first would definitely be something that would help. Being ready for change &ndash; if anyone comes in here and expects to have a solid routine that will last indefinitely, it is not likely to happen. We're not scared to change at Home Depot and we're not scared to improve upon a good idea. Have a voice, you certainly get listened to in this company.<br /><br /><strong>Any tips on providing great customer service?</strong><br />Create an open dialogue with the customer and ask questions about their project.. Sometimes customers may not be aware of all aspects of a project that they are about to begin, and by asking the right questions, you can help to round out their thoughts and help them complete their project, saving them time & money.<br /><br />If learning is available to you take advantage of it. Whether it is a seminar, talking to a vendor or experienced customer or self paced learning material. It will make your job easier, you will have more fun and ultimately provides world class customer service. ";

var Testimonial3Short = "Jackie saw a great opportunity when The Home Depot opened up in her neighbourhood 11 years ago. With the end of her maternity leave approaching and a desire to work close to home, Jackie applied to The Home Depot in hopes of putting some of her previous experience as a lighting consultant to use. Soon after she was hired, she began working in four different departments throughout the store. ";
var Testimonial3Full = "Jackie saw a great opportunity when The Home Depot opened up in her neighbourhood 11 years ago. With the end of her maternity leave approaching and a desire to work close to home, Jackie applied to The Home Depot in hopes of putting some of her previous experience as a lighting consultant to use. Soon after she was hired, she began working in four different departments throughout the store.<br /><br />&quot;In hindsight, this was a great decision on my part because it gave me exposure to both operational and merchandising areas within the store,&quot; said Jackie.<br /><br />Jackie later became the administrative assistant at her district office and was able to gain a solid understanding of The Home Depot's business and operations - an experience which she describes as &quot;a great stepping stone in her career.&quot;<br /><br /><strong>&quot;Luckily for me, and for all Home Depot Associates, opportunities exist where you are willing to look.&quot;</strong><br /><br />Jackie's experience, plus her drive to expand her career within the company, led to her promotion as merchandising assistant for the Tool Rental and Pro departments. These departments, relatively new at the time, allowed her to obtain hands on experience and learn many different areas of the business.<br /><br />After working closely with her human resources business partners, Jackie became very interested in their work and the opportunities available in the HR department. &quot;Luckily for me, and for all Home Depot Associates, opportunities exist where you are willing to look,&quot; said Jackie.<br /><br />Jackie began taking part-time courses to obtain a certificate in HR Management and graduated in 2004.  Since then, she has worked as an HR Generalist for the Store Support Centre in Toronto and currently serves as the Human Resource Manager in the Ajax, Ontario store.<br /><br /><strong>Her advice?</strong><br />&quot;Work hard, learn from everyone you can, expose yourself to as much information as you can and pick a direction you want to take.&quot; ";

var Testimonial1 = false;
var Testimonial2 = false;
var Testimonial3 = false;
function collapseAllTestimonials()
{

	Testimonial1 = false;
	Testimonial2 = false;
	Testimonial3 = false;
	$('TestimonialContainer1').className = 'ExpandedOff';
	$('TestimonialContent1').innerHTML = Testimonial1Short;
	$('TestimonialsButton1').innerHTML = '+ Expand';	
	$('TestimonialContainer2').className = 'ExpandedOff';
	$('TestimonialContent2').innerHTML = Testimonial2Short;
	$('TestimonialsButton2').innerHTML = '+ Expand';
	$('TestimonialContainer3').className = 'ExpandedOff';
	$('TestimonialContent3').innerHTML = Testimonial2Short;
	$('TestimonialsButton3').innerHTML = '+ Expand';
}

function TestimonialsButton1Toggle()
{
	if (Testimonial1 == false)
	{
		collapseAllTestimonials();		
		Testimonial1 = true;
		$('TestimonialContainer1').className = 'ExpandedOn';
		$('TestimonialContent1').innerHTML = Testimonial1Full;
		$('TestimonialsButton1').innerHTML = '- Collapse';
	} else {
		Testimonial1 = false;
		$('TestimonialContainer1').className = 'ExpandedOff';
		$('TestimonialContent1').innerHTML = Testimonial1Short;
		$('TestimonialsButton1').innerHTML = '+ Expand';
	}
}

function TestimonialsButton2Toggle()
{
	if (Testimonial2 == false)
	{
		collapseAllTestimonials();		
		Testimonial2 = true;
		$('TestimonialContainer2').className = 'ExpandedOn';
		$('TestimonialContent2').innerHTML = Testimonial2Full;
		$('TestimonialsButton2').innerHTML = '- Collapse';
	} else {
		Testimonial2 = false;
		$('TestimonialContainer2').className = 'ExpandedOff';
		$('TestimonialContent2').innerHTML = Testimonial2Short;
		$('TestimonialsButton2').innerHTML = '+ Expand';
	}
}
function TestimonialsButton3Toggle()
{
	if (Testimonial3 == false)
	{
		collapseAllTestimonials();		
		Testimonial3 = true;
		$('TestimonialContainer3').className = 'ExpandedOn';
		$('TestimonialContent3').innerHTML = Testimonial3Full;
		$('TestimonialsButton3').innerHTML = '- Collapse';
	} else {
		Testimonial3 = false;
		$('TestimonialContainer3').className = 'ExpandedOff';
		$('TestimonialContent3').innerHTML = Testimonial3Short;
		$('TestimonialsButton3').innerHTML = '+ Expand';
	}
}

















function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}


function DisplayQuizPage(URL)
{
	if (gup('popup') == 'true')
	{
		if (window.opener && !window.opener.closed) {
				window.opener.location.href=URL;
		} 
		parent.location.href = (URL);
		self.close();	
	} else {
		location.href = URL;
	}	
}




function validateSurvey()
{
 var Rating = 0;

 if ($('SurveyA1').checked == true) { Rating = 1;}
 if ($('SurveyA2').checked == true) { Rating = 2;}
 if ($('SurveyA3').checked == true) { Rating = 3;}
 if ($('SurveyA4').checked == true) { Rating = 4;}
 if ($('SurveyA5').checked == true) { Rating = 5;}
 var CommentValue = $('SurveyComments').getValue();
 if (Rating == 0) {
	alert('Please rate how well our new campaign connects with you before submitting');
	return false;
  } else {
    var valueString = "&Rate="+Rating+"&Comments="+CommentValue;
	jQuery.getScript("http://clients.monstermediaworks.ca/homeDepot/email.php?"+valueString, function (){
			alert("Your submission has been received\n Thank you for your time.");
			Control.Modal.close();						   
		});
  }
	return false;	
}
function success()
{
	// do nothing
}
function submitError()
{
	// silent failure
}

function surveyThankYou()
{
	//Effect.Fade('SurveyContainer', afterFinish: function() {});
	// do nothing;
}