<!-- This js file is used by /resdential/products/userguides.html-->

var userGuideType = "resEnglish";
var npa = new Array(719,970,303,720, 307, 435, 801)
var npx = new Array(303,720)
var npa719 = new Array(242, 253, 288, 295, 296, 423, 542, 543, 544, 545, 546, 547, 549, 553, 557, 560, 561, 562, 564, 565, 566, 583, 584, 585, 586, 587, 589, 595, 647, 657, 744, 852, 873, 947, 948, 322, 382, 390, 391, 392, 393, 224, 227, 228, 327, 328, 329, 347, 365, 381, 385, 386, 387, 389, 442, 443, 444, 447, 448, 471, 473, 474, 475, 476, 477, 482, 520, 575, 577, 578, 630, 632, 633, 634, 635, 636, 667, 668, 684, 776, 866, 272, 481, 484, 487, 488, 380, 474, 550, 554, 556, 570, 571, 572, 573, 574, 591, 596, 597, 622, 637, 638, 749, 226, 382, 502, 524, 526, 527, 538, 540, 576, 579, 685, 472, 260, 262, 264, 265, 266, 268, 272, 273, 277, 278, 282, 364, 388, 432, 495, 522, 528, 531, 532, 533, 534, 535, 536, 548, 590, 592, 593, 594, 598, 599, 486);

var npa970 = new Array(240, 249, 252, 323, 325, 497, 626, 205, 300, 384, 429, 544, 920, 922, 924, 925, 927, 928, 945, 947, 247, 259, 335, 375, 382, 385, 387, 426, 764, 884, 241, 242, 243, 244, 245, 248, 254, 255, 256, 257, 263, 298, 623, 683, 986, 203, 278, 461, 593, 613, 619, 622, 624, 635, 663, 667, 669, 679, 962, 204, 206, 207, 223, 225, 226, 229, 237, 266, 267, 282, 288, 377, 532, 568, 304, 336, 346, 347, 348, 350, 351, 352, 353, 356, 378, 392, 395, 515, 587, 674, 686, 221, 224, 407, 416, 419, 472,  482, 484, 488, 490, 491, 492, 493, 494, 495, 498, 748, 845, 949, 262, 453, 468, 496, 513, 547, 572, 752, 668, 968, 476, 477, 479, 827, 489, 662, 284, 330, 339, 454, 506, 737, 785, 834);

var npa303 = new Array(227, 286, 287, 288, 289, 727, 322, 853, 269, 563, 904, 922, 932, 933, 948, 971, 972, 973, 977, 978, 981, 979, 244, 291, 292, 293, 294, 295, 296, 297, 298, 299, 308, 312, 313, 380, 382, 383, 391, 486, 578, 603, 264, 672, 675, 896, 965, 992, 703, 707, 265, 346, 470, 471, 683, 791, 805, 840, 841, 397, 643, 645, 649, 662, 705, 706, 708, 754, 768, 784, 790, 792, 799, 858, 925, 231, 232, 233, 234, 237, 238,  275, 604, 661, 664, 665, 666, 673, 926, 215, 216, 271, 273, 277, 278, 279, 384, 920, 727, 742, 922, 934, 935, 936, 937, 975, 244, 291, 292, 293, 294, 295, 296, 297, 298, 299, 308, 312, 313, 380, 382, 391, 672, 675,  812, 813, 830, 839, 860, 869, 894, 965, 485, 651, 678, 682, 684, 702, 772, 774, 776, 320, 321, 322, 331, 329, 370, 372, 433, 455, 458, 477, 480, 561, 964, 352, 389, 405, 436, 446, 603, 605, 606, 607, 608, 615, 626, 634, 685, 844, 954, 318, 764, 831, 832, 837, 861, 863, 864, 866, 526, 347, 730, 734, 738, 794, 795, 797, 798, 498, 637, 654, 655, 659, 685, 835, 438, 761, 762, 781, 783, 788, 789, 806, 214, 326, 340, 341, 343, 344, 360, 361, 363, 364, 365, 366, 367, 676, 731, 739, 856, 202, 205,  235, 239, 274, 445, 462, 402, 415, 440, 441, 442, 443, 444, 447, 448, 449, 546, 642, 694, 708, 714, 740, 741, 770, 773, 779, 793, 796, 846, 850, 889, 930, 967, 494, 497, 543, 554, 242, 305, 534, 566, 592, 595, 620, 623, 628, 629, 631, 404, 410, 438, 439, 460, 464, 465, 466, 469, 533, 635, 642, 220, 224, 265, 267, 290, 486, 488, 504, 689, 712, 713, 721, 782, 784, 804, 843, 252, 254, 255, 280, 450, 451, 452, 453, 457, 538, 412, 426, 427, 428, 429, 430, 487, 650, 657, 351, 647, 660, 663, 681, 688, 712, 814, 261, 307, 373, 375, 459, 567, 574, 576, 585, 716, 763, 816, 838, 914, 969, 980, 984, 985, 986, 987, 988, 989, 270, 333, 336, 355, 377, 388, 393, 394, 398, 399, 780, 347, 730, 734, 738, 794, 795, 797, 798, 306, 337, 338, 368, 369, 614, 636, 671, 695, 696, 743, 745, 750, 751, 752, 755, 873, 300, 504, 512, 584, 639, 691, 692, 753, 756, 757, 758, 759, 782, 260, 281, 282, 603, 607, 698, 715, 722, 733, 744, 765, 777, 778, 871, 403, 420, 421, 422, 423, 424, 425, 431, 432, 456, 463, 467, 582, 642);

