 jQnC(document).ready(function(){

	//-------------------- START OF RSS FEEDS POP-UP -------------------------//	

		jQnC(".subscribe > a").toggle(
      // Toggle 1
      function (e) {
				x = e.pageX; // X position of the mouse when CLICKED
				y = e.pageY; // Y position of the mouse	when CLICKED		
											
				/* Removed by Andy Jarrett */
				// Reinstated by Ken M as new function was
				// incomplete or just not doing what was hoped
				 
				objSubscribe = document.getElementById('rssSubscribe');
				curleft = findPosX(objSubscribe);  // finds X position of ELEMENT
				curtop = findPosY(objSubscribe);	// finds Y position of ELEMENT
				
				if (curleft < 1) {
					x = e.pageX;					
				}
				else { x = curleft};
				
				if (curtop < 1) {
					y = e.pageY;					
				}
				else { y = curtop };				
				
				d = jQnC("#rssfeed"); // D for div		
				
				// Added by Andy Jarrett
				// changes the location of the div pop-up if 
				// called from the var right of the screen
				bodyWidth = jQnC(document).width();
				boxWidth = jQnC("#rssfeed").width();
												
				/* 	alert(bodyWidth);
					alert(boxWidth);
					alert(x);
				*/				
				
				var myLocation = window.location.href; // get the caller address
				var findMyLocation = myLocation.search(/home/i); // check to see if the caller is the home page
					
					if ( findMyLocation < 0 ) {
						x = (x - 270 ) ;  // off set box position by 270
					} 				
								
	      var cssObj = {
	      	position: "absolute",
	        top: y+15, // Move the box 15px below the mouse position
	        left: x+25 // Move the div back to the left behind the mouse by 10px 
	      }
	      
	      d.css(cssObj); // Apply the CSS	      
	
			
	jQnC('#rssfeed').slideDown('fast'); // Show the div 
	
		    
      },
      // Toggle 1
      function () {	  	
        jQnC("#rssfeed").slideUp('slow'); // Hide the div
      }      
		)
		
		// Create new div
		var newDiv = document.createElement("div");
		// give it an ID
		jQnC(newDiv).attr("id","rssfeed");
		
		// Add it to the body 
		jQnC(newDiv).appendTo("body")
		
		var newDivCssObj = {
			display:	"none"
		};
		
		jQnC("#rssfeed").css(newDivCssObj);//Apply CSS		
				
		// We're going to load the page in
		jQnC("#rssfeed").load("/index.cfm/events/home.feeds");		
		
	//-------------------- END OF RSS FEEDS POP-UP -------------------------//
		
	 function findPosX(obj)  {
    	var curleft = 0;
    		if(obj.offsetParent)
        		while(1) 
        	{
          	curleft += obj.offsetLeft;
          		if(!obj.offsetParent)
           			break;
          	obj = obj.offsetParent;
        	}
    			else if(obj.x)
        		curleft += obj.x;
    		return curleft;
  		}
		
		function findPosY(obj){
			var curtop = 0;
			if (obj.offsetParent) 
				while (1) {
					curtop += obj.offsetTop;
					if (!obj.offsetParent) 
						break;
					obj = obj.offsetParent;
				}
			else 
				if (obj.y) 
					curtop += obj.y;
			return curtop;
		}			

		
	//-------------------- START OF EXPLAIN THIS PAGE POP-UP -------------------------//	

		jQnC(".explain > a").toggle(
      // Toggle 1
      function (e) {
				x = e.pageX; // X position of the mouse
				y = e.pageY; // Y position of the mouse
				
				/* Removed by AL */
				/* Put back in by Ken M */
				objSubscribe = document.getElementById('rssSubscribe');
				curleft = findPosX(objSubscribe); 
				curtop = findPosY(objSubscribe);
				
				if (curleft < 1) {
					x = e.pageX;					
				}
				else { x = curleft};
				
				if (curtop < 1) {
					y = e.pageY;					
				}
				else { y = curtop };			
				
				d = jQnC("#explain"); // D for div	
				
				var myLocation = window.location.href; // get the caller address
				var findMyLocation = myLocation.search(/home/i); // check to see if the caller is the home page
					
					if ( findMyLocation < 0 ) {
						x = (x - 245 ) ;  // off set box position
					} 				
				
	      var cssObj = {
	      	position: "absolute",
	        top: y+15, // Move the box 15px below the mouse position
	        left: x-100 // Move the div back to the left behind the mouse  
	      }
	      d.css(cssObj); // Apply the CSS
				
				
		jQnC("#explain").slideDown('fast'); // Show the div        
      },
      // Toggle 1
      function () {
        jQnC("#explain").slideUp('slow'); // Hide the div
      }      
		)
		
		// Create new div
		var newDiv = document.createElement("div");
		// give it an ID
		jQnC(newDiv).attr("id","explain");
		
		// Add it to the body 
		jQnC(newDiv).appendTo("body")
		
		var newDivCssObj = {
			display:					"none"			
		};
		jQnC("#explain").css(newDivCssObj);//Apply CSS		
				
		// We're going to load the page in
		jQnC("#explain").load("/index.cfm/events/home.explain");		
		
	//-------------------- END OF EXPLAIN THIS PAGE POP-UP -------------------------//


	//-------------------- START OF ADD ART EVENT DROP DOWN -------------------------//	

		jQnC(".chooseAddEvent > a").toggle(
      // Toggle 1
      function (e) {
	  	
			// alert(e.originalEvent.cancelBubble);			
			// alert(this.lastToggle);
						
				x = e.pageX; // X position of the mouse
				y = e.pageY; // Y position of the mouse
				
				objSubscribe = document.getElementById('id_addArtEvent');
				curleft = findPosX(objSubscribe); 
				curtop = findPosY(objSubscribe);
				
				if (curleft < 1) {
					x = e.pageX;					
				}
				else { x = curleft};
				
				if (curtop < 1) {
					y = e.pageY;					
				}
				else { y = curtop };
				
				d = jQnC("#chooseAdd"); // D for div		
				
				document.getElementById('id_addArtEvent').className='dropList dropListClicked';
						
	      var cssObj = {
	      	position: "absolute",
	        top: y+22, // Move the box 15px below the mouse position
	        left: x-10 // Move the div back to the left behind the mouse by 10px 
	      }
	      d.css(cssObj); // Apply the CSS
	    		
				jQnC('#chooseAdd').slideDown('fast'); // Show the div
				        
      },
      // Toggle 1
      function () {
        jQnC("#chooseAdd").slideUp('fast'); // Hide the div		    
		document.getElementById('id_addArtEvent').className='dropList';
		// alert(this.lastToggle);
      }      
		)
		
		// Create new div
		var newDiv = document.createElement("div");
		// give it an ID
		jQnC(newDiv).attr("id","chooseAdd");
		
		// Add it to the body 
		jQnC(newDiv).appendTo("body")
		
		var newDivCssObj = {
			display: "none",
			width: "130px"
		//	backgroundImage:	"url('/media/img/bg-grad-s.gif')"
		//  backgroundRepeat: "repeat-x"
		}
		
		jQnC("#chooseAdd").css(newDivCssObj);//Apply CSS		

// We're going to load the page in
		jQnC("#chooseAdd").load("/index.cfm/events/home.chooseAddEvent");		
		
	//-------------------- END OF ADD ART EVENT DROP DOWN -------------------------//


	//-------------------- BUBBLE -------------------------//	

		//home - event info more info bubble
		jQnC(".bubbleInfo").bubble( {
			distance: 0,
			time:250, 
			hideDelay: 100
		});
	
	//-------------------- DIARY LIST - HIDE DAY/SHOW DAY -------------------------//		
-		jQnC(".diary-list-day").hide();
-		jQnC(".diary-list-day-hide").hide();

		jQnC(".diary-list-day-hide").bind('click', function () {
			jQnC(".diary-list-day").slideUp();
			jQnC(".diary-list-day-hide").hide();
			jQnC(".diary-list-day-show").show();
		});

		jQnC(".diary-list-day-show").bind('click', function () {
			jQnC(".diary-list-day").slideDown();
			jQnC(".diary-list-day-show").hide();
			jQnC(".diary-list-day-hide").show();

		});
	
	//-------------------- DIARY MONTH, WEEK, DAY - HIDE CALENDARS -------------------------//
		//identify class of box checked inside diary-month-artcalendrs-checkboxes, hide any paragraphs with the same class in the .calendar div
		jQnC(".diary-month-artcalendrs-checkboxes input").bind('click', function() {
			var id = jQnC(this).get(0).id;
			jQnC(".calendar ."+id).toggle();
		});

	//--------DIARY DAY - POPUP ------------------//
	jQnC(".diary_item_popover").hide();

	jQnC(".diary_item").bind('mouseover', function () {
		var id = jQnC(this).get(0).id;
		jQnC("#popover_"+id).show();
	});
	jQnC(".diary_item").bind('mouseout', function () {
		var id = jQnC(this).get(0).id;
		jQnC("#popover_"+id).hide();
	});

	//-------- DIARY WEEK SMALL POPUP ------------------//
	jQnC(".diary-week-bubble-info").bubble( {
		distance: 0,
		time:250, 
		hideDelay: 100,
		measure: 0
	});	
	
	//-------- DIARY WEEK EDIT FORM POPUP ------------------//
	jQnC(".diary-week-edit-form").hide();
	jQnC(".diary-week-edit-link").bind('click', function () {
		var id = jQnC(this).get(0).id;
		jQnC("#diary-week-edit-form-"+id).show();
	});
	
	//--------------------CITY CATEGORIES -------------------------//
	
	//on click next, hide the list with show class
	jQnC(".next-city").bind("click", function() {
		//get the next item
		var nextItem = jQnC(".city-categories .show").next();
		if(nextItem.is(".links")) {
			jQnC(".city-categories .show").removeClass("show").addClass("hide").next().removeClass("hide").addClass("show");				
			jQnC(".city-categories .star-on").removeClass("star-on").addClass("star-off").parent().next().children().addClass("star-on").removeClass("star-off");
		}
	});
	//on click prev, hide the list with show class
	jQnC(".prev-city").bind("click", function() {
		//get the next item
		var prevItem = jQnC(".city-categories .show").prev();
		if(prevItem.is(".links")) {
			jQnC(".city-categories .show").removeClass("show").addClass("hide").prev().removeClass("hide").addClass("show");
			jQnC(".city-categories .star-on").removeClass("star-on").addClass("star-off").parent().prev().children().addClass("star-on").removeClass("star-off");
		}
	});
	//on click star, highlight star and show relevant list
	jQnC(".city-categories .indicator a").bind("click", function() {
		//get the class of selected a
		var id = jQnC(this).get(0).id;
		jQnC(".city-categories .show").removeClass("show").addClass("hide");
		jQnC(".city-categories ."+id).removeClass("hide").addClass("show");
		jQnC(".city-categories .star-on").removeClass("star-on").addClass("star-off");
		jQnC(".city-categories #"+id).removeClass("star-off").addClass("star-on");
	});		
	
	//--------------------EVENT CATEGORIES -------------------------//
	
		//on click next, hide the list with show class
		jQnC(".next-category").bind("click", function() {
			//get the next item
			var nextItem = jQnC(".event-categories .show").next();
			if(nextItem.is(".links")) {
				jQnC(".event-categories .show").removeClass("show").addClass("hide").next().removeClass("hide").addClass("show");				
				jQnC(".event-categories .star-on").removeClass("star-on").addClass("star-off").parent().next().children().addClass("star-on").removeClass("star-off");
			}
		});
		//on click prev, hide the list with show class
		jQnC(".prev-category").bind("click", function() {
			//get the next item
			var prevItem = jQnC(".event-categories .show").prev();
			if(prevItem.is(".links")) {
				jQnC(".event-categories .show").removeClass("show").addClass("hide").prev().removeClass("hide").addClass("show");
				jQnC(".event-categories .star-on").removeClass("star-on").addClass("star-off").parent().prev().children().addClass("star-on").removeClass("star-off");
			}
		});
		//on click star, highlight star and show relevant list
		jQnC(".event-categories .indicator a").bind("click", function() {
			//get the class of selected a
			var id = jQnC(this).get(0).id;
			jQnC(".event-categories .show").removeClass("show").addClass("hide");
			jQnC(".event-categories ."+id).removeClass("hide").addClass("show");
			jQnC(".event-categories .star-on").removeClass("star-on").addClass("star-off");
			jQnC(".event-categories #"+id).removeClass("star-off").addClass("star-on");
		});		
		
		//on click category, call relevant page
		jQnC(".event-categories .links a").bind('click', function () {
			var id = jQnC(this).get(0).id;
			jQnC.get("index.cfm/events/layout.moreCategoryList?id="+id, function(data){
			("#categories-events").empty().append(data);
			});
		});
		
	//-------------------- SPECIAL EVENTS -------------------------//		

		//on click next, hide the list with show class
		jQnC(".next-special").bind("click", function() {
			//get the next item
			var nextItem = jQnC(".special-events .show").next();
			if(nextItem.is(".links")) {
				jQnC(".special-events .show").removeClass("show").addClass("hide").next().removeClass("hide").addClass("show");
				jQnC(".special-events .star-on").removeClass("star-on").addClass("star-off").parent().next().children().addClass("star-on").removeClass("star-off");
			}
		});
		//on click prev, hide the list with show class
		jQnC(".prev-special").bind("click", function() {
			//get the prev item
			var prevItem = jQnC(".special-events .show").prev();
			if(prevItem.is(".links")) {
				jQnC(".special-events .show").removeClass("show").addClass("hide").prev().removeClass("hide").addClass("show");
				jQnC(".special-events .star-on").removeClass("star-on").addClass("star-off").parent().prev().children().addClass("star-on").removeClass("star-off");
			}
		});
		//on click star, highlight star and show relevant list
		jQnC(".special-events .indicator a").bind("click", function() {
			//get the class of selected a
			var id = jQnC(this).get(0).id;
			jQnC(".special-events .show").removeClass("show").addClass("hide");
			jQnC(".special-events ."+id).removeClass("hide").addClass("show");
			jQnC(".special-events .star-on").removeClass("star-on").addClass("star-off");
			jQnC(".special-events #"+id).removeClass("star-off").addClass("star-on");
		});	
		

		jQnC(".special-events-groups a").bind("click", function() {
			//get the class of selected a
			var id = jQnC(this).get(0).id;
			jQnC(".greyboxCol1 .show ").removeClass("show").addClass("hide");
			jQnC(".greyboxCol1 ."+id).removeClass("hide").addClass("show");
			jQnC(".event-list-1 ").removeClass("hide").addClass("show");
		});	
		
	//-------------------- TIPS -------------------------//
	jQnC(".blackbox .next").bind("click", function() {
		//get the next item
		var nextItem = jQnC(".blackbox .show").next();
		if (nextItem.is(".tip")) {
			jQnC(".blackbox .show").removeClass("show").addClass("hide").next().removeClass("hide").addClass("show");
		}
	});
	jQnC(".blackbox .prev").bind("click", function() {
		//get the next item
		var prevItem = jQnC(".blackbox .show").prev();
		if (prevItem.is(".tip")) {
			jQnC(".blackbox .show").removeClass("show").addClass("hide").prev().removeClass("hide").addClass("show");
		}
	});	

	//--------------------HOMEPAGE EVENT LISTS -------------------------//

		//hide all extra lists except the first
		
		
		jQnC(".prev_screen").addClass('disabled');

		//on click prev, show prev list item, hide current one
		jQnC(".prev_screen").bind("click", function() {
			//identify which .prev has been clicked
			id = jQnC(this).parents('.block').get(0).id;

			if(jQnC("#"+id+" .event-list-4").is(".show")) {
				jQnC("#"+id+" .event-list-4").hide();
				jQnC("#"+id+" .event-list-4").removeClass('show');			

				jQnC("#"+id+" .event-list-3").addClass('show');
				jQnC("#"+id+" .event-list-3").show();
		
				jQnC("#"+id+" .next").removeClass('disabled');
			} else if (jQnC("#"+id+" .event-list-3").is(".show")) {
				jQnC("#"+id+" .event-list-3").hide();
				jQnC("#"+id+" .event-list-3").removeClass('show');			

				jQnC("#"+id+" .event-list-2").addClass('show');
				jQnC("#"+id+" .event-list-2").show();			
			} else if (jQnC(".event-list-2").is(".show")) {
				jQnC("#"+id+" .event-list-2").hide();
				jQnC("#"+id+" .event-list-2").removeClass('show');			

				jQnC("#"+id+" .event-list-1").addClass('show');
				jQnC("#"+id+" .event-list-1").show();		
		
				jQnC("#"+id+" .prev_screen").addClass("disabled");
			}
		});

		//on click next, show next list item, hide current one
		jQnC(".next_screen").bind("click", function() {
			//identify which .next has been clicked
			id = jQnC(this).parents('.block').get(0).id;

			if(jQnC("#"+id+" .event-list-1").is(".show")) {

				jQnC("#"+id+" .event-list-1").hide();
				jQnC("#"+id+" .event-list-1").removeClass('show');			

				jQnC("#"+id+" .event-list-2").addClass('show');
				jQnC("#"+id+" .event-list-2").show();
		
				jQnC("#"+id+" .prev_screen").removeClass('disabled');

			} else if (jQnC(".event-list-2").is(".show")) {

				jQnC("#"+id+" .event-list-2").hide();
				jQnC("#"+id+" .event-list-2").removeClass('show');			

				jQnC("#"+id+" .event-list-3").addClass('show');
				jQnC("#"+id+" .event-list-3").show();

			} else if (jQnC(".event-list-3").is(".show")) {
				jQnC("#"+id+" .event-list-3").hide();
				jQnC("#"+id+" .event-list-3").removeClass('show');			

				jQnC("#"+id+" .event-list-4").addClass('show');
				jQnC("#"+id+" .event-list-4").show();		
		
				jQnC("#"+id+" .next_screen").addClass("disabled");
			} 
		});

	//------- events - star rating --------//
	jQnC(function(){
	 jQnC('.star').rating({
	  callback: function(value, link){
		// 'this' is the hidden form element holding the current value
		// 'value' is the value selected
		// 'element' points to the link element that received the click.
		valArray = value.split("_");		

		//if cancelled
		if (valArray == 0) {
			// we need to go to the star rating to split out the ID
			value = jQnC(this).next().next().text();
			// We again split the value
			valArray = value.split("_");
			// We set the new rating to zero. Effectively a cancel
			valArray[0] = 0;
		}
		
		jQnC.get("/index.cfm/events/events.ratings/rateval/"+valArray[0]+"/eventid/"+valArray[1]);
	
	 }
	 });
	});
	
    
    jQnC('.starStretched').rating({
        required: 'true',
        callback: function(value, link){
            // 'this' is the hidden form element holding the current value
            // 'value' is the value selected
            // 'element' points to the link element that received the click.
            valArray = value.split("_");
            
            //if cancelled
            if (valArray == 0) {
                // we need to go to the star rating to split out the ID
                value = jQnC(this).next().next().text();
                // We again split the value
                valArray = value.split("_");
                // We set the new rating to zero. Effectively a cancel
                valArray[0] = 0;
            }
            jQnC.get("/index.cfm/events/events.ratings/rateval/" + valArray[0] + "/eventid/" + valArray[1]);
        }
    });	
	
	
	//-------- events - tabbing --------//		
	jQnC.jtabber({
		mainLinkTag: ".tabs a", // much like a css selector, you must have a 'title' attribute that links to the div id name
		activeLinkClass: "selected", // class that is applied to the tab once it's clicked
		hiddenContentClass: "hiddencontent", // the class of the content you are hiding until the tab is clicked
		showDefaultTab: null, // 1 will open the first tab, 2 will open the second etc.  null will open nothing by default
		showErrors: false, // true/false - if you want errors to be alerted to you
		effect: 'slide', // null, 'slide' or 'fade' - do you want your content to fade in or slide in?
		effectSpeed: 'medium' // 'slow', 'medium' or 'fast' - the speed of the effect
	})	

	//------ events events-list rollover --------//
	jQnC(".js-rollover li").hover(
		function() {			
			jQnC(this).addClass("grey");
		},
		function() {
			jQnC(this).removeClass("grey");
		}		
	);
	
	//----- sidebar show reveal ---------//
	jQnC("h3.add-event").bind("click", function() {
		jQnC(".event-box").slideToggle();
	});
	jQnC("h3.filter-events").bind("click", function() {
		jQnC(".filter-box").slideToggle();
	});
	jQnC("h3.add-alert").bind("click", function() {
		jQnC(".alert-box").slideToggle();
	});
	jQnC("h3.calendar").bind("click", function() {
		jQnC(".calendar-box").slideToggle();
	});
	jQnC("h3.my-alerts").bind("click", function() {
		jQnC(".my-alerts-box").slideToggle();
	});
	jQnC("h3.extra-search").bind("click", function() {
		jQnC(".extraSearchFields").slideToggle();
	});
	jQnC("h4.venueProfile").bind("click", function() {
		jQnC(".venueProfileDetails").slideToggle();
	});
	jQnC("h4.newsProfile").bind("click", function() {
		jQnC(".newsProfileDetails").slideToggle();
	});
	jQnC("h4.eventProfile").bind("click", function() {
		jQnC(".eventProfileDetails").slideToggle();
	});
	jQnC("h4.imageProfile").live("click", function() {
		jQnC(".imageProfileDetails").slideToggle();
	});
	jQnC("a.extra-location").bind("click", function() {
		jQnC(".extraLocationFields").slideToggle();
	});
	jQnC("a.add-list").bind("click", function() {
		jQnC(".new_todo_list").slideToggle();
	});
	jQnC("a.add-item").bind("click", function() {
		jQnC(".todoItem").slideToggle();
	});
	
	//------ time slots on day view page todo: shrink this down ------//
	jQnC("a.dayTime7").bind("click", function() {
		jQnC(".dayTimeDiv7").slideToggle();
	});
	jQnC("a.dayTime8").bind("click", function() {
		jQnC(".dayTimeDiv8").slideToggle();
	});
	jQnC("a.dayTime9").bind("click", function() {
		jQnC(".dayTimeDiv9").slideToggle();
	});
	jQnC("a.dayTime10").bind("click", function() {
		jQnC(".dayTimeDiv10").slideToggle();
	});
	jQnC("a.dayTime11").bind("click", function() {
		jQnC(".dayTimeDiv11").slideToggle();
	});
	jQnC("a.dayTime12").bind("click", function() {
		jQnC(".dayTimeDiv12").slideToggle();
	});
	jQnC("a.dayTime13").bind("click", function() {
		jQnC(".dayTimeDiv13").slideToggle();
	});
	jQnC("a.dayTime14").bind("click", function() {
		jQnC(".dayTimeDiv14").slideToggle();
	});
	jQnC("a.dayTime15").bind("click", function() {
		jQnC(".dayTimeDiv15").slideToggle();
	});
	jQnC("a.dayTime16").bind("click", function() {
		jQnC(".dayTimeDiv16").slideToggle();
	});
	jQnC("a.dayTime17").bind("click", function() {
		jQnC(".dayTimeDiv17").slideToggle();
	});
	jQnC("a.dayTime18").bind("click", function() {
		jQnC(".dayTimeDiv18").slideToggle();
	});
	jQnC("a.dayTime18").bind("click", function() {
		jQnC(".dayTimeDiv18").slideToggle();
	});
	
	//------ day slots on weekList view page todo: shrink this down ------//
	jQnC("a.weekDay0").bind("click", function() {
		jQnC(".weekDayBody0").slideToggle();
	});
	jQnC("a.weekDay1").bind("click", function() {
		jQnC(".weekDayBody1").slideToggle();
	});
	jQnC("a.weekDay2").bind("click", function() {
		jQnC(".weekDayBody2").slideToggle();
	});
	jQnC("a.weekDay3").bind("click", function() {
		jQnC(".weekDayBody3").slideToggle();
	});
	jQnC("a.weekDay4").bind("click", function() {
		jQnC(".weekDayBody4").slideToggle();
	});
	jQnC("a.weekDay5").bind("click", function() {
		jQnC(".weekDayBody5").slideToggle();
	});
	jQnC("a.weekDay6").bind("click", function() {
		jQnC(".weekDayBody6").slideToggle();
	});
	
	//------ to do list show/hide ------//
	jQnC(".notes-container").hide();
	jQnC(".hide_note").hide();
	
	jQnC("a.show_note").bind('click', function () {		
		var id = jQnC(this).get(0).id;
		jQnC("#notes_"+id).slideToggle();
		jQnC(this).hide();
		jQnC(".hide_"+id).show();
	});
	
	jQnC("a.hide_note").bind('click', function () {		
		var id = jQnC(this).get(0).id;
		jQnC("#notes_"+id).slideToggle();
		jQnC(this).hide();
		jQnC(".show_"+id).show();
	});	


});

