var arVersionA = navigator.appVersion.split("MSIE");
var versionA = parseFloat(arVersionA[1]);

if(window.HTMLElement){
	Node.prototype.removeNode = function(removeChildren) {
		if (Boolean(removeChildren))
			return this.parentNode.removeChild(this);
		else {
			var r=document.createRange();
			r.selectNodeContents(this);
			return this.parentNode.replaceChild(r.extractContents(),this);
		}
	}
}

function Move_Up_ChildA(row)
{
	if (versionA >= 5.5) {
		if (row.previousSibling){
			row.swapNode(row.previousSibling);
		}
	} else {
		if (row.previousElementSibling){
			pn = row.parentNode;

			n = row.cloneNode(true);
			nt = row.previousElementSibling;

			row.removeNode(true);
			pn.insertBefore(n,nt);
		} else if (row.previousSibling){
			pn = row.parentNode;

			n = row.cloneNode(true);
			nt = row.previousSibling;

			row.removeNode(true);
			pn.insertBefore(n,nt);
		}
	}
}

function select_starA(starSubId, starCount, currentStar)
{
	for(i = 1; i <= currentStar; i++)
		document.getElementById(starSubId + '_' + i).src = "/images/star-yellow.gif";
	for(i = starCount; i > currentStar; i--)
		document.getElementById(starSubId + '_' + i).src = "/images/star-white.gif";
}

function set_starA(starSubId, currentStar)
{
	if (document.getElementById(starSubId).value == currentStar) currentStar--;
	document.getElementById(starSubId).value = currentStar;
}

function getCaretPositionA(ctrl) {
 
	var CaretPos = 0;
	// IE Support
	if (document.selection) {
 
		//ctrl.focus ();
		var Sel = document.selection.createRange ();
 
		Sel.moveStart ('character', -ctrl.value.length);
 
		CaretPos = Sel.text.length;
	}
	// Firefox support
	else if (ctrl.selectionStart || ctrl.selectionStart == '0')
		CaretPos = ctrl.selectionStart;
	return (CaretPos);
}
 
function setCaretPositionA(ctrl, pos)
{
 
	if(ctrl.setSelectionRange)
	{
		//ctrl.focus();
		ctrl.setSelectionRange(pos,pos);
	}
	else if (ctrl.createTextRange) {
		var range = ctrl.createTextRange();
		range.collapse(true);
		range.moveEnd('character', pos);
		range.moveStart('character', pos);
		range.select();
	}
}

function erase_all_symbolA(subject){
    return subject.replace(/[^0-9]/g, "");
}

function convert_phoneA(phone){
    var A = "";
    if((A = phone.replace(/([0-9]{1})([0-9]{3})([0-9]{3})([0-9]{4})/, '$1-$2-$3-$4')) == phone)
      A = phone.replace(/([0-9]{3})([0-9]{3})([0-9]{4})/, '$1-$2-$3');
    return A;
}

