var notifyList = [];

function NotifyList(floorPlanId) {
	if(notifyList.length == 0){
		notifyList.push(floorPlanId);
	}
	else{
		var add = 1;
		for(var i=0; i<notifyList.length; i++){
			if(notifyList[i] == floorPlanId){
				notifyList[i]=null;
				add = 0;
			}
		}
		if(add == 1){
			notifyList.push(floorPlanId);
		}
	}
}
	
function goToNotification(propertyID, localeID){
	var notify=null;
	var form = document.NotificationForm;
	for(var i=0; i<notifyList.length; i++){
		if(notify == null){
			notify = notifyList[i];
		}
		else{
			notify = notify + "," + notifyList[i];
		}
	}
	form.pid.value=propertyID;
	form.lid.value=localeID;
	form.fids.value=notify;
	form.submit();
}

function goToFloorplanError(ec1){
	var form = document.ErrorForm;	
	form.pid.value=document.getElementById('pid').value;
	form.lid.value=document.getElementById('lid').value;
	form.er.value=ec1;
	form.submit();
}

function getContextualHelpBubble(helptext){
	        var bubble = $('<div class="help-bubble"><div class="top"></div><p>' + helptext + '</p><div class="bottom"></div></div>');
            $('body').append(bubble);    
            $('.sort a.help-icon').hover(
                function () {
                    var offset =  $(this).offset();
                    
                    var top = offset.top + 11;
                    var left = offset.left - 73;
    
                    bubble.css('top', top + 'px'); 
                    bubble.css('left', left + 'px'); 
                    bubble.css('display', 'block');
                },
                function () {
                    bubble.css('display', 'none');
                }
            )
}

function checkPIDClientSide(propertyId){
	var reqPid = document.getElementById('pid').value;
	if(propertyId != reqPid)
	{
		window.location.reload();
	}
}