var npa720 = new Array(344, 348, 842, 851, 904, 932, 946, 568, 852, 873, 874, 875, 895, 497, 568, 977, 884, 264, 423, 424, 578, 917, 947, 494, 652, 864, 941, 945, 854, 855, 362, 944, 746, 406, 548, 562, 563, 564, 565, 622, 230, 263, 685, 563, 842, 922, 216, 277, 324, 532, 579, 777, 847, 857, 858, 859, 862, 949, 975, 998, 544, 854, 897, 304, 359, 931, 566, 489, 528, 536, 554, 872, 929, 540, 542, 733, 374, 568, 924, 962, 963, 283, 524, 570);

var npa307 = new Array(215, 224, 232, 234, 235, 237, 261, 265, 266, 268, 315, 333, 439, 472, 473, 577, 995, 220, 222, 256, 274, 275, 316, 426, 432, 433, 459, 514, 632, 633, 634, 635, 637, 638, 771, 772, 773, 775, 777, 778, 920, 996);

var npa435 = new Array(477, 586, 865, 867, 868, 251, 256, 272, 275, 574, 627, 628, 634, 635, 652, 656, 674, 688, 705, 772, 773, 879, 986, 695, 723, 734, 245, 258, 563, 713, 716, 750, 752, 753, 754, 755, 787, 527, 893, 896, 492, 756, 772, 855, 654, 657, 709);

var npa801 = new Array(525, 728, 771, 773, 774, 775, 776, 779, 737, 782, 786, 731, 732, 317, 436, 452, 475, 476, 479, 689, 781, 917, 334, 392, 393, 394, 395, 398, 399, 525, 612, 620, 621, 622, 624, 625, 626, 627, 629, 648, 728, 745, 778, 786, 829, 845, 876, 985, 342, 343, 344, 354, 356, 370, 371, 373, 374, 375, 377, 378, 379, 418, 429, 470, 709, 734, 812, 818, 221, 222, 223, 224, 225, 226, 227, 228, 229, 234, 235, 426, 431, 434, 655, 715, 722, 724, 762, 764, 802, 850, 331, 341, 407, 653, 766, 767, 768, 785, 796, 423, 465, 489, 491, 754, 794, 798, 453, 733, 942, 943, 944, 947, 207, 261, 263, 264, 265, 266, 267, 268, 269, 270, 281, 284, 287, 288, 290, 293, 312, 313, 314, 507, 590, 685,  743, 905, 204, 245, 325, 448, 505, 519, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 575, 594, 595, 596, 799, 933215, 320, 321, 322, 328, 350, 355, 359, 363, 364, 366, 517, 521, 524, 526, 961, 417, 679, 840, 902, 955, 957, 962, 963, 964, 965, 966, 967, 968, 969, 982, 988, 844, 886, 887, 908, 952, 954, 956, 972, 973, 974, 975, 977, 978, 233, 250, 252, 255, 256, 260, 282, 304, 307, 352, 444, 447, 451, 497, 508, 544, 546, 549, 561, 562, 563, 565, 566, 567, 568, 569, 593, 748, 790, 212, 220, 236, 237, 238, 239, 240, 257, 258, 297, 333, 462, 578, 715, 741, 869, 250, 251, 252, 382, 412, 461, 463, 464, 466, 467, 468, 474, 481, 482, 484, 485, 200, 214, 224, 241, 496, 513, 602, 604, 615, 645, 647, 649, 655, 658, 659, 703, 714, 840, 841, 849, 850, 901, 940, 962, 213, 581, 582, 583, 584, 585, 587, 588, 646, 883, 884, 402, 447, 451, 923, 939, 432, 495, 501, 523, 545, 553, 571, 572, 576, 619, 816, 999, 272, 273, 274, 277, 278, 308, 424, 527, 930, 937, 253, 254, 260, 280, 282, 285, 302, 446, 878, 249, 277, 833, 843, 882, 884, 292, 294, 295, 296, 298, 299, 383, 397, 614, 677, 683, 693, 758, 771, 936, 444, 497, 498, 543, 544, 546, 547, 549, 552);