function InitFeedback(MoverId, Id)
{
	if (document.getElementById('msgs_'+MoverId+'_'+Id)){
		$(function(){
			var tPhone = $("#fb_phone_"+MoverId+"_"+Id);
			var tChar = $("#maxchars_"+MoverId+"_"+Id);
			var tArea = $("#msgs_"+MoverId+"_"+Id);
			var tCounter = $("#counter_chars_"+MoverId+"_"+Id);
			var tButton = $("#send_button_"+MoverId+"_"+Id);

			var PressedTab = false;

			function TestValue(){
				if (tArea.val().length > parseInt(tChar[0].value)){
					old = getCaretPositionA(tArea[0]);
					tArea[0].value = String(tArea[0].value).substr(0, parseInt(tChar[0].value));
					setCaretPositionA(tArea[0], old);
				}
				tCounter[0].innerHTML = (parseInt(tChar[0].value) - tArea.val().length);
				if (tArea.val().length > 0){
					tButton[0].style.color='#FFFFFF';
					tButton[0].style.backgroundPosition='0 -26';
					tButton[0].parentNode.previousSibling.style.backgroundPosition='0 -26';
					tButton[0].parentNode.nextSibling.style.backgroundPosition='0 -26';
				} else {
					tButton[0].style.color='#000000';
					tButton[0].style.backgroundPosition='0 2';
					tButton[0].parentNode.previousSibling.style.backgroundPosition='0 2';
					tButton[0].parentNode.nextSibling.style.backgroundPosition='0 2';
				}
			}

			tPhone.keypress(function(b){
				var a=b.which;
				var c=String.fromCharCode(a);
				return !!(a==0||a==8||a==9||a==13||c.match(/[0-9()\-+\s\x25\x27\x24\x23\x2E]/))
			});

			tPhone.blur(function(i){
				var test = erase_all_symbolA(tPhone.val());
				tPhone.val(convert_phoneA(test));
			});

			tArea.keypress(function(b){
				if (b.which !== 17){
					if ((b.ctrlKey)&&(b.which == 67)){
						return true;
					}
					if ((b.which == 9)||((b.keyCode == 9)&&(b.which == 0))){
						tArea[0].value += String.fromCharCode(9);
						PressedTab = true;
					} else if ((b.which !== 8)&&(b.which !== 46)&&
					   (b.which !== 37)&&(b.which !== 38)&&
					   (b.which !== 39)&&(b.which !== 40)&&
					   (b.which !== 33)&&(b.which !== 34)&&
					   (b.which !== 35)&&(b.which !== 36)&&(b.which !== 0)){
						if (tArea.val().length >= parseInt(tChar[0].value)){
							tCounter[0].innerHTML = (parseInt(tChar[0].value) - tArea.val().length);
							return false;
						}
					} else {
						TestValue();
					}
				}
				return true;
			});

			tArea.keyup(function(b){
				TestValue();
			});

			tArea.mousemove(function(b){
				TestValue();
			});

			tArea.blur(function(I){
				TestValue();
				if (PressedTab){
					PressedTab = false;
					tArea.focus();
				}
			});

			tArea.focus();
		});
	}
}

function fbSuccess(data, status)
{
	this.result = true;
	if (document.getElementById('_parent_mover_box_'+this.iMoverId+'_'+this.iId)){
		document.getElementById('right_panel_box_'+this.iMoverId+'_'+this.iId).removeNode(true);
		document.getElementById('left_panel_box_'+this.iMoverId+'_'+this.iId).colSpan = "4";
		document.getElementById('left_panel_box_'+this.iMoverId+'_'+this.iId).innerHTML = 'Thanks for your feedback, it is very important to us.';
	}
}

function fbCompleteSend(xhr, status)
{
	if (!this.result){
		document.getElementById('error_box_'+this.iMoverId+'_'+this.iId).innerHTML = 'Failed to send: Server not responding!';
	}
}

function testEmail(email)
{
	if (email == ''){
		return false;
	}

	var idx = email.indexOf('@');

	if (idx > 0){

		var point = false;
		var st = 0;
		var ed = idx;
		var ch = 0;

		for(j = 0; j < 2; j++){
			next = false;
			error = false;

			for(i = st; i < ed; i++){

				ch = email.charCodeAt(i);

				if ((ch == 46)||(ch == 45)){
					if (!next){
						error = true;
						break;
					}
					next = false;
					if ((j == 1)&&(ch == 46)){
						point = true;
					} else {
						point = false;
					}
				} else {
					if (((ch >= 48)&&(ch <= 57))||
						((ch >= 97)&&(ch <= 122))||
						((ch >= 65)&&(ch <= 90))){
						next = true;
					} else {
						error = true;
						break;
					}
				}
			}

			if ((!error)&&(!next)){
				error = true;
			}

			if (error){
				break;
			}

			st = idx + 1;
			ed = email.length;
		}

		if ((error)||(!point)){
			return false;
		} else {
			return true;
		}

	} else {
		return false;
	}

}

