//DropdownList.js
$(document).ready(function() {$('#wedding-navigation li').mouseover(function() { $(this).addClass("over"); }).mouseout(function() { $(this).removeClass("over"); });});

// virtual="~/js/jquery.tabbedContent.js" --
(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false;}progress+=seperator;});words[wordAt]=v;v=words.join(options.multipleSeparator);}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value)return[""];if(!options.multiple)return[$.trim(value)];return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null;});}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);if(words.length==1)return words[0];var cursorAt=$(input).selection().start;if(cursorAt==value.length){words=trimWords(value)}else{words=trimWords(value.replace(value.substring(cursorAt),""));}return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$(input).selection(previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else{$input.val("");$input.trigger("result",null);}}});}};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase());}if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}setTimeout(populate,25);function flush(){data={};length=0;}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else
if(data[q]){return data[q];}else
if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select();}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}}else if(this.setSelectionRange){this.setSelectionRange(start,end);}else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end;}});}var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selectionEnd}}};})(jQuery);/* Extra links */
var divHeight;
var oldHeight;


function toggleUMapLocationList(Id){
	if($('#slideeffect_' + Id).is(":hidden")){$('#slideeffect_' + Id).slideDown('slow');  
	}else{$('#slideeffect_' + Id).slideUp('slow');}}


$(document).ready(function(){
    $("div .umap_headingbg").click(function(){
        var listId=this.id;
        toggleUMapLocationList(listId);
         var websiteName= $("#hddnWebsiteName").val();
        if($('#slideeffect_' + Id).is(":hidden"))
        {
            $(this).css({backgroundImage :"url(" + websiteName + "/Images/bullet-up.gif)"});
        }
         else
        {
            $(this).css({backgroundImage :"url(" + websiteName + "/Images/bullet-down.gif)"});
        }
    });  
    
	//Resize on show/hide
$('span.more-text-holder:eq(0)> a').click(function() {
	//var newHeight =$("#" + IDMainContent() + "ctl00_lblDescription").height(); 
        return false;
});
 });


  
function ViewGoogleMap(tabId)
	{var $tabs = $('#tabs').tabs();$tabs.tabs('select', "maps");}
  
  


    function DisplayGoogleMap(tabId )
    {        
        var $tabs = $('#tabs').tabs();
        var selected = $tabs.tabs('option', 'selected');         
        if(selected == tabId ){
            CreateGoogleMapForVenueDetail();
            }
    }  
    function AdjustTabHeight()
    {
        var accommodationHeight = $(' .accommodation-listing').height();
        var topHeight=$('#divTop').height();
        if(topHeight < 280){topHeight = 280;}
        var newHeight = $('#tabs').height();
        $('#rightHandNavDiv').css({height:"auto"});
        ReAssignHieght('rightHandNavDiv',topHeight,newHeight + 120 + accommodationHeight );
        AdjustHeight();
        divHeight = $('#rightHandNavDiv').height();oldHeight = $("#" + IDMainContent() + "ctl00_lblDescription").height();
     }
   
function ViewReviewTab(){
	$('#tabs').tabs({
		selected : 1,fxFade: true,fxSpeed: 'fast',show: function(event, ui) {               
		AdjustTabHeight();DisplayGoogleMap(0);isChangeHeight =true;}
	});	      
}

function GetSelectedSubTab(){
    var monthName=$("#" + IDMainContent() + "hddnLateAvailabilityMonth").val();	
    var getTabIndex=1;
    $('#tabs-2 ul').find('li').each(function(i){
        if(this.id == 'li_' + monthName){
            getTabIndex=i;    
            }
    });
    $("#tabs-2").tabs('select',getTabIndex-1);

}
    
function ToggleAttributes(collectionId){        
if($('#slideeffectVenues'+ collectionId).is(":hidden")){$('#slideeffectVenues'+ collectionId).slideDown("slow");$('#slideOutVenue'+ collectionId).show();$('#slideInVenue'+ collectionId).hide();
}else{$('#slideeffectVenues'+ collectionId).slideUp("slow");$('#slideOutVenue'+ collectionId).hide();$('#slideInVenue'+ collectionId).show();}
AdjustHeight();
}

function ShowFirstCollectionList(collectionId){
ToggleAttributes($('#'+collectionId).val());
}/**
 * @author alexander.farkas
 * 
 * @version 2.5.4
 * project site: http://plugins.jquery.com/project/AjaxManager
 */