function viewMapPoint(v, m){
	if(v == 'noMapPoint'){
		jQnC(".noMapPoint").html('There is no map point for <br/><br/><span style="font-size:30px;">' + m + '</span>');
		jQnC(".noMapPoint").show("fast");
		//setTimeout(function()
		//{
		//	jQnC(".noMapPoint").hide();
		//}, 3000);
		GM_clearMap();
	}else{
		jQnC(".noMapPoint").hide();
		GM_viewProperty(v);
	}
}


jQnC(".reportSpam").click(function(){
	var title_id 	= jQnC("#title_id").attr('value');
	var title_name 	= jQnC("#title_name").attr('value');
	var i = jQnC(this).attr('id');
	var contactName	= jQnC("#currentContactName"+i).attr('value');


	// Hide the button to prevent multiple submits
	jQnC("#reportSpam"+i).hide();
	// Show a spinny loading image
	jQnC("#loadingImg"+i).show();

	jQnC.ajax({
		url: "/index.cfm/events/home.reportSpam",
		processData: false,
		data: "title_id=" + title_id + "&contactName=" + contactName + "&title_name=" + title_name,
		//dataType:"xml",
		error: function(xml,textStatus, errorThrown){
			var x = xml;
			var t = textStatus;
			var e = errorThrown;
			window.location.href = '/';
		},
		success: function(xml){

			jQnC("#reportSpamBlock"+i).html('An Email has been sent');

		}
	});
});

function feature(currentRow){
	// Hide the button to prevent multiple submits
	jQnC("##response_"+currentRow).hide();
	// Show a spinny loading image
	jQnC("##loadingImg"+currentRow).show();

	jQnC.ajax({
	    type: "POST",
	    url: "#request.myself#admin.featureVenue",
	    data:     "venue_id=" + document.getElementById("venue_id_" + currentRow).value +
	            "&feature=" + document.getElementById("feature_" + currentRow).value +
	            "&row=" + currentRow
	            ,
	    success: function(html){
	        jQnC("##response_" + currentRow).html(html);
			jQnC("##loadingImg"+currentRow).hide();
			jQnC("##response_"+currentRow).show();
	        if (document.getElementById("feature_" + currentRow).value == '0'){
		        document.getElementById("tableRow_" + currentRow).className = 'yellowBack';
		    }else{
		        document.getElementById("tableRow_" + currentRow).className = 'whiteBack';
		    }
	    }
	});

}

function popup(mylink, windowname){
		if (! window.focus)return true;
		var href;
		if (typeof(mylink) == 'string')
		   href=mylink;
		else
		   href=mylink.href;
		window.open(href, windowname, 'width=700,height=700,scrollbars=no');
		return false;
	}

