Greasy Fork is available in English.

WME UR Comments (Stable)

This script is for replying to user requests the goal is to speed up and simplify the process. Thanks to Chat Jumper and URO+!

Från och med 2015-01-01. Se den senaste versionen.

// ==UserScript==
// @name           WME UR Comments (Stable)
// @description    This script is for replying to user requests the goal is to speed up and simplify the process. Thanks to Chat Jumper and URO+!
// @namespace      RickZabel@gmail.com
// @grant          none
// @grant          GM_info
// @version        0.8.6
// @match          https://editor-beta.waze.com/*editor/*
// @match          https://www.waze.com/*editor/*
// @author         Rick Zabel '2014
// @license        MIT/BSD/X11
// @icon			data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNT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HJ+7WLu7u22IitaBn94eRT1cugxg/CXKl8/vMEbOF/d8tIBxfIIaivvI7du3/zInJ2d2XV1dzcqVKz+EZDlb4tPzHrw3YryZQXNihN0y8yIw1xAREWE8d+5cv7o8EmhpSkqKHGWPH0Cr+XiMz4TZk3Apxh6tHziYx+J3KNYSCA+xaOfOnVeqq6ubQUuH941o7NYYlJULC4w14Z0ehtyLe37XY8SFOtD6HWa7d1newEVwkcuqwODQs5T5k4EvepY+PxMgMTkWwc9l4Gtfv379ebwX0QS89+HzE/Qc7fhs28qVCcYL/LUAcy0Od65QCJj7g3xmtrPBREVFOXJrMOdi1wYAnLbKISHWbWbOC+vg+XzPjZUV4/mrq5V7bpC2o7jghnszABv4EJH9NPhY+w9fHhl0dna2FQQNXE1gK01wdQpIhMexWjgAcyXt7LmxivEnGTvXmUyDF8D3zm13nCszcNZrVhN4HRaC2Z37G5X36P/YjtJLCA0NlfIRA38UQi+BtCT8Ycj5hVUy/NhAcIFgb8H3SqVSZCH4+fmJ7DmgguLjiIhDvwmyG+SyTALmHvtYLNIOcHaei5S0H5X9UYPL/wQYAOwQASZqvrLnAAAAAElFTkSuQmCC
// ==/UserScript==
//URO+ in order for the URO pop up not to be over the ur pin change the URO+ script find all 4 uroPopupX = markerXY.x + popupXOffset; and change it to uroPopupX = markerXY.x + popupXOffset + 40;
//to make this script find open URs faster change the number 1000 to something smaller this is in milliseconds 1000 = 1 second
//line 892 it looks like this setTimeout(URComments.LookForOpenedUR, 1000);  // 1 second search
//line 892 it looks like this setTimeout(URComments.LookForOpenedUR, 500);   // .5 second search
var URCommentVersion = "0.8.6";
var URCommentUpdateMessage = "yes"; // yes alert the user, no has a silent update.

/* Changelog
The change log has been moved to https://docs.google.com/spreadsheets/d/1PM4bOYGJxL82E4th2yy87ZzQKpMDF4N1dcKZ2evXc5o/edit?usp=sharing
This sheet will now be used to also track editor requests, to add a request please pm me on waze at rickzabel  
*/

var URCommentVersionUpdateNotes = "UR Comments has been updated to " + URCommentVersion + " please read the change log!";
URCommentVersionUpdateNotes = URCommentVersionUpdateNotes + "\n" + "There is a new comment list built into the script please switch to the list named \"Comments Team\"";
URCommentVersionUpdateNotes = URCommentVersionUpdateNotes + "\n" + "Fixed the URO presets to work with the new version of URO.";
URCommentVersionUpdateNotes = URCommentVersionUpdateNotes + "\n" + "Changed the opacity of the non-selected pins, from .3 to .7, ";
URCommentVersionUpdateNotes = URCommentVersionUpdateNotes + "\n" + "Added text replacement to swap out $URD for the requesters original description. example of this working is in the comment \"Include Users Description\"";
URCommentVersionUpdateNotes = URCommentVersionUpdateNotes + "\n" + "As usual let me know if there are any issues - RickZabel";

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////
////// Define items that need to be at the root level so they can be used inside functions
//////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//use this for counting how many times we waited for waze to finish a task.. 
//currently used to write to the console so the code is easier to debug
//in the future we might do actions if we waited to long
var PauseCount = "1";

//these are the names of the comments lists built into the script and will show up in the comment list drop down
var BoilerPlateCreatorsArray = ["CommentTeam",
	"Custom",
	//"Czech" //maintained by Zirland zirland&gmail.com
	"Dutch" //maintained by moweez moweeznh&gmail.com
	//"Spanish" //maintained by carloslaso carloslaso&gmail.com
	//"Brazilian-Portuguese" //maintained Murilo-Carvalho mcarvalho79&gmail.com
];

//get the SelectedBoilerPlateCreator
var SelectedBoilerPlateCreator = localStorage.getItem('BoilerPlateCreators');

//if the comment list hasn't been chosen default to the CommentTeam's list
if (SelectedBoilerPlateCreator === "" || SelectedBoilerPlateCreator === null || SelectedBoilerPlateCreator === "rickzabel") {
    SelectedBoilerPlateCreator = "CommentTeam";
    localStorage.setItem('BoilerPlateCreators', SelectedBoilerPlateCreator);
}

//array that holds the comments
var URCommentsArray = [];
//the var that holds the reply instruction
var ReplyInstructions = "";


//these are the holders for the position in the comments list that the reminder and close messages are at
var ReminderPosistion = "";
var CloseNotIdentifiedPosistion = "";

//default waze message array
var def_names = [];

//used to keep track of how many times a beta tester clicked a comment
var BetaaTestersCheckCount = 0;
//waze swaps out the close button on the UR window after you click send. we use this to grab the close and compare to the new one
var CloseButtonHolder = "";
//since we are scanning for open ur i need to keep taack of the current urID so the comments can be overridden
var UrCommentLasturID = "";

//this is used to hold the info about the previous tab, before we auto switched tabs
var PreviousTab = null;

//used to track if we are switching languages
var ChangeLanguage = false;