function SendFeedBackNow(MoverId, Id)
{
	var i, j, Err = new Array();
	var vardata = {}
	vardata.fname = document.getElementById('fb_fname_'+MoverId+'_'+Id).value;
	vardata.city = document.getElementById('fb_city_'+MoverId+'_'+Id).value;
	vardata.state = document.getElementById('fb_state_'+MoverId+'_'+Id).value;
	vardata.email = document.getElementById('fb_email_'+MoverId+'_'+Id).value;
	vardata.msgs = document.getElementById('msgs_'+MoverId+'_'+Id).value;

	if (vardata.fname == '') Err[Err.length] = 'fb_fname_'+MoverId+'_'+Id;
	if (vardata.city == '') Err[Err.length] = 'fb_city_'+MoverId+'_'+Id;
	if (vardata.state == '0') Err[Err.length] = 'fb_state_'+MoverId+'_'+Id;
	if (vardata.msgs == '') Err[Err.length] = 'msgs_'+MoverId+'_'+Id;
	if (!testEmail(vardata.email)) Err[Err.length] = 'fb_email_'+MoverId+'_'+Id;

	if (Err.length == 0){
		vardata.month = document.getElementById('month_'+MoverId+'_'+Id).value;
		vardata.day = document.getElementById('days_'+MoverId+'_'+Id).value;
		vardata.year = document.getElementById('years_'+MoverId+'_'+Id).value;
		vardata.phone = document.getElementById('fb_phone_'+MoverId+'_'+Id).value;
		vardata.jobtype = document.getElementById('JobType_'+MoverId+'_'+Id).value;
		vardata.quality = document.getElementById('Quality_'+MoverId+'_'+Id).value;
		vardata.expertise = document.getElementById('Expertise_'+MoverId+'_'+Id).value;
		vardata.cost = document.getElementById('Cost_'+MoverId+'_'+Id).value;
		vardata.shedule = document.getElementById('Schedule_'+MoverId+'_'+Id).value;
		vardata.prof = document.getElementById('Professionalism_'+MoverId+'_'+Id).value;

		vardata.moverid = MoverId;
		vardata.memberid = 0;

		jQuery.ajax({
			url: '/set_feedback.php',
			data: vardata,
			type: 'post',
			dataType: 'json',
			iMoverId: MoverId,
			iId: Id,
			result: false,
			success: fbSuccess,
			complete: fbCompleteSend
		});
	} else {
		for(i = 0; i < Err.length; i++){
			document.getElementById(Err[i]).style.backgroundColor = "#FFF0F0";
			document.getElementById(Err[i]).onfocus = function(){this.style.backgroundColor = '#FFFFFF';};
		}
	}
}

function FeedBackTestDate(MoverId, Id)
{
	var maxDateOnMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	var yr = parseInt(document.getElementById('years_'+MoverId+'_'+Id).value);
	if ((Math.floor(yr / 4) * 4) == yr){
		maxDateOnMonth[1] = 29;
	}
	var mn = parseInt(document.getElementById('month_'+MoverId+'_'+Id).value);
	var dy = parseInt(document.getElementById('days_'+MoverId+'_'+Id).value);
	if (dy > maxDateOnMonth[mn - 1]) dy = maxDateOnMonth[mn - 1];
	var str = '';
	for(var i = 1; i <= maxDateOnMonth[mn - 1]; i++){
		str += '<option value="'+i+'"'+((dy == i)?' selected':'')+'>'+i+'</option>';
	}
	document.getElementById('days_'+MoverId+'_'+Id).innerHTML = str;
}

