var imgSrc = "http://www.mcgrawhill.ca/college/olcsupport/mcshane6e/selfassess/";
// ---------------------------------------
var ansWin = null;
var qCount = 57;
// ---------------------------------------
function WriteResponse(content) {
if (ansWin && !ansWin.closed) {
	ansWin.close()
}
ansWin = window.open("","","toolbar=NO,location=NO,resizable,scrollbars,width=650,height=450");
ansWin.document.write(content);
ansWin.document.close();
}
// ---------------------------------------
function GetTable(totalnum,avernum) {
var top1 = "Low Importance<br>-1 to +1";
var top2 = "Medium importance<br>+2 to +4";
var top3 = "High importance<br>+5 to +7";
var labelnum = ""; var calcnum = 0;
var aver = "" + (totalnum/avernum);
var dotspot = aver.indexOf(".")
if (dotspot >= 0) {
	labelnum = "" + aver.substr(0,dotspot + 2)
} else {
	labelnum = "" + aver.substr(0) + ".0"
}
// all calculation in building the graph are mutliplying 0.0 values by 10; the proportions are right but easier to construct the graph
calcnum = (parseFloat(labelnum)*10)
var theresult = MakeTable(0,80,(calcnum+10),("" + "-1"),("" + "7"),labelnum,top1,top2,top3,30,30,20);
return theresult;
}
// ---------------------------------------
function GradeAssess(theForm) {
var cntlname; var cntlname2; var cont; var cont2;
var totals = new Array(11);
totals[0] = 0; totals[1] = 0; totals[2] = 0; totals[3] = 0; totals[4] = 0;
totals[5] = 0; totals[6] = 0; totals[7] = 0; totals[8] = 0; totals[9] = 0; totals[10] = 0;
for (var i = 0; i < qCount; i++) {
	cntlname2 = "Q" + (i+1) + "Cat";
	cont2 = theForm[cntlname2].value;
	cntlname = "pd"+ (i+1);
	cont = theForm[cntlname].options[theForm[cntlname].selectedIndex].value;
	if (cont == 99) {
		alert("One or more questions are unanswered. Please complete the form and try again.");
		return false;
	}
	totals[cont2] += (cont/1);
}
var rsp = "";
rsp += BeginPage();
rsp += GetFeedback0();
// 4 4 3 3 5 7 5 4 4 5
rsp += GetTable(totals[1],4)
rsp += GetFeedback1();
rsp += GetTable(totals[2],4)
rsp += GetFeedback2();
rsp += GetTable(totals[3],3)
rsp += GetFeedback3();
rsp += GetTable(totals[4],3)
rsp += GetFeedback4();
rsp += GetTable(totals[5],5)
rsp += GetFeedback5();
rsp += GetTable(totals[6],7)
rsp += GetFeedback6();
rsp += GetTable(totals[7],5)
rsp += GetFeedback7();
rsp += GetTable(totals[8],4)
rsp += GetFeedback8();
rsp += GetTable(totals[9],4)
rsp += GetFeedback9();
rsp += GetTable(totals[10],5)
rsp += GetFeedback10();
rsp += EndPage();
WriteResponse(rsp);
return false;
}
// ---------------------------------------
function MakeTable(datamin,datamax,dscore,ll,lr,strlabel,lt1,lt2,lt3,bl1,bl2,bl3) {
var spread = datamax - datamin;
var maxwidth = 550;
var dfactor = (maxwidth - (maxwidth%spread))/spread;
var gwidth = spread * dfactor;
var gscore = (dscore - datamin) * dfactor;
var ptrloc = gscore - 7;
var ptricon;
if ( (ptrloc) < 0 ) {
	ptricon = "redpointerleft.gif\" width=\"8\"";
	ptrloc = gscore
} else {
	if ( (ptrloc + 15) > gwidth ) {
		ptricon = "redpointerright.gif\" width=\"8\"";
		ptrloc = gscore - 8
	} else {
		ptricon = "redpointer.gif\" width=\"15\""
	}
}
// var padder = 0;
var bar1 = bl1*dfactor;
var bar2 = bl2*dfactor;
var bar3 = gwidth - (bar1 + bar2);
var winCode = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr valign=\"bottom\"><td></td><td></td><td width=\"" + gwidth + "\" align=\"center\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr valign=\"bottom\" align=\"center\"><td class=\"smlabel\" width=\"33%\">" + lt1 + "</td><td class=\"smlabel\" width=\"34%\">" + lt2 + "</td><td class=\"smlabel\" width=\"33%\">" + lt3 + "</td></tr></table></td><td></td><td></td></tr><tr valign=\"bottom\"><td rowspan=\"2\" align=\"right\" valign=\"middle\" class=\"smlabel\">" + ll + "</td><td align=\"right\"><img src=\"" + imgSrc + "whitespacer.gif\" width=\"4\" height=\"1\"><img src=\"" + imgSrc + "blackspacer.gif\" width=\"1\" height=\"25\"></td><td nowrap align=\"center\"><img src=\"" + imgSrc + "grayspacer.gif\" width=\"" + bar1 + "\" height=\"10\"><img src=\"" + imgSrc + "blackspacer.gif\" width=\"" + bar2 + "\" height=\"10\"><img src=\"" + imgSrc + "grayspacer.gif\" width=\"" + bar3 + "\" height=\"10\"></td><td><img src=\"" + imgSrc + "blackspacer.gif\" width=\"1\" height=\"25\"><img src=\"" + imgSrc + "whitespacer.gif\" width=\"4\" height=\"1\"></td><td rowspan=\"2\" valign=\"middle\" class=\"smlabel\">" + lr + "</td></tr><tr valign=\"top\"><td align=\"right\"><img src=\"" + imgSrc + "whitespacer.gif\" width=\"4\" height=\"1\"><img src=\"" + imgSrc + "blackspacer.gif\" width=\"1\" height=\"20\"></td><td nowrap valign=\"bottom\"><img src=\"" + imgSrc + "whitespacer.gif\" width=\"" + ptrloc + "\" height=\"1\"><img height=\"12\" src=\"" + imgSrc + ptricon + "></td><td><img src=\"" + imgSrc + "blackspacer.gif\" width=\"1\" height=\"20\"><img src=\"" + imgSrc + "whitespacer.gif\" width=\"4\" height=\"1\"></td></tr></tr></table>";
// subtracts 1 from dscore because of faking negative values
winCode += "<p align=\"center\"><font color=\"#cc0000\"><b>Your averaged score was " + strlabel + "</b></p>";
return winCode
}
// ---------------------------------------
function GetFeedback0() {
var winCode = "<h3 class=\"explanation\">Understanding Your Score on the Schwartz's Values Scale</h3><p>Values are stable, evaluative beliefs that guide our preferences for outcomes or courses of action in a variety of situations. They are perceptions about what is good or bad, right or wrong. Values influence our choice of goals and the means for achieving those goals. We arrange our personal values into a hierarchy of preferences, called a value system. Each person's unique value system tends to be stable and long lasting because it was developed and reinforced through socialization from parents, religious institutions, friends, personal experiences, and the society in which we live.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This instrument estimates your preferences for a broad range of personal values. These values are grouped into 10 broad domains of values. Scores on each domain potentially range from -1 to +7. However, you are unlikely to have such an extreme score on any domain because the self-assessment asked you to use the extreme responses sparingly. Instead, the results shown here give you an estimate of your value system. They indicate your relative preference across the broad range of values.</p><hr noshade size=\"1\">\n";
return winCode
}
// ---------------------------------------
function GetFeedback1() {
var winCode = "<p><b>POWER:</b> Social status and prestige, control or dominance over people and resources</p><hr noshade size=\"1\">\n";
return winCode
}
// ---------------------------------------
function GetFeedback2() {
var winCode = "<p><b>ACHIEVEMENT:</b> Personal success through demonstrating competence according to social standards </p><hr noshade size=\"1\">\n";
return winCode
}
// ---------------------------------------
function GetFeedback3() {
var winCode = "<p><b>HEDONISM:</b> Pleasure or sensuous gratification for oneself </p><hr noshade size=\"1\">\n";
return winCode
}
// ---------------------------------------
function GetFeedback4() {
var winCode = "<p><b>STIMULATION:</b> Excitement, novelty, and challenge in life </p><hr noshade size=\"1\">\n";
return winCode
}
// ---------------------------------------
function GetFeedback5() {
var winCode = "<p><b>SELF-DIRECTION:</b> Independent thought and action &#151; choosing, creating, exploring </p><hr noshade size=\"1\">\n";
return winCode
}
// ---------------------------------------
function GetFeedback6() {
var winCode = "<p><b>UNIVERSALISM:</b> Understanding, appreciation, tolerance, and protection for the welfare of all people and for </p><hr noshade size=\"1\">\n";
return winCode
}
// ---------------------------------------
function GetFeedback7() {
var winCode = "<p><b>BENEVOLENCE:</b> Preservation and enhancement of the welfare of people with whom one is in frequent personal contact </p><hr noshade size=\"1\">\n";
return winCode
}
// ---------------------------------------
function GetFeedback8() {
var winCode = "<p><b>TRADITION:</b> Respect, commitment, and acceptance of the customs and ideas that traditional culture or religion provide </p><hr noshade size=\"1\">\n";
return winCode
}
// ---------------------------------------
function GetFeedback9() {
var winCode = "<p><b>CONFORMITY:</b> Restraint of actions, inclinations, and impulses likely to upset or harm others and violate social expectations or norms </p><hr noshade size=\"1\">\n";
return winCode
}
// ---------------------------------------
function GetFeedback10() {
var winCode = "<p><b>SECURITY:</b> Safety, harmony, and stability of society, of relationships, and of self </p></p>\n";
return winCode
}
// ---------------------------------------
function BeginPage() {
var winCode = "<html><head><title>Organizational Behaviour Self-Assessment Exercises</title>\n\n";
winCode += "<script language=\"JavaScript\">\n<!--\n// ---------------------------\n";
winCode += "function printScreen(){\nif (window.print) {\n window.print();\n} else {\n alert(\"Your browser does not support printer links embedded within a web page. PC users, however, can right-click within the window and a popup menu will appear from which you can print. Macintosh users can access a similar menu by holding down the mouse for several seconds.\");\n}\n}\n";
winCode += "//-" + "->\n</script>\n" + GetStyles() + "</head>\n";
winCode += "<body bgcolor=\"#ffffff\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr><td bgcolor=\"#000000\"><font size=\"4\">&nbsp;</font></td></tr>\n</table>\n<table border=\"0\" width=\"100%\" cellpadding=\"20\" cellspacing=\"0\">\n<tr valign=\"top\"><td>\n\n";
return winCode
}
//----------------------------------------
function GetStyles() {
return "\n<link href=\"http://www.mcgrawhill.ca/college/olcsupport/mcshane6e/selfassess/selfassess.css\" type=\"text/css\" rel=\"stylesheet\"></link>\n";
var winCode = "\n<style>\n<!-- For some reason Netscape seems to go for case sensitivity. Here's uppercase tags. -->\nA\n{\ntext-decoration: none;\n}\nA:HOVER\n{\ntext-decoration: underline;\n}\nA.hint \n{\ncolor: #999999;\ntext-decoration: none;\nfont-weight: bold;\n}\nA.nav \n{\nfont-size: 10px;\ncolor:#999999;\ntext-decoration: none;\nfont-weight:bold;\n}\nA.navCur \n{\nfont-size: 10px;\ncolor:#FFFFFF;\ntext-decoration: none;\nfont-weight:bold;\n}\nBODY \n{\nfont-family: verdana, sans-serif;\nfont-size: 12px;\n}\nTABLE\n{\nfont-family: verdana, sans-serif; \nfont-size: 12px;\n}\nTR\n{\nfont-family: verdana, sans-serif; \nfont-size: 12px;\n}\nTD\n{\nfont-family: verdana, sans-serif; \nfont-size: 12px;\n}\nTD.smlabel\n{\nfont-family: verdana, sans-serif; \nfont-size: 10px;\ncolor: #999999;\n}\nP\n{\nfont-family: verdana, sans-serif; \nfont-size: 12px\n}\np\n{\nfont-family: verdana, sans-serif; \nfont-size: 12px;\n}\nUL\n{\nfont-family: verdana, sans-serif; \nfont-size: 12px;\n}\nOL\n{\nfont-family: verdana, sans-serif;\nfont-size: 12px;\n}\nLI\n{\nfont-family: verdana, sans-serif;\nfont-size: 12px;\n}\nH3 \n{\nfont-family: verdana, sans-serif;\nfont-size: 16px;\nfont-weight: bold;\ncolor: #000000;\nmargin: 0px;\npadding: 0px;\npadding-bottom: 3px;\npadding-top: 2px;\n}\n<!-- For some reason Netscape seems to go for case sensitivity. Here's lowercase tags. -->\na\n{\ntext-decoration: none;\n}\na:hover\n{\ntext-decoration: underline;\n}\na.hint \n{\ncolor: #999999;\ntext-decoration: none;\nfont-weight: bold;\n}\na.nav \n{\nfont-size: 10px;\ncolor:#999999;\ntext-decoration: none;\nfont-weight:bold;\n}\na.navCur \n{\nfont-size: 10px;\ncolor:#FFFFFF;\ntext-decoration: none;\nfont-weight:bold;\n}\nbody \n{\nfont-family: verdana, sans-serif;\nfont-size: 12px;\n}\ntable\n{\nfont-family: verdana, sans-serif; \nfont-size: 12px;\n}\ntr\n{\nfont-family: verdana, sans-serif; \nfont-size: 12px;\n}\ntd\n{\nfont-family: verdana, sans-serif; \nfont-size: 12px;\n}\ntd.smlabel\n{\nfont-family: verdana, sans-serif; \nfont-size: 10px;\ncolor: #999999;\n}\nul\n{\nfont-family: verdana, sans-serif; \nfont-size: 12px;\n}\nol\n{\nfont-family: verdana, sans-serif;\nfont-size: 12px;\n}\nli\n{\nfont-family: verdana, sans-serif;\nfont-size: 12px;\n}\nh3 \n{\nfont-family: verdana, sans-serif;\nfont-size: 16px;\nfont-weight: bold;\ncolor: #000000;\nmargin: 0px;\npadding: 0px;\npadding-bottom: 3px;\npadding-top: 2px;\n}\n.explanation\n{\ncolor: #0000ff;\n}\n.footer\n{\nfont-size: 10px;\n}\n</style>\n\n";
return winCode;
}
// ---------------------------------------
function EndPage() {
var winCode = "\n\n<p class=\"footer\"><hr noshade size=\"1\" />\n<font face=\"Symbol\" color=\"ff0000\">&#168;</font> <a href=\"javascript:printScreen()\"><b>Print Screen</b></a>\n</p>\n<p class=\"footer\"><a href=\"mailto:highered_web@mcgrawhill.ca\">Comments or questions?</a><br>Copyright &copy; 2004 McGraw-Hill Ryerson Limited<br>&nbsp;</p></td></tr></table></body></html>";
return winCode
}