(function($){
	$.support.ajax = !!(window.XMLHttpRequest);
	if(window.ActiveXObject){
		try{
			new ActiveXObject("Microsoft.XMLHTTP");
			$.support.ajax = true;
		} catch(e){
			if(window.XMLHttpRequest){
				$.ajaxSetup({xhr: function(){
					return new XMLHttpRequest();
				}});
			}
		}
	}
	$.manageAjax = (function(){
		var cache 			= {},
			queues			= {},
			presets 		= {},
			activeRequest 	= {},
			allRequests 	= {},
			triggerEndCache = {},
			defaults 		= {
						queue: true, //clear
						maxRequests: 1,
						abortOld: false,
						preventDoubbleRequests: true,
						cacheResponse: false,
						complete: function(){},
						error: function(ahr, status){
							var opts = this;
							if(status && status.indexOf('error') != -1){
								setTimeout(function(){
									var errStr = status +': ';
									if(ahr.status){
										errStr += 'status: '+ ahr.status +' | ';
									}
									errStr += 'URL: '+ opts.url;
									throw new Error(errStr);
								}, 1);
							}
						},
						success: function(){},
						abort: function(){}
				}
		;
		
		function create(name, settings){
			var publicMethods = {};
			presets[name] = presets[name] ||
				{};
			
			$.extend(true, presets[name], $.ajaxSettings, defaults, settings);
			
			if(!allRequests[name]){
				allRequests[name] 	= {};
				activeRequest[name] = {};
				activeRequest[name].queue = [];
				queues[name] 		= [];
				triggerEndCache[name] = [];
			}
			$.each($.manageAjax, function(fnName, fn){
				if($.isFunction(fn) && fnName.indexOf('_') !== 0){
					publicMethods[fnName] = function(param, param2){
						if(param2 && typeof param === 'string'){
							param = param2;
						}
						fn(name, param);
					};
				}
			});
			return publicMethods;
		}
		
		function complete(opts, args){
			
			if(args[1] == 'success' || args[1] == 'notmodified'){
				opts.success.apply(opts, [args[0].successData, args[1]]);
				if (opts.global) {
					$.event.trigger("ajaxSuccess", args);
				}
			}
			
			if(args[1] === 'abort'){
				opts.abort.apply(opts, args);
				if(opts.global){
					$.active--;
					$.event.trigger("ajaxAbort", args);
				}
			}
			
			opts.complete.apply(opts, args);
			
			if (opts.global) {
				$.event.trigger("ajaxComplete", args);
			}
			
			if (opts.global && ! $.active){
				$.event.trigger("ajaxStop");
			}
			//args[0] = null; 
		}
		
		function proxy(oldFn, fn){
			return function(xhr, s, e){
				fn.call(this, xhr, s, e);
				oldFn.call(this, xhr, s, e);
				xhr = null;
				e = null;
			};
		}
		
					
		function callQueueFn(name){
			var q = queues[name];
			if(q && q.length){
				var fn = q.shift();
				if(fn){
					fn();
				}
			}
		}

		
		function add(name, opts){
			if(!presets[name]){
				create(name, opts);
			}
			opts = $.extend({}, presets[name], opts);
			//aliases
			var allR 	= allRequests[name],
				activeR = activeRequest[name],
				queue	= queues[name];
			
			var id 				= opts.type +'_'+ opts.url.replace(/\./g, '_'),
				triggerStart 	= true,
				oldComplete 	= opts.complete,
				ajaxFn 			= function(){
									activeR.queue.push(id);
									activeR[id] = {
										xhr: false,
										ajaxManagerOpts: opts
									};
									activeR[id].xhr = $.ajax(opts);
									return id;
								}
				;
				
			if(opts.data){
				id += (typeof opts.data == 'string') ? opts.data : $.param(opts.data);
			}
			
			if(opts.preventDoubbleRequests && allRequests[name][id]){
				return false;
			}
			
			allR[id] = true;
			
			opts.complete = function(xhr, s, e){
				var triggerEnd = true;
				if(opts.abortOld){
					$.each(activeR.queue, function(i, activeID){
						if(activeID == id){
							return false;
						}
						abort(name, activeID);
						return activeID;
					});
				}
				oldComplete.call(this, xhr, s, e);
				//stop memory leak
				if(activeRequest[name][id]){
					if(activeRequest[name][id] && activeRequest[name][id].xhr){
						activeRequest[name][id].xhr = null;
					} 
					activeRequest[name][id] = null;
				}
				triggerEndCache[name].push({xhr: xhr, status: s});
				xhr = null;
				activeRequest[name].queue = $.grep(activeRequest[name].queue, function(qid){
					return (qid !== id);
				});
				allR[id] = false;
				
				e = null;
				
				delete activeRequest[name][id];
				
				$.each(activeR, function(id, queueRunning){
					if(id !== 'queue' || queueRunning.length){
						triggerEnd = false;
						return false;
					}
				});
				
				if(triggerEnd){
					$.event.trigger(name +'End', [triggerEndCache[name]]);
					$.each(triggerEndCache[name], function(i, cached){
						cached.xhr = null; //memory leak
					});
					triggerEndCache[name] = [];
				}
			};
			
			if(cache[id]){
				ajaxFn = function(){
					activeR.queue.push(id);
					complete(opts, cache[id]);
					return id;
				};
			} else if(opts.cacheResponse){
				 opts.complete = proxy(opts.complete, function(xhr, s){
					if( s !== "success" && s !== "notmodified" ){
						return false;
					}
					cache[id][0].responseXML 	= xhr.responseXML;
					cache[id][0].responseText 	= xhr.responseText;
					cache[id][1] 				= s;
					//stop memory leak
					xhr = null;
					return id; //strict
				});
				
				opts.success = proxy(opts.success, function(data, s){
					cache[id] = [{
						successData: data,
						ajaxManagerOpts: opts
					}, s];
					data = null;
				});
			}
			
			ajaxFn.ajaxID = id;
			
			$.each(activeR, function(id, queueRunning){
				if(id !== 'queue' || queueRunning.length){
					triggerStart = false;
					return false;
				}
			});
			
			if(triggerStart){
				$.event.trigger(name +'Start');
			}
			if(opts.queue){
				opts.complete = proxy(opts.complete, function(){
					
					callQueueFn(name);
				});
				 
				if(opts.queue === 'clear'){
					queue = clear(name);
				}
				
				queue.push(ajaxFn);
				
				if(activeR.queue.length < opts.maxRequests){
					callQueueFn(name); 
				}
				return id;
			}
			
			
			
			return ajaxFn();
		}
		
		function clear(name, shouldAbort){
			$.each(queues[name], function(i, fn){
				allRequests[name][fn.ajaxID] = false;
			});
			queues[name] = [];
			
			if(shouldAbort){
				abort(name);
			}
			return queues[name];
		}
		
		function getXHR(name, id){
			var ar = activeRequest[name];
			if(!ar || !allRequests[name][id]){
				return false;
			}
			if(ar[id]){
				return ar[id].xhr;
			}
			var queue = queues[name],
				xhrFn;
			$.each(queue, function(i, fn){
				if(fn.ajaxID == id){
					xhrFn = [fn, i];
					return false;
				}
				return xhrFn;
			});
			return xhrFn;
		}
		
		function abort(name, id){
			var ar = activeRequest[name];
			if(!ar){
				return false;
			}
			function abortID(qid){
				if(qid !== 'queue' && ar[qid] && ar[qid].xhr){
					try {
						ar[qid].xhr.abort();
					} catch(e){}
					complete(ar[qid].ajaxManagerOpts, [ar[qid].xhr, 'abort']);
				}
				return null;
			}
			if(id){
				return abortID(id);
			}
			return $.each(ar, abortID);
		}
		
		function unload(){
			$.each(presets, function(name){
				clear(name, true);
			});
			cache = {};
		}
		
		return {
			defaults: 		defaults,
			add: 			add,
			create: 		create,
			cache: 			cache,
			abort: 			abort,
			clear: 			clear,
			getXHR: 		getXHR,
			_activeRequest: activeRequest,
			_complete: 		complete,
			_allRequests: 	allRequests,
			_unload: 		unload
		};
	})();
	//stop memory leaks
	$(window).unload($.manageAjax._unload);
})(jQuery);//jquery.json.js
/*
    based on
    http://www.JSON.org/json2.js
    2008-11-19
    
    jQuery plugin info:
    @author  Jim Dalton (jim.dalton@furrybrains.com)
    @date    1/15/2009
    @version 1.0
    
    Comments below were modified to reflect usage in the context of jQuery. Otherwise
    these comments are identical to the source library.

    Public Domain.

    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

    See http://www.JSON.org/js.html

    This file creates a global JSON object containing two methods: jQuery.jSONToString
    and jQuery.toJSON.

        jQuery.jSONToString(value, replacer, space)
            value       any JavaScript value, usually an object or array.

            replacer    an optional parameter that determines how object
                        values are stringified for objects. It can be a
                        function or an array of strings.

            space       an optional parameter that specifies the indentation
                        of nested structures. If it is omitted, the text will
                        be packed without extra whitespace. If it is a number,
                        it will specify the number of spaces to indent at each
                        level. If it is a string (such as '\t' or '&nbsp;'),
                        it contains the characters used to indent at each level.
            
            This method produces a JSON text from a JavaScript value.

            When an object value is found, if the object contains a toJSON
            method, its toJSON method will be called and the result will be
            stringified. A toJSON method does not serialize: it returns the
            value represented by the name/value pair that should be serialized,
            or undefined if nothing should be serialized. The toJSON method
            will be passed the key associated with the value, and this will be
            bound to the object holding the key.

            For example, this would serialize Dates as ISO strings.

                Date.prototype.toJSON = function (key) {
                    function f(n) {
                        // Format integers to have at least two digits.
                        return n < 10 ? '0' + n : n;
                    }

                    return this.getUTCFullYear()   + '-' +
                         f(this.getUTCMonth() + 1) + '-' +
                         f(this.getUTCDate())      + 'T' +
                         f(this.getUTCHours())     + ':' +
                         f(this.getUTCMinutes())   + ':' +
                         f(this.getUTCSeconds())   + 'Z';
                };

            You can provide an optional replacer method. It will be passed the
            key and value of each member, with this bound to the containing
            object. The value that is returned from your method will be
            serialized. If your method returns undefined, then the member will
            be excluded from the serialization.

            If the replacer parameter is an array of strings, then it will be
            used to select the members to be serialized. It filters the results
            such that only members with keys listed in the replacer array are
            stringified.

            Values that do not have JSON representations, such as undefined or
            functions, will not be serialized. Such values in objects will be
            dropped; in arrays they will be replaced with null. You can use
            a replacer function to replace those with JSON values.
            JSON.stringify(undefined) returns undefined.

            The optional space parameter produces a stringification of the
            value that is filled with line breaks and indentation to make it
            easier to read.

            If the space parameter is a non-empty string, then that string will
            be used for indentation. If the space parameter is a number, then
            the indentation will be that many spaces.

            Example:

            text = jQuery.jSONToString(['e', {pluribus: 'unum'}]);
            // text is '["e",{"pluribus":"unum"}]'


            text = jQuery.jSONToString(['e', {pluribus: 'unum'}], null, '\t');
            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'

            text = jQuery.jSONToString([new Date()], function (key, value) {
                return this[key] instanceof Date ?
                    'Date(' + this[key] + ')' : value;
            });
            // text is '["Date(---current time---)"]'


        jQuery.toJSON(text, reviver)
            This method parses a JSON text to produce an object or array.
            It can throw a SyntaxError exception.

            The optional reviver parameter is a function that can filter and
            transform the results. It receives each of the keys and values,
            and its return value is used instead of the original value.
            If it returns what it received, then the structure is not modified.
            If it returns undefined then the member is deleted.

            Example:

            // Parse the text. Values that look like ISO date strings will
            // be converted to Date objects.

            myData = jQuery.toJSON(text, function (key, value) {
                var a;
                if (typeof value === 'string') {
                    a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
                    if (a) {
                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
                            +a[5], +a[6]));
                    }
                }
                return value;
            });

            myData = jQuery.toJSON('["Date(09/09/2001)"]', function (key, value) {
                var d;
                if (typeof value === 'string' &&
                        value.slice(0, 5) === 'Date(' &&
                        value.slice(-1) === ')') {
                    d = new Date(value.slice(5, -1));
                    if (d) {
                        return d;
                    }
                }
                return value;
            });


    This is a reference implementation. You are free to copy, modify, or
    redistribute.

    This code should be minified before deployment.
    See http://javascript.crockford.com/jsmin.html

    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
    NOT CONTROL.
*/
;(function($) {
    if (!this.JSON) {
        this.JSON = {};
    }
    /*
		    http://www.JSON.org/json2.js
		    2009-09-29
		
		    Public Domain.
		
		    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
		
		    See http://www.JSON.org/js.html
		
		
		    This code should be minified before deployment.
		    See http://javascript.crockford.com/jsmin.html
		
		    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
		    NOT CONTROL.
		
		
		    This file creates a global JSON object containing two methods: stringify
		    and parse.
		
		        JSON.stringify(value, replacer, space)
		            value       any JavaScript value, usually an object or array.
		
		            replacer    an optional parameter that determines how object
		                        values are stringified for objects. It can be a
		                        function or an array of strings.
		
		            space       an optional parameter that specifies the indentation
		                        of nested structures. If it is omitted, the text will
		                        be packed without extra whitespace. If it is a number,
		                        it will specify the number of spaces to indent at each
		                        level. If it is a string (such as '\t' or '&nbsp;'),
		                        it contains the characters used to indent at each level.
		
		            This method produces a JSON text from a JavaScript value.
		
		            When an object value is found, if the object contains a toJSON
		            method, its toJSON method will be called and the result will be
		            stringified. A toJSON method does not serialize: it returns the
		            value represented by the name/value pair that should be serialized,
		            or undefined if nothing should be serialized. The toJSON method
		            will be passed the key associated with the value, and this will be
		            bound to the value
		
		            For example, this would serialize Dates as ISO strings.
		
		                Date.prototype.toJSON = function (key) {
		                    function f(n) {
		                        // Format integers to have at least two digits.
		                        return n < 10 ? '0' + n : n;
		                    }
		
		                    return this.getUTCFullYear()   + '-' +
		                         f(this.getUTCMonth() + 1) + '-' +
		                         f(this.getUTCDate())      + 'T' +
		                         f(this.getUTCHours())     + ':' +
		                         f(this.getUTCMinutes())   + ':' +
		                         f(this.getUTCSeconds())   + 'Z';
		                };
		
		            You can provide an optional replacer method. It will be passed the
		            key and value of each member, with this bound to the containing
		            object. The value that is returned from your method will be
		            serialized. If your method returns undefined, then the member will
		            be excluded from the serialization.
		
		            If the replacer parameter is an array of strings, then it will be
		            used to select the members to be serialized. It filters the results
		            such that only members with keys listed in the replacer array are
		            stringified.
		
		            Values that do not have JSON representations, such as undefined or
		            functions, will not be serialized. Such values in objects will be
		            dropped; in arrays they will be replaced with null. You can use
		            a replacer function to replace those with JSON values.
		            JSON.stringify(undefined) returns undefined.
		
		            The optional space parameter produces a stringification of the
		            value that is filled with line breaks and indentation to make it
		            easier to read.
		
		            If the space parameter is a non-empty string, then that string will
		            be used for indentation. If the space parameter is a number, then
		            the indentation will be that many spaces.
		
		            Example:
		
		            text = JSON.stringify(['e', {pluribus: 'unum'}]);
		            // text is '["e",{"pluribus":"unum"}]'
		
		
		            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
		            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
		
		            text = JSON.stringify([new Date()], function (key, value) {
		                return this[key] instanceof Date ?
		                    'Date(' + this[key] + ')' : value;
		            });
		            // text is '["Date(---current time---)"]'
		
		
		        JSON.parse(text, reviver)
		            This method parses a JSON text to produce an object or array.
		            It can throw a SyntaxError exception.
		
		            The optional reviver parameter is a function that can filter and
		            transform the results. It receives each of the keys and values,
		            and its return value is used instead of the original value.
		            If it returns what it received, then the structure is not modified.
		            If it returns undefined then the member is deleted.
		
		            Example:
		
		            // Parse the text. Values that look like ISO date strings will
		            // be converted to Date objects.
		
		            myData = JSON.parse(text, function (key, value) {
		                var a;
		                if (typeof value === 'string') {
		                    a =
		/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
		                    if (a) {
		                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
		                            +a[5], +a[6]));
		                    }
		                }
		                return value;
		            });
		
		            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
		                var d;
		                if (typeof value === 'string' &&
		                        value.slice(0, 5) === 'Date(' &&
		                        value.slice(-1) === ')') {
		                    d = new Date(value.slice(5, -1));
		                    if (d) {
		                        return d;
		                    }
		                }
		                return value;
		            });
		
		
		    This is a reference implementation. You are free to copy, modify, or
		    redistribute.
		*/
		
		/*jslint evil: true, strict: false */
		
		/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
		    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
		    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
		    lastIndex, length, parse, prototype, push, replace, slice, stringify,
		    test, toJSON, toString, valueOf
		*/
		
		
		// Create a JSON object only if one does not already exist. We create the
		// methods in a closure to avoid creating global variables.
		
		if (!this.JSON) {
		    this.JSON = {};
		}
		
		(function () {
		
		    function f(n) {
		        // Format integers to have at least two digits.
		        return n < 10 ? '0' + n : n;
		    }
		
		    if (typeof Date.prototype.toJSON !== 'function') {
		
		        Date.prototype.toJSON = function (key) {
		
		            return isFinite(this.valueOf()) ?
		                   this.getUTCFullYear()   + '-' +
		                 f(this.getUTCMonth() + 1) + '-' +
		                 f(this.getUTCDate())      + 'T' +
		                 f(this.getUTCHours())     + ':' +
		                 f(this.getUTCMinutes())   + ':' +
		                 f(this.getUTCSeconds())   + 'Z' : null;
		        };
		
		        String.prototype.toJSON =
		        Number.prototype.toJSON =
		        Boolean.prototype.toJSON = function (key) {
		            return this.valueOf();
		        };
		    }
		
		    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
		        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
		        gap,
		        indent,
		        meta = {    // table of character substitutions
		            '\b': '\\b',
		            '\t': '\\t',
		            '\n': '\\n',
		            '\f': '\\f',
		            '\r': '\\r',
		            '"' : '\\"',
		            '\\': '\\\\'
		        },
		        rep;
		
		
		    function quote(string) {
		
		// If the string contains no control characters, no quote characters, and no
		// backslash characters, then we can safely slap some quotes around it.
		// Otherwise we must also replace the offending characters with safe escape
		// sequences.
		
		        escapable.lastIndex = 0;
		        return escapable.test(string) ?
		            '"' + string.replace(escapable, function (a) {
		                var c = meta[a];
		                return typeof c === 'string' ? c :
		                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
		            }) + '"' :
		            '"' + string + '"';
		    }
		
		
		    function str(key, holder) {
		
		// Produce a string from holder[key].
		
		        var i,          // The loop counter.
		            k,          // The member key.
		            v,          // The member value.
		            length,
		            mind = gap,
		            partial,
		            value = holder[key];
		
		// If the value has a toJSON method, call it to obtain a replacement value.
		
		        if (value && typeof value === 'object' &&
		                typeof value.toJSON === 'function') {
		            value = value.toJSON(key);
		        }
		
		// If we were called with a replacer function, then call the replacer to
		// obtain a replacement value.
		
		        if (typeof rep === 'function') {
		            value = rep.call(holder, key, value);
		        }
		
		// What happens next depends on the value's type.
		
		        switch (typeof value) {
		        case 'string':
		            return quote(value);
		
		        case 'number':
		
		// JSON numbers must be finite. Encode non-finite numbers as null.
		
		            return isFinite(value) ? String(value) : 'null';
		
		        case 'boolean':
		        case 'null':
		
		// If the value is a boolean or null, convert it to a string. Note:
		// typeof null does not produce 'null'. The case is included here in
		// the remote chance that this gets fixed someday.
		
		            return String(value);
		
		// If the type is 'object', we might be dealing with an object or an array or
		// null.
		
		        case 'object':
		
		// Due to a specification blunder in ECMAScript, typeof null is 'object',
		// so watch out for that case.
		
		            if (!value) {
		                return 'null';
		            }
		
		// Make an array to hold the partial results of stringifying this object value.
		
		            gap += indent;
		            partial = [];
		
		// Is the value an array?
		
		            if (Object.prototype.toString.apply(value) === '[object Array]') {
		
		// The value is an array. Stringify every element. Use null as a placeholder
		// for non-JSON values.
		
		                length = value.length;
		                for (i = 0; i < length; i += 1) {
		                    partial[i] = str(i, value) || 'null';
		                }
		
		// Join all of the elements together, separated with commas, and wrap them in
		// brackets.
		
		                v = partial.length === 0 ? '[]' :
		                    gap ? '[\n' + gap +
		                            partial.join(',\n' + gap) + '\n' +
		                                mind + ']' :
		                          '[' + partial.join(',') + ']';
		                gap = mind;
		                return v;
		            }
		
		// If the replacer is an array, use it to select the members to be stringified.
		
		            if (rep && typeof rep === 'object') {
		                length = rep.length;
		                for (i = 0; i < length; i += 1) {
		                    k = rep[i];
		                    if (typeof k === 'string') {
		                        v = str(k, value);
		                        if (v) {
		                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
		                        }
		                    }
		                }
		            } else {
		
		// Otherwise, iterate through all of the keys in the object.
		
		                for (k in value) {
		                    if (Object.hasOwnProperty.call(value, k)) {
		                        v = str(k, value);
		                        if (v) {
		                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
		                        }
		                    }
		                }
		            }
		
		// Join all of the member texts together, separated with commas,
		// and wrap them in braces.
		
		            v = partial.length === 0 ? '{}' :
		                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
		                        mind + '}' : '{' + partial.join(',') + '}';
		            gap = mind;
		            return v;
		        }
		    }
		
		// If the JSON object does not yet have a stringify method, give it one.
		
		    if (typeof JSON.stringify !== 'function') {
		        JSON.stringify = function (value, replacer, space) {
		
		// The stringify method takes a value and an optional replacer, and an optional
		// space parameter, and returns a JSON text. The replacer can be a function
		// that can replace values, or an array of strings that will select the keys.
		// A default replacer method can be provided. Use of the space parameter can
		// produce text that is more easily readable.
		
		            var i;
		            gap = '';
		            indent = '';
		
		// If the space parameter is a number, make an indent string containing that
		// many spaces.
		
		            if (typeof space === 'number') {
		                for (i = 0; i < space; i += 1) {
		                    indent += ' ';
		                }
		
		// If the space parameter is a string, it will be used as the indent string.
		
		            } else if (typeof space === 'string') {
		                indent = space;
		            }
		
		// If there is a replacer, it must be a function or an array.
		// Otherwise, throw an error.
		
		            rep = replacer;
		            if (replacer && typeof replacer !== 'function' &&
		                    (typeof replacer !== 'object' ||
		                     typeof replacer.length !== 'number')) {
		                throw new Error('JSON.stringify');
		            }
		
		// Make a fake root object containing our value under the key of ''.
		// Return the result of stringifying the value.
		
		            return str('', {'': value});
		        };
		    }
		
		
		// If the JSON object does not yet have a parse method, give it one.
		
		    if (typeof JSON.parse !== 'function') {
		        JSON.parse = function (text, reviver) {
		
		// The parse method takes a text and an optional reviver function, and returns
		// a JavaScript value if the text is a valid JSON text.
		
		            var j;
		
		            function walk(holder, key) {
		
		// The walk method is used to recursively walk the resulting structure so
		// that modifications can be made.
		
		                var k, v, value = holder[key];
		                if (value && typeof value === 'object') {
		                    for (k in value) {
		                        if (Object.hasOwnProperty.call(value, k)) {
		                            v = walk(value, k);
		                            if (v !== undefined) {
		                                value[k] = v;
		                            } else {
		                                delete value[k];
		                            }
		                        }
		                    }
		                }
		                return reviver.call(holder, key, value);
		            }
		
		
		// Parsing happens in four stages. In the first stage, we replace certain
		// Unicode characters with escape sequences. JavaScript handles many characters
		// incorrectly, either silently deleting them, or treating them as line endings.
		
		            cx.lastIndex = 0;
		            if (cx.test(text)) {
		                text = text.replace(cx, function (a) {
		                    return '\\u' +
		                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
		                });
		            }
		
		// In the second stage, we run the text against regular expressions that look
		// for non-JSON patterns. We are especially concerned with '()' and 'new'
		// because they can cause invocation, and '=' because it can cause mutation.
		// But just to be safe, we want to reject all unexpected forms.
		
		// We split the second stage into 4 regexp operations in order to work around
		// crippling inefficiencies in IE's and Safari's regexp engines. First we
		// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
		// replace all simple value tokens with ']' characters. Third, we delete all
		// open brackets that follow a colon or comma or that begin the text. Finally,
		// we look to see that the remaining characters are only whitespace or ']' or
		// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
		
		            if (/^[\],:{}\s]*$/.
		test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
		replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
		replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
		
		// In the third stage we use the eval function to compile the text into a
		// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
		// in JavaScript: it can begin a block or an object literal. We wrap the text
		// in parens to eliminate the ambiguity.
		
		                j = eval('(' + text + ')');
		
		// In the optional fourth stage, we recursively walk the new structure, passing
		// each name/value pair to a reviver function for possible transformation.
		
		                return typeof reviver === 'function' ?
		                    walk({'': j}, '') : j;
		            }
		
		// If the text is not JSON parseable, then a SyntaxError is thrown.
		
		            throw new SyntaxError('JSON.parse');
		        };
		    }
		}());

    $.toJSON = function(text, reviver) {
        if (typeof reviver == "undefined") {
            reviver = null;
        }
        return JSON.parse(text, reviver);
    };
    $.jSONToString = function(value, replacer, space) {
        if (typeof replacer == "undefined") {
            replacer = null;
        }
        if (typeof space == "undefined") {
            space = null;
        }
        return JSON.stringify(value, replacer, space);
    };
    
})(jQuery);