function FeedBackLeftPanel(MoverId, Id, email, fname)
{
	var monthStr = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	var now = new Date();
	mon = (now.getMonth() + 1);
	day = now.getDate();
	yer = now.getFullYear();

	var monStr = '';
	for(var i=1; i <= 12; i++){
		monStr += '<option value="'+i+'"'+((mon == i)?' selected':'')+'>'+monthStr[i - 1]+'</option>';
	}

	var maxDateOnMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	if ((Math.floor(yer / 4) * 4) == yer){
		maxDateOnMonth[1] = 29;
	}

	var dayStr = '';
	for(var i=1; i <= maxDateOnMonth[mon - 1]; i++){
		dayStr += '<option value="'+i+'"'+((day == i)?' selected':'')+'>'+i+'</option>';
	}

	var yerStr = '';
	for(var i = (yer-1); i <= (yer + 9); i++){
		yerStr += '<option value="'+i+'"'+((yer == i)?' selected':'')+'>'+i+'</option>';
	}

	return '<table border="0" cellpadding="2" cellspacing="0" width="324"><tbody>'+
			'<tr>'+
				'<td class="tah11black" align="right">Full name:</td>'+
				'<td class="tah12black"><input id="fb_fname_'+MoverId+'_'+Id+'" name="feedback[fname]" class="tah11black" type="text" style="width: 200px;" value="'+fname+'"><span style="color: #ff0000;">*</span></td>'+
			'</tr>'+
			'<tr>'+
				'<td class="tah11black" align="right">Phone:</td>'+
				'<td class="tah12black"><input id="fb_phone_'+MoverId+'_'+Id+'" name="feedback[phone]" class="tah11black" type="text" style="width: 200px;"></td>'+
			'</tr>'+
			'<tr>'+
				'<td class="tah11black" align="right">City:</td>'+
				'<td class="tah12black"><input id="fb_city_'+MoverId+'_'+Id+'" name="feedback[city]" class="tah11black" type="text" style="width: 200px;"><span style="color: #ff0000;">*</span></td>'+
			'</tr>'+
			'<tr>'+
				'<td class="tah11black" align="right">State:</td>'+
				'<td class="tah12black">'+
					'<select id="fb_state_'+MoverId+'_'+Id+'" name="feedback[state]" class="tah11black" style="width: 200px;">'+
						'<option value="0">Please select</option>'+
						'<option value="Alabama">Alabama</option>'+
						'<option value="Alaska">Alaska</option>'+
						'<option value="Arizona">Arizona</option>'+
						'<option value="Arkansas">Arkansas</option>'+
						'<option value="California">California</option>'+
						'<option value="Colorado">Colorado</option>'+
						'<option value="Connecticut">Connecticut</option>'+
						'<option value="Delaware">Delaware</option>'+
						'<option value="District of Columbia">District of Columbia</option>'+
						'<option value="Florida">Florida</option>'+
						'<option value="Georgia">Georgia</option>'+
						'<option value="Hawaii">Hawaii</option>'+
						'<option value="Idaho">Idaho</option>'+
						'<option value="Illinois">Illinois</option>'+
						'<option value="Indiana">Indiana</option>'+
						'<option value="Iowa">Iowa</option>'+
						'<option value="Kansas">Kansas</option>'+
						'<option value="Kentucky">Kentucky</option>'+
						'<option value="Louisiana">Louisiana</option>'+
						'<option value="Maine">Maine</option>'+
						'<option value="Maryland">Maryland</option>'+
						'<option value="Massachusetts">Massachusetts</option>'+
						'<option value="Michigan">Michigan</option>'+
						'<option value="Minnesota">Minnesota</option>'+
						'<option value="Mississippi">Mississippi</option>'+
						'<option value="Missouri">Missouri</option>'+
						'<option value="Montana">Montana</option>'+
						'<option value="Nebraska">Nebraska</option>'+
						'<option value="Nevada">Nevada</option>'+
						'<option value="New Hampshire">New Hampshire</option>'+
						'<option value="New Jersey">New Jersey</option>'+
						'<option value="New Mexico">New Mexico</option>'+
						'<option value="New York">New York</option>'+
						'<option value="North Carolina">North Carolina</option>'+
						'<option value="North Dakota">North Dakota</option>'+
						'<option value="Ohio">Ohio</option>'+
						'<option value="Oklahoma">Oklahoma</option>'+
						'<option value="Oregon">Oregon</option>'+
						'<option value="Pennsylvania">Pennsylvania</option>'+
						'<option value="Puerto Rico">Puerto Rico</option>'+
						'<option value="Rhode Island">Rhode Island</option>'+
						'<option value="South Carolina">South Carolina</option>'+
						'<option value="South Dakota">South Dakota</option>'+
						'<option value="Tennessee">Tennessee</option>'+
						'<option value="Texas">Texas</option>'+
						'<option value="Utah">Utah</option>'+
						'<option value="Vermont">Vermont</option>'+
						'<option value="Virginia">Virginia</option>'+
						'<option value="Washington">Washington</option>'+
						'<option value="West Virginia">West Virginia</option>'+
						'<option value="Wisconsin">Wisconsin</option>'+
						'<option value="Wyoming">Wyoming</option>'+
					'</select><span style="color: #ff0000;">*</span>'+
				'</td>'+
			'</tr>'+
			'<tr>'+
				'<td class="tah11black" align="right">When:</td>'+
				'<td class="tah12black">'+
					'<select class="tah11black" style="width: 100px;" id="month_'+MoverId+'_'+Id+'" name="feedback[month]" onchange="FeedBackTestDate(\''+MoverId+'\', \''+Id+'\')">'+monStr+'</select>'+
					'<select class="tah11black" style="width: 45px;" id="days_'+MoverId+'_'+Id+'" name="feedback[day]" onchange="FeedBackTestDate(\''+MoverId+'\', \''+Id+'\')">'+dayStr+'</select>'+
					'<select class="tah11black" style="width: 55px;" id="years_'+MoverId+'_'+Id+'" name="feedback[year]" onchange="FeedBackTestDate(\''+MoverId+'\', \''+Id+'\')">'+yerStr+'</select>'+
				'<span style="color: #ff0000;">*</span></td>'+
			'</tr>'+
			'<tr>'+
				'<td class="tah11black" align="right">E-mail:</td>'+
				'<td class="tah12black"><input id="fb_email_'+MoverId+'_'+Id+'" name="feedback[email]" class="tah11black" type="text" style="width: 200px;" value="'+email+'"><span style="color: #ff0000;">*</span></td>'+
			'</tr>'+
			'<tr>'+
				'<td class="tah11grey-padleft" colspan="2">We will not share your e-mail with any third parties.<br>We value your privacy.</td>'+
			'</tr>'+
			'<tr>'+
				'<td class="tah11black" colspan="2" align="right"><span style="color: #ff0000;">*</span> Required fields.</td>'+
			'</tr>'+
			'</tbody></table>';
}

