//DropdownList.js
$(document).ready(function() {$('#wedding-navigation li').mouseover(function() { $(this).addClass("over"); }).mouseout(function() { $(this).removeClass("over"); });});
/*
 * jQuery UI 1.7.1
 *
 * 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.1",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 Tabs 1.7.1
 *
 * 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").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");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header");this.lis.addClass("ui-state-default");this.panels.addClass("ui-tabs-panel ui-widget-content");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-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header");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-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","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").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-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.1",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);;/**
 * @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);//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);
}jQuery.fn.truncate=function(max,settings){settings=jQuery.extend({chars:/\s/,trail:["...",""]},settings);var myResults={};var ie=$.browser.msie;function fixIE(o){if(ie){o.style.removeAttribute("filter")}}return this.each(function(){var $this=jQuery(this);var myStrOrig=$this.html().replace(/\r\n/gim,"");var myStr=myStrOrig;var myRegEx=/<\/?[^<>]*\/?>/gim;var myRegExArray;var myRegExHash={};var myResultsKey=$("*").index(this);while((myRegExArray=myRegEx.exec(myStr))!=null){myRegExHash[myRegExArray.index]=myRegExArray[0]}myStr=jQuery.trim(myStr.split(myRegEx).join(""));if(myStr.length>max){var c;while(max<myStr.length){c=myStr.charAt(max);if(c.match(settings.chars)){myStr=myStr.substring(0,max);break}max--}if(myStrOrig.search(myRegEx)!=-1){var endCap=0;for(eachEl in myRegExHash){myStr=[myStr.substring(0,eachEl),myRegExHash[eachEl],myStr.substring(eachEl,myStr.length)].join("");if(eachEl<myStr.length){endCap=myStr.length}}$this.html([myStr.substring(0,endCap),myStr.substring(endCap,myStr.length).replace(/<(\w+)[^>]*>.*<\/\1>/gim,"").replace(/<(br|hr|img|input)[^<>]*\/?>/gim,"")].join(""))}else{$this.html(myStr)}myResults[myResultsKey]=myStrOrig;$this.html(["<div class='truncate_less'>",$this.html(),settings.trail[0],"</div>"].join("")).find(".truncate_show",this).click(function(){if($this.find(".truncate_more").length==0){$this.append(["<div class='truncate_more' style='display: none;'>",myResults[myResultsKey],settings.trail[1],"</div>"].join("")).find(".truncate_hide").click(function(){$this.find(".truncate_more").css("background","#fff").fadeOut("normal",function(){$this.find(".truncate_less").css("background","#fff").fadeIn("normal",function(){fixIE(this);$(this).css("background","none")});fixIE(this)});return false})}$this.find(".truncate_less").fadeOut("normal",function(){$this.find(".truncate_more").fadeIn("normal",function(){fixIE(this)});fixIE(this)});jQuery(".truncate_show",$this).click(function(){$this.find(".truncate_less").css("background","#fff").fadeOut("normal",function(){$this.find(".truncate_more").css("background","#fff").fadeIn("normal",function(){fixIE(this);$(this).css("background","none")});fixIE(this)});return false});return false})}})};/* =========================================================

// jquery.innerfade.js

// Datum: 2008-02-14
// Firma: Medienfreunde Hofmann & Baldes GbR
// Author: Torsten Baldes
// Mail: t.baldes@medienfreunde.com
// Web: http://medienfreunde.com

// based on the work of Matt Oakes http://portfolio.gizone.co.uk/applications/slideshow/
// and Ralf S. Engelschall http://trainofthoughts.org/

 *
 *  <ul id="news"> 
 *      <li>content 1</li>
 *      <li>content 2</li>
 *      <li>content 3</li>
 *  </ul>
 *  
 *  $('#news').innerfade({ 
 *	  animationtype: Type of animation 'fade' or 'slide' (Default: 'fade'), 
 *	  speed: Fading-/Sliding-Speed in milliseconds or keywords (slow, normal or fast) (Default: 'normal'), 
 *	  timeout: Time between the fades in milliseconds (Default: '2000'), 
 *	  type: Type of slideshow: 'sequence', 'random' or 'random_start' (Default: 'sequence'), 
 * 		containerheight: Height of the containing element in any css-height-value (Default: 'auto'),
 *	  runningclass: CSS-Class which the container getâ€™s applied (Default: 'innerfade'),
 *	  children: optional children selector (Default: null)
 *  }); 
 *

// ========================================================= */