// -- /js/Validations.js --
//Venues.Autocomplete.SearchBox
var tempX = 0;
var tempY = 0;
var actualHeight;
var mapHeight;
var lateHeight;
var accommodationHeight;
var recordType = "Venue";


function HideMostPopularSearch()
{    
    $("#divMostPopularLinks").fadeOut("slow");
}
function ShowMostPopularSearch() {

    $("#divMostPopularLinks").fadeIn("slow");
    $("#divMostPopularLinks").css({
        "position": "absolute",
        "top": (tempY - 122),
        "left": 420
    });
}


function GetLateAvailabilityHeight()
{    
    if($('.lateAvailability').is(':hidden'))
    {
        return  0;
        }
    else{
        return lateHeight;
        }
}

function GetAccommodationControlHeight()
{    
    if($('.accommodations').is(':hidden')){
        return  0;
        }
    else{
        return accommodationHeight;
        }
}
function GetMapHeight() {
    if ($('.mapsearch').is(':hidden')){
        return 0;
        }
    else{
        return mapHeight + 90;
        }
}

function SearchBoxOnFocus(isFocus, searchBox)
{  
    var textLength = $(searchBox).val().length;
    if(isFocus ){
        $(searchBox).removeClass("autosearch");
        }
    else if(textLength === 0 ){
       $(searchBox).addClass("autosearch");      
       }
  
}