var UrCommentsIcon  ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQyQjZDNjdEODYzODExRTRBRDY0Q0I2QjA1MjU4N0EyIiB4bXBNTTpEb2N1bWVudElEPSJ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0y8yIw1xAREWE8d+5cv7o8EmhpSkqKHGWPH0Cr+XiMz4TZk3Apxh6tHziYx+J3KNYSCA+xaOfOnVeqq6ubQUuH941o7NYYlJULC4w14Z0ehtyLe37XY8SFOtD6HWa7d1newEVwkcuqwODQs5T5k4EvepY+PxMgMTkWwc9l4Gtfv379ebwX0QS89+HzE/Qc7fhs28qVCcYL/LUAcy0Od65QCJj7g3xmtrPBREVFOXJrMOdi1wYAnLbKISHWbWbOC+vg+XzPjZUV4/mrq5V7bpC2o7jghnszABv4EJH9NPhY+w9fHhl0dna2FQQNXE1gK01wdQpIhMexWjgAcyXt7LmxivEnGTvXmUyDF8D3zm13nCszcNZrVhN4HRaC2Z37G5X36P/YjtJLCA0NlfIRA38UQi+BtCT8Ycj5hVUy/NhAcIFgb8H3SqVSZCH4+fmJ7DmgguLjiIhDvwmyG+SyTALmHvtYLNIOcHaei5S0H5X9UYPL/wQYAOwQASZqvrLnAAAAAElFTkSuQmCC";

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////
////// bootstrap 
//////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//now we use this to load the arrays, but we wait till the me tab loads, this gives the custom comments file a chance to also load
function URComments_bootstrap() {
	
		//get the SelectedBoilerPlateCreator
		var SelectedBoilerPlateCreator = localStorage.getItem('BoilerPlateCreators');

        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // these is the array used to store the ur comments
        // comment arrays should follow the format
        // "Title",     * is what will show up in the ur comment tab
        // "comment",   * is the comment that will be sent to the user currently 
        // "URStatus"   * this is action to take when the option "Auto Click Open, Solved, Not Identified" is on.
        //					after clicking send it will click one of those choices. usage is. "Open", or "Solved",or "NotIdentified",
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////

        if (SelectedBoilerPlateCreator === "CommentTeam") {

            //CommentTeam's list
            URCommentsArray = [
                "Errors with no text",
                //"Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!",  //karlcr9911 12/7/14 //rickzabel 12/7/14 //t0cableguy 12/7/14
                "Volunteer responding, Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!", //rickzabel 12/8/14
                "Open",

                "4 day Follow-Up", //do not change (rickzabel)
                "Just a reminder: We have not received a response on your report. If we don't hear back from you soon we will infer everything is okay and close the report. Thanks!",
                "Open", //karlcr9911 12/7/14  //this has been getting me the most responses, but it probably is the special link i am including with the UR layer enabled rickzabel 12/7/14 t0cableguy 12/8/14

                "7th day With No Response",
                "The problem was unclear and volunteers didn't receive a response so we are closing this report. As you travel, please feel welcome to report any map issues you encounter. Thanks!",
                "NotIdentified", //karlcr9911 12/7/14 //rickzabel 12/7/14 t0cableguy 12/8/14
               
			   "Bad GPS",
                "Volunteer responding, It appears that your device was having GPS trouble. GPS signals do not travel through vehicles or tall buildings. Please make sure your device is somewhere with a clear view of the sky.",
                "NotIdentified",
				
				"Valid Route",
                //"We reviewed the issue and did not find any map errors. It looks like Waze provided a valid route. If you feel yours is correct, keep driving that way. If it is indeed faster, Waze will learn from your drives and route you and others the faster route. Thanks!", //karlcr9911 12/7/14  
                //"We reviewed the issue and did not find any map errors. It looks like Waze provided you with a valid route. If you feel yours is correct, keep driving that way. If it is indeed faster, Waze will learn from your drives and route you and others the faster route. Thanks!", //added "you with" rickzabel 12/7/14
                //"We reviewed the issue and did not find any map errors. It looks like Waze provided you with a valid route. Try the Waze suggested route a few times, it may turn out to actually be faster, if not you'll be teaching Waze that that route is slower, and your route will become preferred " //Pesach 12/8/14
                "Volunteer responding, We reviewed the issue and did not find any map errors. It looks like Waze provided you with a valid route. Try the Waze suggested route a few times, it may turn out to actually be faster, if not you'll be teaching Waze that that route is slower, and the faster route will become preferred.", //rickzabel 12/8/14, karlcr9911 12/8/14
                "NotIdentified",
				"Detours / Odd-Routing",
                //"We can't find anything in the map to explain route Waze gave you. Waze wants to save you time every way it can and sometimes it suggests complex detours just to shave a few seconds off your trip. Waze may recommend a detour even after the traffic has cleared up because: it doesn't know yet, other Wazers may have reported a temporary street closure, or daily traffic patterns. In any event, we are very sorry to say that the volunteer map editors can't be much help here. Thanks!",
                //"We can't find anything on the map to explain route Waze gave you. Waze tries to save you time and sometimes suggests complex detours just to shave a few seconds off your trip. We are very sorry to say that the volunteer map editors can not be much help here. Thanks!", //rickzabel 12/7/14
                //"We can't find anything on the map to explain the route Waze gave you. Waze will route complex detours to save a few seconds. We are very sorry to say that map editors can not be helpful in this situation. Thanks!", //t0cableguy 12/7/14 //rickzabel 12/7/14 //karlcr9911 12/8/14
                "Volunteer responding, We can't find anything on the map to explain the route Waze gave you. Waze will route complex detours to save a few seconds. We are very sorry to say that map editors can not be helpful in this situation. Thanks!", //rickzabel 12/11/14
                "NotIdentified",
				
				"Overall Waze complaint",
				"Volunteer responding, You can help make Waze better by reporting problems as you find them. Please include as many details as possible? Thanks!",
				"NotIdentified", //rickzabel Pesach 12/22/14

				"Report to local municipality",
				"Volunteer responding, We are only able to help with map issues, this should be reported to the local municipality. Please feel welcome to report any map issues you encounter. Thanks!",
				"NotIdentified", //rickzabel Pesach 12/22/14

				"No user transponder (avoid tolls)",
				"Volunteer responding, Waze is about getting you to your destination the fastest; however, it does not know if you have a toll transponder. Therefore, if you prefer to not have toll routes suggested, there is a feature under Settings > Navigation to avoid toll roads. Thanks!",
				"NotIdentified", //rickzabel Pesach 12/22/14

				"No user transponder",
				"Volunteer responding, Waze is about getting to your destination the fastest; however, it does not know if you have a toll transponder. As you travel, please feel welcome to report any map issues you encounter. Thanks!",
				"NotIdentified", //rickzabel Pesach 12/22/14
				
				"Not Using HOV",
                //"The map is setup correctly to support the HOV lane here. However the Waze Client App doesn't yet have the ability to know if you are in an HOV vehicle, it therefore assumes you do not meet the HOV criteria, and will only route you on roads open to all private vehicles.\nIf you are a qualified HOV vehicle and want to use the HOV lane, driving into the HOV should force Waze to recalculate your route. Once Waze realizes you are in the HOV lane, it should calculate the best route to your destination allowing you to stay in the HOV lane. If you have other questions or issues, please reply here, or send a new report at the location of the issue.\nThank you, and Happy Wazing", //peash 12/14/14

                "Waze does not have the ability to know you meet the HOV criteria. Driving into the HOV lane should force Waze to recalculate your route. Afterwards you should be allowed to stay in the HOV lane. Thanks!", //rickzabel 12/14/14
                "NotIdentified",
				
				"U-turns",
				"Volunteer responding, Currently Waze will not tell you to make a \"U-turn\". It will route you in several left/right turns to effectively create a U-turn. This is a programming issue that cannot be changed by the volunteer map editors, but we understand that Waze is working on a fix. Thanks!",
				"NotIdentified", //rickzabel Pesach 12/22/14
				
				"Traffic - Stale Information",
                //"Volunteer map editors can't do anything about Waze's traffic reporting. Waze relies on data from people using Waze to assess traffic. In the case of a fresh accident or slowdown, Waze may not yet have any data on the situation. Once Waze has detected a traffic situation, it can remember it for awhile, sometimes long after the situation changes.",
                "Waze relies on data from people using Waze to assess traffic. The volunteer map editors cannot edit conditions reported through the Waze app. In the case of a recent accident or slowdown, Waze may not have any data for this situation. Once Waze has detected a traffic situation it might remember it for a period of time after the situation cleared up.", // reworded - rickzabel 12/7/2014, karlcr9911 12/8/14
                "NotIdentified",

                "Traffic - Jams",
                //"To report traffic jam conditions, please use the Report -> Traffic Jam options in the Waze app. This will tell Waze about the problem in real-time. Traffic Jam reports can help route you and other Wazers around traffic problems.",
                "To report a traffic jams please use the Waze app by clicking the pin in the lower right and then clicking Traffic Jam. Traffic Jam reports can help route you and other Wazers around traffic problems in real-time. Thanks!", // reworded - rickzabel 12/7/2014, karlcr9911 12/8/14
                "NotIdentified",

                "Signal Avoidance Bug",
                //"I do not see any issues with the current turn restrictions in the area. This appears to be part of the known signal avoidance bug. Waze's developers are working on a fix for the issue but currently we do not have an ETA. Please feel free to take the turn until the issue is resolved. Thanks!",  // remove - rickzabel 12/7/2014  // added - rickzabel 12/7/2014
                //"There are no issues with the intersection’s turn restrictions. Waze's developers are working on a fix for this issue but we do not have an ETA. Please feel free use the signaled turn until the issue is resolved. Thanks!", // t0cableguy 12/7/14 
                "There are no issues with the intersection’s turn restrictions. Waze's developers are working on a fix for this issue but we do not have an ETA. Please feel free to use the turn until the issue is resolved. Thanks!", // rickzabel 12/9/14 
                "NotIdentified",
				
				"Already included restrictions",
				"This restriction is already included in the map, Waze should not route through this illegal turn. If Waze ever gives you a route through a restricted turn, please send another Map Issue report at that time. Thanks!",
				"NotIdentified",  //rickzabel Pesach 12/27/14
				
				"Temporary road blockage",
				"Volunteer responding, if the road is completely blocked use the Report > Closure feature for you and others to be rerouted around it, otherwise please use Report > Traffic. At a minimum Waze is learning that that route is slower, and a faster route will become preferred.",
				"NotIdentified", //rickzabel Pesach 12/22/14

                "Temporary Road Closure",
                //"How long is the road going to be closed? For closures of only a few days, we volunteer map editors can't be much help. It takes at least that long for our edits to make it to devices! When you encounter short-term road closures in the future, please use the Report->Closure feature in the Waze app. If this is a long-term closure please respond and let us know as much as you can. Thanks!",
                "Do you know how long the road is going to be closed? For closures that last only a few days, the volunteer map editors cannot be much help. It takes at least that long for our edits to make it to the live map! When you encounter short-term road closures in the future, please use the Report > Closure feature built into the Waze app. If this is a long-term closure please respond and let us know as much as you can. Thanks!", // reworded - rickzabel 12/7/2014, karlcr9911 12/8/14
                "Open",	
				
				"Closure clean-up",
				"Due to daily changing closures we are closing out the old requests to concentrate on the newest ones. For closures that last only a few days, the volunteer map editors cannot be much help. It takes at least that long for our edits to make it to the live map! When you encounter short-term road closures in the future, please use the Report > Closure feature built into the Waze app. Thanks!",
				"NotIdentified",

				"Thanks for the reply",
                "Thank you for the reply! This request will be closed. As you travel, please feel welcome to report any map issues you encounter.",
                "NotIdentified", //rickzabel 12/27/14			
				
				"No further communication",
                //"No further communication was received. This request will now be closed. As you travel, please feel welcome to report any map issues you encounter. Thanks!",  //rickzabel 12/7/14, karlcr9911 12/7/14 t0cableguy 12/8/14 // one sentence? rickzabel 12/7/14
                //"No further communication was received. This request will now be closed. As you travel, please feel welcome to report any map issues you encounter. Thanks!",

                "No further information was received and the request is being closed. As you travel, please feel welcome to report any map issues you encounter. Thanks!", //t0cableguy 12/8/14 //rickzabel 12/8/14 , karlcr9911 12/8/14
                "NotIdentified", // same comment different action based off ur status rickzabel 12/7/14, karlcr9911 12/7/14 // one sentence? rickzabel 12/7/14 t0cableguy 12/8/14

				"<br>",
                "",
                "",
				
                "No further communication",
                "No further information was received and the request is being closed. As you travel, please feel welcome to report any map issues you encounter. Thanks!",
                "Solved", //t0cableguy 12/8/14 //rickzabel 12/8/14 , karlcr9911 12/8/14

				"Fixed",
                "Thanks to your report we've found and fixed a problem with the map. The fix should reach handheld devices within a few days, but on rare occasions it can take closer to a week.",
                "Solved", //karlcr9911 12/7/14  //removed an extra space at the end - rickzabel 12/7/14 t0cableguy 12/8/14

				"Address Adjustments",
				"Thanks! The address has been adjusted. This should reach handheld devices within a few days, but on rare occasions it can take closer to a week.",
				"Solved",				
                "Address fishing",
                //"Waze does not tell us your starting or ending destinations. Would you tell us the address you are having problems with as you entered it into Waze? Thanks!"
                //"Waze does not tell us your starting or ending destinations. Would you please tell us the destination name and address you are having problems with? Thanks!", //t0cableguy 12/7/14, karlcr9911 12/7/14 
                //"Waze does not tell us your starting or ending destinations. Would you please tell us the destination name and address you are having problems with? Thanks!",
                //this is going to be the message we voted on above! rickzabel 12/8/14
                "Waze does not tell us your starting or ending destinations. Would you tell us your destination as you entered it into Waze? Thanks!", //rickzabel i use this one after i sent a message with Volunteer responding 1
                "Open",

                "Problem appears corrected",
                "Just a reminder: The problem appears to be corrected. Please let us know if you are continuing to have the issue. If we do not hear from you in a few days we will close this report. Thanks!",
                "Open", //karlcr9911 12/7/14 t0cableguy 12/8/14 //rickzabel 12/8/14
 
				"Clears comment & sets UR status to Open",
                "",
                "Open",
				
				"Include Users Description",
				"Volunteer responding, You reported \"$URD\" and Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!",
                "Open",
				
				"Wrong Street Name",
				"Volunteer responding, Waze did not send us enough information to fix your request. Would you please let us know which street name you think is wrong and what it should be? Thanks",
				"Open", //rickzabel Pesach 12/22/14
				


				"<br>",
                "",
                "",

                //Default URs  6 through 22 are all the different types of UR that a user can submit do not change them thanks
                "Incorrect turn", //6
                //"Would you please let us know what turn you are having a problem with? Thanks!",
                //"Volunteer responding to your report: Would you please let us know what turn you are having a problem with? Would you tell us your destination as you entered it into Waze? Thanks!",//rickzabel 12/7/14, karlcr9911 12/8/14
                "Volunteer responding, Would you please let us know what turn you are having a problem with? Would you tell us your destination as you entered it into Waze? Thanks!", //rickzabel 12/9/14
                "Open",

                "Incorrect address", //7
                //"Waze did not send us enough information to fix your request. In order for us to help you we need to know a couple of things; What is the address as you entered it into Waze and what was the problem you were having with this address?",
                //"Volunteer responding to your report: Waze did not send us enough information to fix your request. Would you tell us your destination as you entered it into Waze? What is the problem you are having with this address? Thanks!", //rickzabel 12/8/14, karlcr9911 12/8/14
                "Volunteer responding, Waze did not send us enough information to fix your request. Would you tell us your destination as you entered it into Waze? What is the problem you are having with this address? Thanks!", //rickzabel 12/8/14
                "Open",

                "Incorrect route", //8
                //"Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!",
                //"Volunteer responding to your report: Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!", // karlcr9911  12/8/14
                "Volunteer responding, Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!", //rickzabel 12/9/14
                "Open",

                /*
                "Missing roundabout", //9
                "Volunteer responding,",
                "Open",
                */

                "General error", //10
                //"Waze did not send us enough information to fix your request. Would you please let us know what went wrong? Would you tell us your destination as you entered it into Waze? Thanks!",
                "Volunteer responding, Waze did not send us enough information to fix your request. Would you please let us know what went wrong? Would you tell us your destination as you entered it into Waze? Thanks!", //rickzabel 12/9/14
                "Open",

                "Turn not allowed", //11
                //"Would you please let us know what turn was not, or should not be, allowed and the street names at the intersection? Thanks!",
                "Volunteer responding, Would you please let us know what turn was not, or should not be, allowed and the street names at the intersection? Thanks!", //rickzabel 12/9/14
                "Open",

                "Incorrect junction", //12
                //"Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!",
                "Volunteer responding, Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!", //rickzabel 12/9/14
                "Open",

                "Missing bridge overpass", //13
                //"Would you please let us know what overpass you believe is missing? When moving at highway speeds, Waze deliberately chooses not to display some nearby features to avoid cluttering the screen. Would you tell us as much as possible about the missing overpass. Thanks!",
                "Volunteer responding, Would you please let us know what overpass you believe is missing? When moving at highway speeds, Waze deliberately chooses not to display some nearby features to avoid cluttering the screen. Would you tell us as much as possible about the missing overpass. Thanks!", //rickzabel 12/9/14
                "Open",

                "Wrong driving direction", //14
                //"Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!",
                "Volunteer responding, Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!", //rickzabel 12/9/14
                "Open",
				

                "Missing Exit", //15
                //"Waze did not send us enough information to fix your request. Would you please let us know as much as possible about the missing exit? Thanks!",

                "Volunteer responding, Waze did not send us enough information to fix your request. Would you please let us know as much as possible about the missing exit? Thanks!", //rickzabel 12/9/14
                "Open",

                "Missing Road", //16
                //"Would you tell us as much as possible about the road you believe is missing? Thanks!",
                "Volunteer responding, Would you tell us as much as possible about the road you believe is missing? Thanks!", //rickzabel 12/9/14
                "Open",

                /*
                "Missing Landmark", //18
                "Volunteer responding,",
                "Open",

                "Blocked Road", //19
                "Volunteer responding,",
                "Open",

                "Missing Street Name", //21
                "Volunteer responding,",
                "Open",

                "Incorrect Street Prefix or Suffix", ///22
                "Volunteer responding,",
                "Open",


                */

                "<br>",
                "",
                "",
                //End of Default URs  

                "User Followed Waze's route",
                //"It appears that you ended up going the route Waze suggested, what was the problem you were having? Would you tell us your destination as you entered it into Waze? Thanks!",
                //"It appears that you followed the Waze-suggested route. What problem did you encounter here? Would you tell us your destination as you entered it into Waze? Thanks!",  //karlcr9911 12/7/2014
                "Volunteer responding, It appears that you followed the route Waze suggested. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!", //reworded rickzabel 12/7/2014
                "Open",

                "Alley Interference",
                //"Waze doesn't tell volunteer editors where you were going, although it was probably adjacent to the alley. If you would, please supply your destination as you entered it into Waze it may be helpful in correcting the route. Thanks!",
                //"Waze does not let the volunteer editors know where you were going, although it was probably adjacent to the alley. If you would, please supply your destination as you entered it into Waze, it may be helpful in correcting the route. Thanks!", //rickzabel 12/7/14
                "Volunteer responding, Waze does not let the us know where you were going, although it was probably adjacent to the alley. Would you tell us your destination as you entered it into Waze? Thanks!", //rickzabel 12/9/14
                "Open",

                "Road Closed",
                //"Would you please let us know the following; What road is closed?; between which intersections is this road closed; Do you know how long this road is scheduled to be closed? Thanks!", //karlcr9911
                "Volunteer responding, Would you please let us know the following; What road is closed?; between which intersections is this road closed; Do you know how long this road is scheduled to be closed? Thanks!", //rickzabel 12/9/14
                "Open",

                "Area Entrances",
                "We have had problems with Google pins being placed in the center of large landmarks. Delete your previous search and do a new search for the location. Go to the bottom of the auto fill list to see more results and make sure you pick the Waze search engine. ",
                "Open",

                "48 Hour Reply",
                //"Please allow 48 hours for changes to be reflected in the live map.",
                "We made some changes to the map, please allow up to 48 hours for the changes to be reflected on the live map.", //rickzabel 12/7/14 //t0cableguy 12/8/14, karlcr9911 12/8/14
                "Open",

                "Clear Saved Locations",
                //"You should remove the location from your favorites and recent searches and then re-search for the location to update the result.",
                //"To get an updated result you should remove the location from your favorites and recent searches and then re-search for the location.", //rickzabel 12/7/14
                "To get an updated result, remove the location from your navigation history and then search for the location again.", //t0cableguy 12/8/14, karlcr9911 12/8/14
                "Open",

                "Clear TTS Cache",
                //"If you continue to have this problem you will need to clear your Text-to-Speech cache. Go to the navigation screen and type cc@tts in search field and hit search. You should get a pop up message that the TTS file has been cleared. It will take a few days for the file to build back up with all the spoken street names.",
                //"Please clear your Text-to-Speech cache. In the navigate search box type cc@tts in the search field and press search. A message that the TTS file has been cleared should appear. It will take a few days for the file to download the spoken street names. Thanks!", //t0cableguy 12/8/2014, karlcr9911 12/8/14
                "Please clear your Text-to-Speech cache. In the navigate search box type cc@tts in the search field and press search. You will get a message that the TTS file has been cleared. It will take a few days for the the spoken street names to be downloaded. Thanks!", //rickzabel 12/9/14
                "Open",

                "Address - Incorrect Position",
                //"Thank you for your report. Would you please let us know what address you’re reporting the problem with? You can also use the Report -> Places feature in Waze to mark the location. It is helpful that after taking a picture, if you move near the location your are marking to save the place. Also, please do not submit pictures containing faces, license plates, or similar personal details. Thanks!", //i also prefer not to send messages with contractions "you’re" rickzabel 12/7/14
                "What was the Address you had issues with? Please show us where the address you had issues is with the Report > Places feature in Waze. After taking a picture move as close to the entrance of the place you are adding before saving. Please do not submit images with personal details. Thanks!", //t0cableguy 12/7/14, karlcr9911 12/8/14
                "Open",

                "Address - Missing from Map",
                //"Thank you for your report. Would you please let us know where the address you're reporting is? The live map doesn't have all the street numbers for that street and Waze is interpolating in error. You can also use the Report -> Places feature in Waze to mark the location. It is helpful that after taking a picture, if you move near the location you’re marking to save the place. Also, please do not submit pictures containing faces, license plates, or similar personal details. Thanks!", //rickzabel 12/7/14 
                "Volunteer responding,  Would you let us know the address that is missing? The live map does not have all the street numbers. You can also use the Report Places feature in Waze to mark the location. It is helpful that after taking a picture that you move near the location you’re marking to save the place. Also, please do not submit pictures containing faces, license plates, or personal details. Thanks!", //rickzabel 12/9/14 
                "Open",

                "Address - Bad Results",
                //"Thank you for your report. The search feature retrieves results from a number of locations, including Google. Scrolling to the bottom the Navigate screen, you'll see more results for 'name.' Select that and Waze will list locations Around You. From there, you can also select results from other search engines.",
                //"Search results in Waze are retrieved from numerous sources. After tapping search, Scroll to the bottom and you will see options for other search engines . Please try a different option as each one may provide better navigation", //t0cableguy 12/7/14, karlcr9911 12/8/14
                "Search results in Waze are retrieved from numerous sources. After tapping search, Scroll to the bottom and you will see options for other search engines . Please try a different option as another search engine might have the address you are looking for", //rickzabel 12/9/14
                "Open",

                "House Number Adjustment",
                //"I've forced Waze to re-register the house number for your destination. I believe this should correct your issue. Please allow 48 hours for changes to be reflected in the live map. If the location is in your saved searches or favorites, please remove them and search for them again to pick up the change in the live map. Please let me know if you continue to experience the problem. Thanks!",
                "I've forced Waze to re-register the house number for your destination. I believe this should correct your issue. Please allow up to 48 hours for changes to be reflected in the live map. If you have the location in your saved searches or favorites, please remove them and re-add the destination. Please let me know if you continue to experience this problem by submitting another error report. Thanks!", //rickzabel 12/7/14 //karlcr9911 12/8/14
                "Open",

                "Missing Bridges or Roads",
                //"The roads here have been pretty thoroughly mapped and we volunteers can't see anything missing that should ordinarily be there. Waze probably simply chose not to show you the feature in question. When moving at highway speeds, Waze deliberately chooses not to display some nearby features to avoid cluttering the screen. If you are certain a feature is missing from the map, please reply and tell us as much as possible about it. Thanks!",
                "The roads for this area are thoroughly mapped and the volunteer editors can not find anything missing from the map. When you are moving, Waze deliberately chooses not to display some nearby features to avoid cluttering the screen. If you are certain a feature is missing from the map, please reply and tell us as much as possible about it. Thanks!", //reworded rickzabel 12/7/14  //karlcr9911 12/8/14
                "Open",

                "Manual Refresh",
                //"You can try a manual refresh by going to Settings > Advanced > Data transfer > refresh maps.",
                //"Please try doing these options. Tap the Wazer icon > Settings > Advanced > Data transfer > Refresh Map Of My Area. Second you can try clearing Waze's app cache in your phone’s app manager. The final option is  to Uninstall and Reinstall the app.", //t0cableguy 12/7/14
                "Please try doing these options. Tap the Wazer icon > Settings > Advanced > Data transfer > Refresh Map Of My Area. Second, you can try clearing Waze's app cache in your phone’s app manager. The final option is to reset the app by going to the navigation screen and type ##@resetapp in search field and hit search.", // to Uninstall and Reinstall the app. (avoid user to use cellular data) //carloslaso 12/7/14 //rickzabel //t0cableguy
                "Open",

                "Pave Road",
                //"Please use the pave function in the app to show us the path of the missing road. You can do this by tapping the bottom right Pin icon, then Map Issue, and selecting the Pave Road tab. Once you leave any mapped roads you can tap start paving. Please be sure to tap the steamroller and tap stop paving before driving back onto any roads that are mapped. If paving a parking lot, please only drive the main roads and perimeters, not each aisle and space. Thanks for your contribution to the map! Thanks!", //requested by t0cableguy
                //"Please use the pave function in the app to show us the path of the missing road. You can do this by tapping the bottom right Pin icon, then Map Issue, and selecting the Pave Road tab. Once you leave any mapped roads you can tapp paving. Please be sure to tap the steamroller and tap stop paving before driving back onto any roads that are mapped. If paving a parking lot please only drive the main roads and perimeters, not each aisle and space. Thanks for your contribution to the map! Thanks!",//rickzabel
                //"Please pave the road in the app. Tap the Pin icon > Map Issue > Pave Road tab. After leaving any mapped roads tap start paving. Once done tap the steamroller > stop paving. Thanks for your contribution to the map!", //shortened and voted for by t0cableguy 12/7/14, karlcr9911 12/8/14
                //"Please pave the road in the app. Tap the Pin icon > Map Issue > Pave Road tab. After leaving any mapped roads tap start paving. Once done tap the steamroller > stop paving. If you then tap the  Pin icon (Report) > Map Issue > Missing Road, you can enter text providing information about the new road (name, is it a private road, etc.). Thanks for your contribution to the map!",//addition suggested by SuperDave1426 12/08/14
                //We already have open communication if we are telling them to pave a road. It would be helpful to drop ur pins but we have open communication and the users know how to submit reports. We shouldn’t close the UR that is already open, so we don’t need another UR.  t0cableguy 12/8/14 I’m leaning more torward adding this though SD as a teaching tool. t0cableguy 12/8/14
                "Volunteer responding, You can pave the road from the app by tapping the Pin icon > Map Issue > Pave Road tab. After leaving the paved road tap start paving. Once done tap the steamroller > stop paving. You can provide information about the new road such as it's name buy tapping on the Pin icon > Map Issue > Missing Road, and Thanks!", //rickzabel 12/8/14 t0cableguy 12/8/14
                "Open",

                "The road has been closed.",
                //"Thank you for your report, the road has been closed.",
                "Volunteer responding, Thank you for your report, the road has been closed.", //rickzabel 1211/14
                "Open", //requested by SkiDooGuy

                "The road has been closed.",
                //"Thank you for your report, the road has been closed.",
                "Volunteer responding, Thank you for your report, the road has been closed.", //rickzabel 1211/14
                "Open", //requested by SkiDooGuy

                //"Blank Screen.",
                //"Please follow these instructions in the app. Tap the Wazer icon > Settings > Advanced > Data transfer > Refresh map of my area. Second you can try clearing Waze's app cache in your phone’s app manager. The final option is  to Uninstall and Reinstall the app.",
                //"Open", //requested by t0cableguy 12/7/14 in map refresh now t0cableguy 12/8/14

                "Unlock request",
                //"I have requested the rights to get this issue fixed. Thanks for your report. Thanks! ", //requested by t0cableguy 12/8/14 
                //"Volunteer responding to your report: I have requested the rights to get this issue fixed. Thanks for your report.", //rikzabel 12/8/14  i usually dont say anything cause this is weird that they made a request for you to make a request…
                //"I have begun the process to get this issue fixed. Thanks for your report. Thanks! ",//reword t0cableguy 12/8/14
                "I have begun the process to get this issue fixed. Thanks for your report!", //rickzabel 12/11/14
                "Open"


            ];

            //auto insertion config:
            //the position in the list that the reminder message is at. (counting titles, comments, and ur status)
            ReminderPosistion = 3;

            //the position of the close as Not Identified message that you have in the list (the first comment is the list is 0)
            CloseNotIdentifiedPosistion = 6;

            //this is the text for the link when doing reminder messages
            ReplyInstructions = 'To reply to this request go to the following link and click the map pin, then click on the conversation button.';


            //Waze's default URs number to name conversion array
            //Thanks to SuperMedic

            def_names[6] = "Incorrect turn";
            def_names[7] = "Incorrect address";
            def_names[8] = "Incorrect route";
            def_names[9] = "Missing roundabout";
            def_names[10] = "General error";
            def_names[11] = "Turn not allowed";
            def_names[12] = "Incorrect junction";
            def_names[13] = "Missing bridge overpass";
            def_names[14] = "Wrong driving direction";
            def_names[15] = "Missing Exit";
            def_names[16] = "Missing Road";
            def_names[18] = "Missing Landmark";
            def_names[19] = "Blocked Road";
            def_names[21] = "Missing Street Name";
            def_names[22] = "Incorrect Street Prefix or Suffix";

            //end CommentTeam's list

			//custom other languages lists from external list
			// } else if (SelectedBoilerPlateCreator === "Custom") {
	   } else {
            var CustomListError = false;
            var CustomErrorListText = "";
            var CustomErrorListCount = 0;
            if (!eval("window.Urcomments" + SelectedBoilerPlateCreator + "Array2")) {
                CustomErrorListText = CustomErrorListText + "Urcomments" + SelectedBoilerPlateCreator + "Array2, ";
                CustomListError = true;
                CustomErrorListCount = CustomErrorListCount + 1;
            }

            if (!eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names")) {
                CustomErrorListText = CustomErrorListText + "Urcomments" + SelectedBoilerPlateCreator + "def_names, ";
                CustomListError = true;
                CustomErrorListCount = CustomErrorListCount + 1;
            }

            if (!eval("window.Urcomments" + SelectedBoilerPlateCreator + "ReplyInstructions")) {
                CustomErrorListText = CustomErrorListText + "Urcomments" + SelectedBoilerPlateCreator + "ReplyInstructions, ";
                CustomListError = true;
                CustomErrorListCount = CustomErrorListCount + 1;
            }

            if (!eval("window.Urcomments" + SelectedBoilerPlateCreator + "ReminderPosistion")) {
                CustomErrorListText = CustomErrorListText + "Urcomments" + SelectedBoilerPlateCreator + "ReminderPosistion, ";
                CustomListError = true;
                CustomErrorListCount = CustomErrorListCount + 1;
            }

            if (!eval("window.Urcomments" + SelectedBoilerPlateCreator + "CloseNotIdentifiedPosistion")) {
                CustomErrorListText = CustomErrorListText + "Urcomments" + SelectedBoilerPlateCreator + "CloseNotIdentifiedPosistion.";
                CustomListError = true;
                CustomErrorListCount = CustomErrorListCount + 1;
            }


            if (CustomListError === false) {

                //found custom list
                URCommentsArray = eval("window.Urcomments" + SelectedBoilerPlateCreator + "Array2");

                ReplyInstructions = eval("window.Urcomments" + SelectedBoilerPlateCreator + "ReplyInstructions");
                //the position in the list that the reminder message is at. (starting at 0 counting titles, comments, and ur status)
                ReminderPosistion = eval("window.Urcomments" + SelectedBoilerPlateCreator + "ReminderPosistion");

                //the position of the close as Not Identified message (starting at 0 counting titles, comments, and ur status)
                CloseNotIdentifiedPosistion = eval("window.Urcomments" + SelectedBoilerPlateCreator + "CloseNotIdentifiedPosistion");

                //copy the waze default titles into the active ?
                //Waze's default URs number to name conversion array
                //Thanks to SuperMedic

                def_names[6] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[6]"); //"Incorrect turn";
                def_names[7] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[7]"); //"Incorrect address";
                def_names[8] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[8]"); //"Incorrect route";
                def_names[9] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[9]"); //"Missing roundabout";
                def_names[10] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[10]"); //"General error";
                def_names[11] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[11]"); //"Turn not allowed";
                def_names[12] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[12]"); //"Incorrect junction";
                def_names[13] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[13]"); //"Missing bridge overpass";
                def_names[14] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[14]"); //"Wrong driving direction";
                def_names[15] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[15]"); //"Missing Exit";
                def_names[16] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[16]"); //"Missing Road";
                def_names[18] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[18]"); //"Missing Landmark";
                def_names[19] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[19]"); //"Blocked Road";
                def_names[21] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[21]"); //"Missing Street Name";
                def_names[22] = eval("window.Urcomments" + SelectedBoilerPlateCreator + "def_names[22]"); //"Incorrect Street Prefix or Suffix";	

            } else {

                if (CustomErrorListCount == 5) {
                    alert("UR Comments - You either have a older version of the custom comments file or a syntax error either will keep the custom list from loading. Missing: " + CustomErrorListText);
                } else {
                    alert("UR Comments - you are missing the following items from your custom comment list: " + CustomErrorListText);

                }

                URCommentsArray = [SelectedBoilerPlateCreator + " List can not be found you can find the list and instructions at https://wiki.waze.com/wiki/User:Rickzabel/UrComments/",
                    " ",
                    " "
                ];
                ReplyInstructions = 'To reply to this request go to the following link and click the map pin, then click on the conversation button.';
            }
        }
        URComments_init();
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////
    ////// init
    //////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////

function URComments_init() {
        console.log("URComments - Start init 1");

        //create the URComments object
        var URComments = {};

        URComments.init = function() {
		
			
			//if we are changing the language do not redraw the tab		
			if (ChangeLanguage === false) {
		
				//CSS
				//expand the UR textarea so we can verfiy what comment we clicked on. special thanks to SeekingSerenity 
				var g = '.ur-comment-list .comment-list { bottom: 200px !important; } .ur-comment-list .new-comment-form textarea { height: 140px !important; } .ur-comment-list .new-comment-form { height: 200px !important; }';

				//betaeditor commetn textarea
				g = g + '.new-comment-form .new-comment-text { height: 140px !important; }';

				//css for items in my tab that are in a label (uro presets)
				g = g + '#sidepanel-Comments label { cursor:pointer; margin:0px 0px 0px; vertical-align: middle;font-size: 10px;}';

				//css for checkboxes
				g = g + '#sidepanel-Comments .URCommentsCheckbox { text-decoration:none; cursor:pointer; color: #000000; margin:0px 0px 0px; vertical-align: middle; font-size: 12px;}';

				//css for our comments,
				g = g + '#sidepanel-Comments .URComments { text-decoration:none; cursor:pointer; color: #000000; font-size: 12px;}'; // margin-top: 5px;

				//css for our uro presets,
				g = g + '#sidepanel-Comments .URCommentsPresets { text-decoration:none; cursor:pointer; color: #000000; font-size: 10px;}';
				
				//css for our nav tabs,
				g = g + '#comments-tab22 ul { font-size: 12px; padding: 0px;}';
				
				//css for our nav tabs links,
				g = g + '#comments-tab22 a { padding: 3px !important ; margin-right: 0px !important;}';

				//css for non selected Ur opicaty
				g = g + ".olMap.problem-selected .map-problem:not(.selected) { opacity: .7 !important;}";
				
				//css to fix the beta editors UR window
				g = g + '.problem-edit .section .title { line-height: 15px;  }';
				g = g + '.problem-edit .header { line-height: 15px; padding: 0px 15px; }';
				g = g + '.problem-edit .section .content { padding: 5px; }';
				g = g + '.problem-edit { max-height: 85%; }';
				g = g + '.problem-edit .body { position: absolute; top: 30px; bottom: 5px; overflow: auto !important; width: 280px;}';
				g = g + '#panel-container .panel { left: 0px; top: 60px; bottom: 25px; margin-bottom: 15px;}';
				g = g + '.problem-edit .conversation.section .new-comment-form { padding: 10px 15px !important; }';
				g = g + '.problem-edit .conversation.section .new-comment-form textarea { placeholder: "Remember, be nice!"; margin-bottom: 5px; }';
				g = g + '.problem-edit .actions .controls-container label[for|="state"] { margin-bottom: 5px; }';
				g = g + '.header .close-panel { padding-top: 5px; }';
				g = g + '.header .focus { padding-top: 5px; }';
				g = g + '.problem-edit .conversation.section .comment-list { padding-right: 0px; margin-right: 5px; padding-left: 0px; margin-left: 5px; overflow-y: hidden; max-height: 100%;}';
				
				

				//append our css to the head
				$("head").append($('<style type="text/css">' + g + '</style>'));

				console.log("URComments - Start adding the URComments's tab");

				//add comments tab
				var b = $('<li><a href="#sidepanel-Comments" data-toggle="tab" id="CommentsTab">UrComments</a> </li> ');
				//i had to switch to first() becuase someone was reusing the nav tabs in another script and this would cause my tab to go inside theirs!
				$("h2 + ul.nav-tabs").first().append(b);


				//add the content to the comments tab
				//Comment tab header and zoom out button
				var c = "";
				c = c + '<div class="tab-pane" id="sidepanel-Comments" ><div class="URComments"></div></div>';
				$("h2 + ul.nav-tabs + .tab-content").append(c);
				
			}
			//reset the var to change the language
			ChangeLanguage = false;

			
			var c = "";
			c = c + '<div style="position: absolute; left: 20px;"><img src="' + UrCommentsIcon + '" style="cursor:default;"></div>';

			c = c + '<div style="position: absolute; left: 70px;"><b>UR Comments Version ' + URCommentVersion + '</b>';
			c = c + '<br>';
			c = c + '<a id="URCommentZoomOutButton" class="URComments" Title="Zooms all the way out and closes the UR window">Zoom Out 0 & Close UR</a>';
			c = c + '<br>';
			c = c + '<a id="URCommentZoomOutButton2" class="URComments" Title="Zooms out to level 2 this is where I found most of the toolbox highlighting works and closes the UR window">Zoom Out 2 & Close UR</a>';
			c = c + '<br>';
			c = c + '<a id="URCommentZoomOutButton3" class="URComments" Title="Zooms out to level 3 this is where I found most of the toolbox highlighting works and closes the UR window">Zoom Out 3 & Close UR</a>';
			c = c + '<div id="URCWazeReloadMap" title="Reload the map" data-original-title="" class="icon-repeat reload-button URComments" content="" style="font-size: 20px; position: absolute; left: 140px; top: 22px;"></div>';			
			//c = c + '</div>';
			
			//c = c + '</div>';
			
            //i had to switch to first() becuase someone was reusing the nav tabs in another script and this would cause my tab to go inside theirs
			
            $("#sidepanel-Comments").append(c);
			
			//add the map zoomout handlers
			//$("#URCommentZoomOutButton").click(URComments.SetZoomCloseUR(0, "CloseUR"));
            $("#URCommentZoomOutButton").click(URComments.SetZoomCloseUR(0, "CloseUR"));
			$("#URCommentZoomOutButton2").click(URComments.SetZoomCloseUR(2, "CloseUR"));
			$("#URCommentZoomOutButton3").click(URComments.SetZoomCloseUR(3, "CloseUR"));
			
			//add the map reload handler
			$("#URCWazeReloadMap").click(URComments.AutoReloadMapOnComment);

            c = '<div id="comments-tab22" class="active" style="padding-top: 75px;">';
            c = c + '	<ul class="nav nav-tabs">';
            c = c + '		<li class="active"><a data-toggle="tab" href="#sidepanel-URComments-list">Comments</a></li>';
            c = c + '		<li><a data-toggle="tab" href="#sidepanel-URComments-URO-Presets">URO Presets</a></li>';
            c = c + '		<li><a data-toggle="tab" href="#sidepanel-URComments-settings">Settings</a></li>';
            c = c + '	</ul>';
            c = c + '	<div class="tab-content">'; // style="padding: 10px 1px 1px 10px !important;"
            c = c + '		<div class="tab-pane active" id="sidepanel-URComments-list">';
            c = c + '		</div>';
            c = c + '		<div class="tab-pane" id="sidepanel-URComments-URO-Presets">';
            c = c + '		</div>';
            c = c + '		<div class="tab-pane" id="sidepanel-URComments-settings">';
            c = c + '		</div>';
            c = c + '	</div>';
            c = c + '</div>';

            //add the sub tabs to the scripts main tab
            $("#sidepanel-Comments").append(c);
			
			////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //////
            ////// Comments
            //////
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////
			

			
            //start generating the comment list and mouse click handlers
            console.log("URComments - Start adding comments to the comment tab");
            //comments setup
			d = "";

            //CurrentIndex is used to keep count of total arrays pairs which is used on the div's id tags
            var CurrentIndex = 1;
            console.log("URComments - Create Div 1");

            //setup the comment color var
            var colorrr = "CC0000";
            var Title = "";
            var URCommentURLNote = "";

            //go over the array and generate divs
            for (var i = 0; i < URCommentsArray.length; i = i + 3) {
                console.log("URComments - Create div for - " + URCommentsArray[i] + " " + URCommentsArray[i + 2]);

                // make the UrStatus lower case
                var URStatus = (URCommentsArray[i + 2]).toLowerCase();

                if (URStatus === "open") {
                    //black
                    colorrr = "#000000";
                } else if (URStatus === "solved") {
                    //green
                    colorrr = "#008F00";
                } else if (URStatus === "notidentified") {
                    //orange
                    colorrr = "#E68A00";
                } else {
                    //red - not defined and that is a problem	
                    colorrr = "#CC0000";

                }
                //escaping titles and comments with escapeHtml(Comment) so we can display items with special char as html;
                //generate the comment links

                Title = URCommentsArray[i];
                var Comment = URComments.escapeHtml(URCommentsArray[i + 1]);

                //normal comment link
                d = '<div><a id="URComments-comment' + CurrentIndex + '" class="URComments" style="color:' + colorrr + '" Title="Title: ' + Title + ' Action: ' + URStatus + '; Comment: ' + Comment + ' ">' + Title + '</a>';
                //$("#sidepanel-Comments").append(d);

                //(double click) comment add-on
                if (URCommentsArray[i] === URCommentsArray[CloseNotIdentifiedPosistion] && localStorage.getItem('DBLClk7DCAutoSend') == "yes" || localStorage.getItem('DBLClkAll') == "yes") {
                    if (URCommentsArray[i] !== "<br>") {
                        d = d + '<a id="URComments-commentDBLCLK' + CurrentIndex + '" class="URComments" style="color:' + colorrr + '" Title="Double click here to auto send - ' + Title + '"> (Double Click)</a>';
                    }
                }

                d = d + '</div>';

                //add comment to list
                $("#sidepanel-URComments-list").append(d);

                console.log("URComments - Create callback(s) for - " + 'URComments-comment' + CurrentIndex);

                urID = 0;

                //create the click function for each comment
                $("#URComments-comment" + CurrentIndex).click(URComments.AutoZoomIN(URCommentsArray[i], URCommentsArray[i + 1], URStatus, urID));

                //create the double click function for each comment
                if (URCommentsArray[i] !== "<br>" && URCommentsArray[i] === URCommentsArray[CloseNotIdentifiedPosistion] && localStorage.getItem('DBLClk7DCAutoSend') == "yes" || localStorage.getItem('DBLClkAll') == "yes") {
                    //use this to click send automatically
                    if (URCommentsArray[i] !== "<br>") {
                        $("#URComments-commentDBLCLK" + CurrentIndex).dblclick(URComments.AutoZoomIN(URCommentsArray[i], URCommentsArray[i + 1], URStatus, urID, "AutoSendComment"));
                    }

                }

                //inc the CurrentIndex
                CurrentIndex++;
            }

			//add 2 br to the end of the list for lower resolution monitors
			d = '<br><br>';
			$("#sidepanel-URComments-list").append(d);	

			

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //////
            ////// URO+ Preset filters
            //////
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////

            console.log("URComments - Start adding URO preset filters to the comment tab");
            //uro preset header
            // var d = $('<div title="This is a list of saved settings for URO+ that will help you find URs of a certian type."><b>URO+ Presets</b></div>');
            //$("#sidepanel-URComments-list").append(d);

			/*
            //test
            var d = $('<div><a id="URCommenttest" class="URCommentsPresets" Title="test">test</a></div>');
            //d.click (URCommentscomment1);
            $("#sidepanel-URComments-list").append(d);
            //create the callback function
            $("#URCommenttest").click(URComments.TagAllNoCommentURs('a'));
			*/
			
            //URO+ new ur with no description
            var d = $('<div><a id="URONewNoDescription" class="URCommentsPresets" Title="Use URO+ to only show new requests without descriptions">URO+ New UR without descriptions</a></div>');
            $("#sidepanel-URComments-URO-Presets").append(d);
            $("#URONewNoDescription").click(URComments.UROClearClicked('URONewNoDescription'));

            //URO+ new ur
            d = $('<div><a id="URCommentURONEW" class="URCommentsPresets" Title="Use URO+ to only show new requests or ones that have replies from the requestor">URO+ New requests / UR replies</a></div>');
            $("#sidepanel-URComments-URO-Presets").append(d);
            $("#URCommentURONEW").click(URComments.UROClearClicked('UroShowNew'));

            //show no responses for 4 days
            d = $('<div><a id="URCommentURO4DayFollowUp" class="URCommentsPresets" Title="Use URO+ to only show URs that need a 4 day follow up message sent to them">URO+ 4 Day Follow Up</a></div>');
            //d.click (URCommentscomment1);
            $("#sidepanel-URComments-URO-Presets").append(d);
            //create the callback function
            $("#URCommentURO4DayFollowUp").click(URComments.UROClearClicked('URO4DayFollowUp'));

            //show no responses for 7 days needs closing
            d = $('<div><a id="URCommentURO7Day" class="URCommentsPresets" Title="Use URO+ to only show URs that are older than 7 days and need to be closed">URO+ 7 Day</a></div>');
            //d.click (URCommentscomment1);
            $("#sidepanel-URComments-URO-Presets").append(d);
            //create the callback function
            $("#URCommentURO7Day").click(URComments.UROClearClicked('URO7Day'));

            //show no responses for 8 days needs closing
            d = $('<div><a id="URCommentURO8Day" class="URCommentsPresets" Title="Use URO+ to only show URs that are older than 8 days and need to be closed">URO+ 8 Day</a></div>');
            //d.click (URCommentscomment1);
            $("#sidepanel-URComments-URO-Presets").append(d);
            //create the callback function
            $("#URCommentURO8Day").click(URComments.UROClearClicked('URO8Day'));

            //show no responses for 10 days needs closing
            d = $('<div><a id="URCommentURO10Day" class="URCommentsPresets" Title="Use URO+ to only show URs that are older than 10 days and need to be closed">URO+ 10 Day</a></div>');
            //d.click (URCommentscomment1);
            $("#sidepanel-URComments-URO-Presets").append(d);
            //create the callback function
            $("#URCommentURO10Day").click(URComments.UROClearClicked('URO10Day'));

            //show no responses for 24 Hour Notice now needs closing
            d = $('<div><a id="URCommentURO24Hr" class="URCommentsPresets" Title="URO+ 8 day 24 Hour Notice. the idea behind this one is that on day 7 you will send 24 hour notices and then 24 hours later come back with this preset to find the ones that need closing">24 Hour Notice expermintal</a></div>');
            //d.click (URCommentscomment1);
            $("#sidepanel-URComments-URO-Presets").append(d);
            //create the callback function
            $("#URCommentURO24Hr").click(URComments.UROClearClicked('URO24Hr'));

            //URO+ clear
            d = $('<div><a id="URCommentUROclearUROFiltrs" class="URCommentsPresets" Title="Clears all of the checks boxes in URO’s URs tab, except for Do not apply state/age filters to tagged URs and if you have Only My URs enabled in UrComments">URO+ Clear UR Filters</a></div>');
            $("#sidepanel-URComments-URO-Presets").append(d);
            //create the callback function
            $("#URCommentUROclearUROFiltrs").click(URComments.UROClearClicked('UROclearUROFiltrs'));

            //the predefined presets only show comments that the current user has commented on
            d = $('<label Title="Use URO+ to only Show URs with comments from me"><input type="checkbox" id="URCommentUROOnlyMyUR" class="URCommentsCheckbox"> Only My URs</input></label><br><br>');
            $("#sidepanel-URComments-URO-Presets").append(d);
            //create the callback function
            $("#URCommentUROOnlyMyUR").click(URComments.OnlyMyUR);
	
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //////
            ////// Draw Options
            //////
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////

            //Auto Set ur comment on new URs
            d = $('<label Title="Auto set the UR comment on new URs that do not already have comments"><input type="checkbox" id="UrCommentAutoSetNewComment" class="URCommentsCheckbox"> Auto set new UR comment</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentAutoSetNewComment").click(URComments.AutoSetNewComment);

            //Auto Set ur reminder on new URs
            d = $('<label Title="Auto set the UR reminder comment for URs that are older than 4 days and have only one comment"><input type="checkbox" id="UrCommentAutoSet4dayComment" class="URCommentsCheckbox"> Auto set reminder UR comment</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentAutoSet4dayComment").click(URComments.UrCommentAutoSet4dayComment);

            /*
            //Auto Set ur 7 day close comment
            d = $('<label Title="Auto set the UR remineder comment on URs that are older then 7 days and have only one comments"><input type="checkbox" id="UrCommentAutoSet7dayComment" class="URCommentsCheckbox"> Auto set 7 day close comment</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentAutoSet7dayComment").click(URComments.UrCommentAutoSet7dayComment);
            */

            //add reply Instructions to the 4 day Follow-Up
            d = $('<label Title="Adds extra reply Instructions the 4 day reply including a link to the user request with the UR layer enabled. (The link Waze sends doesn’t have the layers enabled and people have a hard time figuring it out) NOTE this will automatically zoom and center you to the UR you may move the map around to better show the UR but then you must re-click your 4 day reminder message"><input type="checkbox" id="UrCommentAddReplyInstructions" class="URCommentsCheckbox"> 4 day reminder (zoom & instructions)</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentAddReplyInstructions").click(URComments.AddReplyInstructions);

            //auto zoom in for new with no comments
            d = $('<label Title="Auto zoom in when opening URs with no comments and when sending UR reminders"><input type="checkbox" id="UrCommentNewZoomIn" class="URCommentsCheckbox"> Auto zoom in on new UR</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentNewZoomIn").click(URComments.NewZoomIn);

            //auto center at current zoom for UR with comments
            d = $('<label Title="Auto Center the map at the current map zoom when UR has comments and the zoom is less than 3"><input type="checkbox" id="UrCommentWithCommentRecenter" class="URCommentsCheckbox"> Auto center on UR</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentWithCommentRecenter").click(URComments.WithCommentRecenter);

            //Auto Click open solved not Identified 
            d = $('<label Title="Suppress the message about recent pending questions to the reporter and then depending on the choice set for that comment Clicks Open, Solved, Not Identified"><input type="checkbox" id="URCommentAutoClickURStatus" class="URCommentsCheckbox"> Auto click open, solved, not identified</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#URCommentAutoClickURStatus").click(URComments.AutoClickURStatus);

            //UrCommentSaveAfterComment
            d = $('<label Title="If Auto Click Open, Solved, Not Identified is also checked, this option will click the save button after clicking on a UR-Comment and then the send button"><input type="checkbox" id="UrCommentSaveAfterComment" class="URCommentsCheckbox"> Auto save after a solved or not identified comment</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentSaveAfterComment").click(URComments.SaveAfterComment);

            //auto close after sending comment replies
            d = $('<label Title="For the user requests that do not require saving this will close the user request after clicking on a UR-Comment and then the send button"><input type="checkbox" id="UrCommentAutoCloseComment" class="URCommentsCheckbox"> Auto close comment window</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentAutoCloseComment").click(URComments.AutoCloseComment);

            //auto reload map after sending comment replies
            d = $('<label Title="Reloads the map after clicking on a UR-Comment and then send button. This forces URO+ to re-apply the chosen URO filters. Currently this does not apply to any messages that get saved. Since saving automatically reloads the map."><input type="checkbox" id="UrCommentAutoReloadAfterComment" class="URCommentsCheckbox"> Auto reload map after comment</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentAutoReloadAfterComment").click(URComments.AutoReloadAfterComment);

            //zoom out map after sending comment replies
            d = $('<label Title="After clicking on a UR-Comment in the list and clicking send on the UR the map zoom will be set all the way out"><input type="checkbox" id="UrCommentZoomOutAfterComment" class="URCommentsCheckbox"> Auto zoom out after comment</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentZoomOutAfterComment").click(URComments.ZoomOutAfterComment);

            //Auto switch to the UR-Comments tab after page load
            d = $('<label Title="Auto switch to the UR-Comments tab after page load and when opening a UR, when the UR window is closed you will be switched to your previous tab"><input type="checkbox" id="UrCommentAutoSwitchToURCommentsTab" class="URCommentsCheckbox"> Auto switch to the UrComments tab</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentAutoSwitchToURCommentsTab").click(URComments.AutoSwitchToURCommentsTab);

            //Double clicking the 7 day close comment will auto send the 7day close comment
            d = $('<label Title="Add an extra link to the 7 day close comment when double clicked will auto send the comment to the UR windows and click send, and then will launch all of the other options that are enabled"><input type="checkbox" id="UrCommentDBLClk7DCAutoSend" class="URCommentsCheckbox"> 7 day - double click link (auto send)</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentDBLClk7DCAutoSend").click(URComments.DBLClk7DCAutoSend);

            //Double clicking comments will auto send comments
            d = $('<label Title="Add an extra link to each comment in the list that when double clicked will auto send the comment to the UR windows and click send, and then will launch all of the other options that are enabled"><input type="checkbox" id="UrCommentDBLClkAll" class="URCommentsCheckbox"> All comments  -  double click link (auto send)</input></label><br>');
            $("#sidepanel-URComments-settings").append(d);
            //create the callback function
            $("#UrCommentDBLClkAll").click(URComments.DBLClkAll);

            //go over  BoilerPlateCreatorsArray and generate the select   
            d = '<font style="font-size: 12px;">Comment List <select id="BoilerPlateCreators" style="font-size: 12px; margin-top: 5px;" title"This is shows the selected comment list, there is support for a custom list or If you would like your comment list built into the this script or have suggestions on the Comments team’s list please contact me at rickzabel @waze or @gmail">';
            for (i = 0; i < BoilerPlateCreatorsArray.length; i = i + 1) {
                console.log("URComments - make div for - " + BoilerPlateCreatorsArray[i]);
                //var d = $('<div><a id="URComments-comment' + i + '" class="URComments" style="float:none;color:#000000" Title="123">' + BoilerPlateCreatorsArray[ i ] + '</a></div>');  
                d = d + '<option style="font-size 12px;" value="' + BoilerPlateCreatorsArray[i] + '">' + BoilerPlateCreatorsArray[i] + '</option>';
                console.log("URComments - BoilerPlateCreatorsArray " + BoilerPlateCreatorsArray[i]);
            }
            d = d + "</select> </font><br><br>";
            $("#sidepanel-URComments-settings").append(d);
            //create call back for the select
            $("#BoilerPlateCreators").change(URComments.BoilerPlateCreatorsFunction);

            console.log("URComments - Tab Complete");
			
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //////
            ////// Load and set saved options
            //////
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////

            //UR-Comments tab is loaded load options to last state
            //here we also check to see if the options have ever been set (new user) if not we enable them all on script load
            //enabling them will trigger a click of the option which will cause the option to be saved

            //OnlyMyUR have the predefined pre-sets only show comments that the current user has commented on
            if (localStorage.getItem('OnlyMyUR') == "yes" || !localStorage.getItem('OnlyMyUR')) {
                //alert("YES");
                $("#URCommentUROOnlyMyUR").trigger('click');
            }

            //auto set new urs comment
            if (localStorage.getItem('AutoSetNewComment') == "yes" || !localStorage.getItem('AutoSetNewComment')) {
                //alert("YES");
                $("#UrCommentAutoSetNewComment").trigger('click');
            }

            //auto set 4day urs comment
            if (localStorage.getItem('UrCommentAutoSet4dayComment') == "yes" || !localStorage.getItem('UrCommentAutoSet4dayComment')) {
                //alert("YES");
                $("#UrCommentAutoSet4dayComment").trigger('click');
            }

            /*
            //auto set 7day urs comment
            if (localStorage.getItem('UrCommentAutoSet7dayComment') == "yes" || !localStorage.getItem('UrCommentAutoSet7dayComment')) {
            //alert("YES");
            $("#UrCommentAutoSet7dayComment").trigger('click');
            }
            */

            //post reply Instructions to comments
            if (localStorage.getItem('AddReplyInstructions') == "yes" || !localStorage.getItem('AddReplyInstructions')) {
                //alert("YES");
                $("#UrCommentAddReplyInstructions").trigger('click');
            }

            //UrCommentAutoCloseComment
            if (localStorage.getItem('UrCommentAutoCloseComment') == "yes" || !localStorage.getItem('UrCommentAutoCloseComment')) {
                //alert("YES");
                $("#UrCommentAutoCloseComment").trigger('click');
            }

            //AutoReloadAfterComment
            if (localStorage.getItem('AutoReloadAfterComment') == "yes" || !localStorage.getItem('AutoReloadAfterComment')) {
                //alert("YES");
                $("#UrCommentAutoReloadAfterComment").trigger('click');
            }

            //NewZoomIn
            if (localStorage.getItem('NewZoomIn') == "yes" || !localStorage.getItem('NewZoomIn')) {
                //alert("YES");
                $("#UrCommentNewZoomIn").trigger('click');
            }

            //auto recenter ur without comments
            if (localStorage.getItem('WithCommentRecenter') == "yes" || !localStorage.getItem('WithCommentRecenter')) {
                //alert("YES");
                $("#UrCommentWithCommentRecenter").trigger('click');
            }

            // UR-COmments load and set settings and check boxes  
            if (localStorage.getItem('AutoClickURStatus') == "yes" || !localStorage.getItem('AutoClickURStatus')) {
                //alert("YES");
                $("#URCommentAutoClickURStatus").trigger('click');
            }

            //UrCommentSaveAfterComment
            if (localStorage.getItem('SaveAfterComment') == "yes" || !localStorage.getItem('SaveAfterComment')) {
                //alert("YES");
                $("#UrCommentSaveAfterComment").trigger('click');
            }

            //AutoZoomOutAfterComment
            if (localStorage.getItem('ZoomOutAfterComment') == "yes" || !localStorage.getItem('ZoomOutAfterComment')) {
                //alert("YES");
                $("#UrCommentZoomOutAfterComment").trigger('click');
            }

            //AutoSwitchToURCommentsTab
            if (localStorage.getItem('AutoSwitchToURCommentsTab') == "yes" || !localStorage.getItem('AutoSwitchToURCommentsTab')) {
                //alert("YES");
                $("#UrCommentAutoSwitchToURCommentsTab").trigger('click');
            }

            //UrCommentDBLClk7DCAutoSend
            if (localStorage.getItem('DBLClk7DCAutoSend') == "yes") {
                //alert("YES");
                $("#UrCommentDBLClk7DCAutoSend").prop('checked', true);
            }

            //UrCommentDBLClkAll
            if (localStorage.getItem('DBLClkAll') == "yes") {
                //alert("YES");
                $("#UrCommentDBLClkAll").prop('checked', true);
            }

            //set the users BoilerPlateCreators choice in the select   
            var SelectedBoilerPlateCreator = localStorage.getItem('BoilerPlateCreators');
            $("#BoilerPlateCreators").val(SelectedBoilerPlateCreator);
            //end getting boilerplatecreators

            //check to see if the option to auto switch to the UR-Comments tab is enabled
            if (UrCommentAutoSwitchToURCommentsTab.checked) {
                //make UR Comments tab active
                $('#CommentsTab').trigger('click');
            }

            if (URCommentUpdateMessage === "yes") {
                //alert the user in  URComment version updates
                if (localStorage.getItem('URCommentVersion') === URCommentVersion) {
                    console.log("URComments Version - " + URCommentVersion);
                } else {
                    alert(URCommentVersionUpdateNotes);
                    localStorage.setItem('URCommentVersion', URCommentVersion);
                }
            }

            //set the background of the last used URO preset
            URComments.UROPresetHighlight(localStorage.getItem('UROCurrentPeset'));
			
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //////
            ////// Launch background task(s)
            //////
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////
			
            //start looking for opened UR's window
            setTimeout(URComments.LookForOpenedUR, 1000);
			
            //end of URCommentsinit	

        };
		
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //////
        ////// Background task(s)
        //////
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////

		
        //look for the Ur window to be open	
        URComments.LookForOpenedUR = function() {
		
		    //check for an open UR and that the UR's text area is shown
            //relaunch checking for open ur - moved this up here so the script would keep trying if i had an error
            setTimeout(URComments.LookForOpenedUR, 1000); //line 892
            //console.log("URComments - LookForOpenedUR");
            var urID = 0;

            //12-15-14
            //if (Waze.updateRequestsControl.currentRequest && $(".new-comment-text")[0]) {
            //    urID = Waze.updateRequestsControl.currentRequest.attributes.id;
            urID = $(".update-requests .selected").data("id");

            if (urID > 0 && typeof urID !== 'undefined') {



                //new or same ur (re))open(ed) so now we can do stuff; this prevents this function to continuously applying settings to a ur
                if (UrCommentLasturID != urID && $(".new-comment-text").length !== 0) {
                    //alert(urID);
                    console.log("URComments  - Found open UR - " + urID);

					
                    //grab the current UR ID for next time
                    UrCommentLasturID = urID;
					
					//make the new ur window not dragable
					if ($("#panel-container .ui-draggable").length !== 0) {
					
                        $("#panel-container .panel").removeClass('ui-draggable'); //beta editor auto expand UR Comment box 
						
						$("#panel-container .panel").draggable( { disabled: true } );
						
						$("#panel-container .panel").removeClass('ui-state-disabled'); //beta editor auto expand UR Comment box 
                    }

					
					
					
                    //auto expand ur comments list and text area
                    if ($('#edit-request .comment-view-shown').length === 0) {
                        //alert('trash');
                        //$('#edit-request .toggle-comment-view').delay( 2000 ).trigger('click');

                        setTimeout(function() {
                            $('#edit-request .toggle-comment-view').trigger('click');
                        }, 0);
                    }

                    //replace text in textarea
                    //setTimeout(function () { $(".new-comment-form textarea").attr("placeholder", "Window Resized By UR-Comments"); }, 2000);
                    $(".new-comment-form textarea").attr("placeholder", "Window Resized By UR-Comments");

                    //beta editor auto expand ur comments list and text area
                    if ($("#panel-container .problem-edit .conversation").length !== 0) {
                        $("#panel-container .problem-edit .conversation").removeClass('collapsed'); //beta editor auto expand UR Comment box 
                    }

                    //beta editor auto expand ur comments more info
                    if ($("#panel-container .problem-edit .more-info").length !== 0) {
                        $("#panel-container .problem-edit .more-info").removeClass('collapsed'); //beta editor auto expand UR Comment box 
                    }

					
					//disble the stupid new done button
					if($("#panel-container .content .done").length > 0) {
						$("#panel-container .content .done").attr('disabled', true);
						$("#panel-container .content .done").html('(Done) Disabled by UR-Comments');
					}
					
					
					
                    //scroll to bottom of comments on beta
                    $('.body').scrollTop($('.body')[0].scrollHeight);
                    //$("#chat .chat-body .messages .message-list").scrollTop($("#chat .chat-body .messages .message-list")[0].scrollHeight+10000);

                    //auto fill  in comment
                    //check what type of message to insert into the ur
                    reporter_comment = Waze.model.updateRequestSessions.objects[urID].comments;

                    //Waze.model.updateRequestSessions.objects[3978663]
                    //alert(reporter_comment.length);
                    i = reporter_comment.length;

                    console.log("URComments2 - number of comments: " + i);

                    //if number of comment is zero assume this is a new ur
                    if (i === 0) {
                        //initial, zero comments

                        console.log("URComments2 - no comments");
                        //this if is separate so when we dont have auto inset on new we dont try to get the comment count which would fault out the script
                        if (UrCommentAutoSetNewComment.checked === true) {
                            console.log("URComments2 - no comments2");
                            //this will be on of the types of UR that a user can choose from when submitting a UR 

                            var urType = Waze.model.mapUpdateRequests.objects[urID].attributes.type;

                            //12/15/14
                            //var urType = Waze.updateRequestsControl.currentRequest.attributes.type;

                            console.log("URComments  - Found open UR - " + urID + " " + def_names[urType]);

                            //loop trough the comment array for a comment that matches the request type.
                            for (var ii = 0; ii < URCommentsArray.length; ii = ii + 3) {
                                if (URCommentsArray[ii].toLowerCase() === def_names[urType].toLowerCase()) {
                                    console.log("URComments - Matched Comment: " + def_names[urType]);
                                    setTimeout(URComments.AutoZoomIN(URCommentsArray[ii], URCommentsArray[ii + 1], URCommentsArray[ii + 2], urID), 0);
                                }
                            }


                        }

                    } else {
                        //4DAY OR 7DAY section

                        LastCommentorUserID = reporter_comment[reporter_comment.length - 1].userID;
                        //alert(LastCommentorUserID);
                        console.log("URComments2 - LastCommentorUserID: " + LastCommentorUserID);

                        //uro days old
                        var commentDaysOld = URComments.uroGetCommentAge(W.model.updateRequestSessions.objects[urID].comments[i - 1]);
                        console.log("URComments2 - days old: " + commentDaysOld);

                        if (i === 1 && commentDaysOld >= 4 && LastCommentorUserID > 1 && UrCommentAutoSet4dayComment.checked === true) {
                            //4day - 1 comment, last comment less than 4 days, last comment is not from reporter
                            console.log("URComments2 - 4day");

                            //4 day ur 1 comment
                            setTimeout(URComments.AutoZoomIN(URCommentsArray[ReminderPosistion], URCommentsArray[ReminderPosistion + 1], URCommentsArray[ReminderPosistion + 2], urID), 0);


                        }
                        /* else if(i >= 1 && commentDaysOld >= 7 && LastCommentorUserID > 1 && UrCommentAutoSet7dayComment.checked === true)  {
                        //7day - less than one comment, last comment less then 7 days ago, last comment is not from reporter
                        console.log("URComments2 - 7+day");

                        //7 day ur 1 comment
                        setTimeout(URComments.PostURComment(URCommentsArray[CloseNotIdentifiedPosistion], URCommentsArray[CloseNotIdentifiedPosistion + 1], URCommentsArray[CloseNotIdentifiedPosistion + 2], urID), 0);

                        }*/
                    }

                    var WazeCurrentZoom = "";
                    if (i === 0 && UrCommentNewZoomIn.checked === true) {
                        //zoom in new 
                        //predefined zoom threshold for auto zoom
                        var zoom = 4;
                        WazeCurrentZoom = URComments.GetWazeMapZoomLevel();
                        //do not zoom back out if we are already zoomed in and just happen to be re-clicking on a UR.
                        //or we have the map set good for a 4-day reminder

                        if (WazeCurrentZoom < zoom) {
                            URComments.gotoURById(urID, 5);
                        }
                    } else if (UrCommentWithCommentRecenter.checked === true) {
                        //or recetner
                        //re-center on urs that are not zoom in
                        WazeCurrentZoom = URComments.GetWazeMapZoomLevel();
                        //alert(WazeCurrentZoom);
                        if (WazeCurrentZoom < 3) {
                            //alert(WazeCurrentZoom);
                            URComments.gotoURById(urID, WazeCurrentZoom);
                        }

                    }

                    //auto switch to ur comments tab
                    if (UrCommentAutoSwitchToURCommentsTab.checked) {
                        //grab the active tab
                        PreviousTab = $("h2 + ul.nav-tabs .active a");
                        //make UR Comments tab active
                        $('#CommentsTab').trigger('click');
                    }
                }


            } else {
                //reset the id if a ur is not open so we can set the tab for the same ur
                UrCommentLasturID = "";
                urID = "";
                //switch tab back
                if (UrCommentAutoSwitchToURCommentsTab.checked) {
                    //verify that we had found a tab
                    if (PreviousTab !== null) {
                        //click back on the previous tab
                        $(PreviousTab).trigger('click');
                        //clear out the previous tab holder
                        PreviousTab = null;
                    }
                }
                //console.log("URComments - Looking for ur...");
            }

        };


        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //////
        ////// Save Options on click 
        //////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////

        //use uro to only show urs that I have commented on
        URComments.OnlyMyUR = function() {
            //try to save the state of the check box
            if (URCommentUROOnlyMyUR.checked) {
                localStorage.setItem('OnlyMyUR', 'yes');
                //alert("yes");
            } else {
                localStorage.setItem('OnlyMyUR', 'no');
                //alert("no");
            }

            //only show my ur 'OnlyMyUR' 
            if (URCommentUROOnlyMyUR.checked && !_cbHideAnyComments.checked) {
                $("#_cbHideAnyComments").trigger('click');

            } else if (!URCommentUROOnlyMyUR.checked && _cbHideAnyComments.checked) {
                $("#_cbHideAnyComments").trigger('click');
            }

        };

        URComments.AutoClickURStatus = function() {
            //try to save the state of the check box
            if (URCommentAutoClickURStatus.checked) {
                localStorage.setItem('AutoClickURStatus', 'yes');
                //alert("yes");
            } else {
                localStorage.setItem('AutoClickURStatus', 'no');
                //alert("no");
                //turn off save after send
                if (!URCommentAutoClickURStatus.checked && UrCommentSaveAfterComment.checked) {
                    $('#UrCommentSaveAfterComment').prop('checked', false);
                    localStorage.setItem('SaveAfterComment', 'no');
                }
            }
        };

        URComments.SaveAfterComment = function() {
            //try to save the state of the check box
            if (UrCommentSaveAfterComment.checked) {
                localStorage.setItem('SaveAfterComment', 'yes');
                //alert("yes");
            } else {
                localStorage.setItem('SaveAfterComment', 'no');
                //alert("no");
            }
            //when save if on turn on auto click status
            if (UrCommentSaveAfterComment.checked && !URCommentAutoClickURStatus.checked) {
                $('#URCommentAutoClickURStatus').prop('checked', true);
                localStorage.setItem('AutoClickURStatus', 'yes');
            }
        };

        URComments.AutoCloseComment = function() {
            //try to save the state of the check box
            if (UrCommentAutoCloseComment.checked) {
                localStorage.setItem('UrCommentAutoCloseComment', 'yes');
                //alert("yes");
            } else {
                localStorage.setItem('UrCommentAutoCloseComment', 'no');
                //alert("no");
            }
            //alert ( localStorage.getItem('UrCommentAutoCloseComment') ); 
        };

        // UrCommentAutoReloadAfterComment
        URComments.AutoReloadAfterComment = function() {
            // UrCommentAutoReloadAfterComment
            //try to save the state of the check box
            if (UrCommentAutoReloadAfterComment.checked) {
                localStorage.setItem('AutoReloadAfterComment', 'yes');
                //alert("yes");
            } else {
                localStorage.setItem('AutoReloadAfterComment', 'no');
                //alert("no");
            }
        };

        URComments.ZoomOutAfterComment = function() {
            // UrCommentAutoReloadAfterComment
            //try to save the state of the check box
            if (UrCommentZoomOutAfterComment.checked) {
                localStorage.setItem('ZoomOutAfterComment', 'yes');
                //alert("yes");
            } else {
                localStorage.setItem('ZoomOutAfterComment', 'no');
                //alert("no");
            }
        };

        URComments.AutoSetNewComment = function() {
            //add reply instructions to replies
            //try to save the state of the check box
            if (UrCommentAutoSetNewComment.checked) {
                localStorage.setItem('AutoSetNewComment', 'yes');
                //alert(" AutoSetNewComment yes");
            } else {
                localStorage.setItem('AutoSetNewComment', 'no');
                //alert("AutoSetNewComment no");
            }
        };

        URComments.UrCommentAutoSet4dayComment = function() {
            //add reply instructions to replies
            //try to save the state of the check box
            if (UrCommentAutoSet4dayComment.checked) {
                localStorage.setItem('UrCommentAutoSet4dayComment', 'yes');
                //alert(" UrCommentAutoSet4dayComment yes");
            } else {
                localStorage.setItem('UrCommentAutoSet4dayComment', 'no');
                //alert("UrCommentAutoSet4dayComment no");
            }
        };

        /*
        URComments.UrCommentAutoSet7dayComment = function() {
        //add reply instructions to replies
        //try to save the state of the check box
        if (UrCommentAutoSet7dayComment.checked) {
        localStorage.setItem('UrCommentAutoSet7dayComment', 'yes');
        //alert(" UrCommentAutoSet7dayComment yes");
        } else {
        localStorage.setItem('UrCommentAutoSet7dayComment', 'no');
        //alert("UrCommentAutoSet7dayComment no");
        }
        };
        */

        URComments.AddReplyInstructions = function() {
            //add reply instructions to replies
            //try to save the state of the check box
            if (UrCommentAddReplyInstructions.checked) {
                localStorage.setItem('AddReplyInstructions', 'yes');
                //alert(" AddReplyInstructions yes");
            } else {
                localStorage.setItem('AddReplyInstructions', 'no');
                //alert("AddReplyInstructions no");
            }

        };

        URComments.NewZoomIn = function() {
            //add reply instructions to replies
            //try to save the state of the check box
            if (UrCommentNewZoomIn.checked) {
                localStorage.setItem('NewZoomIn', 'yes');
                //alert(" NewZoomIn yes");
            } else {
                localStorage.setItem('NewZoomIn', 'no');
                //alert("NewZoomIn no");
            }

        };

        URComments.WithCommentRecenter = function() {
            //add reply instructions to replies
            //try to save the state of the check box
            if (UrCommentWithCommentRecenter.checked) {
                localStorage.setItem('WithCommentRecenter', 'yes');
                //alert(" WithCommentRecenter yes");
            } else {
                localStorage.setItem('WithCommentRecenter', 'no');
                //alert("WithCommentRecenter no");
            }

        };

        URComments.AutoSwitchToURCommentsTab = function() {
            // AutoSwitchToURCommentsTab
            //try to save the state of the check box
            if (UrCommentAutoSwitchToURCommentsTab.checked) {
                localStorage.setItem('AutoSwitchToURCommentsTab', 'yes');
                //alert("yes");
            } else {
                localStorage.setItem('AutoSwitchToURCommentsTab', 'no');
                //alert("no");
            }
        };

        //UrCommentDBLClk7DCAutoSend
        URComments.DBLClk7DCAutoSend = function() {
			var r = "";
            if (UrCommentDBLClk7DCAutoSend.checked) {
                r = confirm("Ur-Comments The page will have to be reloaded for this option to be enabled");
                if (r === true) {
                    //save the selection
                    localStorage.setItem('DBLClk7DCAutoSend', 'yes');
                    //this will reload the page
                    location.reload();
                } else {
                    UrCommentDBLClk7DCAutoSend.checked = false;
                }

            } else {

                r = confirm("Ur-Comments The page will have to be reloaded for this option to be disabled");
                if (r === true) {
                    //save the selection
                    localStorage.setItem('DBLClk7DCAutoSend', 'no');
                    //this will reload the page
                    location.reload();
                } else {
                    UrCommentDBLClk7DCAutoSend.checked = true;
                }
                localStorage.setItem('DBLClk7DCAutoSend', 'no');
            }
        };


        //UrCommentDBLClkAll
        URComments.DBLClkAll = function() {
			var r = "";
            if (UrCommentDBLClkAll.checked) {
                r = confirm("Ur-Comments The page will have to be reloaded for this option to be enabled");
                if (r === true) {
                    //save the selection
                    localStorage.setItem('DBLClkAll', 'yes');
                    //this will reload the page
                    location.reload();
                } else {
                    UrCommentDBLClkAll.checked = false;
                }

            } else {

                r = confirm("Ur-Comments The page will have to be reloaded for this option to be disabled");
                if (r === true) {
                    //save the selection
                    localStorage.setItem('DBLClkAll', 'no');
                    //this will reload the page
                    location.reload();
                } else {
                    UrCommentDBLClkAll.checked = true;
                }
                localStorage.setItem('DBLClkAll', 'no');
            }
        };

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //////
        //////  UR Comment functions
        //////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////

        URComments.escapeHtml = function(a) {
            a = a.replace(/&/g, "&amp;");
            a = a.replace(/</g, "&lt;");
            a = a.replace(/>/g, "&gt;");
            a = a.replace(/"/g, "&quot;");
            a = a.replace(/'/g, "&#039;");
            return a;
        };
		
		//$( "#update-request-panel .solution p").html()
		URComments.StringSwap = function(a) {
            
			if($( "#update-request-panel .solution p").length > 0 ) {
				a = a.replace( "$URD", $( "#update-request-panel .solution p").html() );
			}
			
			if($( ".description .content").length > 0){
				a = a.replace( "$URD", $( ".description .content").html() );
			//alert($( ".description .content").html());
            }
			return a;
        };
				

        //gets the total number of comments on a ur
        TotalNumberOfComments = function(urID) {
            console.log("URComments - reporterComments");
            return ($(wazeModel.updateRequestSessions.objects[urID].comments).length);
        };

        //sorry URO if i was going to use you to sort Urs i needed to use the same dates you do! Thanks! ;)
        URComments.uroGetCommentAge = function(commentObj) {
            if (commentObj.createdOn === null) return -1;
            return URComments.uroDateToDays(commentObj.createdOn);
        };

        URComments.uroDateToDays = function(dateToConvert) {
            var dateNow = new Date();
            var elapsedSinceEpoch = dateNow.getTime();
            var elapsedSinceEvent = elapsedSinceEpoch - dateToConvert;
            dateNow.setHours(0);
            dateNow.setMinutes(0);
            dateNow.setSeconds(0);
            dateNow.setMilliseconds(0);
            var elapsedSinceMidnight = elapsedSinceEpoch - dateNow.getTime();
            if (elapsedSinceEvent < elapsedSinceMidnight) {
                // event occurred today...
                return 0;
            } else {
                // event occurred at some point prior to midnight this morning, so return a minimum value of 1...
                return 1 + Math.floor((elapsedSinceEvent - elapsedSinceMidnight) / 86400000);
            }
        };

        /*	
        URComments.t1= function(a){

        a="1";
        alert(a);

        };
        URComments.t2= function(a){
        a="2";
        alert(a);
        };
        URComments.t3= function(a){
        a="3";
        alert(a);
        };
        URComments.t4= function(a){
        a="4";
        alert(a);
        };
        */

        // this was used to grab all visible urs and started out as the raid bookmark-let
        //currently i have been using it for testing
        URComments.TagAllNoCommentURs = function(a) {
            //this is where auto open next ur is going to be right now it is a collection of tests

            return function() {
			
			alert($(".new-comment-text").val() );
			
			
			
			//alert( $( "#update-request-panel .solution p").html() );
			//$(".new-comment-text").val('You reported "' + $( "#update-request-panel .solution p").html() + '" ' + $(".new-comment-text").val());
			
			//var a = URComments.StringSwap( $(".new-comment-text").val() );
			//alert(a);
			//You reported, "
			
                //a="123";
                //URComments.t1(a);
                //URComments.t2(a);
                //URComments.t3(a);
                //URComments.t4(a);
                //alert(a);
                //alert($(".update-requests .selected").attr("data-id"));
                //alert($(".update-requests .selected").data("id"));

                //id="W.Layer.Markers_246"


                //test getting current edits off the save icon
                //class "#edit-buttons .counter" 

                //window.open('https://docs.google.com/spreadsheets/d/1PM4bOYGJxL82E4th2yy87ZzQKpMDF4N1dcKZ2evXc5o/edit?usp=sharing', 'window name', 'window settings');	

                /*
                //URO+ new ur
                c = $('<div class="tab-pane" id="sidepanel-Comments" style="font-size: 14px;> <div id="test" class="result-list-container"><p class="URComments" style="font-size: 12px;"><b>UR Comments Version ' + URCommentVersion + ' </b> <br><a id="URCommentZoomOutButton" class="URComments" Title="Zoom all the way out.">Zoom Out</a></p></div></div><br><br>');
                $("h2 + ul.nav-tabs + .tab-content").append(c);
                $('#34123').click();	

                $('#34123').trigger('click');
                */


                /*
                var PreviousTab = $("h2 + ul.nav-tabs .active");
                //alert("urc - " + $("h2 + ul.nav-tabs .active"));

                $("h2 + ul.nav-tabs .active").removeClass();

                $(PreviousTab).addClass('active22');
                */




                //testing auto getting urs 
                //alert(urid);
                //https://www.waze.com/editor/?zoom=5&lat=41.701116&lon=-88.234631&mapUpdateRequest=3961111&env=usa#
                //https://www.waze.com/editor/?zoom=5&mapUpdateRequest=&env=usa#
                //https://www.waze.com/editor/?zoom=5&mapUpdateRequest=3916638&env=usa# //works

                //test finding stuff
                //if($(".layer-togglers .reload-button").length);

                //clicks the comment send btn
                //$('.new-comment-form .new-comment-text + .btn-default').trigger('click');

                //clicks the comment send btn
                //$('#chat-toggle .toggle').trigger('click');

                //alert( $( "#update-request-panel h1").html() );
                //moves text
                //$( "#update-request-panel .problem-description" ).prepend( '<article class="solution"><h2>Type: </h2>' + $( "#update-request-panel h1").html() + '</article>' );

                console.log('URComments:TagAllNoCommentURs');
                /*
                function onScreen(obj){
                if (obj.geometry){
                return(Waze.map.getExtent().intersectsBounds(obj.geometry.getBounds()));    
                }    
                return(false);  
                }
                */


                /*
                var urcount = 0
                var idList = [];
                var vcomments = "";
                for (var urID in W.model.mapUpdateRequests.objects){
                urcount++;

                if(W.model.updateRequestSessions.objects[urID] == null) idList.push(urID);

                var nComments = W.model.updateRequestSessions.objects[urID].comments.length;
                //if(nComments == 0) return false;

                for(var cidx=0; cidx<nComments; cidx++){
                vcomments = vcomments + W.model.updateRequestSessions.objects[urID].comments[cidx].userID;
                }

                console.log("urc - " + urcount + " - "  + urID + " - " +  vcomments );
                vcomments = "";
                }
                if(idList.length > 0){
                uroAddLog('grabbing updateRequestSessions with IDs '+idList);
                W.model.updateRequestSessions.get(idList);
                }
                */


                /*
                var urcount = 0
                for (var urID in W.model.mapUpdateRequests.objects){
                urcount++;

                var cur_x = W.model.mapUpdateRequests.objects.attributes.geometry.x;
                var cur_y = W.model.mapUpdateRequests.objects.attributes.geometry.y;

                console.log("urc - " + urcount + " - "  + urID + " - "  + cur_x + " - "  + cur_y);
                }
                */

                /*
                Object.forEach(Waze.model.mapUpdateRequests.objects, function(k, v){
                //if (v.type == "mapUpdateRequest" && onScreen(v) && v.attributes.description == null){ 
                if (v.type == "mapUpdateRequest" && onScreen(v)){ 
                console.log('URc 1: on screen = ' + v.attributes.id);

                urSessionURL = 'https://www.waze.com/Descartes-live/app/MapProblems/UpdateRequests?ids=' + v.attributes.id;
                //"/Descartes-live/app/MapProblems/UpdateRequests/Comment"

                $.ajax({
                dataType: "json",
                url: urSessionURL,
                success: function(json) {
                try {
                console.log('URc 2: ' + v.attributes.id );
                var urDetail = json.updateRequestSessions.objects[0];
                if(urDetail.comments.length==0){
                console.log('URc 3: no comments for id ' + v.attributes.id + '. Adding comment.');
                //Waze.model.updateRequestSessions.objects[v.attributes.id].addComment("Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!");	
                Waze.model.updateRequestSessions.objects[v.attributes.id].open
                and
                Waze.model.updateRequestSessions.objects[v.attributes.id].state

                Waze.model.updateRequestSessions.objects[v.attributes.id].addComment("Write this text directly into the UR without opening the UR in the editor");	
                }
                } 					
                catch(e) {
                console.log('URc 4: no UR information available');
                }
                alert("paused - " + v.attributes.id);
                }
                });
                console.log('URc 5: has comment = ' + v.attributes.id);
                } 

                }); 
                */

            };
        };

        //used to track comment clicks and to message users not on the beta tester list
        URComments.CheckBetaTesters = function() {
            if (BetaaTestersCheckCount >= 5) {
                //email list 
                /*
				aeroseek
				Bigbear3764
				Confedyank
				hawkeygoal
				mike0723
				SeekingSerenity
				t0cableguy
				SuperMedic
				orbitc
				davielde
				dolphinwave
				randyboy
				MojaveCactusMonkey
				HavanaDay 
				AlanOfTheBerg
				KB_Steveo
				karlcr9911
				ggrane
				JasonN899
				AlanOfTheBerg
				Confedyank
				dolphinwave
				ggrane
				HavanaDay 
				mike0723
				randyboy
				SeekingSerenity
				t0cableguy
				KuniaKid 
                */

                var BetaTesters = ["rickzabel",
                    "aeroseek",
                    "Bigbear3764",
                    "Confedyank",
                    "hawkeygoal",
                    "mike0723",
                    "SeekingSerenity",
                    "t0cableguy",
                    "SuperMedic",
                    "orbitc",
                    "davielde ",
                    "dolphinwave",
                    "randyboy",
                    "AlanoftheBerg",
                    "driving79",
                    "MojaveCactusMonkey",
                    "HavanaDay",
                    "AlanOfTheBerg",
                    "KB_Steveo",
                    "ggrane",
                    "KuniaKid "
                ];
                //check if the user who is logged in is in the beta tester array
                if ($.inArray($("#user-info strong").html(), BetaTesters) >= 0) {
                    //alert($( "#user-info strong").html() );
                } else {
                    alert($("#user-info strong").html() + " UR Comments is currently in beta testing. When I add or change features I send out email to all users informing them of the changes." + "\n" + "Please pm me at rickzabel and let me know you are using this script and I will gladly add you to the list!");
                }
                BetaaTestersCheckCount = 0;
            }

            BetaaTestersCheckCount = BetaaTestersCheckCount + 1;

        };

        //save what comment list is selected and then reload the page
        URComments.BoilerPlateCreatorsFunction = function() {
			
			//eventually make this replace innerhtml of the comments tab so we dont have to reload the page
            //.innerHTML
			
			/*
			var r = confirm("Ur-Comments you have chosen " + BoilerPlateCreators.value + "'s list. The page now must be reloaded to repopulate the UR-Comment tab");
            //this is where we reuse the r var this makes the nested ifs much more simple
            if (r === true) {
                //save the selection
                localStorage.setItem('BoilerPlateCreators', BoilerPlateCreators.value);
                //this will reload the page
                location.reload();
            } else {
			*/
                //$("#BoilerPlateCreators").val(localStorage.getItem('BoilerPlateCreators'));
            //}

			//save the selection
			localStorage.setItem('BoilerPlateCreators', BoilerPlateCreators.value);

			//clear the html from the tabs
			$("#sidepanel-Comments").html('');
			//reload the content
			ChangeLanguage = true;
			
			//setTimeout(URComments_bootstrap, 20);
			URComments_bootstrap();

			};

        URComments.URCommentZoomOutcheck = function(Title, URStatus) {

            return function() {
				console.log("URComments - zoom out URCommentZoomOutcheck");
                //this is the new place for zooming out and will still be happening while the comment is sending
                //zoom out option - if the user option is set to reload map after posting a comment reply
                if (UrCommentZoomOutAfterComment.checked === true) {
                    console.log("URComments - zoom out ZoomOutAfterComment enabled");
                    setTimeout(URComments.SetZoomCloseUR(0, "LeaveOpen"), 0);
                } else {
                    //alert("autozoomout not checked");
                }

                // $('.new-comment-form .new-comment-text + .btn-default').click(URComments.URCommentSendBtnClicked(Title, URStatus));
                setTimeout(URComments.URCommentSendBtnClicked(Title, URStatus), 20);
            };
        };

        URComments.URCommentSendBtnClicked = function(Title, URStatus) {

            //waze is weird and after clicking send button the close button had to be refound, which takes a few seconds for the new close button to be drawn
            // so we wait 1500 milliseconds before looking for the close button
            //since we are passing vars to the next function we have to pass this to handler function so it doesn't happen on click

            //the above is still true but what i have found is that it sometimes takes a while from clicking send to the comment actually posting. there was time when i closed the comment before it actually posted and it would have to be redone. so added a check and a timeout and recheck if the textarea isn't empty. afterwards we can re-grab and click the close button

            //grab the close button to compare to later
            CloseButtonHolder = $(".problem-panel-navigation button.close-button");

            return function() {
                //check to see if the comments went through before saving or closing the comment 
                if ($(".new-comment-text").val() !== "" && $(".new-comment-text").val() !== undefined) {
                    console.log('URComments - the send button was clicked, Waiting for the comment to send. ' + PauseCount);
					 console.log("current comment = " + $(".new-comment-text").val() );
					 console.log("current comment = ");
                    PauseCount++;
                    setTimeout(URComments.URCommentSendBtnClicked(Title, URStatus), 20);
                } else {
                    console.log('URComments - the comment went through, jumping to CloseDelayHack2');
                    PauseCount = "1";
                    URComments.CloseDelayHack2(Title, URStatus);
                }
            };
        };

        //this checks to see if the Waze's save button is waiting to be clicked.
        URComments.WazeSaveWaiting = function() {
            if ($(".WazeControlSave").hasClass('ItemInactive')) {
                return true;
            } else {
                return false;
            }
        };

        URComments.CloseDelayHack2 = function(Title, URStatus) {
            console.log("URComments - CloseDelayhack2 " + Title + " " + URStatus);

            ////check if we have the old or the new close button 
            //if (CloseButtonHolder == $(".problem-panel-navigation button.close-button")) {
            //    console.log("URComments - old close button searching for new" + PauseCount);
            //    PauseCount++;
            //    //old button jump back into this function 500 ms later
            //    setTimeout(URComments.CloseDelayHack2(Title, URStatus), 20);
            //} else {
            PauseCount = "1";
            console.log("URComments - new close button");
            //wrap the code in the finding of the new close button

            //now that we found the new close button and send was clicked

            //lets check if we should click close or save
            //when clicking save you dint need to click close

            //this checks to see if the Waze's save button is waiting to be clicked.
            //URComments.WazeSaveWaiting()

            if (URStatus.toLowerCase() === "solved" || URStatus.toLowerCase() === "notidentified") {
                console.log("URComments - CloseDelayhack2 Solved or NotIdentified- Clicking Save");
                //this clicks the waze save btn
                if (URCommentAutoClickURStatus.checked === true && UrCommentSaveAfterComment.checked === true) {
                    //click save
                    $('#toolbar #edit-buttons .WazeControlSave').trigger('click');
                } else if (UrCommentAutoCloseComment.checked) {
                    $(".problem-panel-navigation button.close-button").trigger('click');
                }

            } else {
                //when not saving you have to click close.
                console.log("URComments - CloseDelayhack2 since we are not saving click the close button");
                if (UrCommentAutoCloseComment.checked) {
                    console.log("URComments - CloseDelayhack2 auto close option checked");


                    //normal editor
                    if ($(".problem-panel-navigation button.close-button").length !== 0) {
                        console.log("URComments - zoom out CloseDelayHack2 normal editor");
                        $(".problem-panel-navigation button.close-button").trigger('click');
                    }

                    //beta editor
                    if ($(".problem-edit .header .close-panel").length !== 0) {
                        console.log("URComments - zoom out CloseDelayHack2 beta editor");
                        $(".problem-edit .header .close-panel").trigger('click');
                        //setTimeout(function() {
                        //    $('a .close-popover').trigger('click');
                       // }, 2000);
                    }




                    //since saving above reloads the map we need this reload only to happen when we dont click save
                    //auto reload map for non save urs
                    if (UrCommentAutoReloadAfterComment.checked) {
                        setTimeout(URComments.AutoReloadMapOnComment, 500);
                    }
                }
            }

            console.log("URComments - end of saving or closing comment");
            //}

            //this is the new place for zooming out and will still be happening while the comment is sending
            //zoom out option - if the user option is set to reload map after posting a comment reply
            if (UrCommentZoomOutAfterComment.checked === true) {
                console.log("URComments - zoom out CloseDelayHack2");
                setTimeout(URComments.SetZoomCloseUR(0, "LeaveOpen"), 0);
            } else {
                //alert("autozoomout not checked");
            }

        };

        URComments.SetZoomCloseUR = function(a, b) {
            //this sets the map zoom; 0 is all the way out; 10 is all the way in but next to useless (the map and sat views disappear);
            //the closest zoom that shows the sat and map is zoom 9
            return function() {
                console.log("URComments - Setting map zoom to: " + a + " with flag: " + b);
                //alert(a + " " + b);
                Waze.map.setCenter(Waze.map.getCenter(), a);
                //close ur if zooming out to 
                if (b === "CloseUR") {
                    //alert(b);

                    //normal editor
                    if ($(".problem-panel-navigation button.close-button").length !== 0) {
                        $(".problem-panel-navigation button.close-button").trigger('click');
                    }

                    //beta editor
                    if ($(".problem-edit .header .close-panel").length !== 0) {
                        $(".problem-edit .header .close-panel").trigger('click');
                       // setTimeout(function() {
                        //    $('a .close-popover').trigger('click');
                       // }, 2000);
                    }



                }
            };
        };

        URComments.AutoReloadMapOnComment = function() {
            //waze together with URO is buggy i have to close the comment window before reloading the map or the pin ends up getting stuck on for all URO filters and it takes a page reload to fix it.
            // to get URO to rescan urs that have been commented on you have to reload the map this also causes URO to hide the ones that no longer fit the current URO filters like when using my pre-sets

            //click the reload button for the map
            $(".layer-togglers .reload-button").trigger('click');
        };

        URComments.ConfirmToConsole = function() {
            //over ride the default action of the standard confirm by writing confirm to a new function nconfirm, making a 'fake' confirm and then restoring confirm by copying the nconfirm back over confirm!
            nconfirm = unsafeWindow.confirm;
            unsafeWindow.confirm = function(msg) {
                //if ((I18n.translations[I18n.locale].update_requests.panel.confirm == msg) && (uroGetCBChecked('_cbDisablePendingQuestions') == true)) {
                console.log('URComment confirm redirected to console: ' + msg);
                return true;
            };
        };

        URComments.RestoreConfirmToConfirm = function() {
            //restore the normal action of confirm by writing nconfirm to back over confirm, so the site is able to send user messages outside of my script!
            unsafeWindow.confirm = nconfirm;
        };

        URComments.AutoZoomIN = function(Title, Comment, URStatus, urID, AutoSendComment) {
            return function() {
                console.log("URComments - AutoZoomIN");
				
				
				var URCommentsUnsavedDetected = false;
				
				var URCommentsUnsaveCount = $(".WazeControlSave .counter").html();
				
				//detect unsaved changed if there are and the auto save option is on abort adding comments to the UR
				if (URCommentsUnsaveCount > 0 && $("#UrCommentSaveAfterComment").is(":checked") && URStatus.toLowerCase() !== "open") {
					
					URCommentsUnsavedDetected = true;
					
					alert("UrComments has detected that you have unsaved changes!\n\nWith the Auto Save option enabled and with unsaved changes you cannot send comments that would require the script to save. Please save your changes and then reclick the comment you wish to send.");
				}
				//URCommentsUnsavedDetected = true;
				
				
				
				//get urid for manaully clicked commetns
                if (urID === 0) {
                    urID = $(".update-requests .selected").data("id");
                }


                //check to see if the auto zoom in option in enabled if it is start the zooming in process
                console.log("URComments - AutoZoomIN checking if we should zoom in based of if the Title is the same as the reminder title: " + Title + " pointer title: " + URCommentsArray[ReminderPosistion]);
                //having OneOrTheOTher first is a hack to make the logic work
                var OneOrTheOTher = "no";
                if (UrCommentAddReplyInstructions.checked === true && Title === URCommentsArray[ReminderPosistion]) {
                    OneOrTheOTher = "yes";
					
                } else if (UrCommentNewZoomIn.checked === true && Title != URCommentsArray[CloseNotIdentifiedPosistion] && AutoSendComment != "AutoSendComment") {
                    OneOrTheOTher = "yes";
	            }

                //alert(OneOrTheOTher);
                if (OneOrTheOTher === "yes" && URCommentsUnsavedDetected === false) {

                    console.log("URComments - AutoZoomIN zooming to location");

                    //predefined zoom threshold for auto zoom
                    var zoom = 4;

                    //do not zoom back out if we are already zoomed in and just happen to be re-clicking on a UR.
                    //or we have the map set good for a 4-day reminder
                    var WazeCurrentZoom = URComments.GetWazeMapZoomLevel();
                    if (WazeCurrentZoom < zoom) {
                        URComments.gotoURById(urID, 5);
                    }

                    //setTimeout(URComments.AutoZoomIN2(Title, Comment, URStatus), 2500);
                    setTimeout(URComments.PostURComment(Title, Comment, URStatus, AutoSendComment), 1);

                } else if(URCommentsUnsavedDetected === false) {

                    //auto zoom in is disabled jump to postURComment
                    //alert("else");
                    console.log("URComments - AutoZoomIN disabled to PostURComment");
                    //we have to use set timeout here because we need the  return function() in PostURComment
                    //for when we are zooming in and out for the reminder
                    //since we are not zooming here jump rigth to PostURComment
                    setTimeout(URComments.PostURComment(Title, Comment, URStatus, AutoSendComment), 1);
                }

            };
        };

        /* no longer used
        URComments.AutoZoomIN2 = function(Title, Comment, URStatus) {
        return function() {
        //set the map out a few zoom levels
        console.log("URComments - AutoZoomIN2 settign the map zoom to 5");
        //Waze.map.setCenter(Waze.map.getCenter(),5);
        setTimeout(URComments.SetZoomCloseUR(5, "LeaveOpen"), 0);

        //wait a duration
        setTimeout(URComments.PostURComment(Title, Comment, URStatus), 1500);
        };
        };
        */

        URComments.gotoURById = function(urID, zoom) {
            //alert(urID);
            //$('span[id="WME_AutoUR_Count"]').html((WMEAutoUR.Auto.index+1)+"/"+WMEAutoUR.Auto.UR_len);


            //12-15-14	
            //Waze.updateRequestsControl.selectById(urID);
            //var x = Waze.updateRequestsControl.currentRequest.attributes.geometry.x;
            //var y = Waze.updateRequestsControl.currentRequest.attributes.geometry.y;

            var x = Waze.model.mapUpdateRequests.objects[urID].attributes.geometry.x;
            var y = Waze.model.mapUpdateRequests.objects[urID].attributes.geometry.y;

            console.log("URComments - gotoURById: " + "x: " + x + "y: " + y + "zoom: " + zoom);

            Waze.map.setCenter([x, y], zoom);
            //WMEAutoUR.UR.getInfo();
            //WMEAutoUR.changeMessage(Waze.updateRequestsControl.currentRequest.attributes.type);
            return;
        };

        URComments.GetWazeMapZoomLevel = function(Title, Comment, URStatus) {
            /*
            var href = $('.WazeControlPermalink a').attr('href');
            var zoom = parseInt(getQueryString(href, 'zoom'));
            return zoom;
            */
            zoom = W.map.mapState.mapLocation.zoom;
            console.log("URComments - Current Zoom: " + zoom);
            return zoom;
        };

        URComments.PostURComment = function(Title, Comment, URStatus, AutoSendComment) {
            // the user clicked on a comment link

            return function() {
                //run the beta testers check every comment clicked
                //URComments.CheckBetaTesters();

				//Swap out special text
				Comment = URComments.StringSwap( Comment );
					
				
                console.log("URComments - attaching to send button " + Title + " - " + Comment + " - " + URStatus);

                //add event listener that runs most of the options
                //$('.new-comment-form .new-comment-text + .btn-default').click(URComments.URCommentSendBtnClicked(Title, URStatus));

                //URCommentZoomOutcheck
                $('.new-comment-form .new-comment-text + .btn-default').click(URComments.URCommentZoomOutcheck(Title, URStatus));

                /* I am going to move this under send button was clicked, that way editor can click a comment and then uncheck the zoom out option before clicking send and not be zoomed out.
                //zoom out option - if the user option is set to reload map after posting a comment reply
                if (UrCommentZoomOutAfterComment.checked === true) {
                console.log("URComments - attaching map zoom out to send");
                $('.new-comment-form .new-comment-text + .btn-default').click(URComments.SetZoomCloseUR(0, "LeaveOpen"));
                }
                */

                //check if the comment text area is present if not alert the user to open a UR
                if ($(".new-comment-text")[0]) {



                    //check to see if we are doing a "4 day Follow-Up" with the map link option turned on if not treat this comment as any other 
                    if (UrCommentAddReplyInstructions.checked === true && Title === URCommentsArray[ReminderPosistion]) {

                        //reply instructions + map link
                        var href = $('.WazeControlPermalink a').attr('href');
                        var lon = getQueryString(href, 'lon');
                        var lat = getQueryString(href, 'lat');
                        var zoom = parseInt(getQueryString(href, 'zoom'));
                        //alert(href);
                        var layers = "&layers=1797"; //this should have on; sat maps, roads, user requests, edit area, live editors
                        //zoom = zoom > 5 ? 17 : zoom + 12;
                        // https://www.waze.com/livemap?lon=-40.94918&lat=-18.56958&zoom=7

                        //wrap the zoom level in logic to confirm that we are not zoomed way out on accident
                        // set the confirm to false so we can reuse the variable
                        var r = false;
                        //zoom 4 seems like the furthest out we would ever need to send a link to
                        if (zoom > 3) {
                            //zoomed in enough
                            r = true;
                        } else {
                            //zoomed to far out to give the user a useful link
                            //promt the user

                            //this used to promt the user now reminders auto fill //disabled confirm                 r = confirm("UR Comments!\nThe map's zoom level is at " + zoom + " are you sure you want to send the user a link to the map with this zoom level? Remember to center the pin in your map window before clicking 4-day reminder.");

                        }
                        //this is where we reuse the r var this makes the nested ifs much more simple
                        if (r === true) {
                            //https://www.waze.com/editor/?env=usa&lon=-87.78955&lat=41.93165&layers=1797&zoom=6
                            //https://www.waze.com/editor/?-87.78955&lat=41.93165&layers=1797&zoom=6
                            var mapsUrl = 'https://www.waze.com/editor/?lon=' + lon + '&lat=' + lat + layers + '&zoom=' + zoom;
                            console.log('URComments - ReplyInstructions - ' + ReplyInstructions + mapsUrl);
                            $(".new-comment-text").val(Comment + "\r\n\r\n" + ReplyInstructions + "\r\n" + mapsUrl);
                        } else {
                            //user chose no lets clear the text area just in case there was 4 day from before
                            $(".new-comment-text").val("");
                        }

                    } else {
                        //comment only, wasnt a "4 day Follow-Up" with map option enabled so just apply the comment 
                        console.log('URComment - comment only ' + Title + ' - ' + Comment);

                        $(".new-comment-text").val(Comment);
                    }

                    if (URCommentAutoClickURStatus.checked === true) {

                        //redirect confirm function to our own holder function so we can restore it later  on
                        URComments.ClickStatus(URStatus);
                        //alert("clicked ur status");
                    }

                    if (AutoSendComment === "AutoSendComment") {
                        //alert(AutoSendComment);
                        $('.new-comment-form .new-comment-text + .btn-default').trigger('click');
                    }


                } else {
                    //we were unable to find an open UR
                    alert("URComments: Can not find the comment box! In order for this scrip to work you need to have a user request open");
                }
            };
        };

        //this is part of the script that gets the maps position for the 4 day reminder map link
        getQueryString = function(link, name) {
            var pos = link.indexOf(name + '=') + name.length + 1;
            var len = link.substr(pos).indexOf('&');
            if (-1 == len) len = link.substr(pos).length;
            return link.substr(pos, len);
        };

        URComments.ClickStatus = function(URStatus) {
            //bypass the confirm function so other site messages do not come up!
            URComments.ConfirmToConsole();
            //click the ur status options (Not identified solved, open)

            //check for regular editor
            if ($("#state-1").length !== 0) {

                if (URStatus.toLowerCase() == "notidentified") {
                    //click Not identified 
                    $("#state-1").trigger('click');
                } else if (URStatus.toLowerCase() == "solved") {
                    //click solved
                    $("#state-0").trigger('click');
                } else {
                    //click back on open just encase the wrong reply was clicked previously
                    $("#state--1").trigger('click');
                }
            }

            //check for beta editor
            if ($("#state-open").length !== 0) {
                $(".problem-edit .body").scrollTop($(".problem-edit .body")[0].scrollHeight);
                if (URStatus.toLowerCase() == "notidentified") {
                    //click Not identified 
                    $("#state-not-identified").trigger('click');
                } else if (URStatus.toLowerCase() == "solved") {
                    //click solved
                    $("#state-solved").trigger('click');
                } else {
                    //click back on open just encase the wrong reply was clicked previously
                    $("#state-open").trigger('click');
                }
            }


            //restores confirm function so other site messages come up!
            URComments.RestoreConfirmToConfirm();
        };

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////
        //// on start-up keep checking the site to see if the me tab is loaded
        ////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////	

        URComments.startcode = function() {
            // Check if WME is loaded, if not, waiting a moment and checks again. if yes init URComments
            try {
                //look for the me tab instead if the buggy chat room!           
                var element = $("#user-details");
                console.log("URComments - Found user-details window");
                if (typeof element !== "undefined" && element.value !== '') {
                    URComments.init();
                } else {
                    setTimeout(URComments.startcode, 2000);
                }
            } catch (err) {
                console.log("URComments - " + err);
                if (err === "TypeError: element is null" || err === "TypeError: element is null") {
                    setTimeout(URComments.startcode, 2000);
                }
                setTimeout(URComments.startcode, 2000);
            }
        };
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////    URO Preset Filters
        ////   
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        //URO+ these are the tags of all of the items URO uses to filter URs
        URComments.UROCheckboxesArray = ["_cbFilterWazeAuto",
            "_cbFilterIncorrectTurn",				//
            "_cbFilterIncorrectAddress",			//
            "_cbFilterIncorrectRoute",				//
            "_cbFilterMissingRoundabout",			//
            "_cbFilterGeneralError", 				//
            "_cbFilterTurnNotAllowed",				//
            "_cbFilterIncorrectJunction",			//
            "_cbFilterMissingBridgeOverpass",		//
            "_cbFilterWrongDrivingDirection",		//
            "_cbFilterMissingExit",					//
            "_cbFilterMissingRoad",					//
            "_cbFilterBlockedRoad",					//
            "_cbFilterMissingLandmark",				//
            "_cbFilterUndefined",					//
            //"_cbFilterCryosphere",				//
            "_cbFilterRoadworks",					//
            "_cbFilterConstruction",				//
            "_cbFilterClosure",						//
            "_cbFilterEvent",						//
            "_cbFilterNote",						//
            "_cbInvertURFilter",					//
            "_cbFilterOpenUR", 						//
            "_cbFilterClosedUR",					//
            "_cbFilterSolved",						//
            "_cbFilterUnidentified",				//
            "_cbEnableMinAgeFilter",				//
            "_cbEnableMaxAgeFilter",				//
            "_cbURDescriptionMustBePresent",		//
            "_cbURDescriptionMustBeAbsent", 		//
            "_cbEnableKeywordMustBePresent", 		//
            "_cbEnableKeywordMustBeAbsent", 		//
            "_cbCaseInsensitive", 					//
            "_cbHideMyComments", 					//
            "_cbHideAnyComments", 					//
            "_cbHideIfLastCommenter", 				//
            "_cbHideIfNotLastCommenter", 			//
            "_cbHideIfReporterLastCommenter",		//
            "_cbHideIfReporterNotLastCommenter",	//
            "_cbEnableMinCommentsFilter", 			//
            "_cbEnableMaxCommentsFilter", 			//
            "_cbHideMyFollowed", 					//
            "_cbHideMyUnfollowed", 					//
            "_cbEnableCommentAgeFilter2", 			//
            "_cbEnableCommentAgeFilter", 			//
            "_cbNoFilterForTaggedURs",				//
			"_cbURUserIDFilter",					//Without comments from user
			"_cbURResolverIDFilter"					//Not resolved by user
        ];

        URComments.UROPresetHighlight = function(a) {
            //alert(a);
            /*
            switch (a) {
            case "UroShowNew":
            $('#URCommentURONEW').css('background-color', '#FFFF66');
            $('#URCommentURO4DayFollowUp').css('background-color', '');
            $('#URCommentURO7Day').css('background-color', '');
            $('#URCommentURO8Day').css('background-color', '');
            $('#URCommentURO10Day').css('background-color', '');
            $('#URCommentURO24Hr').css('background-color', '');
            break;
            case "URO4DayFollowUp":
            $('#URCommentURONEW').css('background-color', '');
            $('#URCommentURO4DayFollowUp').css('background-color', '#FFFF66');
            $('#URCommentURO7Day').css('background-color', '');
            $('#URCommentURO8Day').css('background-color', '');
            $('#URCommentURO10Day').css('background-color', '');
            $('#URCommentURO24Hr').css('background-color', '');

            break;
            case "URO7Day":
            $('#URCommentURONEW').css('background-color', '');
            $('#URCommentURO4DayFollowUp').css('background-color', '');
            $('#URCommentURO7Day').css('background-color', '#FFFF66');
            $('#URCommentURO8Day').css('background-color', '');
            $('#URCommentURO10Day').css('background-color', '');
            $('#URCommentURO24Hr').css('background-color', '');
            break;
            case "URO8Day":	
            $('#URCommentURONEW').css('background-color', '');
            $('#URCommentURO4DayFollowUp').css('background-color', '');
            $('#URCommentURO7Day').css('background-color', '');		
            $('#URCommentURO8Day').css('background-color', '#FFFF66');
            $('#URCommentURO10Day').css('background-color', '');
            $('#URCommentURO24Hr').css('background-color', '');
            break;
            case "URO10Day":	
            $('#URCommentURONEW').css('background-color', '');
            $('#URCommentURO4DayFollowUp').css('background-color', '');
            $('#URCommentURO7Day').css('background-color', '');		
            $('#URCommentURO8Day').css('background-color', '');
            $('#URCommentURO10Day').css('background-color', '#FFFF66');
            $('#URCommentURO24Hr').css('background-color', '');
            break;	
            case "URO24Hr":	
            $('#URCommentURONEW').css('background-color', '');
            $('#URCommentURO4DayFollowUp').css('background-color', '');
            $('#URCommentURO7Day').css('background-color', '');		
            $('#URCommentURO8Day').css('background-color', '');
            $('#URCommentURO10Day').css('background-color', '');
            $('#URCommentURO24Hr').css('background-color', '#FFFF66');
            break;	
            case "UROclearUROFiltrs":
            $('#URCommentURONEW').css('background-color', '');
            $('#URCommentURO4DayFollowUp').css('background-color', '');
            $('#URCommentURO7Day').css('background-color', '');
            $('#URCommentURO8Day').css('background-color', '');
            $('#URCommentURO10Day').css('background-color', '');
            $('#URCommentURO24Hr').css('background-color', '');
            break;
            }
            */

            if (a === "URONewNoDescription") {
                $('#URONewNoDescription').css('background-color', '#FFFF66');
                $('#URCommentURONEW').css('background-color', '');
                $('#URCommentURO4DayFollowUp').css('background-color', '');
                $('#URCommentURO7Day').css('background-color', '');
                $('#URCommentURO8Day').css('background-color', '');
                $('#URCommentURO10Day').css('background-color', '');
                $('#URCommentURO24Hr').css('background-color', '');
            }

            if (a === "UroShowNew") {
                $('#URONewNoDescription').css('background-color', '');
                $('#URCommentURONEW').css('background-color', '#FFFF66');
                $('#URCommentURO4DayFollowUp').css('background-color', '');
                $('#URCommentURO7Day').css('background-color', '');
                $('#URCommentURO8Day').css('background-color', '');
                $('#URCommentURO10Day').css('background-color', '');
                $('#URCommentURO24Hr').css('background-color', '');
            }
            if (a === "URO4DayFollowUp") {
                $('#URONewNoDescription').css('background-color', '');
                $('#URCommentURONEW').css('background-color', '');
                $('#URCommentURO4DayFollowUp').css('background-color', '#FFFF66');
                $('#URCommentURO7Day').css('background-color', '');
                $('#URCommentURO8Day').css('background-color', '');
                $('#URCommentURO10Day').css('background-color', '');
                $('#URCommentURO24Hr').css('background-color', '');
            }
            if (a === "URO7Day") {
                $('#URONewNoDescription').css('background-color', '');
                $('#URCommentURONEW').css('background-color', '');
                $('#URCommentURO4DayFollowUp').css('background-color', '');
                $('#URCommentURO7Day').css('background-color', '#FFFF66');
                $('#URCommentURO8Day').css('background-color', '');
                $('#URCommentURO10Day').css('background-color', '');
                $('#URCommentURO24Hr').css('background-color', '');
            }
            if (a === "URO8Day") {
                $('#URONewNoDescription').css('background-color', '');
                $('#URCommentURONEW').css('background-color', '');
                $('#URCommentURO4DayFollowUp').css('background-color', '');
                $('#URCommentURO7Day').css('background-color', '');
                $('#URCommentURO8Day').css('background-color', '#FFFF66');
                $('#URCommentURO10Day').css('background-color', '');
                $('#URCommentURO24Hr').css('background-color', '');
            }
            if (a === "URO10Day") {
                $('#URONewNoDescription').css('background-color', '');
                $('#URCommentURONEW').css('background-color', '');
                $('#URCommentURO4DayFollowUp').css('background-color', '');
                $('#URCommentURO7Day').css('background-color', '');
                $('#URCommentURO8Day').css('background-color', '');
                $('#URCommentURO10Day').css('background-color', '#FFFF66');
                $('#URCommentURO24Hr').css('background-color', '');
            }
            if (a === "URO24Hr") {
                $('#URONewNoDescription').css('background-color', '');
                $('#URCommentURONEW').css('background-color', '');
                $('#URCommentURO4DayFollowUp').css('background-color', '');
                $('#URCommentURO7Day').css('background-color', '');
                $('#URCommentURO8Day').css('background-color', '');
                $('#URCommentURO10Day').css('background-color', '');
                $('#URCommentURO24Hr').css('background-color', '#FFFF66');
            }
            if (a === "UROclearUROFiltrs") {
                $('#URONewNoDescription').css('background-color', '');
                $('#URCommentURONEW').css('background-color', '');
                $('#URCommentURO4DayFollowUp').css('background-color', '');
                $('#URCommentURO7Day').css('background-color', '');
                $('#URCommentURO8Day').css('background-color', '');
                $('#URCommentURO10Day').css('background-color', '');
                $('#URCommentURO24Hr').css('background-color', '');
            }

        };

        URComments.UROClearClicked = function(a) {
            return function() {

                //alert(a);
                URComments.UROPresetHighlight(a);

                //save the current preset so we can reaply the highlighting on startup
                localStorage.setItem('UROCurrentPeset', a);

                if ($("#sidepanel-uroverview").length) {
                    //alert("test");
					console.log("URComments - URO clear");
                    //this is the array used to store the URO id tags

                    //go over the array and clear all of the URO+ check boxes
                    for (var URComments_URO_Index = 0; URComments_URO_Index < URComments.UROCheckboxesArray.length; URComments_URO_Index = URComments_URO_Index + 1) {

                        if ($('#' + URComments.UROCheckboxesArray[URComments_URO_Index]).length <= 0) {
                            alert("URComments - there was an error finding URO's tag " + URComments.UROCheckboxesArray[URComments_URO_Index]);
                            return false;
                        }

                        if ($('#' + URComments.UROCheckboxesArray[URComments_URO_Index]).is(":checked")) {
                            //clicks the checkbox by if the checkbox is checked
                            $('#' + URComments.UROCheckboxesArray[URComments_URO_Index]).trigger('click');
                        } else {
                            //click check box if checkbox in unchecked
                            //$(document.getElementById(URComments.UROCheckboxesArray[ URComments_URO_Index ])).trigger('click');
                        }
                    }

					/*
                    //on clearing uro+ clear the check box for only showing editors urs
                    if (a === "UROclearUROFiltrs" && URCommentUROOnlyMyUR.checked) {
                        $('#URCommentUROOnlyMyUR').trigger('click');
                    }

					*/
					
                    // make it so uro+ doesnt filter tagged urs [NOTE]...
                    $('#_cbNoFilterForTaggedURs').trigger('click');

                    //set the different filters here
                    /*
                    switch (a) {
                    case "UroShowNew":
                    console.log("URComments - URO show new");
                    $('#_cbHideIfReporterNotLastCommenter').trigger('click');
                    break;
                    case "URO4DayFollowUp":
                    console.log("URComments - URO 4 day");
                    $('#_inputFilterMinComments').val(1);
                    $('#_cbEnableMinCommentsFilter').trigger('click');
                    $('#_inputFilterMaxComments').val(1);
                    $('#_cbEnableMaxCommentsFilter').trigger('click');
                    $('#_inputFilterCommentDays2').val(4);
                    $('#_cbEnableCommentAgeFilter2').trigger('click');

                    //if the editors were not on top of 4-day URs some of these would move into 7 day 
                    //$('#_inputFilterCommentDays').val(6);
                    //$('#_cbEnableCommentAgeFilter').trigger('click');

                    break;
                    case "URO7Day":
                    console.log("URComments - URO 7 day");
                    $('#_inputFilterMinComments').val(1);
                    $('#_cbEnableMinCommentsFilter').trigger('click');
                    $('#_inputFilterCommentDays2').val(7);
                    $('#_cbEnableCommentAgeFilter2').trigger('click');
                    $('#_cbHideIfReporterLastCommenter').trigger('click');
                    break;
                    case "URO8Day":	
                    console.log("URComments - URO 7 day");
                    $('#_inputFilterMinComments').val(1);
                    $('#_cbEnableMinCommentsFilter').trigger('click');
                    $('#_inputFilterCommentDays2').val(8);
                    $('#_cbEnableCommentAgeFilter2').trigger('click');
                    $('#_cbHideIfReporterLastCommenter').trigger('click');
                    break;
                    case "URO10Day":	
                    console.log("URComments - URO 10 day");
                    $('#_inputFilterMinComments').val(1);
                    $('#_cbEnableMinCommentsFilter').trigger('click');
                    $('#_inputFilterCommentDays2').val(10);
                    $('#_cbEnableCommentAgeFilter2').trigger('click');
                    $('#_cbHideIfReporterLastCommenter').trigger('click');
                    break;
                    case "URO24Hr":

                    //alanoftheberg 
                    //check "yes" on "If last comment made by UR reporter?"
                    $('#_cbHideIfReporterLastCommenter').trigger('click');

                    //check "Hide URs less than days old" "8" days old
                    $('#_inputFilterMinDays').val(8);
                    $('#_cbEnableCommentAgeFilter2').trigger('click');

                    //check "With less than" and put in "1" comments
                    $('#_inputFilterMinComments').val(1);
                    $('#_cbEnableMinCommentsFilter').trigger('click');

                    //check "Last comment more than"  "1" days ago
                    $('#_inputFilterCommentDays').val(1);
                    $('#_cbEnableCommentAgeFilter').trigger('click');
                    break;
                    case "UROclearUROFiltrs":
                    break;
                    }
                    */




                    if (a === "UroShowNew") {
                        console.log("URComments - URO show new");
						
						//If last comment made by UR reporter? chose no
                        $('#_cbHideIfReporterNotLastCommenter').trigger('click');
                    }
                    if (a === "URONewNoDescription") {
						//only show no user description
                        $('#_cbURDescriptionMustBeAbsent').trigger('click');
						
						//hide reporter did not leave the last comment
                        $('#_cbHideIfReporterNotLastCommenter').trigger('click');
						
						//Hide With more than 1 comments
                        $('#_cbEnableMaxCommentsFilter').trigger('click');
                        $('#_inputFilterMaxComments').val(1);
                    }
                    if (a === "URO4DayFollowUp") {
                        console.log("URComments - URO 4 day");
						
						//hide With less than 1 comments
                        $('#_inputFilterMinComments').val(1);
                        $('#_cbEnableMinCommentsFilter').trigger('click');
					
						//Hide With more than 1 comments
                        $('#_inputFilterMaxComments').val(1);
                        $('#_cbEnableMaxCommentsFilter').trigger('click');
						
						//Hide Last comment less than 4 days ago
                        $('#_inputFilterCommentDays2').val(4);
                        $('#_cbEnableCommentAgeFilter2').trigger('click');

                    }
                    if (a === "URO7Day") {
                        console.log("URComments - URO 7 day");
						
						//hide With less than 1 comments
                        $('#_inputFilterMinComments').val(1); //1
                        $('#_cbEnableMinCommentsFilter').trigger('click');
						
						//hide Last comment less than 7 days ago
                        $('#_inputFilterCommentDays2').val(7);//7
                        $('#_cbEnableCommentAgeFilter2').trigger('click');
						
						//hide If last comment made by UR reporter?
                        $('#_cbHideIfReporterLastCommenter').trigger('click');
                    }
                    if (a === "URO8Day") {
                        console.log("URComments - URO 7 day");
						
						//hide With less than 1 comments
                        $('#_inputFilterMinComments').val(1); //1
                        $('#_cbEnableMinCommentsFilter').trigger('click');
						
						//hide Last comment less than 8 days ago
                        $('#_inputFilterCommentDays2').val(8);//8
                        $('#_cbEnableCommentAgeFilter2').trigger('click');
						
						//hide If last comment made by UR reporter?
                        $('#_cbHideIfReporterLastCommenter').trigger('click');
                    }
                    if (a === "URO10Day") {
                        console.log("URComments - URO 10 day");
						
						//hide With less than 1 comments
                        $('#_inputFilterMinComments').val(1); //1
                        $('#_cbEnableMinCommentsFilter').trigger('click');
						
						//hide Last comment less than 8 days ago
                        $('#_inputFilterCommentDays2').val(10);//10
                        $('#_cbEnableCommentAgeFilter2').trigger('click');
						
						//hide If last comment made by UR reporter?
                        $('#_cbHideIfReporterLastCommenter').trigger('click');
                    }
                    if (a === "URO24Hr") {

                        //alanoftheberg 
 
						//check "Hide URs less than days old" "8" days old
                        $('#_inputFilterMinDays').val(8);//8
                        $('#_cbEnableMinAgeFilter').trigger('click');

						
						//check "yes" on "If last comment made by UR reporter?"
                        $('#_cbHideIfReporterLastCommenter').trigger('click');
						
						//check "With less than" and put in "1" comments
                        $('#_inputFilterMinComments').val(1);//1
                        $('#_cbEnableMinCommentsFilter').trigger('click');

						//check "Last comment more than"  "1" days ago
                        $('#_inputFilterCommentDays').val(1);//1
                        $('#_cbEnableCommentAgeFilter').trigger('click');

                    }
                    if (a === "UROclearUROFiltrs") {}

                    //shared URO settings except clear
                    if (a !== "UROclearUROFiltrs") {
                        //$('#_cbFilterClosedUR').trigger('click');
                        //$('#_cbFilterSolved').trigger('click');
                        $('#_cbFilterUnidentified').trigger('click');
                    }

                    if (URCommentUROOnlyMyUR.checked) {
                        $("#_cbHideAnyComments").trigger('click');
                    }

                } else {
                    alert("UR Overview Plus (URO+) needs to be installed to use these URO Presets.");
                }
            };
        };

        //Notes


        //alert(Waze.model.loginManager.user.userName); //editor's user name
        //alert(Waze.model.loginManager.user.id); //editor's id number

        /*
        //$(document).ready(function() {
        $('#WazeMap').mousedown(function(event) {
        switch (event.which) {
        case 1:
        //alert('Left mouse button pressed');
        break;
        case 2:
        //;alert('Middle mouse button pressed');
        break;
        case 3:
        alert('Right mouse button pressed');
        break;
        default:
        break;

        }
        //alert("test");
        });
        //});
        */

        //$('.new-comment-form button[type="submit"]').click(function() { alert('clicked');}) grabs your button and alerts clicked if you want to get out of the DOM traversal

        //this is how you set the select in a drop down after it is filled
        // $("#BoilerPlateCreators").val("vectorspace");

        //jquery checkbox
        //$('.myCheckbox').prop('checked', true);
        //$('.myCheckbox').prop('checked', false);

        /*
        //change the tag data of an element by class
        var x = document.getElementsByClassName("slider");
        //alert( x.length );
        //go trough all of the eletemnts that match the requested class
        for(var i = 0, j=x.length; i<j; i++){

        var btnHtml = (0 + " - " + x[i].innerHTML);
        alert (btnHtml);

        //this if doent matach the slider type but i am leaving it for future documentation
        if(btnHtml.indexOf("<span>Close</span>") > -1) {

        //change the tag data of an element by class
        //x[i].style.top = "125px";

        }
        }
        */


        URComments.startcode();
    }
    //URComments_bootstrap();
setTimeout(URComments_bootstrap, 3000);