(function($) {

    $.fn.innerfade = function(options) {
        return this.each(function() {   
            $.innerfade(this, options);
        });
    };

    $.innerfade = function(container, options) {
        var settings = {
        		'animationtype':    'fade',
            'speed':            'normal',
            'type':             'sequence',
            'timeout':          2000,
            'containerheight':  'auto',
            'runningclass':     'innerfade',
            'children':         null
        };
        if (options)
            $.extend(settings, options);
        if (settings.children === null || settings.children === undefined)
            var elements = $(container).children();
        else
            var elements = $(container).children(settings.children);
        if (elements.length > 1) {
            $(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass);
            for (var i = 0; i < elements.length; i++) {
                $(elements[i]).css('z-index', String(elements.length-i)).css('position', 'absolute').hide();
            };
            if (settings.type == "sequence") {
                setTimeout(function() {
                    $.innerfade.next(elements, settings, 1, 0);
                }, settings.timeout);
                $(elements[0]).show();
            } else if (settings.type == "random") {
            		var last = Math.floor ( Math.random () * ( elements.length ) );
                setTimeout(function() {
                    do { 
												current = Math.floor ( Math.random ( ) * ( elements.length ) );
										} while (last == current );             
										$.innerfade.next(elements, settings, current, last);
                }, settings.timeout);
                $(elements[last]).show();
						} else if ( settings.type == 'random_start' ) {
								settings.type = 'sequence';
								var current = Math.floor ( Math.random () * ( elements.length ) );
								setTimeout(function(){
									$.innerfade.next(elements, settings, (current + 1) %  elements.length, current);
								}, settings.timeout);
								$(elements[current]).show();
						}	else {
							alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
						}
				}
    };

    $.innerfade.next = function(elements, settings, current, last) {
        if (settings.animationtype == 'slide') {
            $(elements[last]).slideUp(settings.speed);
            $(elements[current]).slideDown(settings.speed);
        } else if (settings.animationtype == 'fade') {
            $(elements[last]).fadeOut(settings.speed);
            $(elements[current]).fadeIn(settings.speed, function() {
							removeFilter($(this)[0]);
						});
        } else
            alert('Innerfade-animationtype must either be \'slide\' or \'fade\'');
        if (settings.type == "sequence") {
            if ((current + 1) < elements.length) {
                current = current + 1;
                last = current - 1;
            } else {
                current = 0;
                last = elements.length - 1;
            }
        } else if (settings.type == "random") {
            last = current;
            while (current == last)
                current = Math.floor(Math.random() * elements.length);
        } else
            alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
        setTimeout((function() {
            $.innerfade.next(elements, settings, current, last);
        }), settings.timeout);
    };

})(jQuery);

// **** remove Opacity-Filter in ie ****
function removeFilter(element) {
	if(element.style.removeAttribute){
		element.style.removeAttribute('filter');
	}
}
// 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();
}
// JScript File
//Starting of  VenuesDetails.js

var mosx;
var mosy;
var prevMonthId=0;
 
var asmxCommon = "/API/Venues/JSWSCommon.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 GenerateLADescriptionPopup(desc)
{
    //var websiteName= $("#hddnWebsiteName").val();
    var textToDispaly = [];   
    textToDispaly[0]="<li class='ulLADesc'>";
    textToDispaly[1]="<div class='la-descriptionTitle'>Description</div>";
    textToDispaly[2]="</li>";
    textToDispaly[3]="<li class='ulLADesc'>";
    textToDispaly[4]="<span>";
    textToDispaly[5]=desc;
    textToDispaly[6]="</span>";
    textToDispaly[7]="</li>";
    this.$OuterDiv =  $('<ul></ul>').append(textToDispaly.join(''));
    return this.$OuterDiv.html()  ;
}
function CallBackFillLateAvailability(result)
{    
    $('#late').html(GenerateLADescriptionPopup(result.d));    
}