function AdjustRHSHeight(option,isAdd)
{
    var newHeight;
    var offset;
    
    if(option == 'map')
    {
        if(isAdd)
        {
             newHeight = mapHeight;        
             offset = 90;   
         }
         else
         {
            newHeight = 0;
            offset = 0;
         }
           
         newHeight = newHeight + GetLateAvailabilityHeight() + GetAccommodationControlHeight();
    }
    else if (option === 'late')
    {
        if(isAdd)
        {
            newHeight = lateHeight;
            }
        else{
            newHeight = 0;
            }
        
        offset=0;
        newHeight = newHeight +GetMapHeight();
    }
   
        $('#rightHandNavDiv').css({height:"auto"});        
        ReAssignHieght('rightHandNavDiv',actualHeight,newHeight+offset);
        AdjustHeight();
        
}


function GetTabName() {
    var tab;
    if ($("#" + IDMainContent() + "ucSearchVenues_rdobtnVenues").is(":checked"))
    {
        tab = "Venue";
        }
    else if ($("#" + IDMainContent() + "ucSearchVenues_rdobtnAccommodation").is(":checked"))
     {
        tab = "Accommodation";
        }
    else
    {
        tab = "LateAvailability";
        }
    return tab;
}

function SetSearchCriteria(sValue) {
    var searchId;
    var searchText;
    var tabName = GetTabName();
    searchId = sValue;

    $("#" + IDMainContent() + "ucSearchVenues_hiddenDisplayTab").val(tabName);
    if (tabName == "LateAvailability") {
        var ddlMonthList = $("#" + IDMainContent() + "ucSearchVenues_ddlMonths");
        $("#" + IDMainContent() + "ucSearchVenues_hiddenYear").val(ddlMonthList.find(':selected').val());
        $("#" + IDMainContent() + "ucSearchVenues_hiddenMonthName").val(ddlMonthList.find(':selected').text());
    }
    searchText = $("#" + IDMainContent() + "ucSearchVenues_txtSuggest").val();
    //SetSearchValues(searchId, searchText);
    $("#" + IDMainContent() + "ucSearchVenues_btnSearchResult").click();
}


function findValue(li) {
    var sValue;
    if (li === null)
    { return alert("No match!");}

    if (!!li.extra)
    { 
         sValue = li.extra[0];
         return true;
    }else{
          sValue = li.selectValue;
          return true;
    }
}

function formatItem(row) {
    return '<a href="' + row[0] + '">' + row[1] + '</a>';
}

function SearchByText() {
    SetSearchCriteria('0');
    return false;
}

function InitiateAutocompleteSearch()
{
    $("#" + IDMainContent() + "ucSearchVenues_txtSuggest").removeData('events');
        
    
    
    var recordType =  $("#" + IDMainContent() + "ucSearchVenues_hiddenTabEnum").val(); 
    var lateAvailabilityMonth = $("#" + IDMainContent() + "ucSearchVenues_hiddenMonthName").val();
    var lateAvailabilityYear = $("#" + IDMainContent() + "ucSearchVenues_hiddenYear").val();
    if (recordType === null) {
    recordType = '';
    }
    
    var searchoptions = { t:recordType, m: lateAvailabilityMonth, y:lateAvailabilityYear};    
    var searchHandlerUrl= '/handlers/search.aspx';    
     $("#" + IDMainContent() + "ucSearchVenues_txtSuggest").autocomplete(searchHandlerUrl,
	 {	       
			minChars:1,
			mustMatch: false,
			delay: 10,
			cacheLength: 100,
			matchContains: true,
			max: 20,
			onFindValue:findValue,
			formatItem:formatItem,
			autoFill:false,
			extraParams:searchoptions
	}).result(function(event, item) {
		 $("#" + IDMainContent() + "ucSearchVenues_txtSuggest").val(item[2]);
		 location.href = item[0];
	});
	
	 $("#" + IDMainContent() + "ucSearchVenues_txtSuggest").keypress(function(e) {       
          if((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13))
          {
               SearchByText();            
               return false;  
           }    
     });
}