function FeedBackRightPanel(MoverId, Id, jobType, maxChars)
{
	return '<table border="0" cellpadding="2" cellspacing="0" width="473"><tbody>'+
			'<tr>'+
				'<td class="tah11black" align="left" style="padding-left: 15px; padding-top: 5px;" valign="top">'+
					'<table border="0" cellpadding="0" cellspacing="0" valign="top"><tbody>'+
					'<tr>'+
						'<td class="tah11black" align="right" style="padding-right: 6px;" nowrap><strong>Job type:</strong></td>'+
						'<td class="tah11black" align="left">'+jobType+'</td>'+
					'</tr>'+
					'</tbody></table>'+
				'</td>'+
				'<td class="tah11black" align="right" style="padding-top: 5px; padding-right: 15px;" valign="top">'+
					'<input id="maxchars_'+MoverId+'_'+Id+'" type="hidden" name="feedback[maxchars]" value="'+maxChars+'"/>'+
					'<input id="JobType_'+MoverId+'_'+Id+'" type="hidden" name="feedback[jobtype]" value="'+jobType+'"/>'+
					'<input id="Quality_'+MoverId+'_'+Id+'" type="hidden" name="feedback[balls][quality]" value="0"/>'+
					'<input id="Expertise_'+MoverId+'_'+Id+'" type="hidden" name="feedback[balls][expertise]" value="0"/>'+
					'<input id="Cost_'+MoverId+'_'+Id+'" type="hidden" name="feedback[balls][cost]" value="0"/>'+
					'<input id="Schedule_'+MoverId+'_'+Id+'" type="hidden" name="feedback[balls][schedule]" value="0"/>'+
					'<input id="Professionalism_'+MoverId+'_'+Id+'" type="hidden" name="feedback[balls][professionalism]" value="0"/>'+
					'<table border="0" cellpadding="0" cellspacing="0" valign="top"><tbody>'+
					'<tr>'+
						'<td class="tah11black" align="right" style="padding-right: 4px;" nowrap><strong>Quality:</strong></td>'+
						'<td><img id="Quality_'+MoverId+'_'+Id+'_1" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Quality_'+MoverId+'_'+Id+'\', 5, 1)" onmouseout="select_starA(\'Quality_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Quality_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Quality_'+MoverId+'_'+Id+'\', 1)"></td>'+
						'<td><img id="Quality_'+MoverId+'_'+Id+'_2" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Quality_'+MoverId+'_'+Id+'\', 5, 2)" onmouseout="select_starA(\'Quality_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Quality_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Quality_'+MoverId+'_'+Id+'\', 2)"></td>'+
						'<td><img id="Quality_'+MoverId+'_'+Id+'_3" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Quality_'+MoverId+'_'+Id+'\', 5, 3)" onmouseout="select_starA(\'Quality_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Quality_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Quality_'+MoverId+'_'+Id+'\', 3)"></td>'+
						'<td><img id="Quality_'+MoverId+'_'+Id+'_4" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Quality_'+MoverId+'_'+Id+'\', 5, 4)" onmouseout="select_starA(\'Quality_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Quality_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Quality_'+MoverId+'_'+Id+'\', 4)"></td>'+
						'<td><img id="Quality_'+MoverId+'_'+Id+'_5" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Quality_'+MoverId+'_'+Id+'\', 5, 5)" onmouseout="select_starA(\'Quality_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Quality_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Quality_'+MoverId+'_'+Id+'\', 5)"></td>'+
					'</tr>'+
					'<tr>'+
						'<td class="tah11black" align="right" style="padding-right: 4px;" nowrap><strong>Expertise:</strong></td>'+
						'<td><img id="Expertise_'+MoverId+'_'+Id+'_1" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5, 1)" onmouseout="select_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Expertise_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Expertise_'+MoverId+'_'+Id+'\', 1)"></td>'+
						'<td><img id="Expertise_'+MoverId+'_'+Id+'_2" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5, 2)" onmouseout="select_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Expertise_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Expertise_'+MoverId+'_'+Id+'\', 2)"></td>'+
						'<td><img id="Expertise_'+MoverId+'_'+Id+'_3" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5, 3)" onmouseout="select_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Expertise_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Expertise_'+MoverId+'_'+Id+'\', 3)"></td>'+
						'<td><img id="Expertise_'+MoverId+'_'+Id+'_4" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5, 4)" onmouseout="select_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Expertise_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Expertise_'+MoverId+'_'+Id+'\', 4)"></td>'+
						'<td><img id="Expertise_'+MoverId+'_'+Id+'_5" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5, 5)" onmouseout="select_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Expertise_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Expertise_'+MoverId+'_'+Id+'\', 5)"></td>'+
					'</tr>'+
					'<tr>'+
						'<td class="tah11black" align="right" style="padding-right: 4px;" nowrap><strong>Cost:</strong></td>'+
						'<td><img id="Cost_'+MoverId+'_'+Id+'_1" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Cost_'+MoverId+'_'+Id+'\', 5, 1)" onmouseout="select_starA(\'Cost_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Cost_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Cost_'+MoverId+'_'+Id+'\', 1)"></td>'+
						'<td><img id="Cost_'+MoverId+'_'+Id+'_2" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Cost_'+MoverId+'_'+Id+'\', 5, 2)" onmouseout="select_starA(\'Cost_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Cost_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Cost_'+MoverId+'_'+Id+'\', 2)"></td>'+
						'<td><img id="Cost_'+MoverId+'_'+Id+'_3" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Cost_'+MoverId+'_'+Id+'\', 5, 3)" onmouseout="select_starA(\'Cost_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Cost_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Cost_'+MoverId+'_'+Id+'\', 3)"></td>'+
						'<td><img id="Cost_'+MoverId+'_'+Id+'_4" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Cost_'+MoverId+'_'+Id+'\', 5, 4)" onmouseout="select_starA(\'Cost_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Cost_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Cost_'+MoverId+'_'+Id+'\', 4)"></td>'+
						'<td><img id="Cost_'+MoverId+'_'+Id+'_5" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Cost_'+MoverId+'_'+Id+'\', 5, 5)" onmouseout="select_starA(\'Cost_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Cost_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Cost_'+MoverId+'_'+Id+'\', 5)"></td>'+
					'</tr>'+
					'<tr>'+
						'<td class="tah11black" align="right" style="padding-right: 4px;" nowrap><strong>Schedule:</strong></td>'+
						'<td><img id="Schedule_'+MoverId+'_'+Id+'_1" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5, 1)" onmouseout="select_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Schedule_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Schedule_'+MoverId+'_'+Id+'\', 1)"></td>'+
						'<td><img id="Schedule_'+MoverId+'_'+Id+'_2" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5, 2)" onmouseout="select_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Schedule_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Schedule_'+MoverId+'_'+Id+'\', 2)"></td>'+
						'<td><img id="Schedule_'+MoverId+'_'+Id+'_3" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5, 3)" onmouseout="select_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Schedule_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Schedule_'+MoverId+'_'+Id+'\', 3)"></td>'+
						'<td><img id="Schedule_'+MoverId+'_'+Id+'_4" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5, 4)" onmouseout="select_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Schedule_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Schedule_'+MoverId+'_'+Id+'\', 4)"></td>'+
						'<td><img id="Schedule_'+MoverId+'_'+Id+'_5" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5, 5)" onmouseout="select_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Schedule_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Schedule_'+MoverId+'_'+Id+'\', 5)"></td>'+
					'</tr>'+
					'<tr>'+
						'<td class="tah11black" align="right" style="padding-right: 4px;" nowrap><strong>Professionalism:</strong></td>'+
						'<td><img id="Professionalism_'+MoverId+'_'+Id+'_1" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5, 1)" onmouseout="select_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Professionalism_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 1)"></td>'+
						'<td><img id="Professionalism_'+MoverId+'_'+Id+'_2" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5, 2)" onmouseout="select_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Professionalism_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 2)"></td>'+
						'<td><img id="Professionalism_'+MoverId+'_'+Id+'_3" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5, 3)" onmouseout="select_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Professionalism_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 3)"></td>'+
						'<td><img id="Professionalism_'+MoverId+'_'+Id+'_4" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5, 4)" onmouseout="select_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Professionalism_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 4)"></td>'+
						'<td><img id="Professionalism_'+MoverId+'_'+Id+'_5" src="/images/star-white.gif" width="12" height="12" onmouseover="select_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5, 5)" onmouseout="select_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5, document.getElementById(\'Professionalism_'+MoverId+'_'+Id+'\').value)" onclick="set_starA(\'Professionalism_'+MoverId+'_'+Id+'\', 5)"></td>'+
					'</tr>'+
					'</tbody></table>'+
				'</td>'+
			'</tr>'+
			'<tr>'+
				'<td class="tah11black" colspan="2" align="right" style="padding-right: 16px;">'+
					'<table border="0" cellpadding="0" cellspacing="0" valign="top"><tbody>'+
					'<tr>'+
						'<td valign="top" align="right" class="tah11black" style="padding-left: 5px; padding-top: 4px; padding-right: 6px;" nowrap><strong>Comments:</strong></td>'+
						'<td align="center"><textarea id="msgs_'+MoverId+'_'+Id+'" name="feedback[comments]" rows="4" style="width: 362px; height: 65px;"></textarea></td>'+
						'<td class="tah12black" valign="top"><span style="position: absolute; color: #ff0000; margin: 0 0 0 0;">*</span></td>'+
					'</tr>'+
					'</tbody></table>'+
				'</td>'+
			'</tr>'+
			'<tr>'+
				'<td class="tah11red" style="padding-left: 16px;" id="error_box_'+MoverId+'_'+Id+'"></td>'+
				'<td class="tah11black" align="right" style="padding-right: 15px;">limit of <span id="counter_chars_'+MoverId+'_'+Id+'">'+maxChars+'</span> characters</td>'+
			'</tr>'+
			'<tr>'+
				'<td class="tah11black" colspan="2" align="left" style="padding-left: 15px; padding-right: 15px; padding-bottom: 5px;">'+
					'<table border="0" cellpadding="0" cellspacing="0"><tbody>'+
					'<tr>'+
						'<td style="background:url(/images/button/left.png) no-repeat 0 2px;"><img src="/images/spacer.gif" width="6">'+
						'</td><td width="auto"><input id="send_button_'+MoverId+'_'+Id+'" type="submit" class="button-yellow-static" onclick="SendFeedBackNow(\''+MoverId+'\', \''+Id+'\'); return false;" value="LEAVE&nbsp;FEEDBACK">'+
						'</td><td style="background:url(/images/button/right.png) no-repeat 0 2px;"><img src="/images/spacer.gif" width="6">'+
						'</td>'+
					'</tr>'+
					'</tbody></table>'+
				'</td>'+
			'</tr>'+
			'</tbody></table>';
}