function Show(monthID)
{
   var q = $HitchedAjaxOptions; 
   q.url = asmxCommon + "FillLateAvailability";                 
   q.data = "{monthId:" + monthID + "}";                        
   q.success = CallBackFillLateAvailability;  
   ajaxQueue.add(q);          
}


 $(document).ready(function() { 
     var isPreview;
     if ($('.divAdvertDetails').attr('id')) {
         var clientID = '#' + $('.divAdvertDetails').attr('id').replace('divAdvertDetails', '');
          isPreview = $( clientID + 'hddnIsPreview').val();
     }
     if (isPreview === '1') {
         $('.divAdvertDetails').css("top", "0px");
         $('.divAdvertDetails').show();
         $(window).scroll(function() {
             var docHeight = $(document.body).height();
             var divHeight = $('.divAdvertDetails').height();
             if ($(window).scrollTop() + divHeight < docHeight){             
                 $('.divAdvertDetails').animate({ top: $(window).scrollTop() + "px" }, { queue: false, duration: 350 });
                 }
         });
     }
     else { $('.divAdvertDetails').hide(); }

     $("#*[id$='divInteractiveMap']").mouseover(function(e) {
         var height = $('#divVenueDetails').height();
         var width = $('#divVenueDetails').width();
         leftVal = (width / 2 + 200) + "px";
         topVal = (e.pageY - (height / 2)) - 250 + "px";
         FillVenueGMap();
         $("#pop-win").css({ 'left': leftVal, 'top': topVal });
     });

     $("*[id$='divLateAvailability']").find('a').mouseover(function(e) {
         var lateId = this.id;
         lateId = lateId.split('_');
         $(this).css("color", "#93148c");
         $('#href_' + prevMonthId).css("color", "#380063");
         prevMonthId = lateId[1];
         Show(lateId[1]);
         $('#late').show();
     });

     $("*[id$='divLateAvailability']").find('a').click(function(e) {
         return false;
     });
     SetupTooltips();
 });



function showlocationlist()
{
    var objLocationList;
    objLocationList=$("*[id$='hddLocationList']").val();
    if(objLocationList){ 
        if (objLocationList=="False"){
            $("#divLocationlist").css({"display":"none","width":"0px"});
            $("#map_canvas").css("width","800px");
        }else{
            $("#divLocationlist").css({"display":"block","width":"200px"});
            $("#map_canvas").css("width","600px");
        } 
    } 
}

ShowTooltip = function(e){
	var text = $(this).next('.show-tooltip-text');
	if (text.attr('class') != 'show-tooltip-text'){
		return false;
		}
	text.fadeIn().css('top', e.pageY + "px").css('left', (e.pageX+10) + "px");
	return false;
};
HideTooltip = function(e)
{
	var text = $(this).next('.show-tooltip-text');
	if (text.attr('class') !== 'show-tooltip-text'){
		return false;    }
	text.fadeOut();
	return false;
};

SetupTooltips = function()
{
	$('.show-tooltip').each(function(){
			$(this).after($('<span/>').attr('class', 'show-tooltip-text').html($(this).attr('title'))).attr('title', '');}).hover(ShowTooltip, HideTooltip);
};

//End of  VenuesDetails.js/* 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());
}// 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(); */
} 
    
      var divStart = "<div class='dvErrorMsg'>";
    var divEnd = "</div>";
    var validator;
    var actualHeight = "";    
    jQuery.validator.addMethod("CheckAlfaNumeric", function(value, element) {var RECheckAlfaNumeric = new RegExp("^[A-Za-z\ ]+$");
    return this.optional(element) || RECheckAlfaNumeric.test(value);}, divStart+"Please enter letters."+divEnd);
    jQuery.validator.addMethod("PhoneNumber", function(phone_number, element){var REPhoneNumber = new RegExp("^[0-9]+$");return this.optional(element) || REPhoneNumber.test(phone_number);}, divStart +"Please enter valid phone number"+ divEnd);
 