function ToggleLateAvailabilitySection()
{           
        if ($("#" + IDMainContent() + "ucSearchVenues_rdobtnLateAvailability").is(':checked')) 
        {
            //$("#" + IDMainContent() + "ucSearchVenues_hiddenTabEnum").val('4')
            $('.lateAvailability').slideDown('fast');
            $('.accommodations').slideUp('fast');
            AdjustRHSHeight('late',true);      
        }
		else if($("#" + IDMainContent() + "ucSearchVenues_rdobtnAccommodation").is(':checked'))
		{
		    //$("#" + IDMainContent() + "ucSearchVenues_hiddenTabEnum").val('3')
		   $('.accommodations').slideDown('fast');
		   $('.lateAvailability').slideUp('fast');
		   AdjustRHSHeight('late',true);
        }
        else
        {
            //$("#" + IDMainContent() + "ucSearchVenues_hiddenTabEnum").val('1')
            $('.accommodations').slideUp('fast');
		    $('.lateAvailability').slideUp('fast');
		    AdjustRHSHeight('late',false);
        }
        InitiateAutocompleteSearch();
		   
}

function OnChangeLateAvailabilityMonth()
{
    var ddlMonthList =$("#" + IDMainContent() + "ucSearchVenues_ddlMonths");        
    $("#" + IDMainContent() + "ucSearchVenues_hiddenYear").val(ddlMonthList.find(':selected').val());
    $("#" + IDMainContent() + "ucSearchVenues_hiddenMonthName").val(ddlMonthList.find(':selected').text());
    InitiateAutocompleteSearch();
}

function getMouseXY(e) {
    tempX = e.pageX;
    tempY = e.pageY;
    return true;
}


function GetTabEnum() {
    var tab;
    if ($("#" + IDMainContent() + "ucSearchVenues_rdobtnVenues").is(":checked"))
    {
        tab = "1";
       }
    else if ($("#" + IDMainContent() + "ucSearchVenues_rdobtnAccommodation").is(":checked"))
    {
        tab = "2";
        }
    else if ($("#" + IDMainContent() + "ucSearchVenues_rdobtnLateAvailability").is(":checked"))
    {
        tab = "3";
        }
    return tab;
}
function lookupAjax() {
    var oSuggest = $("#" + IDMainContent() + "ucSearchVenues_suggest1")[0].Autocompleter;
    oSuggest.findValue();
    return false;
}

$(document).ready(function() {
    
    var venuesSearchHandlerUrl = '/handlers/SearchVenue.aspx';
    //if (!isOldIE) document.captureEvents(Event.MOUSEMOVE);
    $("#ancMostPopularSearch").mousemove( function(e){getMouseXY(e);});  //HACK: Use jquery instead  
    mapHeight = $('.mapsearch').height(); 
	
    $("#popupClose").click(function(){HideMostPopularSearch();});    
    $("#ancMostPopularSearch").click(function(){
		ShowMostPopularSearch();
		return false;
	});        
	$("#" + IDMainContent() + "ucSearchVenues_txtVenueName").autocomplete(venuesSearchHandlerUrl,
	    {	   
				minChars:1,
				mustMatch: false,
				delay: 10,
				cacheLength: 100,
				matchContains: true,
				max: 20,
				onFindValue:findValue,
				formatItem:formatItem,
				autoFill:false
	    }
	).result(function(event, item) {
		 $("#" + IDMainContent() + "ucSearchVenues_txtVenueName").val(item[1]);
		 location.href = item[0];
	});	
	$('div.search-for-right').click(function(){
		ToggleLateAvailabilitySection();
	});
	actualHeight = $('#rightHandNavDiv').height();  
	lateHeight = $('.lateAvailability').height();  
	accommodationHeight = $('.accommodations').height();  
	ToggleLateAvailabilitySection();

});
// -- /js/HomePage.js" --
// Listing.JS
//Used for LHN?

$(document).ready(function(){   
        
    $('div .toggle-list-head').click(function(){
            var listingId=this.id;
            listingId=listingId.split('_');
           ToggleHeader(listingId[1]);
        });
 });

function checkListing(title)
{
   var headerId=$("*[id$='hddnFirstHeaderId']").val();
   //alert(headerId);
   if(headerId !== null || headerId !== 'undefined' || headerId !== '' || headerId !== undefined)
   {
			$('#slideeffectRegion' + headerId).slideDown('slow');  
			if(title=='Venues')
			{
				$('#lblHeaderName_' + headerId).attr("style","display:none");
				$('#lblHeaderName_00').attr("style","display:none");
				$('#slideeffectRegion00').attr("style","display:none");
			}
   }
   AdjustHeight();
}
 
function ToggleHeader(HeaderId)
{
    var websiteName= $("#hddnWebsiteName").val();
    if($('#slideeffectRegion' + HeaderId).is(":hidden"))
    {       
         $("#lblHeaderName_" + HeaderId).css({backgroundImage :"url(" + websiteName + "/Images/down_arrow.gif)"});
         $('#slideeffectRegion' + HeaderId).slideDown('slow');  
    }   
    else
    { 
        $("#lblHeaderName_" + HeaderId).css({backgroundImage :"url(" + websiteName + "/Images/left_arrow.gif)"});
        $('#slideeffectRegion' + HeaderId).slideUp('slow');          
    }
    /*AdjustHeight(); */
} 
    
  
// -- /js/jquery.tooltip.js" --
//Common.Map.Settings
function DefaultHitchedMapIcon() {
    var i = new GIcon(G_DEFAULT_ICON);
    i.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
    i.iconSize = new GSize(32, 32);
    i.shadow = "http://maps.gstatic.com/intl/en_ALL/mapfiles/shadow50.png";
    i.shadowSize = new GSize(59, 32);
    i.iconAnchor = new GPoint(16, 30);
    i.infoWindowAnchor = new GPoint(16, 1);
    return i;
}
function SmallHitchedMapIcon() {
	var i = new GIcon(G_DEFAULT_ICON);
  i.image = "/images/small-map-dot.png";
	i.shadow = "";
	i.iconSize = new GSize(10, 10);
	i.iconSize = new GSize(10, 10);
	i.iconAnchor = new GPoint(4, 5);
	i.infoWindowAnchor = new GPoint(8, 1);
	return i;			
}
function DefaultDetailMapSize() {
    return new GSize(400, 400);
}// JScript File
var websiteName= $("#hddnWebsiteName").val();
var ukCenterLat = "54.0710320549604";
var ukCenterLong = "-2.78397635451732";
var points=[];
var index=-1;
var googleMap ;

function CreateRatingImage(imageName)
{
    var ratingImage = [];
    ratingImage[0] = '<img src="';
    ratingImage[1] = websiteName;
    ratingImage[2] = '/images/';
    ratingImage[3] = imageName;
    ratingImage[4] = '" ></img>';
    return ratingImage.join('');
}

function CreateRatingDiv(text , ratingCount)
{
    
   var ratingArray = [];   
   ratingArray[0] = '<span>';
   ratingArray[1] = text;
   ratingArray[2] = " : ";
   var i = 1;
    if(ratingCount > 0)
    {
        for(i=1;i<=Math.floor(ratingCount);i++)
        {
            ratingArray[2+i] =CreateRatingImage("heart_shape.png") ;
        }
        temp = ratingCount - Math.floor(ratingCount);
        
        if(temp == 0.5){
            ratingArray[2+i] = CreateRatingImage("half_heart.png");
            }
        else if(temp > 0.5 ){
            ratingArray[2+i] = CreateRatingImage("half_heart.png");
            }
        else if(temp < 0.5 &&  ratingCount != 5 ){ 
            ratingArray[2+i] = CreateRatingImage("blank_heart.png");
            }
    }   
    else
    {     
        for(i=1;i<=5;i++)
        {   
            ratingArray[2+i] = CreateRatingImage("blank_heart.png");
        }  

    } 
    ratingArray[2+i] = "</span>";
    return ratingArray.join('');
    
}