function vmPopup(leftPos, topPos, setUserGuideType){
	userGuideType = setUserGuideType
	var rcmdContent = "";
		
	document.getElementById('vmPopup').style.left = leftPos;
	document.getElementById('vmPopup').style.top = topPos;
	document.getElementById('vmPopup').style.display = "block";
}	

function chooseGuide(){
	var checkNPA = document.getElementById('npa').value;
	var checkNNX = document.getElementById('nnx').value;
	npa += ''; // this ensures variable is a string

	//guideType can be resEnglish, resSpanish, or smallBus
	if(userGuideType == "resEnglish"){
		userGuideURLNew = "/residential/pdf/user_guides/english/VMS2_Web_8_07_New_Platform-2.pdf"
		userGuideURL = "/residential/pdf/user_guides/english/Voice_Mail_English_8_07-2.pdf"
		}
	else if(userGuideType == "resSpanish"){
		userGuideURLNew = "http://www.qwest.com/residential/pdf/user_guides/spanish/RES_Voice_Mail2_Web_7_2_07_Spanish-10.pdf"
		userGuideURL = "http://www.qwest.com/residential/pdf/user_guides/spanish/Voice_Mail_Spanish_8_07-3.pdf"
		}
	else if(userGuideType == "smallBus"){
		userGuideURLNew = "/smallbusiness/pdf/user_guides/BVMS_NewPlatform_7_3_07-11.pdf"
		userGuideURL = "/smallbusiness/pdf/user_guides/BVMS1_Web_11_07_Old_Platform-1.pdf"
		}
	else if(userGuideType == "smallBusMailBox"){
		userGuideURLNew = "http://www.qwest.com/smallbusiness/pdf/user_guides/Extension_MBox2_SMB_5-3-07.pdf"
		userGuideURL = "http://www.qwest.com/smallbusiness/pdf/user_guides/Extension_Mailbox_EXTMB_BE_12_7_05.pdf"
		}
	else if(userGuideType == "smallBusMsg"){
		userGuideURLNew = "http://www.qwest.com/smallbusiness/pdf/user_guides/Msg_Notification2_SMB_5-9-07.pdf"
		userGuideURL = "http://www.qwest.com/smallbusiness/pdf/user_guides/Message_Notification_MESNT_BE_12_7_05.pdf"
		}
	else if(userGuideType == "smallBusCallRouting"){
		userGuideURLNew = "/smallbusiness/pdf/user_guides/Call_Routing2_SMB_5-3-07.pdf"
		userGuideURL = "/smallbusiness/pdf/user_guides/Call_Routing_CLRT_BE_12_7_05.pdf"
		}
	else if(userGuideType == "smallBusCallRoutingToNumber"){
		userGuideURLNew = "/smallbusiness/pdf/user_guides/Call_Rout_to_Number2_SMB_5-3-07.pdf"
		userGuideURL = "/smallbusiness/pdf/user_guides/Call_Routing_Number_CLRTN_BE_12_7_05.pdf"
		}
		

	if(checkNPA == "" || checkNNX == ""){
		alert("Please enter your area code and the first three digits of your phone number");
		return;
	}
	
	if(npa.indexOf(checkNPA) > -1){
		nnxArrayId = eval('npa' + checkNPA) + ''; // this ensures variable is a string
		if(nnxArrayId.indexOf(checkNNX) > -1){
			userGuideURL = userGuideURLNew;
		}
	}

	document.getElementById('vmContent').innerHTML = "<a href=" + userGuideURL + ">User Guide</a><div style=\"clear:both;\"></div>";
	window.open(userGuideURL, 'winOpen');
}	

var isNN = (navigator.appName.indexOf("Netscape")!=-1);
// autotab functionality
function autoTab(input,len, e)
{
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	if(input.value.length >= len && !containsElement(filter,keyCode))
	{
		input.value = input.value.slice(0, len);
		input.form[(getIndex(input)+1) % input.form.length].focus();
	}
	function containsElement(arr, ele)
	{
		var found = false, index = 0;
		while(!found && index < arr.length)
			if(arr[index] == ele)
				found = true;
			else
				index++;
		return found;
	}
	function getIndex(input)
	{
		var index = -1, i = 0, found = false;
		while (i < input.form.length && index == -1)
			if (input.form[i] == input)
				index = i;
			else
				i++;
		return index;
	}
	return true;
}