function OpenBoxA(MoverId, Id, objActive, leftContent, rightContent, cls, bgcolor)
{
	var button_del = false;
	if (document.getElementById('_parent_mover_box_' + MoverId + '_' + Id))
	{
		if(!document.getElementById("right_panel_box_" + MoverId + '_' + Id)){
			button_del = true;
		}
		document.getElementById('_parent_mover_box_' + MoverId + '_' + Id).removeNode(true);
	}

	var moversTbodyTable = document.getElementById('Table_moversRowName_' + MoverId + '_' + Id);

	if (typeof bgcolor == "undefined")
	{
		bgcolor = "#F0F0F0";
	}

	var tr = document.createElement("TR");
	tr.id = '_parent_mover_box_' + MoverId + '_' + Id;

	var td = document.createElement("TD");
	td.id = "left_panel_box_" + MoverId + '_' + Id;
	td.width = "324px";
	td.style.paddingTop = "7px";
	td.style.paddingBottom = "7px";
	td.colSpan = "2";
	td.bgColor = bgcolor;
	td.align = "center";
	td.verticalAlign = "top";
	td.innerHTML = leftContent;
	tr.appendChild(td);

	var td = document.createElement("TD");
	td.id = "right_panel_box_" + MoverId + '_' + Id;
	td.width = "473px";
	td.style.paddingTop = "7px";
	td.style.paddingBottom = "7px";
	td.colSpan = "2";
	td.bgColor = bgcolor;
	td.align = "center";
	td.verticalAlign = "top";
	td.innerHTML = rightContent;
	tr.appendChild(td);

	document.getElementById('tBodyTableTag').insertBefore(tr, moversTbodyTable);
	Move_Up_ChildA(moversTbodyTable);

	if (cls){
		NobjActive = (objActive + MoverId + '_' + Id);

		var oldClassName = document.getElementById(NobjActive).className;

		if (document.getElementById('feedback_button' + MoverId + '_' + Id)){
			if (button_del){
				clearClass(document.getElementById('feedback_button' + MoverId + '_' + Id),'active','styledbutton');
				document.getElementById('feedback_button' + MoverId + '_' + Id).removeNode(true);
			} else {
				clearClass(document.getElementById('feedback_button' + MoverId + '_' + Id),'active','styledbutton');
				document.getElementById('feedback_button' + MoverId + '_' + Id).innerHTML = '<img src="/images/space.gif" alt="" class="left">Leave feedback<img src="/images/space.gif" alt="" class="right">';
			}
		}

		if ((!document.getElementById(NobjActive))||(document.getElementById(NobjActive).className !== oldClassName))
		{
			document.getElementById('_parent_mover_box_' + MoverId + '_' + Id).removeNode(true);
		} else {
			addClass(document.getElementById(NobjActive),'active','styledbutton');
			document.getElementById(NobjActive).innerHTML = '<img src="/images/space.gif" alt="" class="left">Close<img src="/images/space.gif" alt="" class="right">';
		}
	}
}