function CreateMarkerHtmlForFeaturedListing(name,previewimage,address,phoneNumber,venueRating,detailLink,requestLink,description,totalReview,reviewLink  )
{
   var tab = $('#'+ IDMainContent() + 'hiddenDisplayTab').val();
   
   var textToInsert = [];   
   textToInsert[0] = '<span class="mainHeading">';
   textToInsert[1] = name;
   textToInsert[2] = '</span><div><div class="popup_left"> <a href="';
   textToInsert[3] = detailLink;
   textToInsert[4] = '"><img src="';
   textToInsert[5] = previewimage;
   if(tab == "Venue" || tab == "LateAvailability")
   {
        textToInsert[6] = '"/></a> </div><div class="popup_right"><div class="popup_left">';   
        }
    else
    {
        textToInsert[6] = '"/></a> </div><div class="popup_right"><div class="popup_left hide">';   
     }   
   textToInsert[7] = CreateRatingDiv("Venue Rating", venueRating);         
   if(tab == "Venue" || tab == "LateAvailability")
   {
        textToInsert[8] = '</div><div class="popup_right">from <a href="';
        }
   else
   {
        textToInsert[8] = '</div><div class="popup_right hide">from <a href="';
        }        
   textToInsert[9] = reviewLink;
   textToInsert[10] = '">';
   textToInsert[11] = totalReview;
   textToInsert[12] = ' reviews</a> </div><div class="clear"/><div>'  ;
   textToInsert[13] = description;
   textToInsert[14] = '</div><div class="popup_left"><a href="';
   textToInsert[15] = requestLink;
   textToInsert[16] = '"><img src="';
   textToInsert[17] = websiteName;
   if(tab == "Venue" || tab == "LateAvailability")
   {
        textToInsert[18] = '/images/contact_venue.jpg"/></a></div><div class="popup_right"><a href="';
        }
    else
    {
        textToInsert[18] = '/images/contact_accommodation.jpg"/></a></div><div class="popup_right"><a href="';
        }
   textToInsert[19] = detailLink;
   textToInsert[20]= '"><img src="';
   textToInsert[21] = websiteName;
   textToInsert[22] = '/images/i_icon.png"/></a><a href="';
   textToInsert[23] = detailLink;
   textToInsert[24] = '"> More Details</a></div><div class="clear"/></div><div class="clear"/></div>';
   
   this.$OuterDiv =  $('<div></div>').addClass("popup-featured").append(textToInsert.join(''));      
   return this.$OuterDiv.html() ;
}
function SetGoogleMap()
{    
    googleMap = new GMap2(document.getElementById("map_canvas"));         
    googleMap.setCenter(new GLatLng(ukCenterLat,ukCenterLong),4);
    googleMap.addControl(new GLargeMapControl());
    googleMap.addControl(new GMapTypeControl());
    googleMap.enableDoubleClickZoom();
}


function CreateMarkers(pt,ic,divData)
{
      var mk = new GMarker(pt,ic);        
     GEvent.addListener(mk, "mouseup",function(){
               mk.closeInfoWindow();                
               mk.openInfoWindowHtml(divData);} );       
               return mk;
    
}  


function SetGoogleMarker(latitude ,longitude,html,eliteStatus)
{   
    
	if(latitude !== null && longitude !==null && latitude !== "" && longitude !== ""  && latitude !== "0" && longitude !== "0")
	{        
		var i = DefaultHitchedMapIcon();
		var point = new GLatLng(latitude, longitude);
		var divData = html;

		index = index + 1;
		if(points != undefined)
		    points[index] = point;
		
		switch (eliteStatus) {
			case "3":
				i.image = "http://maps.google.com/mapfiles/ms/micons/purple-dot.png";
				break;
			case "1":
				i = SmallHitchedMapIcon();
				break;
			default:
				i = DefaultHitchedMapIcon();
				break;			
		}          
		var marker = CreateMarkers(point, i, divData); 
		googleMap.addOverlay(marker);
	}   
}

function AddGoogleMarker(latitude,longitude,name,image,address,phoneNumber,serviceRating,venueRating , detailLink , requestLink ,description,totalReview,reviewLink ,eliteStatus)
{   
    var divData = CreateMarkerHtmlForFeaturedListing(name,image,address,phoneNumber,venueRating,detailLink,requestLink,description,totalReview,reviewLink);            
    SetGoogleMarker(latitude, longitude,divData,eliteStatus);            
}
function FitGoogleMap( map, points ) {

    var bounds = new GLatLngBounds();
    if (points != undefined) {
        for (var i = 0; i < points.length; i++) {
            bounds.extend(points[i]);
        } 
    }
   map.setZoom(map.getBoundsZoomLevel(bounds));
   map.setCenter(bounds.getCenter());
}
    
    
function DrawGoogeMapData(retValue , type)
{    
    index = -1;    
    points = [];
    SetGoogleMap();
    for (var i = 0; i < retValue.length; i++) 
    {   
        AddGoogleMarker(retValue[i].VenueLatitude,retValue[i].VenueLongitude,retValue[i].VenueName,retValue[i].VenueImgPath,retValue[i].VenueAddress1,retValue[i].VenuePhoneNumber,retValue[i].ServiceRating,retValue[i].VenueRating,retValue[i].DetailPageLink,retValue[i].RequestPageLink,retValue[i].VenueDescription,retValue[i].VenueRatingCount,retValue[i].ReviewPageLink , retValue[i].EliteStatus);
    }
    FitGoogleMap(googleMap,points);
    
}   


function CreateMap(lati,longi){
    var map = new GMap2(document.getElementById("map_canvas"));        
    var icon = DefaultHitchedMapIcon();
    map.setCenter(new GLatLng(lati,longi),14);  
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.enableDoubleClickZoom();
    var point = new GLatLng(lati,longi);
    var marker = new GMarker(point,icon); 
    map.addOverlay(marker); 
}

function CreateGoogleMapForVenueDetail()
{    
    var lati = $("#" + IDMainContent() + "hddnLatitude").val();
    var longi = $("#" + IDMainContent() + "ctl00_hddnLongitude").val();    
    CreateMap(lati,longi); 
 }   
 
function FillVenueGMap()
{  
    var $gmap = $('#pop-win');
    $gmap.show();
    /*$gmap.css({		
		"top": (mosy-250),
		"left": 120
	});*/    
    CreateGoogleMapForVenueDetail();
}


function HideMap()
{
    var gmap = $('#pop-win');
    gmap.hide();
}
/// <reference path="jquery-1.3.2-vsdoc.js" />
// WeddingVenues.js - for the search results page
//LHN filtering attribute lists
//Update search results
//Toggle map on the main page
//Cookie settings

var displayMenu = "";
var recordNotFound = "No result found";
var searchObject;
var attributeVenues ="";
var attributeVenueNames ="";
var attributeAccommodation="";
var attributeAccommodationNames="";
var removedOptionId = "";
var tabName = "";
var topHeight ;
var iSearch;
var pageNo = 1;

var asmxVenuesSearch = "/API/Venues/JSWSVenuesSearch.asmx/";
var $HitchedAjaxOptions = {
type: "POST",
contentType: "application/json; charset=utf-8",
      dataType: "json",
      error: function(result) {
            alert("Error in server:" + result.status + ' ' + result.statusText);
      }};

var ajaxQueue = $.manageAjax.create('AjaxQueue', { queue: true, cacheResponse: true }); 

function GetValueFromHiddenField(Id)
{
   return $("#" + IDMainContent() + Id).val();    
}

function GetCookie(c_name)
{
      
    if (document.cookie.length>0)
    {
        c_start=document.cookie.indexOf(c_name + "=");
        if (c_start!== -1)
        { 
            c_start=c_start + c_name.length+1; 
            c_end=document.cookie.indexOf(";",c_start);
            if (c_end === -1){
             c_end=document.cookie.length;
             }
             return unescape(document.cookie.substring(c_start,c_end));
        } 
    }
    return "";
}

function ChangeCookieValue(name, value)
{
    var cookies = GetCookie("SearchCriteria");
    var cookieArray = cookies.split("&");
    var newCookie = "";
    var seperator = "";
    var i;    
    for(i=0;i<cookieArray.length;i++)
    {
        
        if(i === 0)
        {
            seperator = "";
            }
        else{
            seperator = "&";
            }
        if (cookieArray[i].match(name + "=") !== null  ){
            newCookie = newCookie +  seperator +  name + "=" + escape(value);
            }
        else{
            newCookie =  newCookie + seperator + cookieArray[i];
            }
     }    
    
     var exdate=new Date();
     var expiredays = null;
     exdate.setDate(exdate.getDate()+expiredays);
     document.cookie="SearchCriteria=" + newCookie + '; path=/' + ((expiredays === null || expiredays === undefined)? "" : ";expires="+exdate.toGMTString());
}