$(document).ready(function(){ 
    var IDToName = IDMainContent().replace(/_/g, "$");
    var myRules = new Object();
    myRules[IDToName + "txtFirstName"] = { required:true, CheckAlfaNumeric:true };
    myRules[IDToName + "txtLastName"] = { required:true, CheckAlfaNumeric:true };    
    myRules[IDToName + "txtTelephone"] = { required:true, PhoneNumber:true};
    myRules[IDToName + "txtEmail"] = { required:true, email:true };    

    var myMessages = new Object();
    myMessages[IDToName + "txtFirstName"] = { required: divStart +"Please enter first name" + divEnd };
    myMessages[IDToName + "txtLastName"] = { required:divStart +"Please enter last name" + divEnd};    
    myMessages[IDToName + "txtTelephone"] = { required: divStart +"Please enter telephone number" + divEnd};
    myMessages[IDToName + "txtEmail"] = { required: divStart +"Please enter email address."+ divEnd, email:divStart +"Please enter a valid email address."+ divEnd};    


     validator = $("#aspnetForm").validate({ rules: myRules, messages: myMessages });
    $("#" + IDMainContent() + "ddlDay").blur(function(){SetWeddingDate(this.id,IDMainContent()+'hddnDay');});
    $("#" + IDMainContent() + "ddlMonth").blur(function(){SetWeddingDate(this.id,IDMainContent()+'hddnMonth');});
    $("#" + IDMainContent() + "ddlYear").blur(function(){SetWeddingDate(this.id,IDMainContent()+'hddnYear');});
    
    $("#" + IDMainContent() + "txtFirstName").blur(function(){$("#" + IDMainContent() + "txtFirstName").valid(); AdjustFormHeight();});
    $("#" + IDMainContent() + "txtLastName").blur(function(){$("#" + IDMainContent() + "txtLastName").valid();AdjustFormHeight();});    
    $("#" + IDMainContent() + "txtTelephone").blur(function(){$("#" + IDMainContent() + "txtTelephone").valid();AdjustFormHeight();});
    $("#" + IDMainContent() + "txtEmail").blur(function(){$("#" + IDMainContent() + "txtEmail").valid();AdjustFormHeight();});    
    $('.textbox').focus(function(){	    
		    $(this).parent().addClass('li-hint-parent').find('.hint-box').show();		    
	    }).blur(function() {
		    $('.hint-box').hide();		    
            $(this).parent().removeClass('li-hint-parent');
	 });	    
    $("#" + IDMainContent() + "btnSubmit").click(function() {
        if(!$("#aspnetForm").valid())
        {
            AdjustFormHeight();
            }
    });    
    actualHeight = $("#rightHandNavDiv").height();
    $('.optional').fadeOut();
    $('.rfi-optional').click(function(){ ExpandCollapse();});
});
function ExpandCollapse()
{    
    if ($('.optional').is(":hidden")) 
    {
       $('.optional').fadeIn();
       $('#btnExpand' ).attr("src","/images/minus.jpg");
    }
    else
    {
        $('.optional').fadeOut();        
        $('#btnExpand').attr("src","/images/plus.jpg");
    }    
}
function AdjustFormHeight()
{    
    ReAssignHieght('rightHandNavDiv',actualHeight,validator.numberOfInvalids()* 18);
    /*AdjustHeight(); */   
}
function SetWeddingDate(elementId,hiddenFieldID)
{   
    $('#'+hiddenFieldID).val($('#'+ elementId +' :selected').val());    
}