var obj_id = '';
var tm_all_box_a = null;
function closeObj()
{
	if (document.getElementById(obj_id))
	{
		document.getElementById(obj_id).style.display = 'none';
	}
	tm_all_box_a = null;
}

function opencloseBoxes(e, id, tp)
{
	if (versionA >= 5.5) {
		if (document.activeElement.tagName == "INPUT")
		{
			var ob = document.activeElement;
		}
	}

	if (typeof tp == "undefined")
	{
		var auto = true;
	} else {
		var auto = false;
	}

	var obj = document.getElementById(id);
	if (((obj.style.display == 'none')&&(auto))||((!auto)&&(tp)))
	{
		document.getElementById('help_box').style.display = 'none';
		if (document.getElementById('login_box')) document.getElementById('login_box').style.display = 'none';
		for(var i=0; i < 4; i++)
		{
			obj.style.display = 'block';
			w = obj.offsetWidth - e.offsetWidth;
			obj.style.marginLeft = '-' + w + 'px';
		}
		if (tm_all_box_a != null){
			clearTimeout(tm_all_box_a);
			tm_all_box_a = null;
		}
	} else {
		if (!auto)
		{
			tm_all_box_a = setTimeout(closeObj, 3000);
			obj_id = id;
		} else {
			if (tm_all_box_a != null){
				clearTimeout(tm_all_box_a);
				tm_all_box_a = null;
			}
			obj.style.display = 'none';
		}
	}

	if (versionA >= 5.5) {
		if ((ob)&&(obj.style.display == 'block')) ob.focus();
	}
}