function GetAllCheckedAttributesOnPage() {
    var checked = "";
    $(".chkAttributes input[type=checkbox]:checked").each(function() { checked = checked + $(this).val() + ","; });
    return checked;
}
function GetSearchCriteria()
{     
    var venueSearch = new Object();            
    venueSearch.SearchId =  GetValueFromHiddenField("hidSearchId");
    venueSearch.SearchType =  GetValueFromHiddenField("hidSearchType");
    venueSearch.SearchText= GetValueFromHiddenField("hidSearchText");
    venueSearch.Range =  GetValueFromHiddenField("hidRange");
    venueSearch.SearchLatitude = GetValueFromHiddenField("hidSearchLat");
    venueSearch.SearchLongitude = GetValueFromHiddenField("hidSearchLong");
    venueSearch.SelectedSearchFeature = GetAllCheckedAttributesOnPage();
    venueSearch.SelectedAccommodationFeature = GetAllCheckedAttributesOnPage();
	venueSearch.SearchOrder = GetValueFromHiddenField("hidSearchOrder");      
    venueSearch.OrderBy = GetValueFromHiddenField("hidOrderBy");       
    venueSearch.SearchName = GetValueFromHiddenField("hidSearchName");     
    venueSearch.LateAvailabilityMonth = GetValueFromHiddenField("hidLateAvailabilityMonth");     
    venueSearch.LateAvailabilityYear = GetValueFromHiddenField("hidLateAvailabilityYear");         
    venueSearch.ShowAll = GetValueFromHiddenField("hidShowAll");
    venueSearch.RowsPerPageString = GetValueFromHiddenField("hidPageLength");
    venueSearch.SearchPageNo = 1;
    venueSearch.IsVenuePhotos = GetIsVenuesWithPhotos();  
    return venueSearch;  
}


function GetIsVenuesWithPhotos() {
    var checked;
    if ($('.chkVenuePhotos input[type=checkbox]').is(':checked')) {
        checked = true;
    }
    else {
        checked = false;
    }
    return checked; 
}

function GetISearch()
{
    var i = new Object();            
		i.SearchText= GetValueFromHiddenField("hidSearchText");
		i.PageNumber = 1;//Need to get page number variable?     
		i.RowsPerPageString = GetValueFromHiddenField("hidPageLength");
		i.FiltersIDsCSV = GetAllCheckedAttributesOnPage();
		i.Range = GetValueFromHiddenField("hidRange");
		i.SearchType = pageNo;
		i.IsVenuesPhotos = GetIsVenuesWithPhotos();
    return i;  
}


function SetupPageNo(){
        tabName = $("#" + IDMainContent() + "hiddenDisplayTab").val();
		switch (tabName) {
			case "Venue":
				pageNo = 1;
				break;
			case "LateAvailability":
				pageNo = 3;
				break;
			case "Accommodation":
				pageNo = 4;
				break;
			case "Fair":
				pageNo = 5;
				break;
			default:
			    pageNo = 1;
			    break;
		}
}

function DisplayEliteResult(flag)
{   
    if(flag){
        $("#" + IDMainContent() + "divEliteVenues").show();
        $("#eliteHeading").show();
        $("#eliteHeading").removeClass("hide");
        $("#eliteHeading").addClass("heading-text");
    }else{
        $("#" + IDMainContent() + "divEliteVenues").hide();
        $("#eliteHeading").hide();
        $("#eliteHeading").addClass("hide");
    }
}

function DisplaySearchResults(resultData) {
    
    var venueResult = resultData.SearchResultString;
    var eliteResult = resultData.SearchEliteResultString;
    var myText = $("#VenuesPageHead").html();
    if (venueResult !== null && venueResult !== "")
    {
        $("#" + IDMainContent() + "divWeddingVenues").html(venueResult);
    }
    $(".spnSearchDescription").html(resultData.SearchDescription);
    if (resultData.TotalRecord !== null && resultData.TotalRecord !== 0) {
        $("#VenuesPageHead").html(myText.replace("No results for ", ""));
        $("#" + IDMainContent() + "CanFilter").show();
        $("#spnResultCount").html(resultData.TotalRecord);
        $("#" + IDMainContent() + "hiddenTotalEliteResults").val(resultData.TotalElite);
				$("#spnGoogleMapResultCount").html(resultData.TotalRecord);
				var totalRecordOnPage = resultData.EndIndex + resultData.TotalElite;
        $("#spnPages").html("<span class='results-count'>" + resultData.StartIndex + "</span> to <span class='results-count'>" + totalRecordOnPage + "</span> of <span class='results-count'>" + resultData.TotalRecord + "</span>");

        if (resultData.SearchEliteResultString !== null) {

            if (eliteResult.match(recordNotFound) !== null || eliteResult === ""){
                DisplayEliteResult(false);
                }
            else{
                DisplayEliteResult(true);
                }
            $("#" + IDMainContent() + "divEliteVenues").html(eliteResult);
        }
        showMap();
        DrawGoogeMapData(resultData.GoogleMapData, "Search");
    } else {
       hideMap();
        if (myText.indexOf("No results for ") === -1) {
            $("#VenuesPageHead").html("No results for " + myText);
        }
        $("#" + IDMainContent() + "CanFilter").hide();
        $("#spnResultCount").html(" no ");
        $("#spnGoogleMapResultCount").html(resultData.TotalRecord);
        $("#spnPages").html("<span class='results-count'>0</span>");
        $(".pagging-content").hide();
        //$("#" + IDMainContent() + "divWeddingVenues").html("");
        $("#" + IDMainContent() + "divEliteVenues").html("");
    }

}

function CurrentLADate() {
	   var laDate;
	   laDate = "01/"+ GetValueFromHiddenField("hidLateAvailabilityMonth") +"/"+ GetValueFromHiddenField("hidLateAvailabilityYear");
	   return laDate;
}

function GenerateShowResultMenuCallback(result) {
if(result.d){var pagination = result.d.PagingFirstLastNextPrevious;
if (pagination !== null && pagination !== "") {
					$("#" + IDMainContent() + "divBottomPagination").html(pagination);
					$("#" + IDMainContent() + "divTopPagination").html(pagination);
					$(".pagging-content").show();
				} else {
					$(".pagging-content").hide();
				}		
				var rows = result.d.RowsPerPageLinks;
				if (rows !== null && rows !== "") {
					$("#" + IDMainContent() + "divDisplayResult").html(rows);
					$("#" + IDMainContent() + "divTopDisplayResult").html(rows);
				}				
				$("#" + IDMainContent() + "tabLinkVenue").attr("href",result.d.TabLinkVenue);
				$("#" + IDMainContent() + "tabLinkLate").attr("href",result.d.TabLinkLate);
				$("#" + IDMainContent() + "tabLinkAccom").attr("href",result.d.TabLinkAccom);
				$("#" + IDMainContent() + "tabLinkFair").attr("href",result.d.TabLinkFair);
				$("#" + IDMainContent() + "divLateAvailabilityMenu").html(result.d.LateAvailabilityMenu);
			}
}

function SetBreadCrumbCallBack(result) {
        if (result.d !== null && result.d !== "")
        {
            $('#bread-crumb').html(result.d);
         }
         var i = GetISearch();
	     var totalRows = $("#spnResultCount").html();
	     var visibleElite = $("#" + IDMainContent() + "hiddenTotalEliteResults").val();
	     if (totalRows === "" || totalRows === " no "){totalRows = 0;}
	     if (visibleElite === ""){visibleElite = 0;}
	     var currDate = CurrentLADate();
	     var q = $HitchedAjaxOptions; 
	     q.url = asmxVenuesSearch + "GetShowResultMenu";                 
         q.data = "{totalRows:" + totalRows + ",searchObject:" +  JSON.stringify(i) + ",visibleElite:"+ visibleElite +",ExtraParams:'"+ currDate +"'}";                        
         q.success = GenerateShowResultMenuCallback;
         ajaxQueue.add(q);
	 }


function DrawBreadCrumb() {
    var q = $HitchedAjaxOptions;     
    var tabName = 'Venue'; 
    searchObject = GetSearchCriteria();
    if(tabName === "Fair") {        
            searchObject.SelectedSearchFeature = "";            
        }
    else{
            searchObject.SelectedSearchFeature = "";            
    }   
   q.url = asmxVenuesSearch + "SetBreadCrumb";                 
   q.data = "{tabName:'" + tabName + "',searchObject:" +  JSON.stringify(searchObject) + "}";                        
   q.success = SetBreadCrumbCallBack;  
   ajaxQueue.add(q);                      
}

function AdjustResultListingHeight()
{  
    var offset = 20;     
    //var  newHeight = $("#" + IDMainContent() + "divWeddingVenues").height(); 
    var eliteVenuesHeight = $("#" + IDMainContent() + "divEliteVenues").height() ; 
    if(eliteVenuesHeight > 20 ){
        offset = 45;
        }
}


function displayLoading(isVisible)
{
    if(isVisible === 'true'){
         $('#SliderSearchLoader, #searchLoaderOverlay').fadeIn('fast');          
         }
    else{
         $('#SliderSearchLoader, #searchLoaderOverlay').fadeOut('fast');
         }
 }


function SearchResultCallback(result) {
    DisplaySearchResults(result.d);
    displayLoading('false');

    //window.scroll(50, 50);
    $('html, body').animate({ scrollTop: $("#tabs").offset().top }, 100);
    AdjustResultListingHeight();
    DrawBreadCrumb();    
  
    
}