/*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Copyright (c) 20010 Janis Skarnelis
 * Examples and documentation at: http://fancybox.net
 *
 * Version: 1.3.0 (02/02/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

;(function(b){function H(){v.hide();r.onerror=r.onload=null;F&&F.abort();l.empty()}function Q(){b.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})}function B(){H();var a=q[s];e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));var d,f,o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?
b(a).children("img:first"):b(a);if(o==""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(I))f="image";else if(d.match(T))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!==
"swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,s,e)===false){h=false;return}l.css("padding",t+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case "html":l.html(e.content);G();break;case "inline":b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",
function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(l.children())});b(a).appendTo(l);G();break;case "image":h=false;b.fancybox.showActivity();r=new Image;r.onerror=function(){Q()};r.onload=function(){r.onerror=null;r.onload=null;U()};r.src=d;break;case "swf":var u="",w="";u+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+d+'"></param>';b.each(e.swf,function(p,R){u+=
'<param name="'+p+'" value="'+R+'"></param>';w+=" "+p+'="'+R+'"'});u+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+w+"></embed></object>";l.html(u);G();break;case "ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];typeof f=="string"?(f+="&selector="+a[1]):(f.selector=a[1])}h=false;b.fancybox.showActivity();F=b.ajax(b.extend(e.ajax,{url:d,data:f,error:Q,success:function(p){if(F.status==200){l.html(p);G()}}}));break;case "iframe":b('<iframe id="fancybox-frame" name="fancybox-frame'+
(new Date).getTime()+'" frameborder="0" hspace="0" scrolling="'+e.scrolling+'" src="'+e.href+'"></iframe>').appendTo(l);J();break}}function U(){h=true;e.width=r.width;e.height=r.height;b("<img />").attr({id:"fancybox-img",src:r.src,alt:e.title}).appendTo(l);J()}function G(){l.width(e.width);l.height(e.height);if(e.width=="auto")e.width=l.width();if(e.height=="auto")e.height=l.height();J()}function J(){v.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel");
h=false;return}j=q;n=s;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){K&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});y.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}m=V();W();if(g.is(":visible")){b(z.add(C).add(D)).hide();var a=g.position();k={top:a.top,left:a.left,width:g.width(),height:g.height()};
var d=k.width==m.width&&k.height==m.height;i.fadeOut(c.changeFade,function(){function f(){i.html(l.contents()).fadeIn(c.changeFade,L)}b.event.trigger("fancybox-change");i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).empty().css("overflow","hidden");A.prop=0;b(A).animate({prop:1},{duration:d?0:c.changeSpeed,easing:c.easingChange,step:M,complete:f})})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=S();i.css({top:c.padding,
left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(l.contents());g.css(k).show();if(c.opacity)m.opacity=0;A.prop=0;b(A).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(m.width-c.padding*2,1),height:Math.max(m.height-c.padding*2-x,1)}).html(l.contents());g.css(m).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}}function M(a){var d=Math.round(k.width+(m.width-k.width)*a),
f=Math.round(k.height+(m.height-k.height)*a),o=Math.round(k.top+(m.top-k.top)*a),u=Math.round(k.left+(m.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:u+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+x*a),0);i.css({width:d+"px",height:f+"px"});if(typeof m.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)}function L(){i.css("overflow",overflow=c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible");
if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&y.one("click",b.fancybox.close);c.showCloseButton&&z.show();X();b(window).bind("resize.fb",b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;Y()}function V(){var a=N(),d={},f=
c.margin,o=c.autoScale,u=(t+f)*2,w=(t+f)*2,p=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-t*2;o=false}else d.width=c.width+p;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-t*2;o=false}else d.height=c.height+p;if(o&&(d.width>a[0]-u||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){u+=p;w+=p;o=Math.min(Math.min(a[0]-u,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-p))+p;d.height=Math.round(o*
(d.height-p))+p}else{d.width=Math.min(d.width,a[0]-u);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+t*2))*0.5;d.left=a[2]+(a[0]-(d.width+t*2))*0.5;if(c.autoScale==false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d}function S(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Z(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-t,left:a.left-c.padding-t}}else{a=N();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d}
function X(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode==37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d==0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!=0)C.show();
if(c.cyclic&&j.length>1||n!=j.length-1)D.show()}}function Y(){if(j.length-1>n){var a=j[n+1].href;if(typeof a!=="undefined"&&a.match(I)){var d=new Image;d.src=a}}if(n>0){a=j[n-1].href;if(typeof a!=="undefined"&&a.match(I)){d=new Image;d.src=a}}}function $(){if(v.is(":visible")){b("div",v).css("top",O*-40+"px");O=(O+1)%12}else clearInterval(P)}function N(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]}function Z(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))||
0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d}function W(){b("#fancybox-title").remove();x=0;if(c.titleShow!=false){var a=c.title;a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):aa(a);if(!(!a||a=="")){var d=m.width-c.padding*2;b('<div id="fancybox-title" class="'+("fancybox-title-"+c.titlePosition)+'" />').css({width:d,paddingLeft:c.padding,paddingRight:c.padding}).html(a).appendTo("body");
switch(c.titlePosition){case "inside":x=b("#fancybox-title").outerHeight(true)-c.padding;m.height+=x;break;case "over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(E).hide();K&&b("#fancybox-title span").fixPNG()}}}function aa(a){if(a&&a.length)switch(c.titlePosition){case "inside":return a;case "over":return'<span id="fancybox-title-over">'+a+"</span>";default:return'<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">'+
a+'</span><span id="fancybox-title-right"></span></span>'}return false}function ba(){if(!b("#fancybox-wrap").length){b("body").append(l=b('<div id="fancybox-tmp"></div>'),v=b('<div id="fancybox-loading"><div></div></div>'),y=b('<div id="fancybox-overlay"></div>'),g=b('<div id="fancybox-wrap"></div>'));E=b('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(g);
E.append(i=b('<div id="fancybox-inner"></div>'),z=b('<a id="fancybox-close"></a>'),C=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),D=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));z.click(b.fancybox.close);v.click(b.fancybox.cancel);C.click(function(a){a.preventDefault();b.fancybox.prev()});D.click(function(a){a.preventDefault();b.fancybox.next()});b.support.opacity||E.find(".fancy-bg").fixPNG();
if(K){b(z.add(".fancy-ico").add("div",v)).fixPNG();y.get(0).style.setExpression("height","document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");v.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");E.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>')}}}
var l,v,y,g,E,i,z,C,D,s=0,e={},q=[],n=0,c={},j=[],F=null,r=new Image,I=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,T=/[^\.]\.(swf)\s*$/i,P,O=1,k,m,h=false,t=20,A=b.extend(b("<div/>")[0],{prop:0}),x=0,K=!b.support.opacity&&!window.XMLHttpRequest;b.fn.fixPNG=function(){return this.each(function(){var a=b(this).css("backgroundImage");if(a.match(/^url\(["']?(.*\.png)["']?\)$/i)){a=RegExp.$1;b(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod="+
(b(this).css("backgroundRepeat")=="no-repeat"?"crop":"scale")+", src='"+a+"')"}).each(function(){var d=b(this).css("position");d!="absolute"&&d!="relative"&&b(this).css("position","relative")}).css("zoom",1)}})};b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a));b(this).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];s=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");s=
q.index(this)}B();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;q=[];s=0;if(b.isArray(a)){for(var f=0,o=a.length;f<o;f++)if(typeof a[f]=="object")b(a[f]).data("fancybox",b.extend({},d,a[f]));else a[f]=b({}).data("fancybox",b.extend({content:a[f]},d));q=jQuery.merge(q,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},d,a));else a=b({}).data("fancybox",b.extend({content:a},d));q.push(a)}B()}};b.fancybox.showActivity=function(){clearInterval(P);v.show();P=setInterval($,
66)};b.fancybox.hideActivity=function(){v.hide()};b.fancybox.next=function(){return b.fancybox.pos(n+1)};b.fancybox.prev=function(){return b.fancybox.pos(n-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);if(a>-1&&j.length>a){s=a;B()}if(c.cyclic&&j.length>1&&a<0){s=j.length-1;B()}if(c.cyclic&&j.length>1&&a>=j.length){s=0;B()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");H();e&&b.isFunction(e.onCancel)&&e.onCancel(q,s,e);h=false}};b.fancybox.close=function(){function a(){y.fadeOut("fast");
g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=s=0;c=e={};h=false}if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}H();b(z.add(C).add(D)).hide();b("#fancybox-title").remove();g.add(i).add(y).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=S();var d=g.position();m={top:d.top,left:d.left,
width:g.width(),height:g.height()};if(c.opacity)m.opacity=1;A.prop=1;b(A).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){if(!(h||g.is(":hidden"))){h=true;var a=i.wrapInner("<div style='overflow:auto'></div>").children(),d=a.height();g.css({height:d+c.padding*2+x});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=N(),d=c.margin,
f={};f.top=a[3]+(a[1]-(g.height()-x+t*2))*0.5;f.left=a[2]+(a[0]-(g.width()+t*2))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",
titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){ba()})})(jQuery);

$(document).ready(function() {
	$("a.thickbox").fancybox();
}); 
// JScript File
//start Venues.accomodation.js

function GetDirections()
{
    var sourceAddress = $('#txtPostCode').val();
    var googleUrl = "http://maps.google.co.uk/maps?saddr=ab10&daddr=GU15+3DW&hl=en";
    var destinationAddress = $('#hddnPostcode').val();    
    var link =  googleUrl + "&saddr=" +sourceAddress + "&daddr=" +  destinationAddress + "&hl=en";    
    //window.location  =  googleUrl + "&saddr=" +sourceAddress + "&daddr=" +  destinationAddress + "&hl=en";    
    window.open(link,'Get direction','resizable=yes ,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes');
}

$(document).ready(function(){   

    $("#txtPostCode").keypress(function(e) {       
          if((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13))
          {
               GetDirections();            
               return false;  
           }    
     });
    $("#btnGetdirection").click(function(){GetDirections();});
});

function AdjustAccommodationHeight()
{
     var accommodationLeft = $(' .accommodation-detail-left').height();        
     var accommodationRight = $(' .accommodation-detail-right').height();        
     var topHeight;
     if(accommodationLeft > accommodationRight){
        topHeight = accommodationLeft;
        }
     else{
        topHeight = accommodationRight;
        }
     
}
//end of Venues.accomodation.js


// JScript File
// starting of Venues.MediaGallery.js
//Areas used venues admin

var pageNumber = 1;
var asmxMediaGallery = "/API/Venues/JSWSMediaGallery.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 EnabledDisableMediaLink(isEnabled, element) {
    if (isEnabled) {
        $(element).css("color", "#380062");
        $(element).css("textDecoration", 'underline');
        $(element).css("cursor", "pointer");

    }
    else {
        $(element).css("color", "#696969");
        $(element).css("textDecoration", 'none');
        $(element).css("cursor", "text");
    }

}


function enableALL(clientID) {
    var firstLink = $(clientID + "lnkFirst");
    var nextLink = $(clientID + "lnkNext");
    var lastLink = $(clientID + "lnkLast");
    var prevtLink = $(clientID + "lnkPrevious");
    EnabledDisableMediaLink(true, firstLink);
    EnabledDisableMediaLink(true, nextLink);
    EnabledDisableMediaLink(true, lastLink);
    EnabledDisableMediaLink(true, prevtLink);
}

function setPageCount(clientID) {
    var lastPageIndex = $(clientID + "lblLastPageindex");
    var lblCounts = $(clientID + "lblCounts");
    lblCounts.innerHTML = "Page " + pageNumber + " of " + lastPageIndex.innerHTML;
}

function CallBackDeletePost(result)
{
    window.location = "MediaGallery.aspx?msg=delete&rid=" + $("span.lblRecordID").text() + "&type=" + $("span.lblGalleryType").text();
}
function DeleteMediaGalleryPost() {
    $('a.deletePhoto').click(function() {
        if (confirm('Are you sure you want to delete this record?')) {
            $("#loader_media").show();
            $("#loader_media").height($("#divMediaDetailsMain").height());            
            var q = $HitchedAjaxOptions; 
            q.url = asmxMediaGallery + "DeletePost";                 
            q.data = "{postID:" + $(this).attr("title") + "}";                        
            q.success = CallBackDeletePost;  
            ajaxQueue.add(q);              
            return false;
        }
        else {
            return false;
        }
    });
}



function CallBackGetMediaGalleryHTML(result)
{
        $('#divMediaGallery').html(result.d);
        DeleteMediaGalleryPost();        
        $("a.thickbox").fancybox({ 'overlayOpacity': 0.7 });
        $("#loader_media").hide();
}

function getMediaGallery(pageNo, clientID) {
    $("#loader_media").show();
    $("#loader_media").height($("#divMediaDetailsMain").height());
    setTimeout(function() {        
        var RecordID = $(clientID + "lblRecordID").text();
        var GalleryType = $(clientID + "lblGalleryType").text();
        var RecordCount = $(clientID + "lblTotalListed").text();
        var IsAdmin = $(clientID + "lblIsAdmin").text();            
        var q = $HitchedAjaxOptions; 
        q.url = asmxMediaGallery + "GetMediaGalleryHTML";                 
        q.data = "{recordID:" + RecordID + ",galleryType:" + GalleryType + ",PageNumber:" + pageNo + ",RecordCount:" + RecordCount + ",isAdmin:" + IsAdmin + "}";                        
        q.success = CallBackGetMediaGalleryHTML;  
        ajaxQueue.add(q);  
    }, 1);
    setTimeout(function() {  }, 1);
}

function InitializeMediaGallery() {
    var clientID = '';
    if ($('.lblRecordID').attr("id")) {
        clientID = '#' + $('.lblRecordID').attr("id").replace("lblRecordID", "");
    }
    $(clientID + "lnkNext").click(function() {
        var lastPageIndex = $(clientID + 'lblLastPageindex').text();
        if (pageNumber < parseInt(lastPageIndex,0)) {
            enableALL(clientID);
            pageNumber = pageNumber + 1;
            getMediaGallery(pageNumber, clientID);
        }
        if (pageNumber == parseInt(lastPageIndex,0)) {
            var lastLink = $(clientID + "lnkLast");
            EnabledDisableMediaLink(false, this);
            EnabledDisableMediaLink(false, lastLink);
        }
        setPageCount(clientID);
        return false;
    });

    $(clientID + "lnkPrevious").click(function() {
        if (pageNumber > 1) {
            enableALL(clientID);
            pageNumber = pageNumber - 1;
            getMediaGallery(pageNumber, clientID);
        }
        if (pageNumber == 1) {
            var lnkFirst = $(clientID + "lnkFirst");
            EnabledDisableMediaLink(false, this);
            EnabledDisableMediaLink(false, lnkFirst);
        }
        setPageCount(clientID);
        return false;
    });

    $(clientID + "lnkLast").click(function() {
        enableALL(clientID);
        var lastPageIndex = $(clientID + 'lblLastPageindex').text();
        var nextLink = $(clientID + "lnkNext");
        if (pageNumber != lastPageIndex) {
            pageNumber = lastPageIndex;
            EnabledDisableMediaLink(false, this);
            EnabledDisableMediaLink(false, nextLink);
            getMediaGallery(pageNumber, clientID);
            setPageCount(clientID);
        }
        else {
            EnabledDisableMediaLink(false, this);
            EnabledDisableMediaLink(false, nextLink);
        }
        return false;
    });

    $(clientID + "lnkFirst").click(function() {
        enableALL(clientID);
        var prevtLink = $(clientID + "lnkPrevious");
        if (pageNumber != 1) {
            pageNumber = 1;
            EnabledDisableMediaLink(false, this);
            EnabledDisableMediaLink(false, prevtLink);
            getMediaGallery(pageNumber, clientID);
            setPageCount(clientID);
        }
        else {
            EnabledDisableMediaLink(false, this);
            EnabledDisableMediaLink(false, prevtLink);
        }
        return false;
    });
}


$(document).ready(function() {
    InitializeMediaGallery();
    return DeleteMediaGalleryPost();
});

// end of Venues.MediaGallery.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 
}