function GetSearchResults()
{
    SetupPageNo();             
    displayLoading('true');
    searchObject = GetSearchCriteria(); 
    var q = $HitchedAjaxOptions;      
    var str ='Paging';               
    switch (tabName) {
        case "Venue":                       
            q.url = asmxVenuesSearch + "VenueSearchResult";                                   
            q.data = "{searchObject:" +  JSON.stringify(searchObject) + ",functionName:'" + str + "'}";                        
            q.success = SearchResultCallback;  
            ajaxQueue.add(q);                      
            break;
        case "LateAvailability":
            q.url = asmxVenuesSearch + "LateAvailabilitySearchResult";                                   
            q.data = "{searchObject:" +  JSON.stringify(searchObject) + ",functionName:'" + str + "'}";                        
            q.success = SearchResultCallback; 
            ajaxQueue.add(q);                 
            break;
        case "Accommodation": 
            q.url = asmxVenuesSearch + "AccommodationSearchResult";                       
            q.data = "{searchObject:" +  JSON.stringify(searchObject) + ",functionName:'" + str + "'}";                        
            q.success = SearchResultCallback;            
            ajaxQueue.add(q);
            break;
        case "Fair":
            q.url = asmxVenuesSearch + "FairSearchResult";                       
            q.data = "{searchObject:" +  JSON.stringify(searchObject) + ",functionName:'" + str + "'}";                        
            q.success = SearchResultCallback;  
            ajaxQueue.add(q);           
            break;
        default:
            q.url = asmxVenuesSearch + "VenueSearchResult";                       
            q.data = "{searchObject:" +  JSON.stringify(searchObject) + ",functionName:'" + str + "'}";                        
            q.success = SearchResultCallback;   
            ajaxQueue.add(q);            
            break;
    }
    $.geekGaTrackPageAgain();

}



function SliderChange(sliderValue)
{
    //ChangedAttributes(); 
    ChangeCookieValue("Range", sliderValue);
    $("#" + IDMainContent() + "hidRange").val(sliderValue);
    GetSearchResults();
}

function ChangedAttributes() {
    var att = GetAllCheckedAttributesOnPage();
    $('#' + IDMainContent() + 'hidSelectedVenueFeature').val(att);
    $('#' + IDMainContent() + 'hidSelectedAccommodationFeature').val(att);
    ChangeCookieValue("SelectedSearchFeature", att);
    ChangeCookieValue("SelectedAccommodationFeature", att);
    GetSearchResults();
}
function DeselectAllFilterOption()
{
    $('.chkAttributes input[type=checkbox]:checked').attr('checked', false);      
}


function RemoveFilterCriteria()
{
    DeselectAllFilterOption();
    ChangedAttributes(); 
}



function CalculateHeight()
{
    var totalHeight = $('#divMain').height(); 
    var resultListing = $("#" + IDMainContent() + "divWeddingVenues").height();
    topHeight = totalHeight - resultListing; 
}

function ToggleDistanceSection()
{
    if($('#divDistance').is(":hidden"))
    {
        $('#divDistance').slideDown("slow");
        $('#distanceOut').show();
        $('#distanceIn').hide();
    } 
    else
    {
        $('#divDistance').slideUp("slow");
        $('#distanceOut').hide();
        $('#distanceIn').show();                
    }
}

$(document).ready(function() {
    $('.chkVenuePhotos input[type=checkbox]').click(function() {
        ChangedAttributes();
        return true;

    });
    $('.chkAttributes input[type=checkbox]').click(function() {
        //var recordType = $("*[id$='hddnRecordType']").val();
        //var hddnclientid = $(this).parent().find("input[type=hidden]").val();
        //var attributeName = $(this).parent().find("label").text();
        //var checkBox = $(this);
        //CheckAttributIds(checkBox, checkBox.val(), recordType, attributeName);
        ChangedAttributes();
        return true;
    });

    /* Hide the google map by default */
    $('#' + IDMainContent() + 'mapContent').slideUp();

    $("#listView").click(function() {
        hideMap();
        return false;
    });
    $("#mapView").click(function() {
        showMap();
        return false;
    });

    $("#divToggleDistance").click(function() {
        ToggleDistanceSection();
    });

    $(window).scroll(function(e) {
        $('#SliderSearchLoader').animate({ top: ($(window).scrollTop() + screen.height / 2 - 200) + "px" }, { queue: false, duration: 350 });
    });
});
function hideMap() {
	$('#' + IDMainContent() + 'mapContent').slideUp();
	$('#mapView').parent().removeClass('results-activeview');
	$('#listView').parent().addClass('results-activeview');
	return false;
}

function showMap() {
	$('#' + IDMainContent() + 'mapContent').slideDown();
	$('#listView').parent().removeClass('results-activeview');
	$('#mapView').parent().addClass('results-activeview');
	return false;
}/*
 * jQuery UI 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/*
 * jQuery UI Slider 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Slider
 *
 * Depends:
 *	ui.core.js
 */
(function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=a([]);if(c.range){if(c.range===true){this.range=a("<div></div>");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length<c.values.length){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d<b))){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,{handle:this.handles[e],value:d,values:c});var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,{handle:this.handles[e],value:d});if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("stop",d,b)},_change:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("change",d,b)},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/*
 * jQuery UI Tabs 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Tabs
 *
 * Depends:
 *	ui.core.js
 */
(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1<this.anchors.length?1:-1))}d.disabled=a.map(a.grep(d.disabled,function(g,f){return g!=b}),function(g,f){return g>=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading&#8230;</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i<b.anchors.length?i:0)},d);if(h){h.stopPropagation()}});var e=b._unrotate||(b._unrotate=!f?function(h){if(h.clientX){b.rotate(null)}}:function(h){t=g.selected;c()});if(d){this.element.bind("tabsshow",c);this.anchors.bind(g.event+".tabs",e);c()}else{clearTimeout(b.rotation);this.element.unbind("tabsshow",c);this.anchors.unbind(g.event+".tabs",e);delete this._rotate;delete this._unrotate}}})})(jQuery);;/*
 * jQuery UI Effects 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/
 */
jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.data("ec.storage."+h[f],g[0].style[h[f]])}}},restore:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.css(h[f],g.data("ec.storage."+h[f]))}}},setMode:function(f,g){if(g=="toggle"){g=f.is(":hidden")?"show":"hide"}return g},getBaseline:function(g,h){var i,f;switch(g[0]){case"top":i=0;break;case"middle":i=0.5;break;case"bottom":i=1;break;default:i=g[0]/h.height}switch(g[1]){case"left":f=0;break;case"center":f=0.5;break;case"right":f=1;break;default:f=g[1]/h.width}return{x:f,y:i}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var g={width:f.outerWidth(true),height:f.outerHeight(true),"float":f.css("float")};f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return -(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f},easeOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return h*Math.pow(2,-10*i)*Math.sin((i*l-j)*(2*Math.PI)/k)+m+f},easeInOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}if(i<1){return -0.5*(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f}return h*Math.pow(2,-10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k)*0.5+m+f},easeInBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*(h/=j)*h*((i+1)*h-i)+f},easeOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*((h=h/j-1)*h*((i+1)*h+i)+1)+f},easeInOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}if((h/=j/2)<1){return k/2*(h*h*(((i*=(1.525))+1)*h-i))+f}return k/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+f},easeInBounce:function(g,h,f,j,i){return j-d.easing.easeOutBounce(g,i-h,0,j,i)+f},easeOutBounce:function(g,h,f,j,i){if((h/=i)<(1/2.75)){return j*(7.5625*h*h)+f}else{if(h<(2/2.75)){return j*(7.5625*(h-=(1.5/2.75))*h+0.75)+f}else{if(h<(2.5/2.75)){return j*(7.5625*(h-=(2.25/2.75))*h+0.9375)+f}else{return j*(7.5625*(h-=(2.625/2.75))*h+0.984375)+f}}}},easeInOutBounce:function(g,h,f,j,i){if(h<i/2){return d.easing.easeInBounce(g,h*2,0,j,i)*0.5+f}return d.easing.easeOutBounce(g,h*2-i,0,j,i)*0.5+j*0.5+f}})})(jQuery);;
// virtual="~/js/ui.slider.js"
//Adjust Height
//A shared file that allows client side updates of the heigh across broswers.

var offSetHeight = 10;
function FixHeight(one,two) 
{ 
    if($('#'+one))
    {
        var lh= $('#' +one).height();
        var rh = $('#' +two).height();
        var nh = Math.max(lh, rh);  
        $('#'+one).height(nh + offSetHeight);
        $('#'+two).height(nh + offSetHeight);
    }
}

function AdjustHeight()
{   
    //some of the functions from FashionListing.js and FashionNavigation.js
    //are accesing this function  so not removed 
}

function IsIE6Browser()
{
    return ($.browser.msie && $.browser.version.substr(0,1)<7);
}

function ReAssignHieght(id,orginalHeight,value)
{   
     //some of the functions from FashionListing.js and FashionNavigation.js
    //are accesing this function so not removed 
}
