/*Library\mootools.v1.11.js*/
var MooTools={
version:'1.11'
};
function $defined(obj){
return(obj!=undefined);
};
function $type(obj){
if(!$defined(obj))return false;
if(obj.htmlElement)return'element';
var type=typeof obj;
if(type=='object'&&obj.nodeName){
switch(obj.nodeType){
case 1:return'element';
case 3:return(/\S/).test(obj.nodeValue)?'textnode':'whitespace';
}
}
if(type=='object'||type=='function'){
switch(obj.constructor){
case Array:return'array';
case RegExp:return'regexp';
case Class:return'class';
}
if(typeof obj.length=='number'){
if(obj.item)return'collection';
if(obj.callee)return'arguments';
}
}
return type;
};
function $merge(){
var mix={};
for(var i=0;i<arguments.length;i++){
for(var property in arguments[i]){
var ap=arguments[i][property];
var mp=mix[property];
if(mp&&$type(ap)=='object'&&$type(mp)=='object')mix[property]=$merge(mp,ap);
else mix[property]=ap;
}
}
return mix;
};
var $extend=function(){
var args=arguments;
if(!args[1])args=[this,args[0]];
for(var property in args[1])args[0][property]=args[1][property];
return args[0];
};
var $native=function(){
for(var i=0,l=arguments.length;i<l;i++){
arguments[i].extend=function(props){
for(var prop in props){
if(!this.prototype[prop])this.prototype[prop]=props[prop];
if(!this[prop])this[prop]=$native.generic(prop);
}
};
}
};
$native.generic=function(prop){
return function(bind){
return this.prototype[prop].apply(bind,Array.prototype.slice.call(arguments,1));
};
};
$native(Function,Array,String,Number);
function $chk(obj){
return!!(obj||obj===0);
};
function $pick(obj,picked){
return $defined(obj)?obj:picked;
};
function $random(min,max){
return Math.floor(Math.random()*(max-min+1)+min);
};
function $time(){
return new Date().getTime();
};
function $clear(timer){
clearTimeout(timer);
clearInterval(timer);
return null;
};
var Abstract=function(obj){
obj=obj||{};
obj.extend=$extend;
return obj;
};
var Window=new Abstract(window);
var Document=new Abstract(document);
document.head=document.getElementsByTagName('head')[0];
window.xpath=!!(document.evaluate);
if(window.ActiveXObject)window.ie=window[window.XMLHttpRequest?'ie7':'ie6']=true;
else if(document.childNodes&&!document.all&&!navigator.taintEnabled)window.webkit=window[window.xpath?'webkit420':'webkit419']=true;
else if(document.getBoxObjectFor!=null)window.gecko=true;
window.khtml=window.webkit;
Object.extend=$extend;
if(typeof HTMLElement=='undefined'){
var HTMLElement=function(){};
if(window.webkit)document.createElement("iframe");
HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{};
}
HTMLElement.prototype.htmlElement=function(){};
if(window.ie6)try{document.execCommand("BackgroundImageCache",false,true);}catch(e){};
var Class=function(properties){
var klass=function(){
return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=='function')?this.initialize.apply(this,arguments):this;
};
$extend(klass,this);
klass.prototype=properties;
klass.constructor=Class;
return klass;
};
Class.empty=function(){};
Class.prototype={
extend:function(properties){
var proto=new this(null);
for(var property in properties){
var pp=proto[property];
proto[property]=Class.Merge(pp,properties[property]);
}
return new Class(proto);
},
implement:function(){
for(var i=0,l=arguments.length;i<l;i++)$extend(this.prototype,arguments[i]);
}
};
Class.Merge=function(previous,current){
if(previous&&previous!=current){
var type=$type(current);
if(type!=$type(previous))return current;
switch(type){
case'function':
var merged=function(){
this.parent=arguments.callee.parent;
return current.apply(this,arguments);
};
merged.parent=previous;
return merged;
case'object':return $merge(previous,current);
}
}
return current;
};
var Chain=new Class({
chain:function(fn){
this.chains=this.chains||[];
this.chains.push(fn);
return this;
},
callChain:function(){
if(this.chains&&this.chains.length)this.chains.shift().delay(10,this);
},
clearChain:function(){
this.chains=[];
}
});
var Events=new Class({
addEvent:function(type,fn){
if(fn!=Class.empty){
this.$events=this.$events||{};
this.$events[type]=this.$events[type]||[];
this.$events[type].include(fn);
}
return this;
},
fireEvent:function(type,args,delay){
if(this.$events&&this.$events[type]){
this.$events[type].each(function(fn){
try{
fn.create({'bind':this,'delay':delay,'arguments':args})();
}catch(e){}
},this);
}
return this;
},
removeEvent:function(type,fn){
if(this.$events&&this.$events[type])this.$events[type].remove(fn);
return this;
}
});
var Options=new Class({
setOptions:function(){
this.options=$merge.apply(null,[this.options].extend(arguments));
if(this.addEvent){
for(var option in this.options){
if($type(this.options[option]=='function')&&(/^on[A-Z]/).test(option))this.addEvent(option,this.options[option]);
}
}
return this;
}
});
Array.extend({
forEach:function(fn,bind){
for(var i=0,j=this.length;i<j;i++)fn.call(bind,this[i],i,this);
},
filter:function(fn,bind){
var results=[];
for(var i=0,j=this.length;i<j;i++){
if(fn.call(bind,this[i],i,this))results.push(this[i]);
}
return results;
},
map:function(fn,bind){
var results=[];
for(var i=0,j=this.length;i<j;i++)results[i]=fn.call(bind,this[i],i,this);
return results;
},
every:function(fn,bind){
for(var i=0,j=this.length;i<j;i++){
if(!fn.call(bind,this[i],i,this))return false;
}
return true;
},
some:function(fn,bind){
for(var i=0,j=this.length;i<j;i++){
if(fn.call(bind,this[i],i,this))return true;
}
return false;
},
indexOf:function(item,from){
var len=this.length;
for(var i=(from<0)?Math.max(0,len+from):from||0;i<len;i++){
if(this[i]===item)return i;
}
return-1;
},
copy:function(start,length){
start=start||0;
if(start<0)start=this.length+start;
length=length||(this.length-start);
var newArray=[];
for(var i=0;i<length;i++)newArray[i]=this[start++];
return newArray;
},
remove:function(item){
var i=0;
var len=this.length;
while(i<len){
if(this[i]===item){
this.splice(i,1);
len--;
}else{
i++;
}
}
return this;
},
contains:function(item,from){
return this.indexOf(item,from)!=-1;
},
associate:function(keys){
var obj={},length=Math.min(this.length,keys.length);
for(var i=0;i<length;i++)obj[keys[i]]=this[i];
return obj;
},
extend:function(array){
for(var i=0,j=array.length;i<j;i++)this.push(array[i]);
return this;
},
merge:function(array){
for(var i=0,l=array.length;i<l;i++)this.include(array[i]);
return this;
},
include:function(item){
if(!this.contains(item))this.push(item);
return this;
},
getRandom:function(){
return this[$random(0,this.length-1)]||null;
},
getLast:function(){
return this[this.length-1]||null;
}
});
Array.prototype.each=Array.prototype.forEach;
Array.each=Array.forEach;
function $A(array){
return Array.copy(array);
};
function $each(iterable,fn,bind){
if(iterable&&typeof iterable.length=='number'&&$type(iterable)!='object'){
Array.forEach(iterable,fn,bind);
}else{
for(var name in iterable)fn.call(bind||iterable,iterable[name],name);
}
};
Array.prototype.test=Array.prototype.contains;
String.extend({
test:function(regex,params){
return(($type(regex)=='string')?new RegExp(regex,params):regex).test(this);
},
toInt:function(){
return parseInt(this,10);
},
toFloat:function(){
return parseFloat(this);
},
camelCase:function(){
return this.replace(/-\D/g,function(match){
return match.charAt(1).toUpperCase();
});
},
hyphenate:function(){
return this.replace(/\w[A-Z]/g,function(match){
return(match.charAt(0)+'-'+match.charAt(1).toLowerCase());
});
},
capitalize:function(){
return this.replace(/\b[a-z]/g,function(match){
return match.toUpperCase();
});
},
trim:function(){
return this.replace(/^\s+|\s+$/g,'');
},
clean:function(){
return this.replace(/\s{2,}/g,' ').trim();
},
rgbToHex:function(array){
var rgb=this.match(/\d{1,3}/g);
return(rgb)?rgb.rgbToHex(array):false;
},
hexToRgb:function(array){
var hex=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
return(hex)?hex.slice(1).hexToRgb(array):false;
},
contains:function(string,s){
return(s)?(s+this+s).indexOf(s+string+s)>-1:this.indexOf(string)>-1;
},
escapeRegExp:function(){
return this.replace(/([.*+?^${}()|[\]\/\\])/g,'\\$1');
}
});
Array.extend({
rgbToHex:function(array){
if(this.length<3)return false;
if(this.length==4&&this[3]==0&&!array)return'transparent';
var hex=[];
for(var i=0;i<3;i++){
var bit=(this[i]-0).toString(16);
hex.push((bit.length==1)?'0'+bit:bit);
}
return array?hex:'#'+hex.join('');
},
hexToRgb:function(array){
if(this.length!=3)return false;
var rgb=[];
for(var i=0;i<3;i++){
rgb.push(parseInt((this[i].length==1)?this[i]+this[i]:this[i],16));
}
return array?rgb:'rgb('+rgb.join(',')+')';
}
});
Function.extend({
create:function(options){
var fn=this;
options=$merge({
'bind':fn,
'event':false,
'arguments':null,
'delay':false,
'periodical':false,
'attempt':false
},options);
if($chk(options.arguments)&&$type(options.arguments)!='array')options.arguments=[options.arguments];
return function(event){
var args;
if(options.event){
event=event||window.event;
args=[(options.event===true)?event:new options.event(event)];
if(options.arguments)args.extend(options.arguments);
}
else args=options.arguments||arguments;
var returns=function(){
return fn.apply($pick(options.bind,fn),args);
};
if(options.delay)return setTimeout(returns,options.delay);
if(options.periodical)return setInterval(returns,options.periodical);
if(options.attempt)try{return returns();}catch(err){return false;};
return returns();
};
},
pass:function(args,bind){
return this.create({'arguments':args,'bind':bind});
},
attempt:function(args,bind){
return this.create({'arguments':args,'bind':bind,'attempt':true})();
},
bind:function(bind,args){
return this.create({'bind':bind,'arguments':args});
},
bindAsEventListener:function(bind,args){
return this.create({'bind':bind,'event':true,'arguments':args});
},
delay:function(delay,bind,args){
return this.create({'delay':delay,'bind':bind,'arguments':args})();
},
periodical:function(interval,bind,args){
return this.create({'periodical':interval,'bind':bind,'arguments':args})();
}
});
Number.extend({
toInt:function(){
return parseInt(this);
},
toFloat:function(){
return parseFloat(this);
},
limit:function(min,max){
return Math.min(max,Math.max(min,this));
},
round:function(precision){
precision=Math.pow(10,precision||0);
return Math.round(this*precision)/precision;
},
times:function(fn){
for(var i=0;i<this;i++)fn(i);
}
});
var Element=new Class({
initialize:function(el,props){
if($type(el)=='string'){
if(window.ie&&props&&(props.name||props.type)){
var name=(props.name)?' name="'+props.name+'"':'';
var type=(props.type)?' type="'+props.type+'"':'';
delete props.name;
delete props.type;
el='<'+el+name+type+'>';
}
el=document.createElement(el);
}
el=$(el);
return(!props||!el)?el:el.set(props);
}
});
var Elements=new Class({
initialize:function(elements){
return(elements)?$extend(elements,this):this;
}
});
Elements.extend=function(props){
for(var prop in props){
this.prototype[prop]=props[prop];
this[prop]=$native.generic(prop);
}
};
function $(el){
if(!el)return null;
if(el.htmlElement)return Garbage.collect(el);
if([window,document].contains(el))return el;
var type=$type(el);
if(type=='string'){
el=document.getElementById(el);
type=(el)?'element':false;
}
if(type!='element')return null;
if(el.htmlElement)return Garbage.collect(el);
if(['object','embed'].contains(el.tagName.toLowerCase()))return el;
$extend(el,Element.prototype);
el.htmlElement=function(){};
return Garbage.collect(el);
};
document.getElementsBySelector=document.getElementsByTagName;
function $$(){
var elements=[];
for(var i=0,j=arguments.length;i<j;i++){
var selector=arguments[i];
switch($type(selector)){
case'element':elements.push(selector);
case'boolean':break;
case false:break;
case'string':selector=document.getElementsBySelector(selector,true);
default:elements.extend(selector);
}
}
return $$.unique(elements);
};
$$.unique=function(array){
var elements=[];
for(var i=0,l=array.length;i<l;i++){
if(array[i].$included)continue;
var element=$(array[i]);
if(element&&!element.$included){
element.$included=true;
elements.push(element);
}
}
for(var n=0,d=elements.length;n<d;n++)elements[n].$included=null;
return new Elements(elements);
};
Elements.Multi=function(property){
return function(){
var args=arguments;
var items=[];
var elements=true;
for(var i=0,j=this.length,returns;i<j;i++){
returns=this[i][property].apply(this[i],args);
if($type(returns)!='element')elements=false;
items.push(returns);
};
return(elements)?$$.unique(items):items;
};
};
Element.extend=function(properties){
for(var property in properties){
HTMLElement.prototype[property]=properties[property];
Element.prototype[property]=properties[property];
Element[property]=$native.generic(property);
var elementsProperty=(Array.prototype[property])?property+'Elements':property;
Elements.prototype[elementsProperty]=Elements.Multi(property);
}
};
Element.extend({
set:function(props){
for(var prop in props){
var val=props[prop];
switch(prop){
case'styles':this.setStyles(val);break;
case'events':if(this.addEvents)this.addEvents(val);break;
case'properties':this.setProperties(val);break;
default:this.setProperty(prop,val);
}
}
return this;
},
inject:function(el,where){
el=$(el);
switch(where){
case'before':el.parentNode.insertBefore(this,el);break;
case'after':
var next=el.getNext();
if(!next)el.parentNode.appendChild(this);
else el.parentNode.insertBefore(this,next);
break;
case'top':
var first=el.firstChild;
if(first){
el.insertBefore(this,first);
break;
}
default:el.appendChild(this);
}
return this;
},
injectBefore:function(el){
return this.inject(el,'before');
},
injectAfter:function(el){
return this.inject(el,'after');
},
injectInside:function(el){
return this.inject(el,'bottom');
},
injectTop:function(el){
return this.inject(el,'top');
},
adopt:function(){
var elements=[];
$each(arguments,function(argument){
elements=elements.concat(argument);
});
$$(elements).inject(this);
return this;
},
remove:function(){
return this.parentNode.removeChild(this);
},
clone:function(contents){
var el=$(this.cloneNode(contents!==false));
if(!el.$events)return el;
el.$events={};
for(var type in this.$events)el.$events[type]={
'keys':$A(this.$events[type].keys),
'values':$A(this.$events[type].values)
};
return el.removeEvents();
},
replaceWith:function(el){
el=$(el);
this.parentNode.replaceChild(el,this);
return el;
},
appendText:function(text){
this.appendChild(document.createTextNode(text));
return this;
},
hasClass:function(className){
return this.className.contains(className,' ');
},
addClass:function(className){
if(!this.hasClass(className))this.className=(this.className+' '+className).clean();
return this;
},
removeClass:function(className){
this.className=this.className.replace(new RegExp('(^|\\s)'+className+'(?:\\s|$)'),'$1').clean();
return this;
},
toggleClass:function(className){
return this.hasClass(className)?this.removeClass(className):this.addClass(className);
},
setStyle:function(property,value){
switch(property){
case'opacity':return this.setOpacity(parseFloat(value));
case'float':property=(window.ie)?'styleFloat':'cssFloat';
}
property=property.camelCase();
switch($type(value)){
case'number':if(!['zIndex','zoom'].contains(property))value+='px';break;
case'array':value='rgb('+value.join(',')+')';
}
this.style[property]=value;
return this;
},
setStyles:function(source){
switch($type(source)){
case'object':Element.setMany(this,'setStyle',source);break;
case'string':this.style.cssText=source;
}
return this;
},
setOpacity:function(opacity){
if(opacity==0){
if(this.style.visibility!="hidden")this.style.visibility="hidden";
}else{
if(this.style.visibility!="visible")this.style.visibility="visible";
}
if(!this.currentStyle||!this.currentStyle.hasLayout)this.style.zoom=1;
if(window.ie)this.style.filter=(opacity==1)?'':"alpha(opacity="+opacity*100+")";
this.style.opacity=this.$tmp.opacity=opacity;
return this;
},
getStyle:function(property){
property=property.camelCase();
var result=this.style[property];
if(!$chk(result)){
if(property=='opacity')return this.$tmp.opacity;
result=[];
for(var style in Element.Styles){
if(property==style){
Element.Styles[style].each(function(s){
var style=this.getStyle(s);
result.push(parseInt(style)?style:'0px');
},this);
if(property=='border'){
var every=result.every(function(bit){
return(bit==result[0]);
});
return(every)?result[0]:false;
}
return result.join(' ');
}
}
if(property.contains('border')){
if(Element.Styles.border.contains(property)){
return['Width','Style','Color'].map(function(p){
return this.getStyle(property+p);
},this).join(' ');
}else if(Element.borderShort.contains(property)){
return['Top','Right','Bottom','Left'].map(function(p){
return this.getStyle('border'+p+property.replace('border',''));
},this).join(' ');
}
}
if(document.defaultView)result=document.defaultView.getComputedStyle(this,null).getPropertyValue(property.hyphenate());
else if(this.currentStyle)result=this.currentStyle[property];
}
if(window.ie)result=Element.fixStyle(property,result,this);
if(result&&property.test(/color/i)&&result.contains('rgb')){
return result.split('rgb').splice(1,4).map(function(color){
return color.rgbToHex();
}).join(' ');
}
return result;
},
getStyles:function(){
return Element.getMany(this,'getStyle',arguments);
},
walk:function(brother,start){
brother+='Sibling';
var el=(start)?this[start]:this[brother];
while(el&&$type(el)!='element')el=el[brother];
return $(el);
},
getPrevious:function(){
return this.walk('previous');
},
getNext:function(){
return this.walk('next');
},
getFirst:function(){
return this.walk('next','firstChild');
},
getLast:function(){
return this.walk('previous','lastChild');
},
getParent:function(){
return $(this.parentNode);
},
getChildren:function(){
return $$(this.childNodes);
},
hasChild:function(el){
return!!$A(this.getElementsByTagName('*')).contains(el);
},
getProperty:function(property){
var index=Element.Properties[property];
if(index)return this[index];
var flag=Element.PropertiesIFlag[property]||0;
if(!window.ie||flag)return this.getAttribute(property,flag);
var node=this.attributes[property];
return(node)?node.nodeValue:null;
},
removeProperty:function(property){
var index=Element.Properties[property];
if(index)this[index]='';
else this.removeAttribute(property);
return this;
},
getProperties:function(){
return Element.getMany(this,'getProperty',arguments);
},
setProperty:function(property,value){
var index=Element.Properties[property];
if(index)this[index]=value;
else this.setAttribute(property,value);
return this;
},
setProperties:function(source){
return Element.setMany(this,'setProperty',source);
},
setHTML:function(){
this.innerHTML=$A(arguments).join('');
return this;
},
setText:function(text){
var tag=this.getTag();
if(['style','script'].contains(tag)){
if(window.ie){
if(tag=='style')this.styleSheet.cssText=text;
else if(tag=='script')this.setProperty('text',text);
return this;
}else{
this.removeChild(this.firstChild);
return this.appendText(text);
}
}
this[$defined(this.innerText)?'innerText':'textContent']=text;
return this;
},
getText:function(){
var tag=this.getTag();
if(['style','script'].contains(tag)){
if(window.ie){
if(tag=='style')return this.styleSheet.cssText;
else if(tag=='script')return this.getProperty('text');
}else{
return this.innerHTML;
}
}
return($pick(this.innerText,this.textContent));
},
getTag:function(){
return this.tagName.toLowerCase();
},
empty:function(){
Garbage.trash(this.getElementsByTagName('*'));
return this.setHTML('');
}
});
Element.fixStyle=function(property,result,element){
if($chk(parseInt(result)))return result;
if(['height','width'].contains(property)){
var values=(property=='width')?['left','right']:['top','bottom'];
var size=0;
values.each(function(value){
size+=element.getStyle('border-'+value+'-width').toInt()+element.getStyle('padding-'+value).toInt();
});
return element['offset'+property.capitalize()]-size+'px';
}else if(property.test(/border(.+)Width|margin|padding/)){
return'0px';
}
return result;
};
Element.Styles={'border':[],'padding':[],'margin':[]};
['Top','Right','Bottom','Left'].each(function(direction){
for(var style in Element.Styles)Element.Styles[style].push(style+direction);
});
Element.borderShort=['borderWidth','borderStyle','borderColor'];
Element.getMany=function(el,method,keys){
var result={};
$each(keys,function(key){
result[key]=el[method](key);
});
return result;
};
Element.setMany=function(el,method,pairs){
for(var key in pairs)el[method](key,pairs[key]);
return el;
};
Element.Properties=new Abstract({
'class':'className','for':'htmlFor','colspan':'colSpan','rowspan':'rowSpan',
'accesskey':'accessKey','tabindex':'tabIndex','maxlength':'maxLength',
'readonly':'readOnly','frameborder':'frameBorder','value':'value',
'disabled':'disabled','checked':'checked','multiple':'multiple','selected':'selected'
});
Element.PropertiesIFlag={
'href':2,'src':2
};
Element.Methods={
Listeners:{
addListener:function(type,fn){
if(this.addEventListener)this.addEventListener(type,fn,false);
else this.attachEvent('on'+type,fn);
return this;
},
removeListener:function(type,fn){
if(this.removeEventListener)this.removeEventListener(type,fn,false);
else this.detachEvent('on'+type,fn);
return this;
}
}
};
window.extend(Element.Methods.Listeners);
document.extend(Element.Methods.Listeners);
Element.extend(Element.Methods.Listeners);
var Garbage={
elements:[],
collect:function(el){
if(!el.$tmp){
el.$tmp={'opacity':1};
}
return el;
},
trash:function(elements){
return;
for(var i=0,j=elements.length,el;i<j;i++){
if(!(el=elements[i])||!el.$tmp)continue;
if(el.$events)el.fireEvent('trash').removeEvents();
for(var p in el.$tmp)el.$tmp[p]=null;
for(var d in Element.prototype)el[d]=null;
Garbage.elements[Garbage.elements.indexOf(el)]=null;
el.htmlElement=el.$tmp=el=null;
}
Garbage.elements.remove(null);
},
empty:function(){
return;
Garbage.collect(window);
Garbage.collect(document);
Garbage.trash(Garbage.elements);
}
};
window.addListener('beforeunload',function(){
window.addListener('unload',Garbage.empty);
if(window.ie)window.addListener('unload',CollectGarbage);
});
var Event=new Class({
initialize:function(event){
if(event&&event.$extended)return event;
this.$extended=true;
event=event||window.event;
this.event=event;
this.type=event.type;
this.target=event.target||event.srcElement;
if(this.target.nodeType==3)this.target=this.target.parentNode;
this.shift=event.shiftKey;
this.control=event.ctrlKey;
this.alt=event.altKey;
this.meta=event.metaKey;
if(['DOMMouseScroll','mousewheel'].contains(this.type)){
this.wheel=(event.wheelDelta)?event.wheelDelta/120:-(event.detail||0)/3;
}else if(this.type.contains('key')){
this.code=event.which||event.keyCode;
for(var name in Event.keys){
if(Event.keys[name]==this.code){
this.key=name;
break;
}
}
if(this.type=='keydown'){
var fKey=this.code-111;
if(fKey>0&&fKey<13)this.key='f'+fKey;
}
this.key=this.key||String.fromCharCode(this.code).toLowerCase();
}else if(this.type.test(/(click|mouse|menu)/)){
this.page={
'x':event.pageX||event.clientX+document.documentElement.scrollLeft,
'y':event.pageY||event.clientY+document.documentElement.scrollTop
};
this.client={
'x':event.pageX?event.pageX-window.pageXOffset:event.clientX,
'y':event.pageY?event.pageY-window.pageYOffset:event.clientY
};
this.rightClick=(event.which==3)||(event.button==2);
switch(this.type){
case'mouseover':this.relatedTarget=event.relatedTarget||event.fromElement;break;
case'mouseout':this.relatedTarget=event.relatedTarget||event.toElement;
}
this.fixRelatedTarget();
}
return this;
},
stop:function(){
return this.stopPropagation().preventDefault();
},
stopPropagation:function(){
if(this.event.stopPropagation)this.event.stopPropagation();
else this.event.cancelBubble=true;
return this;
},
preventDefault:function(){
if(this.event.preventDefault)this.event.preventDefault();
else this.event.returnValue=false;
return this;
}
});
Event.fix={
relatedTarget:function(){
if(this.relatedTarget&&this.relatedTarget.nodeType==3)this.relatedTarget=this.relatedTarget.parentNode;
},
relatedTargetGecko:function(){
try{Event.fix.relatedTarget.call(this);}catch(e){this.relatedTarget=this.target;}
}
};
Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;
Event.keys=new Abstract({
'enter':13,
'up':38,
'down':40,
'left':37,
'right':39,
'esc':27,
'space':32,
'backspace':8,
'tab':9,
'delete':46
});
Element.Methods.Events={
addEvent:function(type,fn){
this.$events=this.$events||{};
this.$events[type]=this.$events[type]||{'keys':[],'values':[]};
if(this.$events[type].keys.contains(fn))return this;
this.$events[type].keys.push(fn);
var realType=type;
var custom=Element.Events[type];
if(custom){
if(custom.add)custom.add.call(this,fn);
if(custom.map)fn=custom.map;
if(custom.type)realType=custom.type;
}
this.$events[type].values.push(fn);
return(Element.NativeEvents.contains(realType))?this.addListener(realType,fn):this;
},
removeEvent:function(type,fn){
if(!this.$events||!this.$events[type])return this;
var pos=this.$events[type].keys.indexOf(fn);
if(pos==-1)return this;
var key=this.$events[type].keys.splice(pos,1)[0];
var value=this.$events[type].values.splice(pos,1)[0];
var custom=Element.Events[type];
if(custom){
if(custom.remove)custom.remove.call(this,fn);
if(custom.type)type=custom.type;
}
return(Element.NativeEvents.contains(type))?this.removeListener(type,value):this;
},
addEvents:function(source){
return Element.setMany(this,'addEvent',source);
},
removeEvents:function(type){
if(!this.$events)return this;
if(!type){
for(var evType in this.$events)this.removeEvents(evType);
this.$events=null;
}else if(this.$events[type]){
this.$events[type].keys.each(function(fn){
this.removeEvent(type,fn);
},this);
this.$events[type]=null;
}
return this;
},
fireEvent:function(type,args,delay){
if(this.$events&&this.$events[type]){
this.$events[type].keys.each(function(fn){
fn.create({'bind':this,'delay':delay,'arguments':args})();
},this);
}
return this;
},
cloneEvents:function(from,type){
if(!from.$events)return this;
if(!type){
for(var evType in from.$events)this.cloneEvents(from,evType);
}else if(from.$events[type]){
from.$events[type].keys.each(function(fn){
this.addEvent(type,fn);
},this);
}
return this;
}
};
window.extend(Element.Methods.Events);
document.extend(Element.Methods.Events);
Element.extend(Element.Methods.Events);
Element.Events=new Abstract({
'mouseenter':{
type:'mouseover',
map:function(event){
event=new Event(event);
if(event.relatedTarget!=this&&!this.hasChild(event.relatedTarget))this.fireEvent('mouseenter',event);
}
},
'mouseleave':{
type:'mouseout',
map:function(event){
event=new Event(event);
if(event.relatedTarget!=this&&!this.hasChild(event.relatedTarget))this.fireEvent('mouseleave',event);
}
},
'mousewheel':{
type:(window.gecko)?'DOMMouseScroll':'mousewheel'
}
});
Element.NativeEvents=[
'click','dblclick','mouseup','mousedown',
'mousewheel','DOMMouseScroll',
'mouseover','mouseout','mousemove',
'keydown','keypress','keyup',
'load','unload','beforeunload','resize','move',
'focus','blur','change','submit','reset','select',
'error','abort','contextmenu','scroll'
];
Function.extend({
bindWithEvent:function(bind,args){
return this.create({'bind':bind,'arguments':args,'event':Event});
}
});
Elements.extend({
filterByTag:function(tag){
return new Elements(this.filter(function(el){
return(Element.getTag(el)==tag);
}));
},
filterByClass:function(className,nocash){
var elements=this.filter(function(el){
return(el.className&&el.className.contains(className,' '));
});
return(nocash)?elements:new Elements(elements);
},
filterById:function(id,nocash){
var elements=this.filter(function(el){
return(el.id==id);
});
return(nocash)?elements:new Elements(elements);
},
filterByAttribute:function(name,operator,value,nocash){
var elements=this.filter(function(el){
var current=Element.getProperty(el,name);
if(!current)return false;
if(!operator)return true;
switch(operator){
case'=':return(current==value);
case'*=':return(current.contains(value));
case'^=':return(current.substr(0,value.length)==value);
case'$=':return(current.substr(current.length-value.length)==value);
case'!=':return(current!=value);
case'~=':return current.contains(value,' ');
}
return false;
});
return(nocash)?elements:new Elements(elements);
}
});
function $E(selector,filter){
return($(filter)||document).getElement(selector);
};
function $ES(selector,filter){
return($(filter)||document).getElementsBySelector(selector);
};
$$.shared={
'regexp':/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,
'xpath':{
getParam:function(items,context,param,i){
var temp=[context.namespaceURI?'xhtml:':'',param[1]];
if(param[2])temp.push('[@id="',param[2],'"]');
if(param[3])temp.push('[contains(concat(" ", @class, " "), " ',param[3],' ")]');
if(param[4]){
if(param[5]&&param[6]){
switch(param[5]){
case'*=':temp.push('[contains(@',param[4],', "',param[6],'")]');break;
case'^=':temp.push('[starts-with(@',param[4],', "',param[6],'")]');break;
case'$=':temp.push('[substring(@',param[4],', string-length(@',param[4],') - ',param[6].length,' + 1) = "',param[6],'"]');break;
case'=':temp.push('[@',param[4],'="',param[6],'"]');break;
case'!=':temp.push('[@',param[4],'!="',param[6],'"]');
}
}else{
temp.push('[@',param[4],']');
}
}
items.push(temp.join(''));
return items;
},
getItems:function(items,context,nocash){
var elements=[];
var xpath=document.evaluate('.//'+items.join('//'),context,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for(var i=0,j=xpath.snapshotLength;i<j;i++)elements.push(xpath.snapshotItem(i));
return(nocash)?elements:new Elements(elements.map($));
}
},
'normal':{
getParam:function(items,context,param,i){
if(i==0){
if(param[2]){
var el=context.getElementById(param[2]);
if(!el||((param[1]!='*')&&(Element.getTag(el)!=param[1])))return false;
items=[el];
}else{
items=$A(context.getElementsByTagName(param[1]));
}
}else{
items=$$.shared.getElementsByTagName(items,param[1]);
if(param[2])items=Elements.filterById(items,param[2],true);
}
if(param[3])items=Elements.filterByClass(items,param[3],true);
if(param[4])items=Elements.filterByAttribute(items,param[4],param[5],param[6],true);
return items;
},
getItems:function(items,context,nocash){
return(nocash)?items:$$.unique(items);
}
},
resolver:function(prefix){
return(prefix=='xhtml')?'http://www.w3.org/1999/xhtml':false;
},
getElementsByTagName:function(context,tagName){
var found=[];
for(var i=0,j=context.length;i<j;i++)found.extend(context[i].getElementsByTagName(tagName));
return found;
}
};
$$.shared.method=(window.xpath)?'xpath':'normal';
Element.Methods.Dom={
getElements:function(selector,nocash){
var items=[];
selector=selector.trim().split(' ');
for(var i=0,j=selector.length;i<j;i++){
var sel=selector[i];
var param=sel.match($$.shared.regexp);
if(!param)break;
param[1]=param[1]||'*';
var temp=$$.shared[$$.shared.method].getParam(items,this,param,i);
if(!temp)break;
items=temp;
}
return $$.shared[$$.shared.method].getItems(items,this,nocash);
},
getElement:function(selector){
return $(this.getElements(selector,true)[0]||false);
},
getElementsBySelector:function(selector,nocash){
var elements=[];
selector=selector.split(',');
for(var i=0,j=selector.length;i<j;i++)elements=elements.concat(this.getElements(selector[i],true));
return(nocash)?elements:$$.unique(elements);
}
};
Element.extend({
getElementById:function(id){
var el=document.getElementById(id);
if(!el)return false;
for(var parent=el.parentNode;parent!=this;parent=parent.parentNode){
if(!parent)return false;
}
return el;
},
getElementsByClassName:function(className){
return this.getElements('.'+className);
}
});
document.extend(Element.Methods.Dom);
Element.extend(Element.Methods.Dom);
Element.extend({
getValue:function(){
switch(this.getTag()){
case'select':
var values=[];
$each(this.options,function(option){
if(option.selected)values.push($pick(option.value,option.text));
});
return(this.multiple)?values:values[0];
case'input':if(!(this.checked&&['checkbox','radio'].contains(this.type))&&!['hidden','text','password'].contains(this.type))break;
case'textarea':return this.value;
}
return false;
},
getFormElements:function(){
return $$(this.getElementsByTagName('input'),this.getElementsByTagName('select'),this.getElementsByTagName('textarea'));
},
toQueryString:function(){
var queryString=[];
this.getFormElements().each(function(el){
var name=el.name;
var value=el.getValue();
if(value===false||!name||el.disabled)return;
var qs=function(val){
queryString.push(name+'='+encodeURIComponent(val));
};
if($type(value)=='array')value.each(qs);
else qs(value);
});
return queryString.join('&');
}
});
Element.extend({
scrollTo:function(x,y){
this.scrollLeft=x;
this.scrollTop=y;
},
getSize:function(){
return{
'scroll':{'x':this.scrollLeft,'y':this.scrollTop},
'size':{'x':this.offsetWidth,'y':this.offsetHeight},
'scrollSize':{'x':this.scrollWidth,'y':this.scrollHeight}
};
},
getPosition:function(overflown){
overflown=overflown||[];
var el=this,left=0,top=0;
do{
left+=el.offsetLeft||0;
top+=el.offsetTop||0;
el=el.offsetParent;
}while(el);
overflown.each(function(element){
left-=element.scrollLeft||0;
top-=element.scrollTop||0;
});
return{'x':left,'y':top};
},
getTop:function(overflown){
return this.getPosition(overflown).y;
},
getLeft:function(overflown){
return this.getPosition(overflown).x;
},
getCoordinates:function(overflown){
var position=this.getPosition(overflown);
var obj={
'width':this.offsetWidth,
'height':this.offsetHeight,
'left':position.x,
'top':position.y
};
obj.right=obj.left+obj.width;
obj.bottom=obj.top+obj.height;
return obj;
}
});
Element.Events.domready={
add:function(fn){
if(window.loaded){
fn.call(this);
return;
}
var domReady=function(){
if(window.loaded)return;
window.loaded=true;
window.timer=$clear(window.timer);
this.fireEvent('domready');
}.bind(this);
if(document.readyState&&window.webkit){
window.timer=function(){
if(['loaded','complete'].contains(document.readyState))domReady();
}.periodical(50);
}else if(document.readyState&&window.ie){
if(!$('ie_ready')){
var src=(window.location.protocol=='https:')?'://0':'javascript:void(0)';
document.write('<script id="ie_ready" defer src="'+src+'"><\/script>');
$('ie_ready').onreadystatechange=function(){
if(this.readyState=='complete')domReady();
};
}
}else{
window.addListener("load",domReady);
document.addListener("DOMContentLoaded",domReady);
}
}
};
window.onDomReady=function(fn){
return this.addEvent('domready',fn);
};
window.extend({
getWidth:function(){
if(this.webkit419)return this.innerWidth;
if(this.opera)return document.body.clientWidth;
return document.documentElement.clientWidth;
},
getHeight:function(){
if(this.webkit419)return this.innerHeight;
if(this.opera)return document.body.clientHeight;
return document.documentElement.clientHeight;
},
getScrollWidth:function(){
if(this.ie)return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth);
if(this.webkit)return document.body.scrollWidth;
return document.documentElement.scrollWidth;
},
getScrollHeight:function(){
if(this.ie)return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight);
if(this.webkit)return document.body.scrollHeight;
return document.documentElement.scrollHeight;
},
getScrollLeft:function(){
return this.pageXOffset||document.documentElement.scrollLeft;
},
getScrollTop:function(){
return this.pageYOffset||document.documentElement.scrollTop;
},
getSize:function(){
return{
'size':{'x':this.getWidth(),'y':this.getHeight()},
'scrollSize':{'x':this.getScrollWidth(),'y':this.getScrollHeight()},
'scroll':{'x':this.getScrollLeft(),'y':this.getScrollTop()}
};
},
getPosition:function(){return{'x':0,'y':0};}
});
var Fx={};
Fx.Base=new Class({
options:{
onStart:Class.empty,
onComplete:Class.empty,
onCancel:Class.empty,
transition:function(p){
return-(Math.cos(Math.PI*p)-1)/2;
},
duration:500,
unit:'px',
wait:true,
fps:50
},
initialize:function(options){
this.element=this.element||null;
this.setOptions(options);
if(this.options.initialize)this.options.initialize.call(this);
},
step:function(){
var time=$time();
if(time<this.time+this.options.duration){
this.delta=this.options.transition((time-this.time)/this.options.duration);
this.setNow();
this.increase();
}else{
this.stop(true);
this.set(this.to);
this.fireEvent('onComplete',this.element,10);
this.callChain();
}
},
set:function(to){
this.now=to;
this.increase();
return this;
},
setNow:function(){
this.now=this.compute(this.from,this.to);
},
compute:function(from,to){
return(to-from)*this.delta+from;
},
start:function(from,to){
if(!this.options.wait)this.stop();
else if(this.timer)return this;
this.from=from;
this.to=to;
this.change=this.to-this.from;
this.time=$time();
this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);
this.fireEvent('onStart',this.element);
return this;
},
stop:function(end){
if(!this.timer)return this;
this.timer=$clear(this.timer);
if(!end)this.fireEvent('onCancel',this.element);
return this;
},
custom:function(from,to){
return this.start(from,to);
},
clearTimer:function(end){
return this.stop(end);
}
});
Fx.Base.implement(new Chain,new Events,new Options);
Fx.CSS={
select:function(property,to){
if(property.test(/color/i))return this.Color;
var type=$type(to);
if((type=='array')||(type=='string'&&to.contains(' ')))return this.Multi;
return this.Single;
},
parse:function(el,property,fromTo){
if(!fromTo.push)fromTo=[fromTo];
var from=fromTo[0],to=fromTo[1];
if(!$chk(to)){
to=from;
from=el.getStyle(property);
}
var css=this.select(property,to);
return{'from':css.parse(from),'to':css.parse(to),'css':css};
}
};
Fx.CSS.Single={
parse:function(value){
return parseFloat(value);
},
getNow:function(from,to,fx){
return fx.compute(from,to);
},
getValue:function(value,unit,property){
if(unit=='px'&&property!='opacity')value=Math.round(value);
return value+unit;
}
};
Fx.CSS.Multi={
parse:function(value){
return value.push?value:value.split(' ').map(function(v){
return parseFloat(v);
});
},
getNow:function(from,to,fx){
var now=[];
for(var i=0;i<from.length;i++)now[i]=fx.compute(from[i],to[i]);
return now;
},
getValue:function(value,unit,property){
if(unit=='px'&&property!='opacity')value=value.map(Math.round);
return value.join(unit+' ')+unit;
}
};
Fx.CSS.Color={
parse:function(value){
return value.push?value:value.hexToRgb(true);
},
getNow:function(from,to,fx){
var now=[];
for(var i=0;i<from.length;i++)now[i]=Math.round(fx.compute(from[i],to[i]));
return now;
},
getValue:function(value){
return'rgb('+value.join(',')+')';
}
};
Fx.Style=Fx.Base.extend({
initialize:function(el,property,options){
this.element=$(el);
this.property=property;
this.parent(options);
},
hide:function(){
return this.set(0);
},
setNow:function(){
this.now=this.css.getNow(this.from,this.to,this);
},
set:function(to){
this.css=Fx.CSS.select(this.property,to);
return this.parent(this.css.parse(to));
},
start:function(from,to){
if(this.timer&&this.options.wait)return this;
var parsed=Fx.CSS.parse(this.element,this.property,[from,to]);
this.css=parsed.css;
return this.parent(parsed.from,parsed.to);
},
increase:function(){
this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property));
}
});
Element.extend({
effect:function(property,options){
return new Fx.Style(this,property,options);
}
});
Fx.Styles=Fx.Base.extend({
initialize:function(el,options){
this.element=$(el);
this.parent(options);
},
setNow:function(){
for(var p in this.from)this.now[p]=this.css[p].getNow(this.from[p],this.to[p],this);
},
set:function(to){
var parsed={};
this.css={};
for(var p in to){
this.css[p]=Fx.CSS.select(p,to[p]);
parsed[p]=this.css[p].parse(to[p]);
}
return this.parent(parsed);
},
start:function(obj){
if(this.timer&&this.options.wait)return this;
this.now={};
this.css={};
var from={},to={};
for(var p in obj){
var parsed=Fx.CSS.parse(this.element,p,obj[p]);
from[p]=parsed.from;
to[p]=parsed.to;
this.css[p]=parsed.css;
}
return this.parent(from,to);
},
increase:function(){
for(var p in this.now)this.element.setStyle(p,this.css[p].getValue(this.now[p],this.options.unit,p));
}
});
Element.extend({
effects:function(options){
return new Fx.Styles(this,options);
}
});
var XHR=new Class({
options:{
method:'post',
async:true,
onRequest:Class.empty,
onSuccess:Class.empty,
onFailure:Class.empty,
urlEncoded:true,
encoding:'utf-8',
autoCancel:false,
headers:{}
},
setTransport:function(){
this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject('Microsoft.XMLHTTP'):false);
return this;
},
initialize:function(options){
this.setTransport().setOptions(options);
this.options.isSuccess=this.options.isSuccess||this.isSuccess;
this.headers={};
if(this.options.urlEncoded&&this.options.method=='post'){
var encoding=(this.options.encoding)?'; charset='+this.options.encoding:'';
this.setHeader('Content-type','application/x-www-form-urlencoded'+encoding);
}
if(this.options.initialize)this.options.initialize.call(this);
},
onStateChange:function(){
if(this.transport.readyState!=4||!this.running)return;
this.running=false;
var status=0;
try{status=this.transport.status;}catch(e){};
if(this.options.isSuccess.call(this,status))this.onSuccess();
else this.onFailure();
this.transport.onreadystatechange=Class.empty;
},
isSuccess:function(status){
return((status>=200)&&(status<300));
},
onSuccess:function(){
this.response={
'text':this.transport.responseText,
'xml':this.transport.responseXML
};
this.fireEvent('onSuccess',[this.response.text,this.response.xml]);
this.callChain();
},
onFailure:function(){
this.fireEvent('onFailure',this.transport);
},
setHeader:function(name,value){
this.headers[name]=value;
return this;
},
send:function(url,data){
if(this.options.autoCancel)this.cancel();
else if(this.running)return this;
this.running=true;
if(data&&this.options.method=='get'){
url=url+(url.contains('?')?'&':'?')+data;
data=null;
}
this.transport.open(this.options.method.toUpperCase(),url,this.options.async);
this.transport.onreadystatechange=this.onStateChange.bind(this);
if((this.options.method=='post')&&this.transport.overrideMimeType)this.setHeader('Connection','close');
$extend(this.headers,this.options.headers);
for(var type in this.headers)try{this.transport.setRequestHeader(type,this.headers[type]);}catch(e){};
this.fireEvent('onRequest');
this.transport.send($pick(data,null));
return this;
},
cancel:function(){
if(!this.running)return this;
this.running=false;
this.transport.abort();
this.transport.onreadystatechange=Class.empty;
this.setTransport();
this.fireEvent('onCancel');
return this;
}
});
XHR.implement(new Chain,new Events,new Options);
var Ajax=XHR.extend({
options:{
data:null,
update:null,
onComplete:Class.empty,
evalScripts:false,
evalResponse:false
},
initialize:function(url,options){
this.addEvent('onSuccess',this.onComplete);
this.setOptions(options);
this.options.data=this.options.data||this.options.postBody;
if(!['post','get'].contains(this.options.method)){
this._method='_method='+this.options.method;
this.options.method='post';
}
this.parent();
this.setHeader('X-Requested-With','XMLHttpRequest');
this.setHeader('Accept','text/javascript, text/html, application/xml, text/xml, */*');
this.url=url;
},
onComplete:function(){
if(this.options.update)$(this.options.update).empty().setHTML(this.response.text);
if(this.options.evalScripts||this.options.evalResponse)this.evalScripts();
this.fireEvent('onComplete',[this.response.text,this.response.xml],20);
},
request:function(data){
data=data||this.options.data;
switch($type(data)){
case'element':data=$(data).toQueryString();break;
case'object':data=Object.toQueryString(data);
}
if(this._method)data=(data)?[this._method,data].join('&'):this._method;
return this.send(this.url,data);
},
evalScripts:function(){
var script,scripts;
if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader('Content-type')))scripts=this.response.text;
else{
scripts=[];
var regexp=/<script[^>]*>([\s\S]*?)<\/script>/gi;
while((script=regexp.exec(this.response.text)))scripts.push(script[1]);
scripts=scripts.join('\n');
}
if(scripts)(window.execScript)?window.execScript(scripts):window.setTimeout(scripts,0);
},
getHeader:function(name){
try{return this.transport.getResponseHeader(name);}catch(e){};
return null;
}
});
Object.toQueryString=function(source){
var queryString=[];
for(var property in source)queryString.push(encodeURIComponent(property)+'='+encodeURIComponent(source[property]));
return queryString.join('&');
};
Element.extend({
send:function(options){
return new Ajax(this.getProperty('action'),$merge({data:this.toQueryString()},options,{method:'post'})).request();
}
});
var Json={
toString:function(obj){
switch($type(obj)){
case'string':
return'"'+obj.replace(/(["\\])/g,'\\$1')+'"';
case'array':
return'['+obj.map(Json.toString).join(',')+']';
case'object':
var string=[];
for(var property in obj)string.push(Json.toString(property)+':'+Json.toString(obj[property]));
return'{'+string.join(',')+'}';
case'number':
if(isFinite(obj))break;
case false:
return'null';
}
return String(obj);
},
evaluate:function(str,secure){
return(($type(str)!='string')||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval('('+str+')');
}
};
/*Library\mootools.ext.js*/
Element.extend(
{
setClass:function(className)
{
this.className=className;
return this;
}
});
/*AjaxPro\Core.js*/
Function.prototype.getArguments=function(){
var args=[];
for(var i=0;i<this.arguments.length;i++){
args.push(this.arguments[i]);
}
return args;
};
Array.prototype.clear=function()
{
this.length=0;
return this;
};
var AjaxPro={};
var progids=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];
var progid=null;
if(typeof ActiveXObject!="undefined"){
var ie7xmlhttp=false;
if(typeof XMLHttpRequest=="object"){
try{var o=new XMLHttpRequest();ie7xmlhttp=true;}catch(e){}
}
if(typeof XMLHttpRequest=="undefined"||!ie7xmlhttp){
XMLHttpRequest=function(){
var xmlHttp=null;
if(!AjaxPro.noActiveX){
if(progid!=null){
return new ActiveXObject(progid);
}
for(var i=0;i<progids.length&&xmlHttp==null;i++){
try{
xmlHttp=new ActiveXObject(progids[i]);
progid=progids[i];
}catch(e){}
}
}
if(xmlHttp==null&&MS.Browser.isIE){
throw"not supported";
}
return xmlHttp;
};
}
}
$extend(AjaxPro,{
noOperation:function(){},
onLoading:function(){},
onError:function(){},
onTimeout:function(){},
onStateChanged:function(){},
cryptProvider:null,
queue:null,
token:"",
version:"6.9.29.2",
ID:"AjaxPro",
noActiveX:false,
timeoutPeriod:10*1000,
queue:null,
noUtcTime:false,
toJSON:function(o){
if(o==null){
return"null";
}
var v=[];
var i;
var c=o.constructor;
if(c==Number){
return isFinite(o)?o.toString():AjaxPro.toJSON(null);
}else if(c==Boolean){
return o.toString();
}else if(c==String){
for(i=0;i<o.length;i++){
var c=o.charAt(i);
if(c>=" "){
if(c=="\\"||c=='"'){
v.push("\\");
}
v.push(c);
}else{
switch(c){
case"\n":v.push("\\n");break;
case"\r":v.push("\\r");break;
case"\b":v.push("\\b");break;
case"\f":v.push("\\f");break;
case"\t":v.push("\\t");break;
default:
v.push("\\u00");
v.push(c.charCodeAt().toString(16));
}
}
}
return'"'+v.join('')+'"';
}else if(c==Array){
for(i=0;i<o.length;i++){
v.push(AjaxPro.toJSON(o[i]));
}
return"["+v.join(",")+"]";
}else if(c==Date){
var d={};
d.__type="System.DateTime";
if(AjaxPro.noUtcTime==true){
d.Year=o.getFullYear();
d.Month=o.getMonth()+1;
d.Day=o.getDate();
d.Hour=o.getHours();
d.Minute=o.getMinutes();
d.Second=o.getSeconds();
d.Millisecond=o.getMilliseconds();
}else{
d.Year=o.getUTCFullYear();
d.Month=o.getUTCMonth()+1;
d.Day=o.getUTCDate();
d.Hour=o.getUTCHours();
d.Minute=o.getUTCMinutes();
d.Second=o.getUTCSeconds();
d.Millisecond=o.getUTCMilliseconds();
}
return AjaxPro.toJSON(d);
}
if(typeof o.toJSON=="function"){
return o.toJSON();
}
if(typeof o=="object"){
for(var attr in o){
if(typeof o[attr]!="function"){
v.push('"'+attr+'":'+AjaxPro.toJSON(o[attr]));
}
}
if(v.length>0){
return"{"+v.join(",")+"}";
}
return"{}";
}
return o.toString();
},
dispose:function(){
if(AjaxPro.queue!=null){
AjaxPro.queue.dispose();
}
}
});
AjaxPro.Request=new Class(
{
initialize:function(url)
{
this.url=url;
this.xmlHttp=null;
},
url:null,
callback:null,
onLoading:AjaxPro.noOperation,
onError:AjaxPro.noOperation,
onTimeout:AjaxPro.noOperation,
onStateChanged:AjaxPro.noOperation,
args:null,
context:null,
isRunning:false,
abort:function(){
if(this.timeoutTimer!=null){
$clear(this.timeoutTimer);
}
if(this.xmlHttp){
this.xmlHttp.onreadystatechange=AjaxPro.noOperation;
this.xmlHttp.abort();
}
if(this.isRunning){
this.isRunning=false;
this.onLoading(false);
}
},
dispose:function(){
this.abort();
},
getEmptyRes:function(){
return{
error:null,
value:null,
request:{method:this.method,args:this.args},
context:this.context,
duration:this.duration
};
},
endRequest:function(res){
this.abort();
if(res.error!=null){
this.onError(res.error,this);
}
if(typeof this.callback=="function"){
this.callback(res,this);
}
},
mozerror:function(){
if(this.timeoutTimer!=null){
$clear(this.timeoutTimer);
}
var res=this.getEmptyRes();
res.error={Message:"Unknown",Type:"ConnectFailure",Status:0};
this.endRequest(res);
},
doStateChange:function(){
this.onStateChanged(this.xmlHttp.readyState,this);
if(this.xmlHttp.readyState!=4||!this.isRunning){
return;
}
this.duration=new Date().getTime()-this.__start;
if(this.timeoutTimer!=null){
clearTimeout(this.timeoutTimer);
}
var res=this.getEmptyRes();
if(this.xmlHttp.status==200&&this.xmlHttp.statusText=="OK"){
res=this.createResponse(res);
}else{
res=this.createResponse(res,true);
res.error={Message:this.xmlHttp.statusText,Type:"ConnectFailure",Status:this.xmlHttp.status};
}
this.endRequest(res);
},
createResponse:function(r,noContent){
if(!noContent){
var responseText=""+this.xmlHttp.responseText;
if(AjaxPro.cryptProvider!=null&&typeof AjaxPro.cryptProvider=="function"){
responseText=AjaxPro.cryptProvider.decrypt(responseText);
}
if(this.xmlHttp.getResponseHeader("Content-Type")=="text/xml"){
r.value=this.xmlHttp.responseXML;
}else{
if(responseText!=null&&responseText.trim().length>0){
r.json=responseText;
eval("r.value = "+responseText+"*"+"/");
}
}
}
return r;
},
timeout:function(){
this.duration=new Date().getTime()-this.__start;
var r=this.onTimeout(this.duration,this);
if(typeof r=="undefined"||r!=false){
this.abort();
}else{
this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod);
}
},
invoke:function(method,args,callback,context){
this.__start=new Date().getTime();
if(this.xmlHttp==null){
this.xmlHttp=new XMLHttpRequest();
}
this.isRunning=true;
this.method=method;
this.args=args;
this.callback=callback;
this.context=context;
var async=typeof(callback)=="function"&&callback!=AjaxPro.noOperation;
if(async){
if(window.ie){
this.xmlHttp.onreadystatechange=this.doStateChange.bind(this);
}else{
this.xmlHttp.onload=this.doStateChange.bind(this);
this.xmlHttp.onerror=this.mozerror.bind(this);
}
this.onLoading(true);
}
var json=AjaxPro.toJSON(args)+"";
if(AjaxPro.cryptProvider!=null){
json=AjaxPro.cryptProvider.encrypt(json);
}
this.xmlHttp.open("POST",this.url,async);
this.xmlHttp.setRequestHeader("Content-Type","text/plain; charset=utf-8");
this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Method",method);
if(AjaxPro.token!=null&&AjaxPro.token.length>0){
this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Token",AjaxPro.token);
}
if(!window.ie){
this.xmlHttp.setRequestHeader("Connection","close");
}
this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod);
try{this.xmlHttp.send(json);}catch(e){}
if(!async){
return this.createResponse({error:null,value:null});
}
return true;
}
});
AjaxPro.RequestQueue=new Class({
initialize:function(conc)
{
this.queue=[];
this.requests=[];
this.timer=null;
if(isNaN(conc)){conc=2;}
for(var i=0;i<conc;i++){
this.requests[i]=new AjaxPro.Request();
this.requests[i].callback=function(res){
var r=res.context;
res.context=r[3][1];
r[3][0](res,this);
};
this.requests[i].callbackHandle=this.requests[i].callback.bind(this.requests[i]);
}
},
process:function(){
this.timer=null;
if(this.queue.length==0){
return;
}
for(var i=0;i<this.requests.length&&this.queue.length>0;i++){
if(this.requests[i].isRunning==false){
var r=this.queue.shift();
this.requests[i].url=r[0];
this.requests[i].onLoading=r[3].length>2&&r[3][2]!=null&&typeof r[3][2]=="function"?r[3][2]:AjaxPro.onLoading;
this.requests[i].onError=r[3].length>3&&r[3][3]!=null&&typeof r[3][3]=="function"?r[3][3]:AjaxPro.onError;
this.requests[i].onTimeout=r[3].length>4&&r[3][4]!=null&&typeof r[3][4]=="function"?r[3][4]:AjaxPro.onTimeout;
this.requests[i].onStateChanged=r[3].length>5&&r[3][5]!=null&&typeof r[3][5]=="function"?r[3][5]:AjaxPro.onStateChanged;
this.requests[i].invoke(r[1],r[2],this.requests[i].callbackHandle,r);
r=null;
}
}
if(this.queue.length>0&&this.timer==null){
this.timer=setTimeout(this.process.bind(this),0);
}
},
add:function(url,method,args,e){
this.queue.push([url,method,args,e]);
this.process();
},
abort:function(){
this.queue.length=0;
if(this.timer!=null){
clearTimeout(this.timer);
}
this.timer=null;
for(var i=0;i<this.requests.length;i++){
if(this.requests[i].isRunning==true){
this.requests[i].abort();
}
}
},
dispose:function(){
for(var i=0;i<this.requests.length;i++){
var r=this.requests[i];
r.dispose();
}
this.requests.clear();
}
});
AjaxPro.queue=new AjaxPro.RequestQueue(2);
AjaxPro.AjaxClass=new Class({
initialize:function(url){
this.url=url;
},
invoke:function(method,args,e){
if(e!=null){
if(e.length!=6){
for(;e.length<6;){e.push(null);}
}
if(e[0]!=null&&typeof(e[0])=="function"){
return AjaxPro.queue.add(this.url,method,args,e);
}
}
var r=new AjaxPro.Request();
r.url=this.url;
return r.invoke(method,args);
}
});
window.addEvent("unload",AjaxPro.dispose);
/*TripCart.Global.js*/
function provide(name)
{
var obj=window;
var namespaces=name.split(".");
for(var nsIndex=0;nsIndex<namespaces.length;nsIndex++)
{
var ns=namespaces[nsIndex];
if(!obj[ns])obj[ns]={};
obj=obj[ns];
}
}
function isDefined(str,start)
{
var parts=str.split(".");
var obj=start||window;
for(var i=0;i<parts.length;i++)
{
if(!obj[parts[i]])
{
return false;
}
obj=obj[parts[i]];
}
return true;
}
provide("TripCart.Global");
TripCart.Global.Events=
{
Events:{},
Subscribe:function(EventName,Func,Bind,NoAutoUnsubscribe){
if(TripCart.Global.Events.Events[EventName]==null)
TripCart.Global.Events.Events[EventName]=[];
var EventArgs={"Function":Func,"Bind":Bind,"NoAutoUnsubscribe":NoAutoUnsubscribe,"EventName":EventName};
TripCart.Global.Events.Events[EventName].push(EventArgs);
return EventArgs;
},
Unsubscribe:function(EventArgs)
{
if(TripCart.Global.Events.Events[EventArgs.EventName]!=null)
{
TripCart.Global.Events.Events[EventArgs.EventName]=TripCart.Global.Events.Events[EventArgs.EventName].filter(function(cEvent)
{
if(cEvent.Function!=EventArgs.Function||cEvent.Bind!=EventArgs.Bind)
{
return(cEvent);
}
cEvent.Bind=null;
cEvent.Function=null;
cEvent=null;
});
}
},
Fire:function(EventName)
{
try
{
var Subscribers=TripCart.Global.Events.Events[EventName];
if(Subscribers!=null)
{
if(Subscribers.each)
{
Subscribers.each(function(EventArgs){
EventArgs.Function.bind(EventArgs.Bind)();
if(!EventArgs.NoAutoUnsubscribe)
TripCart.Global.Events.Unsubscribe(EventArgs);
});
}
}
}
catch(e){}
}
};
TripCart.Global.Background=
{
Show:function()
{
var bkg=document.getElementById("TCModalBkg");
bkg.style.width=Window.getScrollWidth()-(window.ie?24:0)+"px";
bkg.style.height=Window.getScrollHeight()+"px";
bkg.style.display="";
return bkg;
},
ShowGray:function()
{
TripCart.Global.Background.Show().style.backgroundColor="Gray";
},
Hide:function()
{
var bkg=document.getElementById("TCModalBkg");
bkg.style.display="none";
}
};
TripCart.Global.Location=
{
GetCompleteURL:function()
{
var url=location.href.split("#")[0]+location.hash;
return url;
}
};
TripCart.Encryption=
{
Encrypt:function(to_enc,xor_key)
{
var encChars=[];
for(i=0;i<to_enc.length;++i)
{
encChars.push(String.fromCharCode(xor_key^to_enc.charCodeAt(i)));
}
return encChars.join('');
},
Decrypt:function(to_dec,xor_key)
{
var decChars=[];
for(i=0;i<to_dec.length;i++)
{
decChars.push(String.fromCharCode(xor_key^to_dec.charCodeAt(i)));
}
return decChars.join('');
}
};
provide("TripCart.Global.Context");
if(isDefined("Region.Context.Tab",top))
{
TripCart.Global.Context.Tab=top.Region.Context.Tab;
}
else
{
if(location.href.indexOf("Photo")>0)
TripCart.Global.Context.Tab="Photo";
if(location.href.indexOf("Review")>0)
TripCart.Global.Context.Tab="Review";
if(location.href.indexOf("UserTrip")>0)
TripCart.Global.Context.Tab="UserTrip";
else if(location.href.indexOf("UserProfile")>0)
TripCart.Global.Context.Tab="Profile";
else
{
TripCart.Global.Context.Tab=null;
}
}
/*TCModal.js*/
var Dialog=function()
{
this.initialize.apply(this,arguments);
};
var CurrentDialog=null;
Dialog.prototype=
{
OnCloseCallBack:null,
initialize:function(DialogUrl,IsNotModal)
{
if(CurrentDialog==null)
CurrentDialog=this;
else
return CurrentDialog;
if(!$("TCModal"))
return;
this.closed=false;
this.bkg=$("TCModalBkg");
this.container=$("TCModal");
this.element=$("TCModalIframe");
this.modalHeader=$("TCModalHeader").removeClass("slideShowHeader");
this.titleElement=$("TCModalTitle");
var self=this;
this.selects=[];
if(IsNotModal)
{
this.IsModal=false;
}
else
{
this.IsModal=true;
TripCart.Global.Background.Show();
}
this.closeFirstTimePan();
TripCart.Global.Events.Subscribe("TCModalLoaded",this.iframeLoaded,this);
this.container.setStyles({"display":"","top":(200+document.documentElement.scrollTop)+"px"});
this.element.setStyle("display","none");
this.element.onload=this.iframeLoaded.bind(this);
this.element.setAttribute("src",DialogUrl);
if(this.IsModal)
{
this.disableSelects(document);
if(window.parent!=window)
this.disableSelects(parent.document);
for(var frame=0;frame<window.frames.length;frame++)
{
try{this.disableSelects(window.frames[frame].document);}
catch(e){}
}
}
},
iframeLoaded:function()
{
if(!CurrentDialog.closed)
this.element.setStyle("display","block");
this.element.onload=function(){};
},
close:function()
{
CurrentDialog.closed=true;
for(var i=0;i<CurrentDialog.selects.length;i++)
{
try{CurrentDialog.selects[i].disabled=false;}catch(e){}
}
CurrentDialog.element.style.display="none";
if(CurrentDialog.IsModal)
{
TripCart.Global.Background.Hide();
}
if(CurrentDialog.closeElement)CurrentDialog.closeElement.style.display="none";
if(CurrentDialog.titleElement)CurrentDialog.titleElement.style.display="none";
if(CurrentDialog.OnCloseCallBack)CurrentDialog.OnCloseCallBack(CurrentDialog);
try{
CurrentDialog.element.style.display="none !important";
}catch(e){CurrentDialog.element.style.display="none";}
CurrentDialog.modalHeader.style.display="none";
CurrentDialog=null;
},
disableSelects:function(doc)
{
var selects=doc.getElementsByTagName("select");
for(var i=0;i<selects.length;i++)
{
if(selects[i].disabled!=true)
{
this.selects.push(selects[i]);
selects[i].disabled=true;
}
}
},
resize:function(width,height)
{
this.element.style.height=height+"px";
this.element.style.width=width+"px";
this.width=width;
this.height=height;
},
setCloseCallback:function(CallbackFunction)
{
this.OnCloseCallBack=CallbackFunction;
},
setTitle:function(Text)
{
this.titleElement.innerHTML=Text;
var left=parseInt(310+(this.width-this.titleElement.offsetWidth)/2);
this.titleElement.style.display="";
this.modalHeader.style.display="";
},
setHeaderClass:function(className)
{
if(className)
this.modalHeader.className=className;
},
setBackground:function(Opacity,Color)
{
if(this.bkg)
{
this.bkg.style.opacity=(Opacity||0.9).toString();
this.bkg.style.backgroundColor=Color||"Gray";
this.bkg.style.filter="alpha(opacity="+(Opacity*10||90)+")";
this.bkg.style.MozOpacity=(Opacity||0.9).toString();
}
},
enableCloseButton:function(CloseText)
{
this.closeElement=document.getElementById("TCModalClose");
this.closeElement.onclick=Region?Region.ClickHandlers.CloseModal:CurrentDialog.close;
this.closeElement.style.display="";
},
setFrameBorder:function(Style)
{
this.element.style.border=Style;
},
closeFirstTimePan:function()
{
top.$$("div[name=PanFirstTimeHelp]").setStyle("display","none");
}
};
Dialog.SimpleDialog=function(Url,IsNotModal,Width,Height,OnCloseCallback)
{
var myDialog=new Dialog(Url,IsNotModal);
myDialog.resize(Width,Height);
myDialog.setCloseCallback(OnCloseCallback);
myDialog.setBackground();
TripCart.Global.Background.Show();
return myDialog;
};
Dialog.FullDialog=function(Url,IsNotModal,Width,Height,Title,OnCloseCallback,HeaderClass)
{
var myDialog=new Dialog(Url,IsNotModal);
if(Width&&Height)myDialog.resize(Width,Height);
if(OnCloseCallback)myDialog.setCloseCallback(OnCloseCallback);
myDialog.setBackground();
myDialog.enableCloseButton();
myDialog.setTitle(Title);
myDialog.setHeaderClass(HeaderClass);
TripCart.Global.Background.Show();
return myDialog;
};
/*GeneralFunctions.js*/
String.prototype.Trim=function Trim()
{
return this.replace(/^\s*|\s*$/g,"")
};
String.prototype.Replace=function Replace(oldString,newString)
{
var RE=new RegExp(oldString,"g");
return this.replace(RE,newString);
};
function checkLength(id,maxLength){
var currentField=document.getElementById(id);
if(!currentField)return;
var currentLength=currentField.value.length;
if(currentLength>maxLength){
currentField.value=currentField.value.substr(0,maxLength);
}
}
function CheckLengthKey(element,length,event)
{
if(!length)
var maxlength=element.getAttribute("maxlength")*1;
else
var maxlength=length;
var currentLength=element.value.length;
var key=window.event?event.keyCode:event.which;
if(currentLength<maxlength)
return true;
else
if(key==8||key==35||key==36||key==37||key==39||key==46||key==0)
return true;
else
return false;
}
function GetElementByAttrValue(tagName,attrName,attrValue)
{
var nodes=document.getElementsByTagName(tagName);
var count=nodes.length;
for(i=0;i<count;i++)
{
var item=nodes[i];
if(item.getAttribute(attrName))
{
if(item.getAttribute(attrName)==attrValue)
return item;
}
}
return null;
}
function GetElementsByAttrValue(tagName,attrName,attrValue)
{
var items=[];
var nodes=document.getElementsByTagName(tagName);
var count=nodes.length;
for(i=0;i<count;i++)
{
var item=nodes[i];
if(item.getAttribute(attrName))
{
if(item.getAttribute(attrName)==attrValue)
items.push(item);
}
}
return items;
}
function GetElementsByAttributes(tagName,attrName)
{
var arr=new Array();
var nodes=document.getElementsByTagName(tagName);
var count=nodes.length;
for(i=0;i<count;i++)
{
var item=nodes[i];
if(item.getAttribute(attrName))
{
arr.push(item);
}
}
return arr;
}
function GetChildElementsByAttributes(object,tagName,attrName)
{
var arr=new Array();
var nodes=object.getElementsByTagName(tagName);
var count=nodes.length;
for(i=0;i<count;i++)
{
var item=nodes[i];
if(item.getAttribute(attrName))
{
arr.push(item);
}
}
return arr;
}
function findPosX(id,doc)
{
var obj=doc.getElementById(id);
var curleft=0;
if(obj.offsetParent)
{
while(obj.offsetParent)
{
curleft+=obj.offsetLeft;
obj=obj.offsetParent;
}
}
else if(obj.x)
curleft+=obj.x;
return curleft;
}
function findPosY(id,doc)
{
var obj=doc.getElementById(id);
var curtop=0;
if(obj.offsetParent)
{
while(obj.offsetParent)
{
curtop+=obj.offsetTop;
obj=obj.offsetParent;
}
}
else if(obj.y)
curtop+=obj.y;
return curtop;
}
function previousSibling(element)
{
if(element.previousSibling.nodeType!=1)
return element.previousSibling.previousSibling;
else
return element.previousSibling;
}
function nextSibling(element)
{
if(element.nextSibling.nodeType!=1)
return element.nextSibling.nextSibling;
else
return element.nextSibling;
}
function holdWindButton(id,butEv)
{
var prefix="";
var imageName;
if(id.indexOf('reg_')!=-1)prefix="../";
var button=document.getElementById(id);
switch(butEv){
case("out"):
imageName="but_bar.jpg";
break;
case("down"):
imageName="but_bar_dn.jpg";
break;
case("over"):
imageName="but_bar_ov.jpg";
break;
default:
imageName="but_bar.jpg";
break;
}
button.style.backgroundImage="url("+prefix+"Image1/Buttons/"+imageName+")";
}
function DisableEnterSubmit(event)
{
return((window.event?event.keyCode:event.which)!=13);
}
function firstChildNode(el)
{
var Nodes=el.childNodes;
for(var i=0;i<Nodes.length;i++)
if(Nodes[i].nodeType==1)return Nodes[i];
}
function hideColumns()
{
if(document.styleSheets[0].insertRule)document.styleSheets[0].insertRule(".ShowHide{display:none;}",0);
else document.styleSheets[0].addRule(".ShowHide","display:none;");
}
function showColumns()
{
try
{
if(document.styleSheets[0].deleteRule)document.styleSheets[0].deleteRule(".ShowHide");
else document.styleSheets[0].removeRule();
}
catch(e){}
}
function closeFirstTimeHelp()
{
var PanFirstTimeHelp=GetElementByAttrValue('div','name','PanFirstTimeHelp');
if(!PanFirstTimeHelp)return;
PanFirstTimeHelp.style.display="none";
document.onclick="";
}
function NameEncode(str)
{
return str.Trim().Replace("&amp;","-").Replace(" and ","-").Replace(" And ","-").Replace(":","-").Replace("\\\\","-").Replace("/","-").Replace("&","-").Replace("\"","").Replace(" ","-").Replace(",","-").Replace("--","-").Replace("--","-").Replace("'","");
}
function getQueryVariable(variable)
{
var query=window.location.search.substring(1);
var vars=query.split("&");
for(var i=0;i<vars.length;i++)
{
var pair=vars[i].split("=");
if(pair[0]==variable)return pair[1];
}
return'';
}
var DownTime=-1;
var CheckTimeInterval=60000;
var StartTimeToWarn=600;
function CheckForWindowSize()
{
if(screen.width<1024||screen.height<768)
{
alert("Please configure your display to at least 1024 x 768 resolution  for best results.");
}
}
function RunFunctions()
{
var output=true;
for(var i=0;i<arguments.length;i++)
{
o=arguments[i]();
if(typeof(o)!="undefined"&&typeof(o)=="boolean")
output=output&&o;
}
return output;
}
function indexOf(Array,Value){
if(Array!=null)
{
for(i=0;i<Array.length;i++)
{
if(Array[i]==Value)
{
return i;
}
}
}
return-1;
}
function CheckCookie()
{
var path=location.toString().split("/")[location.toString().split("/").length-1];
if(document.cookie==""&&!path.match("Alert=Cookie"))
location.href=SitePath+"/"+"?Alert=Cookie";
}
if(window.parent==window&&window.TripCart)
{
}
function MaximizeWindow()
{
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
}
function IsUserLoggedIn(OpenLogInWindow,Callback,Context)
{
var response=TripCart.AjaxMethods.IsUserLoggedIn();
if(response.value)
{
if(Callback!=null)
{
if(Context!=null)
{
Callback(Context);
}
else
{
Callback();
}
}
else
{
eval(Context);
}
return true;
}
else if(OpenLogInWindow)
{
var Dialog=new top.Dialog(SitePath+'/SignInV2.aspx');
Dialog.setBackground();
return false;
}
else
return false;
}
function GetAffiliatePath(link)
{
if(SitePath!=null)
{
if(link.indexOf('http')==0)
{
return link;
}
else
{
return SitePath+"/"+link;
}
}
return"";
}
function forwardPage(type,url)
{
var completeURL="/forward/"+type+"/"+url;
if(type!="dll")
tcTracker(completeURL);
var newWindow=window.open(completeURL,'_blank');
newWindow.focus();
}
function getMapIFrame()
{
return parent.frames['MapFrame'];
}
function isMapShown()
{
var mapFrame=top.document.getElementById("MapFrame");
return!(mapFrame.src=="");
}
function loadMapIFrame()
{
if(!isMapShown())
{
var mapFrame=top.document.getElementById("MapFrame");
mapFrame.className="mapContainer";
parent.MapWrapper.LoadMap();
mapFrame.src=top.SitePath+"/TCMapPage.aspx?RegionID="+RegionID;
mapFrame.width="548px";
mapFrame.height="455px"
mapFrame.style.backgroundimage="url(images/design/map-background.gif)";
parent.addEvent("onMapLoaded",function()
{
var mapFrame=top.document.getElementById("MapFrame");
mapFrame.className="";
mapFrame.style.backgroundimage="";
});
if($("InteractiveMap"))
$("InteractiveMap").disabled="true";
}
}
function openInNewTab(url)
{
tcTracker("/printableView");
var newWindow=window.open(url,'_blank');
newWindow.focus();
}
function tcTracker(url)
{
try{urchinTracker(url);}catch(e){}
}

/*GMap\MapGlobals.js*/
var HOTEL="Hotels";
var ATTRACTION="Attractions";
var AIRPORTS="Airports";
var REGION="Regions";
var ROUTE="Routes";
var MAPMARKER="MapMarkers";
var BORDER="Borders";
var LABEL="Labels";
var IconFileNames=
{
"Airport":"act_Airport",
"ArtMuseum":"act_ArtMuseum",
"Beach":"act_Beach",
"Biking":"act_Biking",
"Boating":"act_Boating",
"BotanicalGarden":"act_BotanicalGarden",
"Diving":"act_Diving",
"Entertainment":"act_Entertainment",
"FactoryTour":"act_FactoryTour",
"FallFoliage":"act_FallFoliage",
"Fishing":"act_Fishing",
"Gambling":"act_Gambling",
"GeneralMuseum":"act_GeneralMuseum",
"Golf":"act_Golf",
"Hiking":"act_Hiking",
"HistoricalSite":"act_HistoricalSite",
"HistoryMuseum":"act_HistoryMuseum",
"Hotel":"act_Hotel",
"NearByHotel":"act_Hotel",
"MountainClimbing":"act_MountainClimbing",
"NaturalHistoryMuseum":"act_NaturalHistoryMuseum",
"Nature":"act_Nature",
"Place":"act_Place",
"RockGym":"act_RockGym",
"ScienceMuseum":"act_ScienceMuseum",
"Shopping":"act_Shopping",
"Ski":"act_Ski",
"Spa":"act_Spa",
"SpectatorSports":"act_SpectatorSports",
"Surfing":"act_Surfing",
"ThemeParks":"act_ThemeParks",
"WhiteWater":"act_WhiteWater",
"Winery":"act_Winery",
"Zoo":"act_Zoo"
};
var BalloonFunctionMapping=
{
"Airport":"SetAirportBalloonHTML",
"Attractions":"SetAttractionBalloonHTML",
"ArtMuseum":"SetAttractionBalloonHTML",
"Beach":"SetAttractionBalloonHTML",
"Biking":"SetAttractionBalloonHTML",
"Boating":"SetAttractionBalloonHTML",
"BotanicalGarden":"SetAttractionBalloonHTML",
"Diving":"SetAttractionBalloonHTML",
"Entertainment":"SetAttractionBalloonHTML",
"FactoryTour":"SetAttractionBalloonHTML",
"FallFoliage":"SetAttractionBalloonHTML",
"Fishing":"SetAttractionBalloonHTML",
"Gambling":"SetAttractionBalloonHTML",
"GeneralMuseum":"SetAttractionBalloonHTML",
"Golf":"SetAttractionBalloonHTML",
"Hiking":"SetAttractionBalloonHTML",
"HistoricalSite":"SetAttractionBalloonHTML",
"HistoryMuseum":"SetAttractionBalloonHTML",
"Hotel":"SetHotelBalloonHTML",
"MountainClimbing":"SetAttractionBalloonHTML",
"NaturalHistoryMuseum":"SetAttractionBalloonHTML",
"Nature":"SetAttractionBalloonHTML",
"Place":"SetAttractionBalloonHTML",
"RockGym":"SetAttractionBalloonHTML",
"ScienceMuseum":"SetAttractionBalloonHTML",
"Shopping":"SetAttractionBalloonHTML",
"Ski":"SetAttractionBalloonHTML",
"Spa":"SetAttractionBalloonHTML",
"SpectatorSports":"SetAttractionBalloonHTML",
"Surfing":"SetAttractionBalloonHTML",
"ThemeParks":"SetAttractionBalloonHTML",
"WhiteWater":"SetAttractionBalloonHTML",
"Winery":"SetAttractionBalloonHTML",
"Zoo":"SetAttractionBalloonHTML",
"NearByHotel":"SetHotelBalloonHTML",
"Highlights":"SetAttractionBalloonHTML"
};
function DistractorMapGlobalsVariables()
{
HOTEL=null;delete HOTEL;
ATTRACTION=null;delete ATTRACTION;
AIRPORTS=null;delete AIRPORTS;
REGION=null;delete REGION;
ROUTE=null;delete ROUTE;
MAPMARKER=null;delete MAPMARKER;
BORDER=null;delete BORDER;
LABEL=null;delete LABEL;
IconFileNames=null;delete IconFileNames;
BalloonFunctionMapping=null;delete BalloonFunctionMapping;
}
function DataAdapter(ResultArray,MappingArray)
{
var data={};
for(var i=0;i<MappingArray.length;i++)
{
data[MappingArray[i]]=ResultArray[i];
}
return data;
}
function OpenAttractionMapWindow(url,wndSizeX,wndSizeY)
{
if(url!=null)
{
if((url!="")&&(url!=undefined))
{
window.open(url,"wnd",'height='+wndSizeY+',width='+wndSizeX+',top=0,left=0,menubar=no,toolbar=no,scrollbars=yes,resizable=yes');
}
}
}
function DoAutoSave()
{
try
{
var tableIFrame_in=document.getElementById("tableIFrame").getElementsByTagName("iframe")[0];
tableIFrame_in.contentWindow.document.AutoSave();
}catch(e){}
}
function SetMapType(MapTypeView)
{
switch(MapTypeView)
{
case"S":
myMap.SetMapType("Satellite");
break;
case"H":
myMap.SetMapType("Hybrid");
break;
default:
myMap.SetMapType("Normal");
break;
}
}
function ChangeLink(HtmlElement)
{
if(HtmlElement.className=="btnAddToTrip")
{
HtmlElement.style.fontWeight="bold";
HtmlElement.style.textDecoration="none";
HtmlElement.style.cursor="pointer";
HtmlElement.style.backgroundImage="url("+SitePath+"/Image1/RegionImages/btnAddedViewTripEmpty.gif)";
HtmlElement.style.width="80px";
HtmlElement.style.height="24px";
HtmlElement.className="btnAddedViewTrip";
}
HtmlElement.innerHTML="Added - View Trip";
HtmlElement.href=SitePath+"/MyTripCart.aspx";
HtmlElement.target="_top";
HtmlElement.onclick=function(){top.location.href=SitePath+"/MyTripCart.aspx";return true;};
}
function AddRegionToTrip(HtmlElement,RegionID)
{
try
{
var response=TripCart.AjaxMethods.AddRegionToTrip(RegionID.toString());
HtmlElement.innerHTML="Added - View Trip";
HtmlElement.onclick=function(){top.location.href=SitePath+"/MyTripCart.aspx"};
return true;
}
catch(e){
return false;
}
}
function AddRegionToTrip_CallBack(response){
alert("region was added");
}
var showPOIList_InProgress=false;
/*TextResources.js*/
var arrErrors=
{'Basket.js_Delete_All_Carts':'Are you sure you want to permanently delete the contents of the Deleted Trips folder?',
'Basket.js_Delete_All_Carts_No_Items_To_Delete':'There are no Trips to delete',
'Basket.js_Want_To_Delete_This_Cart':'Are you sure you want to delete this Trip',
'Basket.js_Want_To_Delete_This_Cart_Permanently':'Are you sure you want to permanently delete the selected Trip?',
'MyAccount.js_Email_Address_Required':'An email address is required to sign-in.',
'MyAccount.js_Enter_Correct_Email_Address':'Please enter a valid email address',
'MyAccount.js_Enter_Email_Address':'Please enter a valid email address',
'MyAccount.js_Password_Confirm_Password_Not_The_Same':'Please  try again - the Password and Confirm Password fields are different.',
'MyAccount.js_Password_Confirmation_Required':'Please confirm your  password.',
'MyAccount.js_Password_Required':'A password is required',
'MyAccount.js_Please_Enter_Password':'Please enter your password.',
'MyAccount.js_Sign_In_Form_Not_Correct':'Please sign in correctly.',
'SearchResults.js_No_Regions_To_Add_to_cart':'Please select at least one item',
'SearchResults.js_No_Regions_To_Compare':'There is nothing to hide - please select checkboxes',
'SearchResults.js_No_Regions_To_Hide':'There nothing to compare - please select checkboxes'};
var arrMessages=
{'Basket.js_Invite_See_Other_TripCart':'You are invited to see  &quot;??????&quot; Trip, created by\n ****. \nTo see this Trip you need to be registered client. If you are not registered yet with a Trip Click Here to register',
'Date.js_Save_Messages':'You have unsaved changes.\nAre you sure you want to close?',
'Dates.js_Actual_Start_Day':'actual start day',
'Dates.js_Change_Trip_Dates':'Are you sure you want to change the trip date format?',
'Dates.js_Clean_Data_Without_Restore':'This operation will clean up all previousely saved data without possibility to restore it.\nAre you sure you want to Clear All?',
'Dates.js_Closing_Without_Dates':'You are going to close without setting up the dates. \n It will close the whole \"Edit Dates\" dialog.\n Are you sure you want to close? ',
'Dates.js_Dates_Confirmation_Box':'The changes will overwrite previously entered dates.\n Are you sure you want to save changes? ',
'Dates.js_Need_To_Enter':'You need to enter the ',
'Dates.js_Your_Trip_Length':'your trip length',
'Region.js_No_Regions_Routes_To_Compare':'There nothing to compare - please select checkboxes',
'TripCart.js_Clear_All_Dates':'All  date info for items displayed will be deleted. Are you sure? (Yes and Cancel), with cancel the default',
'TripCart.js_Clear_All_Hotels':'All  hotel info for items displayed will be deleted. Are you sure? (Yes and Cancel), with cancel the default',
'TripCart.js_Clear_All_Notes':'All  notes for items displayed will be deleted. Are you sure? (Yes and Cancel), with cancel the default',
'TripCart.js_Dates_Data_Saved':'Your dates have been updated in your Trip.',
'TripCart.js_Delete_Items_Confirmation':'Are you sure you want to delete\n the selected items from your Trip?',
'TripCart.js_Hotel_Data_Saved':'Your hotel information has been updated.',
'TripCart.js_No_Items_To_Compare':'No items to compare',
'TripCart.js_Notes_Data_Saved':'Your notes have been updated in your Trip.',
'TripCart.js_Save_Changes':'Do you want to save changes to your Trip?'};
var arrTooltip=
{'js_Add_To_Cart':'Add checked items to my Trip',
'js_AddItem_Dates':'Assign dates for other items',
'js_AddItem_Hotels':'Add hotel info for other items',
'js_AddItem_Notes':'Add notes for other items',
'js_Cal_Arrival_Date':'Choose Arrival date from Calendar',
'js_Cal_Departure_Date':'Choose Departure date from Calendar',
'js_Cal_Start_Date':'Choose Start Date according to the selected format',
'js_Compare':'Compare checked items',
'js_Dates_Editor':'Assign dates for checked items',
'js_Delete':'Remove checked items from your Trip',
'js_Hide':'Hide checked items',
'js_Hotels_Editor':'Add hotel info for checked items',
'js_Notes_Editor':'Add notes for checked items',
'js_Scroller_TC_Item':'Click for more icons',
'js_Sort_By_Match':'Sort by Match Factor',
'js_Unhide_All':'Restore hidden items',
'ResultMap.js_Add_To_Cart':'Add To Trip',
'ResultMap.js_Add_To_My_Trip_Cart':'Add to Trip',
'ResultMap.js_Compare':'Compare',
'ResultMap.js_Region_Page':'Explore Region'};

/*AjaxLoader.js*/
AjaxLoader=new Class({
initialize:function(element,control,args)
{
this.element=element;
this.control=control;
this.args=args;
this.GetHtml();
},
GetHtml:function()
{
new Ajax("/AjaxLoader.aspx?ControlToLoad="+this.control+"&"+this.args,{method:"get",evalScripts:true}).addEvent("onComplete",this.onComplete.bind(this)).request();
},
onComplete:function(response)
{
this.element.innerHTML=response;
this.fireEvent("onComplete");
}
});
AjaxLoader.implement(new Events);

/*dates1.js*/
var dateStarted=false;
var tempActStartDay=new Date();
var startDay;
var startDayString="";
var endDay;
var tempStart=null;
var tempEnd=null;
var tempClickedCalendarId=null;
function setSameTime(date)
{
date.setHours(12,0,0,0);
return date;
}
function tripDates(date)
{
date=setSameTime(date);
var today=new Date();
today=setSameTime(today);
if(date<today)
return true;
if(tempEnd){
if(date>tempEnd){
return true;
}else if(startDay){
if(date>=startDay)
return"special";
}else{
return false;
}
}else if(tempStart){
if(date<tempStart){
return true;
}else if(endDay){
if(date<=endDay)
return"special";
}else{
return false;
}
}
return false;
}
function createRowCalendar(calId)
{
tempStart=null;
tempEnd=null;
tempClickedCalendarId=calId;
var op=calId.substr(0,2);
var inpFieldId=calId.substr(0,calId.length-4);
var but=document.getElementById(calId);
var start,end;
var inpField,secondInpFieldId,secondInpField;
if(op=="fr"){
secondInpFieldId="to"+calId.substr(2);
secondInpFieldId=secondInpFieldId.substr(0,secondInpFieldId.length-4);
secondInpField=document.getElementById(secondInpFieldId);
if(secondInpField&&secondInpField.value&&secondInpField.value!=""){
tempEnd=new Date(Date.parse(secondInpField.value));
tempEnd.__msh_oldSetFullYear(tempStart.getFullYear()+100);
tempEnd=setSameTime(tempEnd);
start=new Date();
}
}else if(op=="to"){
secondInpFieldId="fr"+calId.substr(2);
secondInpFieldId=secondInpFieldId.substr(0,secondInpFieldId.length-4);
secondInpField=document.getElementById(secondInpFieldId);
if(secondInpField&&secondInpField.value&&secondInpField.value!=""){
tempStart=new Date(Date.parse(secondInpField.value));
tempStart.__msh_oldSetFullYear(tempStart.getFullYear()+100);
tempStart=setSameTime(tempStart);
start=new Date(tempStart);
}
}
Calendar.setup({
inputField:inpFieldId,
button:calId,
ifFormat:"%m/%e/%y",
dateStatusFunc:tripDates,
weekNumbers:false,
onUpdate:SetDateFromCalendarTbl,
date:start,
showsTime:false,
electric:false,
cache:false
});
but.click();
}
function SetDateFromCalendarTbl(cal)
{
tempStart=null;
tempEnd=null;
if(!tempClickedCalendarId)return;
if(tempClickedCalendarId=="fr_setUp_Cal"){
startDay=cal.date;
startDay=setSameTime(startDay);
}else if(tempClickedCalendarId=="to_setUp_Cal"){
endDay=cal.date;
endDay=setSameTime(endDay);
}
tempClickedCalendarId=null;
return;
}
function onCloseEvent(cal)
{
tempStart=null;
tempEnd=null;
}
function	validateDate(textId)
{
var today=new Date();
today=setSameTime(today);
var textField=document.getElementById(textId);
var op=textId.substr(0,2);
var secondTextId,secondText;
var firstDate,secondDate;
if(!textField)return;
firstDate=new Date(Date.parse(textField.value));
firstDate.__msh_oldSetFullYear(firstDate.getFullYear()+100);
firstDate=setSameTime(firstDate);
if(firstDate<today||isNaN(firstDate)){
textField.value="";
return;
}
if(op=="fr"){
secondTextId="to"+textId.substr(2);
}else{
secondTextId="fr"+textId.substr(2);
}
secondText=document.getElementById(secondTextId);
if(secondText&&secondText.value&&secondText.value!=""){
secondDate=new Date(Date.parse(secondText.value));
secondDate.__msh_oldSetFullYear(secondDate.getFullYear()+100);
secondDate=setSameTime(secondDate);
}
if(op=="fr"){
if(firstDate>secondDate)
textField.value="";
}else{
if(firstDate<secondDate)
textField.value="";
}
}

/*TripCart.MyTrip.js*/
document.AutoSave=function()
{
if(IsNeededToUpdate())__doPostBack('_ctl0_ContentPlaceHolder1_TripItems1_UpdateButton','');
};
document.onclick=function(ev)
{
closeReminderDlg();
};
function ClickOnButtonOnTrue(id,func)
{
if(func())document.getElementById(id).click();
}
function ClickOnButton(id)
{
document.getElementById(id).click();
}
function DoKePress(evt,txtID)
{
vt=(evt)?evt:((event)?event:null);
if(evt)
if(evt.keyCode==46)
document.getElementById(txtID).value='';
}

/*Hash.js*/
function TCHash()
{
this.length=0;
this.items=new Array();
for(var i=0;i<arguments.length;i+=2){
if(typeof(arguments[i+1])!='undefined'){
this.items[arguments[i]]=arguments[i+1];
this.length++;
}
}
}
TCHash.prototype=
{
removeItem:function(in_key)
{
var tmp_value;
if(typeof(this.items[in_key])!='undefined'){
this.length--;
var tmp_value=this.items[in_key];
delete this.items[in_key];
}
return tmp_value;
},
getItem:function(in_key)
{
return this.items[in_key];
},
setItem:function(in_key,in_value)
{
if(typeof(in_value)!='undefined'){
if(typeof(this.items[in_key])=='undefined'){
this.length++;
}
this.items[in_key]=in_value;
}
return in_value;
},
hasItem:function(in_key)
{
return typeof(this.items[in_key])!='undefined';
},
Alert:function()
{
for(var i in this.items)
alert('key is: '+i+', value is: '+this.items[i]);
},
Serialize:function()
{
var s="";
for(var i in this.items)
s+=i+":"+this.items[i]+",";
return s.substr(0,s.length-1);
},
SerializeKeys:function()
{
var s="";
for(var i in this.items)
s+=i+",";
return s.substr(0,s.length-1);
}
};//End function Hash()
/*GMap\v2\TCMap.js*/
var TCMap=function(){
this.initialize.apply(this,arguments);
};
TCMap.prototype=
{
myCenter:null,
myZoomLevel:null,
myGMap:null,
GImgProperty:null,
OpenedPOI:null,
initialize:function(mapElement)
{
if(GBrowserIsCompatible())
{
if(mapElement)
{
this.myCenter=new GLatLng(37.4419,-122.1419);
this.myZoomLevel=13;
this.NewMap(mapElement);
}
}
else
{
throw"Browser isn't compatible";
}
},
NewMap:function(mapElement)
{
this.myGMap=new GMap2(mapElement);
this.geocoder=new GClientGeocoder();
this.myGMap.enableContinuousZoom();
TCMapClosure=this;
GEvent.addListener(this.myGMap,"click",function(overlay,point)
{
if(!overlay)
{
this.getInfoWindow().hide();
}
else
{
TCMapClosure.OpenedPOI=overlay.poi;
}
});
GEvent.addListener(this.myGMap,"load",function()
{
try{MapLoaded();}catch(e){}
try
{
parent.fireEvent("onMapLoaded");
}
catch(e){
}
});
GEvent.bind(this.myGMap,"infowindowclose",this,this.OnBallonClose);
},
AddControls:function(bZoomStepper,bZoomSlider,bMapType,bScale,bPanning,bOverview)
{
if(bZoomStepper)
this.myGMap.addControl(new GSmallMapControl());
if(bZoomSlider)
this.myGMap.addControl(new GLargeMapControl());
if(bMapType)
this.myGMap.addControl(new GMapTypeControl());
if(bScale)
this.myGMap.addControl(new GScaleControl());
if(bOverview)
this.myGMap.addControl(new GOverviewMapControl());
this.SetCenter(this.myCenter.lat(),this.myCenter.lng(),this.myZoomLevel);
},
AddListener:function(onClickFunction,args)
{
GEvent.addListener(this.myGMap,"click",function(overlay,point)
{
if(!overlay)
{
this.getInfoWindow().hide();
}
onClickFunction(args);
});
},
SetCenter:function(latitude,longitude,zoomLevel)
{
this.myCenter=new GLatLng(latitude,longitude);
this.myZoomLevel=zoomLevel||this.myZoomLevel;
this.myGMap.setCenter(this.myCenter,this.myZoomLevel);
},
SetZoom:function(zoomLevel)
{
this.myZoomLevel=zoomLevel;
this.myGMap.setZoom(this.myZoomLevel);
},
ZoomToPOIList:function(arr_poi,zoomLevel)
{
var map=this.myGMap;
var bounds=new GLatLngBounds();
for(var i=0;i<arr_poi.length;i++)
{
bounds.extend(arr_poi[i].marker.getPoint());
}
minX=bounds.getSouthWest().lng();
minY=bounds.getSouthWest().lat();
maxX=bounds.getNorthEast().lng();
maxY=bounds.getNorthEast().lat();
if(zoomLevel==undefined)
this.CenterAndZoomOnBounds(minX,minY,maxX,maxY);
else
this.SetCenter(bounds.getCenter().y,bounds.getCenter().x,zoomLevel);
},
CenterAndZoomOnBounds:function(minX,minY,maxX,maxY)
{
var bounds=new GLatLngBounds(new GLatLng(minY,minX),new GLatLng(maxY,maxX));
var ratio=0.03;
var map=this.myGMap;
var largerBounds=this.ExtendBoundsByRatio(bounds,ratio);
var zoom=map.getBoundsZoomLevel(largerBounds);
map.setCenter(largerBounds.getCenter(),zoom);
},
IsPOIInBounds:function(poi)
{
try
{
var minLng=this.myGMap.getBounds().getSouthWest().lng();
var minLat=this.myGMap.getBounds().getSouthWest().lat();
var maxLng=this.myGMap.getBounds().getNorthEast().lng();
var maxLat=this.myGMap.getBounds().getNorthEast().lat();
return(poi.latitude>=minLat&&poi.latitude<=maxLat&&
poi.longitude>=minLng&&poi.longitude<=maxLng);
}
catch(e)
{
return false;
}
},
ExtendBoundsByRatio:function(bounds,ratio)
{
var map=this.myGMap;
var largerBounds=new GLatLngBounds(
bounds.getSouthWest(),bounds.getNorthEast());
var northEastLat=bounds.getNorthEast().lat();
var northEastLng=bounds.getNorthEast().lng();
var southWestLat=bounds.getSouthWest().lat();
var southWestLng=bounds.getSouthWest().lng();
var diffLat=northEastLat-southWestLat;
var diffLng=northEastLng-southWestLng;
northEastLat+=diffLat*ratio;
southWestLat-=diffLat*ratio;
northEastLng+=diffLng*ratio;
southWestLng-=diffLng*ratio;
largerBounds.extend(new GLatLng(northEastLat,northEastLng));
largerBounds.extend(new GLatLng(southWestLat,southWestLng));
return largerBounds;
},
CloseInfoWindow:function()
{
try{
this.OpenedPOI=null;
this.myGMap.closeInfoWindow();
}catch(e){}
},
OnBallonClose:function()
{
},
Clear:function()
{
try{
this.myGMap.clearOverlays();
}catch(e){}
},
AddMarker:function(marker)
{
this.myGMap.addOverlay(marker,marker.getIcon());
},
AddLine:function(line)
{
this.myGMap.addOverlay(line);
},
RemoveMarker:function(marker)
{
if(marker)
{
this.myGMap.removeOverlay(marker);
}
},
RemoveLine:function(line)
{
this.myGMap.removeOverlay(line);
},
SetMapType:function(iMapType)
{
switch(iMapType){
case"Satellite":
this.myGMap.setMapType(G_SATELLITE_MAP);
break;
case"Hybrid":
this.myGMap.setMapType(G_HYBRID_MAP);
break;
case"Normal":
this.myGMap.setMapType(G_NORMAL_MAP);
break;
}
},
GetImgIdentifyProperty:function()
{
dummyMarker=new GMarker(new GLatLng(37.4419,-122.1419));
this.myGMap.addOverlay(dummyMarker);
for(var i in dummyMarker)
{
if(typeof dummyMarker[i]=="object")
{
try
{
if(typeof dummyMarker[i][0].src!="undefined")
{
this.GImgProperty=i+"[0]";
break;
}
}
catch(e){}
}
}
this.myGMap.removeOverlay(dummyMarker);
},
latLongToPixel:function(coord)
{
var topLeft=this.myGMap.getCurrentMapType().getProjection().fromLatLngToPixel(this.myGMap.fromDivPixelToLatLng(new GLatLng(0,0),true),this.myGMap.getZoom());
var point=this.myGMap.getCurrentMapType().getProjection().fromLatLngToPixel(coord,this.myGMap.getZoom());
return new GPoint(point.x-topLeft.x,point.y-topLeft.y);
}
};
provide("TripCart.Map.Templates");//used for the templates
/*GMap\v2\TCLine.js*/
var TCLine=function(){
this.initialize.apply(this,arguments);
};
TCLine.prototype=
{
gline:null,
map:null,
initialize:function(SerializedPoints,color,weight,opacity,map)
{
var arr_GPoints=new Array();
var PointList=null;
if(typeof(SerializedPoints)=="string")
{
PointList=SerializedPoints.split(";");
for(var i=0;i<PointList.length-1;i++)
{
var LATLONG=PointList[i].split(",");
var p=new GLatLng(LATLONG[1],LATLONG[0]);
arr_GPoints.push(p);
}
}
else
{
arr_GPoints=SerializedPoints;
}
this.gline=new GPolyline(arr_GPoints,color,weight,opacity);
this.map=map;
},
Show:function()
{
this.map.AddLine(this.gline);
},
Hide:function()
{
this.map.RemoveLine(this.gline);
}
};

/*GMap\v2\TCTooltip.js*/
var TCTooltip=function(){
this.initialize.apply(this,arguments);
};
TCTooltip.prototype=
{
marker:null,
text:null,
tooltipElement:null,
arrowElement:null,
initialize:function(marker,text)
{
this.marker=marker;
this.text=text;
},
ShowTooltip:function()
{
if(this.text)
{
if(this.tooltipElement==null)
this.initTooltip();
this.setTTPosition();
this.tooltipElement.style.display="block";
this.arrowElement.style.display="block";
}
},
HideTooltip:function()
{
try{
this.tooltipElement.style.display="none";
}catch(e){}
try{
this.arrowElement.style.display="none";
}catch(e){}
},
initTooltip:function()
{
this.objId="activeMarker";
var b=document.createElement('span');
var arrow=document.createElement('img');
this.arrowElement=arrow;
this.tooltipElement=b;
b.setAttribute('id',this.objId);
b.innerHTML=this.text;
b.className="tooltip";
var c=document.body;
var d=document.getElementById("pdmarkerwork");
if(d)
c=d;
c.appendChild(b);
b.style.position="absolute";
b.style.bottom="5px";
b.style.left="5px";
b.style.zIndex=1;
var tempObj=document.getElementById(this.objId);
this.marker.ttWidth=b.offsetWidth;
this.marker.ttHeight=b.offsetHeight;
c.removeChild(b);
b.style.zIndex=600000;
b.style.bottom="";
b.style.left="";
b.style.display="none";
arrow.style.display="none";
arrow.style.zIndex=600000;
arrow.style.position="absolute";
var pane=this.marker.map.myGMap.getPane(G_MAP_FLOAT_PANE);
pane.appendChild(b);
pane.appendChild(arrow);
this.tooltipElement=b;
},
setTTPosition:function()
{
var map=this.marker.map.myGMap;
var gap=10;
var MarkerCoord=this.marker.getPoint();
var x=parseFloat(MarkerCoord.x);
var iconSize=this.marker.getIcon().iconSize;
var iconWidth=iconSize.width;
var iconHeight=iconSize.height;
var MarkerWidth=this.marker.ttWidth;
var NELatLng=map.getBounds().getNorthEast();
var NELng=parseFloat(NELatLng.lng());
var SWLatLng=map.getBounds().getSouthWest();
var SWLng=SWLatLng.lng();
var bounds=map.getBounds();
var boundsSpan=bounds.toSpan();
var longSpan=boundsSpan.lng();
var mapWidth=map.getSize().width;
var SpanXR=NELng-x;
var SpanXL=x-SWLng;
var MarkerWidthInLatLong=MarkerWidth/mapWidth*longSpan;
var MarkerY=this.marker.map.latLongToPixel(MarkerCoord).y;
var MarkerX=this.marker.map.latLongToPixel(MarkerCoord).x;
var SWLngP=this.marker.map.latLongToPixel(SWLatLng).x;
var NELngP=this.marker.map.latLongToPixel(NELatLng).x;
var Offset=parseInt(iconWidth/2);
var ArrowOffset=0;
if(MarkerWidthInLatLong>SpanXR)
{
if(MarkerWidthInLatLong>SpanXL)
{
this.arrowElement.style.left=MarkerX+"px";
MarkerX-=MarkerX+MarkerWidth-NELngP+iconWidth;
MarkerY+=20;
}
else
{
this.arrowElement.style.left=MarkerX-6+"px";
MarkerX-=MarkerWidth;
MarkerY+=iconHeight+(iconHeight<29?11:-11);
}
ArrowOffset=24;
this.arrowElement.src=SitePath+"/Image1/Arrows/up.gif";
}
else
{
MarkerY+=14;
MarkerX-=7;
ArrowOffset=18;
this.arrowElement.style.left=MarkerX+Offset+"px";
this.arrowElement.src=SitePath+"/Image1/Arrows/left.gif";
}
if(this.tooltipElement)
{
this.tooltipElement.style.top=MarkerY+"px";
this.tooltipElement.style.left=MarkerX+Offset+"px";
this.arrowElement.style.top=MarkerY-ArrowOffset+"px";
}
}
};

/*GMap\v2\TCPoi.js*/
var TCPoi=function(){
this.initialize.apply(this,arguments);
};
TCPoi.prototype=
{
marker:null,
longitude:null,
latitude:null,
id:null,
type:null,
map:null,
icon:null,
zIndex:null,
Showen:false,
initialize:function(latitude,longitude,icon,balloon,
tooltip,onClickFunction,args,onOpenFn,onCloseFn,map)
{
this.map=map;
this.longitude=parseFloat(longitude);
this.latitude=parseFloat(latitude);
this.icon=icon;
if(balloon)
{
this.balloon=balloon;
}
this.marker=this.GetNewMarker(onClickFunction,args,onOpenFn,onCloseFn);
if(tooltip)
{
this.tooltip=new TCTooltip(this.marker,tooltip);
GEvent.addListener(this.marker,"mouseover",function(){
this.poi.tooltip.ShowTooltip();
});
GEvent.addListener(this.marker,"mouseout",function(){
this.poi.tooltip.HideTooltip();
});
}
},
GetNewMarker:function(onClickFunction,args,onOpenFunction,onCloseFunction)
{
if(this.map.GImgProperty==null)
{
this.map.GetImgIdentifyProperty();
}
var marker=null;
if(this.icon)
marker=new GMarker(new GLatLng(this.latitude,this.longitude),this.icon.GetIcon());
else
marker=new GMarker(new GLatLng(this.latitude,this.longitude));
marker.map=this.map;
marker.poi=this;
this.SetCursor("pointer");
if(this.balloon)
{
GEvent.addListener(marker,"click",function()
{
if(marker.poi.type=="Hotels")
tcTracker("/map/hotel-balloon/"+marker.poi.id+"/");
else
tcTracker("/map/attraction-balloon/"+marker.poi.id+"/");
marker.poi.OpenBalloon();
try{document.onclick();}catch(e){}
});
}
else if(onClickFunction)
{
GEvent.addListener(marker,"click",function(){onClickFunction(args);});
}
else
{
this.SetCursor("default");
}
if(this.tooltip)
{
this.tooltip=new TCTooltip(marker,tooltip);
GEvent.addListener(marker,"mouseover",function(){
marker.poi.tooltip.ShowTooltip();
});
GEvent.addListener(marker,"mouseout",function(){
marker.poi.tooltip.HideTooltip();
});
}
return marker;
},
Hide:function()
{
this.map.RemoveMarker(this.marker);
this.Showen=false;
},
Show:function(zIndex)
{
this.map.AddMarker(this.marker);
this.SetCursor(this.cursor);
if(zIndex)
this.SetZIndex(zIndex);
else
this.SetZIndex(++maxZIndex);
this.marker.redraw(true);
this.Showen=true;
},
OpenBalloon:function(onOpenFunction,onCloseFunction,bShowIcon,bRedrawBalloon)
{
if(this.balloon.GetHtml()==""||bRedrawBalloon)
{
if(this.balloon.regId)
{
this.balloon.SetRegionBalloonHTML();
}
else if(this.balloon.HotelID)
{
this.balloon.SetHotelBalloonHTML();
}
else if(this.balloon.ActivityType)
{
this.balloon[BalloonFunctionMapping[this.balloon.ActivityType]]();
}
}
if(typeof this.balloon.GetHtml()!="string")
{
var infoTabs=[];
for(var key in this.balloon.GetHtml())
{
if(typeof(key)=="function")continue;
infoTabs.push(new GInfoWindowTab(""+key+"",this.balloon.GetHtml()[key]));
}
this.map.myGMap.openInfoWindowTabsHtml(this.marker.getPoint(),infoTabs,{onOpenFn:onOpenFunction,onCloseFn:onCloseFunction,selectedTab:0});
}
else
{
this.map.myGMap.openInfoWindowHtml(this.marker.getPoint(),this.balloon.GetHtml(),{onOpenFn:onOpenFunction,onCloseFn:onCloseFunction});
}
this.map.OpenedPOI=this;
if(bShowIcon)
this.Show();
},
IsOpenedBalloon:function()
{
if(this.map.OpenedPOI)
return(this.map.OpenedPOI.id==this.id&&this.map.OpenedPOI.type==this.type);
else
if(this.marker.getPoint()==this.map.myGMap.getInfoWindow().getPoint()&&!this.map.myGMap.getInfoWindow().isHidden())
return true;
return false;
},
SetZIndex:function(zIndex)
{
this.zIndex=zIndex;
try
{
if(this.map.GImgProperty!=null)
{
var propertyName=this.map.GImgProperty.split("[")[0];
var index=this.map.GImgProperty.split("[")[1].split("]")[0];
this.marker[propertyName][index].style.zIndex=zIndex;
}
}
catch(e){}
},
GetZIndex:function()
{
var x=null;
if(this.map.GImgProperty!=null)
x=this.marker[this.map.GImgProperty].style.zIndex;
return x;
},
SetCursor:function(cursor)
{
this.cursor=cursor;
try
{
if(this.map.GImgProperty!=null)
{
this.marker[this.map.GImgProperty].style.cursor=cursor;
}
}
catch(e){}
},
GetCursor:function()
{
var x=null;
if(this.map.GImgProperty!=null)
x=this.marker[this.map.GImgProperty].style.cursor;
return x;
}
};

/*TripCart.Map.Templates.AirportBalloon.jst*/
TripCart.Map.Templates.AirportBalloon=function (DataSource){var _w = [];
_w.push("<table class='infoTbl'cellspacing='0px'border=0 style='width: 210px;'><tr><td align='left'width='30'><img src='");
_w.push(DataSource.ActivityIcon);
_w.push("'title='");
_w.push(DataSource.AttractionName);
_w.push("'width='30'border='0'/></td><td align='left'width='100%'><span style='font-size:12px; font-weight:bold;color:#00309C;'>");
_w.push(DataSource.AttractionName);
_w.push("</span></td></tr><tr><td colspan='2'align='left'style='font-size:12px;'>");
_w.push(DataSource.ShortDescription);
_w.push("</td></tr><tr><td colspan='2'align='left'class='infoWindowLinks'>");
if(DataSource.Page=="Region"){
_w.push("");
if(DataSource.IsNearByHotelsShown){
_w.push("<a href=\"javascript:void(0);\"style=\"margin-left: 0px; font-size: 12px; font-weight: bold; cursor: text; color: rgb(192, 192, 192); nowrap;\">Nearby Hotels Shown</a>");
}else{
_w.push("<a href='javascript:tcCTRL.Map.Instance.ShowLayer({attractionID:");
_w.push(DataSource.AttractionID);
_w.push(",nearByHotels:true,isAirPort:true});'style='margin-left:0px;font-size:12px;font-weight:bold;nowrap;'>Nearby Hotels</a>");
}
_w.push("");
}
_w.push("</td></tr></table>");
return _w.join('');
};

/*TripCart.Map.Templates.RegionBalloon.jst*/
TripCart.Map.Templates.RegionBalloon=function (DataSource){var _w = [];
_w.push("<table tag='");
_w.push(DataSource.ColumnSeperator + DataSource.regId + DataSource.RowSeperator);
_w.push("'class='infoTbl'cellspacing='0px'border='0'><tr><td>");
if(DataSource.Page=="TripCart"){
_w.push("<a href='usa-regions/");
_w.push(DataSource.RegionFolderName);
_w.push(".aspx");
_w.push(DataSource.RegionPageArg);
_w.push("'onclick='return UpdateAndGo(this)'><img src='");
_w.push(DataSource.imgSrc);
_w.push("_icon_s.jpg'title='Click to explore region'/></a>");
}else{
_w.push("<a href='usa-regions/");
_w.push(DataSource.RegionFolderName);
_w.push(".aspx");
_w.push(DataSource.RegionPageArg);
_w.push("'><img src='");
_w.push(DataSource.imgSrc);
_w.push("_icon_b.jpg'title='Click to explore region'/></a>");
}
_w.push("</td><td><div style='width: 170px; overlay: hidden;'><span style='font-size:12px; font-weight:bold;color:#00309C;'>");
if(DataSource.Page=="TripCart"){
_w.push("<a href='usa-regions/");
_w.push(DataSource.RegionFolderName);
_w.push(".aspx");
_w.push(DataSource.RegionPageArg);
_w.push("'onclick='return UpdateAndGo(this)'>");
_w.push(DataSource.regName);
_w.push("</a>");
}else{
_w.push("<a href='usa-regions/");
_w.push(DataSource.RegionFolderName);
_w.push(".aspx");
_w.push(DataSource.RegionPageArg);
_w.push("'>");
_w.push(DataSource.regName);
_w.push("</a>");
}
_w.push("</span><br/><span style='font-size:12px;'>");
_w.push(DataSource.text);
_w.push("</span></div></td></tr><tr><td colspan='2'class='infoWindowLinks'><table width='100%'border='0'cellspacing='0'cellpadding='0'><tr><td nowrap>");
if(DataSource.Page!="TripCart"){
_w.push("");
if(DataSource.IsAddedToCart){
_w.push("<a id='AddToCartA");
_w.push(DataSource.regId);
_w.push("'href='/MyTripCart.aspx'style='margin-left: 0px;font-size:12px;font-weight:bold;color:#C0C0C0;nowrap;'>Added-View Trip</a>");
}else{
_w.push("<a id='AddToCartA");
_w.push(DataSource.regId);
_w.push("'href='javascript:AddToCartSingle(");
_w.push(DataSource.regId);
_w.push(",AddToCart_CallBack)'style='margin-left: 0px;font-size:12px;font-weight:bold;'>Add To Trip</a>");
}}
_w.push("</td><td nowrap>");
if(DataSource.Page=="TripCart"){
_w.push("<a href='usa-regions/");
_w.push(DataSource.RegionFolderName);
_w.push(".aspx");
_w.push(DataSource.RegionPageArg);
_w.push("'style='font-size:12px;font-weight:bold;'onclick='return UpdateAndGo(this)'>");
_w.push(DataSource.tooltip);
_w.push("</a>");
}else{
_w.push("<a href='usa-regions/");
_w.push(DataSource.RegionFolderName);
_w.push(".aspx");
_w.push(DataSource.RegionPageArg);
_w.push("'style='font-size:12px;font-weight:bold;'>");
_w.push(DataSource.tooltip);
_w.push("</a>");
}
_w.push("</td>");
if(DataSource.Page!="TripCart"){
_w.push("<td align='right'valign='bottom'><a href='usa-regions/");
_w.push(DataSource.RegionFolderName);
_w.push(".aspx");
_w.push(DataSource.RegionPageArg);
_w.push("'><img src='Image1/Buttons/but_more.gif'title='Click to explore region, map, highlights and guide'Style='padding-top:5px'/></a></td>");
}
_w.push("</tr></table></td></tr></table>");
return _w.join('');
};

/*TripCart.Map.Templates.HotelBalloon.jst*/
TripCart.Map.Templates.HotelBalloon=function (DataSource){var _w = [];
_w.push("<table class='infoTbl'cellspacing='0px'style='text-align:left;'border='0'width='220px'><tr><td><table class='infoTbl'cellspacing='0px'style='table-layout: fixed;'><tr><td width='40px'>");
if(DataSource.Page=="Region"){
_w.push("<a href=\"javascript:top.IFrameNAV.RegionGuide.GoTo('");
_w.push(Region.RegionFolderName);
_w.push("','Hotels');\"><img src='");
_w.push(DataSource.ActivityIcon);
_w.push("'align='left'alt=\"image of activity\"/></a>");
}else{
_w.push("<img src='");
_w.push(DataSource.ActivityIcon);
_w.push("'align='left'alt=\"image of activity\"/>");
}
_w.push("</td><td>");
var regionId=0;if(top.Region&&top.Region.RegionID)regionId=top.Region.RegionID;TripCart.AjaxMethods.ProcessAffiliateImpression('hotBal/hot_bal_top/'+DataSource.HotelID+'/'+regionId);
_w.push("<a style='font-size:12px; font-weight:bold;color:#00309C;'href=\"#\"onClick=\"forwardPage('hotBal','hot_bal_top/");
_w.push(DataSource.HotelID);
_w.push("/");
_w.push(regionId);
_w.push("'); return false;\">");
_w.push(DataSource.Name);
_w.push("</a></td></tr></table></td></tr><tr><td><table style='margin-top: 8px;'><tr><td style='font-size:12px;'>");
if(DataSource.LowRate>0&&DataSource.LowRate<60){
_w.push("<span style='margin-left: 20px;font-size:12px;'>Rates from $");
_w.push(Math.floor(DataSource.LowRate));
_w.push("</span>");
}else if(DataSource.LowRate>=60&&DataSource.LowRate<=200){
_w.push("<span style='margin-left: 20px;font-size:12px;'>Rates from $");
_w.push(Math.floor(DataSource.LowRate*0.9));
_w.push("</span>");
}
_w.push("");
if(DataSource.NumberOfRooms>10){
_w.push("<span style='margin-left: 20px;font-size:12px;'>");
_w.push(DataSource.NumberOfRooms);
_w.push("&nbsp;Rooms</span>");
}
_w.push("<br/><table class='facilitiesTbl'cellpadding='0'cellspacing='0'><tr>");
if(DataSource.HasFitnessFacility){
_w.push("<td><img src='/Image1/Hotels/facility0.gif'title='Fitness Equipment'/></td>");
}
_w.push("");
if(DataSource.HasInHouseDining){
_w.push("<td><img src='/Image1/Hotels/facility1.gif'title='Restaurant On-site'/></td>");
}
_w.push("");
if(DataSource.HasHandicapAccessible){
_w.push("<td><img src='/Image1/Hotels/facility2.gif'title='Wheelchair Accessible'/></td>");
}
_w.push("");
if(DataSource.HasPetsAllowed){
_w.push("<td><img src='/Image1/Hotels/facility3.gif'title='Pets Allowed'/></td>");
}
_w.push("");
if(DataSource.HasBusinessCenter){
_w.push("<td><img src='/Image1/Hotels/facility4.gif'title='Business Center'/></td>");
}
_w.push("");
if(DataSource.HasDataPorts){
_w.push("<td><img src='/Image1/Hotels/facility5.gif'title='Data Ports'/></td>");
}
_w.push("");
if(DataSource.HasIndoorPool){
_w.push("<td><img src='/Image1/Hotels/facility6.gif'title='Indoor Pool'/></td>");
}
_w.push("");
if(DataSource.HasOutdoorPool){
_w.push("<td><img src='/Image1/Hotels/facility7.gif'title='Outdoor Pool'/></td>");
}
_w.push("");
if(DataSource.HasFamilyRooms){
_w.push("<td><img src='/Image1/Hotels/facility8.gif'title='Family Rooms'/></td>");
}
_w.push("");
if(DataSource.HasKitchen){
_w.push("<td><img src='/Image1/Hotels/facility9.gif'title='Kitchen or Kitchenette'/></td>");
}
_w.push("</tr></table></td></tr></table></td></tr><tr><td class='infoWindowLinks'style='font-size:12px;font-weight:bold;'>");
var regionId=0;if(top.Region&&top.Region.RegionID)regionId=top.Region.RegionID;TripCart.AjaxMethods.ProcessAffiliateImpression('hotBal/hot_bal_bottom/'+DataSource.HotelID+'/'+regionId);
_w.push("<a style='font-size:12px; font-weight:bold;color:#00309C;'href=\"#\"onClick=\"forwardPage('hotBal','balloon/");
_w.push(DataSource.HotelID);
_w.push("/");
_w.push(regionId);
_w.push("'); return false;\">Hotel Info and Booking</a>");
if(DataSource.Page=="Region"){
_w.push("");
if(DataSource.IsAddedToCart){
_w.push("<div style='margin-top:10px;'name='Hot");
_w.push(DataSource.HotelID);
_w.push("'class='btnAddToTripBkg'onClick='top.location.href=\"/MyTripCart.aspx\" ;return true;'><span style='margin-right:0px;'>Added-View Trip</span></div>");
}else{
_w.push("<div style='margin-top:10px;'name='Hot");
_w.push(DataSource.HotelID);
_w.push("'class='btnAddToTripBkg'onclick=\"javascript:parent.tcCTRL.Cart.Instance.AddHotelsToCart('");
_w.push(DataSource.HotelID);
_w.push("')\">Add To Trip</div>");
}
_w.push("");
}
_w.push("</td></tr></table>");
return _w.join('');
};

/*TripCart.Map.Templates.AttractionBalloonTab1.jst*/
TripCart.Map.Templates.AttractionBalloonTab1=function (DataSource){var _w = [];
_w.push("<table class='infoTbl'cellspacing='0px'cellpadding='0'px style='width: 350px;'><tr><td><table class='infoTbl'cellspacing='0px'cellpadding='0px'><tr><td align='left'width='30'>");
if(DataSource.Page!="TripCart"){
_w.push("<a href=\"javascript:top.IFrameNAV.RegionGuide.GoTo('");
_w.push(DataSource.RegionFolderName);
_w.push("','");
_w.push(DataSource.Interest);
_w.push("');\"><img src='");
_w.push(DataSource.ActivityIcon);
_w.push("'title='Click to go to the ");
_w.push(DataSource.InterestName);
_w.push(" topic'width='30'border='0'/></a>");
}else{
_w.push("<a href='/usa-regions/");
_w.push(DataSource.RegionFolderName);
_w.push(",");
_w.push(DataSource.Interest);
_w.push(".aspx'target=''onclick='return UpdateAndGo(this)'><img src='");
_w.push(DataSource.ActivityIcon);
_w.push("'title='Click to go to the ");
_w.push(DataSource.InterestName);
_w.push(" topic'width='30'border=0' />                       </a>                    ");
}
_w.push("                    </td>                    <td>&nbsp;</td>                    <td align='left' colspan='2' width='100%' oncontextmenu='return false;'>                        ");
if(DataSource.Page == "TripCart"){
_w.push("                        <a style='font-size:12px;font-weight:bold;color:#00309C;' target='' href='/usa-regions/");
_w.push(DataSource.RegionFolderName);
_w.push(".aspx#Attraction||");
_w.push(DataSource.AttractionID);
_w.push("||||||||||||' onclick='return UpdateAndGo(this)'>                            ");
_w.push(DataSource.AttractionName);
_w.push("                        </a>                      ");
}else if (top.TripCart.AttractionPage){
_w.push("                        <a href='/");
_w.push(DataSource.AttractionURLSuffix);
_w.push("' style='font-size:12px;font-weight:bold;color:#00309C;' target='_parent'>                          ");
_w.push(DataSource.AttractionName);
_w.push("                        </a>                        ");
}else{
_w.push("                        <a style='font-size:12px;font-weight:bold;color:#00309C;' href='/");
_w.push(DataSource.AttractionURLSuffix);
_w.push("' target='rightPartGuideIFrame'>                          ");
_w.push(DataSource.AttractionName);
_w.push("                        </a>                        ");
}
_w.push("                    </td>                </tr>            </table>        </td>    </tr>    ");
if (DataSource.Affiliates4BalloonDetails.length > 0){
_w.push("    <tr>        <td>			");
for(var i=0;i < DataSource.Affiliates4BalloonDetails.length;i++){
_w.push("				<br/>				");
TripCart.AjaxMethods.ProcessAffiliateImpression('gen/BalloonDetail/' + DataSource.Affiliates4BalloonDetails[i][2]);
_w.push("				<a href=\"#\" onClick=\"forwardPage('gen','BalloonDetail/");
_w.push(parseInt(DataSource.Affiliates4BalloonDetails[i][2]));
_w.push("'); return false;\"					style='font-size:12px;font-weight:bold;color:Green;margin-left:0px;'>");
_w.push(DataSource.Affiliates4BalloonDetails[i][1]);
_w.push("</a>			");
}
_w.push("        </td>    </tr>    ");
}
_w.push("		<tr height='8px'></tr>    <tr>			<td style='font-size:12px;'>				<table class='infoTbl' border='0' cellspacing='0px' cellpadding='0px'>					<tr>						<td>							<font size='2'>");
_w.push(DataSource.ShortDescription);
_w.push("</font>						</td>					</tr>				</table>			</td>		</tr>	<tr height='8px'></tr>	<tr>			<td>				<table class='infoTbl' border=0 cellspacing='0px' cellpadding='0px' style='font-size:12px;height:30px;'>                <tr>                  ");
if (top.TripCart.AttractionPage){
_w.push("                  <td oncontextmenu='return false;'>										<a href='/");
_w.push(DataSource.AttractionURLSuffix);
_w.push("' target='_parent' style='margin-left:0px;font-size:12px;font-weight:bold;text-decoration:underline;'>											More Info                    </a>                  </td>                  <td width='10px'>&nbsp;</td>                  ");
}else if (top.Region){
_w.push("                  <td oncontextmenu='return false;'>                        <a href='/");
_w.push(DataSource.AttractionURLSuffix);
_w.push("' target='rightPartGuideIFrame' style='margin-left:0px;font-size:12px;font-weight:bold;text-decoration:underline;'>                            More Info                        </a>                    </td>                    <td width=10px>&nbsp;</td>                ");
}
_w.push("                ");
if (DataSource.MapURL != null){
_w.push("                    <td>                        <a href='javascript:;' onclick=\"OpenAttractionMapWindow('");
_w.push(DataSource.MapURL);
_w.push("',350,350);\" style='font-size:12px;font-weight:bold;margin-left:0px;text-decoration:underline;'>                            ");
_w.push(DataSource.MapLinkName);
_w.push("                        </a>                    </td>                    <td width=10px>&nbsp;</td>                ");
}
_w.push("                ");
if (DataSource.Page == "Region"){
_w.push("                    <td nowrap>                    ");
if(DataSource.IsNearByHotelsShown){
_w.push("                        <a href=\"Javascript:void(0);\" style=\"margin-left: 0px; font-size: 12px; font-weight: bold; cursor: text; color: rgb(192, 192, 192);text-decoration:underline;\">Nearby Hotels Shown</a>                    ");
}else{
_w.push("                        <a href='javascript:tcCTRL.Map.Instance.ShowLayer({attractionID:");
_w.push(DataSource.AttractionID);
_w.push(",nearByHotels:true});' style='margin-left:0px;font-size:12px;font-weight:bold;text-decoration:underline;'>Nearby Hotels</a>                    ");
}
_w.push("                    ");
if(DataSource.IsNearByAttractionsShown){
_w.push("	                    <a href=\"Javascript:void(0);\" style=\"margin-left: 8px; font-size: 12px; font-weight: bold; cursor: text; color: rgb(192, 192, 192);text-decoration:underline;\">Nearby Attractions Shown</a>	                ");
}else{
_w.push("	                    <a href='javascript:tcCTRL.Map.Instance.ShowLayer({attractionID:");
_w.push(DataSource.AttractionID);
_w.push("});' style='margin-left:8px;font-size:12px;font-weight:bold;text-decoration:underline;'>Nearby Attractions</a>	                ");
}
_w.push("                    </td>                ");
}
_w.push("								</tr>							<tr height='8px'></tr>				</table>				");
if (DataSource.Page != "TripCart"){
_w.push("				");
if (!DataSource.IsReadOnlyTripCart){
_w.push("				");
if (DataSource.IsAddedToCart){
_w.push("				<a href='/MyTripCart.aspx' target='_parent'>					<div name='Att");
_w.push(DataSource.AttractionID);
_w.push("' class='btnAddToTripBkg' id='btnAddToTrip'>						<span style='margin-right:0px'>							Added - View Trip						</span>					</div>				</a>				");
}else{
_w.push("				<div name='Att");
_w.push(DataSource.AttractionID);
_w.push("' class='btnAddToTripBkg' onclick=\"top.tcCTRL.Cart.Instance.AddAttractionsToCart('");
_w.push(DataSource.AttractionID);
_w.push("')\">Add To Trip</div>");
}
_w.push("");
}
_w.push("");
}
_w.push("</td></tr></table>");
return _w.join('');
};

/*TripCart.Map.Templates.AttractionBalloonTab2.jst*/
TripCart.Map.Templates.AttractionBalloonTab2=function (DataSource){var _w = [];
_w.push("<div>");
if(DataSource.StreetAddress!=null){
_w.push("<div><span class='titleMiddle'style='font-weight:bold;'>Address:&nbsp;</span>");
_w.push(DataSource.StreetAddress);
_w.push("</div>");
if(DataSource.CityName||DataSource.StateName){
_w.push("<div style=\"margin-left:60px;\">");
}
_w.push("");
if(DataSource.CityName){
_w.push("");
_w.push(DataSource.CityName);
_w.push("");
}
_w.push("");
if(DataSource.CityName&&DataSource.StateName){
_w.push(",");
}
_w.push("");
if(DataSource.StateName){
_w.push("");
_w.push(DataSource.StateName);
_w.push("");
}
_w.push("");
if(DataSource.CityName||DataSource.StateName){
_w.push("</div>");
}
_w.push("");
}else if(DataSource.CityName||DataSource.StateName){
_w.push("<div><span class='titleMiddle'style='font-weight:bold;'>Address:&nbsp;</span>");
if(DataSource.CityName){
_w.push("");
_w.push(DataSource.CityName);
_w.push("");
}
_w.push("");
if(DataSource.CityName&&DataSource.StateName){
_w.push(",");
}
_w.push("");
if(DataSource.StateName){
_w.push("");
_w.push(DataSource.StateName);
_w.push("");
}
_w.push("</div>");
}
_w.push("");
if(DataSource.Phone!=null){
_w.push("<div style=\"margin-top:10px;\"><span class='titleMiddle'style='font-weight:bold;'>Tel:&nbsp;</span>");
_w.push(DataSource.Phone);
_w.push("</div>");
}
_w.push("");
if(DataSource.Affiliates4BalloonContact.length>0){
_w.push("");
for(var i=0;i<DataSource.Affiliates4BalloonContact.length;i++){
_w.push("<br/>");
TripCart.AjaxMethods.ProcessAffiliateImpression('gen/BalloonContact/'+DataSource.Affiliates4BalloonContact[i][2]);
_w.push("<a href=\"#\"onClick=\"forwardPage('gen','BalloonContact/");
_w.push(parseInt(DataSource.Affiliates4BalloonContact[i][2]));
_w.push("'); return false;\"style='font-size:12px;font-weight:bold;color:Green;margin-left:0px;'>");
_w.push(DataSource.Affiliates4BalloonContact[i][1]);
_w.push("</a>");
}
_w.push("");
}
_w.push("</div>");
return _w.join('');
};

/*GMap\TCBalloon.js*/
var TCBalloon=function(){
this.initialize.apply(this,arguments);
};
TCBalloon.prototype=
{
imgSrc:null,
regId:null,
regName:null,
text:"",
RegionFolderName:null,
RegionPageArg:"",
IsReadOnlyTripCart:null,
tooltip:null,
Page:"",
ColumnSeperator:'|',
RowSeperator:'^',
ObjectSeperator:'~',
ShortDescription:"",
AttractionName:"",
AttractionID:"",
IsMoreInfo:"",
ActivityType:"",
Long:"",
Lat:"",
htmlTxt:"",
IsReadOnlyTripCart:false,
IsAddedToCart:null,
ActivityIcon:null,
MapURL:null,
AverageReviewRating:0,
TotalReviews:0,
TotalPhotos:0,
StreetAddress:null,
Phone:null,
Affiliates4BalloonDetails:[],
Affiliates4BalloonContact:[],
initialize:function(data)
{
this.ExtendBalloonObject(data);
},
ExtendBalloonObject:function(SrcObj)
{
for(var property in SrcObj)
{
if(SrcObj[property]=="$RESET$")
this[property]=null;
else
this[property]=SrcObj[property]||this[property];
}
},
SetRegionBalloonHTML:function()
{
this.htmlTxt=TripCart.Map.Templates.RegionBalloon(this);
},
SetAirportBalloonHTML:function()
{
this.htmlTxt=TripCart.Map.Templates.AirportBalloon(this);
},
SetAttractionTab2:function()
{
if(this.StreetAddress||this.Phone||this.City||this.State)
{
return TripCart.Map.Templates.AttractionBalloonTab2(this);
}
},
SetAttractionTab1:function()
{
this.Interest=JSHashes.ActivityTypeToInterest[this.ActivityType];
this.InterestName=JSHashes.InterestToInterestName[this.Interest];
return TripCart.Map.Templates.AttractionBalloonTab1(this);
},
SetAttractionBalloonHTML:function()
{
var Tab2=this.SetAttractionTab2();
var Tab1=this.SetAttractionTab1();
this.htmlTxt=Tab2!=null?{"Detail":Tab1,"Contact Info":Tab2}:Tab1;
},
SetHotelBalloonHTML:function()
{
this.htmlTxt=TripCart.Map.Templates.HotelBalloon(this);
},
GetHtml:function()
{
return this.htmlTxt;
},
SetHtml:function(htmlTxt)
{
this.htmlTxt=htmlTxt;
}
};

/*GMap\TCIcon.js*/
var TCIcon=function(){
this.initialize.apply(this,arguments);
};
TCIcon.prototype=
{
Naming:
{
"MapMarkers":{"BasePath":SitePath+"/Image1/MapMarkers/","Extension":".png"},
"Labels":{"BasePath":SitePath+"/Image1/MapMarkers/","Extension":".png"},
"RegionIcons":{"BasePath":SitePath+"/Image1/RegionIcons/","Extension":".png"},
"Anchors":{"BasePath":SitePath+"/Image1/MapMarkers/","Extension":".png"},
"ActivityIcons":{"BasePath":SitePath+"/Image1/ActivityIcons/","Extension":".png"},
"Airport":{"BasePath":SitePath+"/Image1/ActivityIcons/","Extension":".png"}
},
imageURL:null,
shadowURL:null,
iconSizeWidth:null,
iconSizeHeight:null,
iconAnchorX:null,
iconAnchorY:null,
infoWindowAnchorX:null,
infoWindowAnchorY:null,
shadowSizeWidth:null,
shadowSizeHeight:null,
icon:null,
initialize:function(IconCategory,iconFileName,height,width)
{
if(IconCategory)
{
switch(IconCategory)
{
case"MapMarkers":
this.imageURL=this.Naming.MapMarkers.BasePath+iconFileName+this.Naming.MapMarkers.Extension;
this.shadowURL=null;
this.iconSizeWidth=22;
this.iconSizeHeight=22;
this.iconAnchorX=10;
this.iconAnchorY=10;
this.infoWindowAnchorX=10;
this.infoWindowAnchorY=10;
this.shadowSizeWidth=null;
this.shadowSizeHeight=null;
break;
case"Anchors":
this.imageURL=this.Naming.Anchors.BasePath+iconFileName+this.Naming.Anchors.Extension;
this.shadowURL=this.Naming.Anchors.BasePath+iconFileName+"_shadow"+this.Naming.Anchors.Extension;
this.iconSizeWidth=22;
this.iconSizeHeight=28;
this.iconAnchorX=16;
this.iconAnchorY=23;
this.infoWindowAnchorX=10;
this.infoWindowAnchorY=10;
this.shadowSizeWidth=37;
this.shadowSizeHeight=28;
break;
case"Labels":
this.imageURL=this.Naming.Labels.BasePath+iconFileName+this.Naming.Labels.Extension;
this.shadowURL=null;
this.iconSizeWidth=80;
this.iconSizeHeight=35;
this.iconAnchorX=10;
this.iconAnchorY=10;
this.infoWindowAnchorX=10;
this.infoWindowAnchorY=10;
this.shadowSizeWidth=null;
this.shadowSizeHeight=null;
break;
case"RegionIcons":
this.imageURL=this.Naming.RegionIcons.BasePath+iconFileName+"_icon_s"+this.Naming.RegionIcons.Extension;
this.shadowURL=null;
this.iconSizeWidth=31;
this.iconSizeHeight=26;
this.iconAnchorX=10;
this.iconAnchorY=30;
this.infoWindowAnchorX=10;
this.infoWindowAnchorY=10;
this.shadowSizeWidth=null;
this.shadowSizeHeight=null;
break;
case"ActivityIcons":
this.imageURL=this.Naming.ActivityIcons.BasePath+iconFileName+this.Naming.ActivityIcons.Extension;
this.shadowURL=this.Naming.ActivityIcons.BasePath+"act_shadow"+this.Naming.ActivityIcons.Extension;
this.iconSizeWidth=21;
this.iconSizeHeight=29;
this.iconAnchorX=10;
this.iconAnchorY=30;
this.infoWindowAnchorX=10;
this.infoWindowAnchorY=10;
this.shadowSizeWidth=34;
this.shadowSizeHeight=29;
break;
case"Airport":
this.imageURL=this.Naming.Airport.BasePath+iconFileName+this.Naming.Airport.Extension;
this.shadowURL=null;
this.iconSizeWidth=21;
this.iconSizeHeight=29;
this.iconAnchorX=10;
this.iconAnchorY=30;
this.infoWindowAnchorX=10;
this.infoWindowAnchorY=10;
this.shadowSizeWidth=null;
this.shadowSizeHeight=null;
break;
}
}
else if(width&&height)
{
this.imageURL=iconFileName;
this.shadowURL=null;
this.iconSizeWidth=width;
this.iconSizeHeight=height;
this.iconAnchorX=10;
this.iconAnchorY=29;
this.infoWindowAnchorX=10;
this.infoWindowAnchorY=29;
this.shadowSizeWidth=34;
this.shadowSizeHeight=29;
}
this.icon=new GIcon();
this.icon.image=this.imageURL;
this.icon.iconSize=new GSize(this.iconSizeWidth,this.iconSizeHeight);
this.icon.iconAnchor=new GPoint(this.iconAnchorX,this.iconAnchorY);
this.icon.infoWindowAnchor=new GPoint(this.infoWindowAnchorX,this.infoWindowAnchorY);
if(this.shadowURL)
{
this.icon.shadow=this.shadowURL;
this.icon.shadowSize=new GSize(this.shadowSizeWidth,this.shadowSizeHeight);
}
},
GetIcon:function()
{
return this.icon;
}
};

/*GMap\TCPoiCollection.js*/
var BULK_SIZE=10;
var MAX_Z_INDEX_INIT_VALUE=1000;
var maxZIndex=MAX_Z_INDEX_INIT_VALUE;
var TCPoiCollection=function(){
this.initialize.apply(this,arguments);
};
TCPoiCollection.prototype=
{
length:null,
map:null,
hashPOIKeys:null,
hashPOIType:null,
initialize:function(map)
{
this.New(map);
},
New:function(map)
{
this.map=map;
this.hashPOIKeys=new TCHash();
this.hashPOIType=new TCHash();
},
GetUniqueKey:function(type,id)
{
return type+"_"+id;
},
Has:function(type,id)
{
var key=this.GetUniqueKey(type,id);
if(this.hashPOIKeys.hasItem(key))
return true;
else
return false;
},
HasType:function(type)
{
return this.GetPOIListByType(type)!=null;
},
Add:function(type,id,poi)
{
var key=this.GetUniqueKey(type,id);
if(!this.Has(type,id))
{
poi.id=id;
poi.type=type;
this.hashPOIKeys.setItem(key,poi);
var hashType=null;
if(this.hashPOIType.items[type]==null)
{
hashType=new TCHash();
this.hashPOIType.setItem(type,hashType);
}
else
{
hashType=this.hashPOIType.getItem(type);
}
hashType.setItem(id,key);
this.length++;
}
},
Remove:function(type,id)
{
var key=this.GetUniqueKey(type,id);
if(this.Has(type,id))
{
var poi=this.GetPOIByIdentifiers(type,id);
poi.id=null;
poi.type=null;
this.hashPOIKeys.removeItem(key);
var hashType=this.hashPOIType.items[type];
hashType.removeItem(id);
this.length--;
}
else
throw"Poi not in collection";
},
RemoveByType:function(type)
{
var arr_poi=this.GetPOIListByType(type);
if(arr_poi)
{
for(var i=0;i<arr_poi.length;i++)
{
this.Remove(arr_poi[i].type,arr_poi[i].id);
}
}
},
GetPOIListByType:function(type)
{
var arr_poi=null;
var hashType=this.hashPOIType.items[type];
if(hashType&&hashType.items.length>0)
{
arr_poi=new Array();
for(var j in hashType.items)
{
if(typeof hashType.items[j]=="function")continue;
var poi=this.GetPOIByIdentifiers(type,j);
arr_poi.push(poi);
}
}
return arr_poi;
},
GetPOIListByID:function(id)
{
var arr_poi=new Array();
for(var type in this.hashPOIType.items)
{
if(this.hashPOIType.items[type]!=null&&this.hashPOIType.items[type].length>0)
{
var poi=this.GetPOIByIdentifiers(type,id);
if(poi)
arr_poi.push(poi);
}
}
if(arr_poi.length>0)
{
return arr_poi;
}
else
{
return null;
}
},
GetPOIList:function()
{
var arr_poi=null;
arr_poi=new Array();
for(var j in this.hashPOIKeys.items)
{
if(typeof this.hashPOIKeys.items[j]=="function")continue;
var poi=this.hashPOIKeys.getItem(j);
arr_poi.push(poi);
}
return arr_poi;
},
ShowPOIByID:function(id)
{
var pois=this.GetPOIListByID(id);
if(pois)
pois[0].OpenBalloon(null,null,false,false);
},
ShowPOITooltipByID:function(id)
{
var pois=this.GetPOIListByID(id);
if(pois)
pois[0].tooltip.ShowTooltip();
},
HidePOITooltipByID:function(id)
{
var pois=this.GetPOIListByID(id);
if(pois)
pois[0].tooltip.HideTooltip();
},
HidePOIByID:function(id)
{
var pois=this.GetPOIListByID(id);
if(pois)
pois[0].Hide();
},
ShowPOIListByType:function(type,zIndex)
{
var arr_poi=this.GetPOIListByType(type);
if(arr_poi)
{
showPOIList_InProgress=true;
window.setTimeout(function(){ShowPOIListByTypeTimeOut(arr_poi,zIndex,0)},1);
}
else
showPOIList_InProgress=false;
if(top.TripCart.Global)
{
top.TripCart.Global.Events.Fire("OnMapLayerAdded_"+type);
}
},
HidePOIListByType:function(type)
{
if(showPOIList_InProgress)
{
return false;
}
var arr_poi=this.GetPOIListByType(type);
if(arr_poi)
{
for(var i=0;i<arr_poi.length;i++)
{
arr_poi[i].Hide();
}
}
if(top.TripCart.Global)
{
top.TripCart.Global.Events.Fire("OnMapLayerRemoved_"+type);
}
return true;
},
GetPOIByIdentifiers:function(type,id)
{
var key=this.GetUniqueKey(type,id);
if(this.hashPOIKeys.items[key]!=null)
return this.hashPOIKeys.items[key];
else
return null;
},
ShowPOIByIdentifiers:function(type,id,zIndex)
{
var poi=this.GetPOIByIdentifiers(type,id);
poi.Show(zIndex);
},
HidePOIByIdentifiers:function(type,id)
{
var poi=GetPOIByIdentifiers(type,id);
poi.Hide();
},
IsIdInCollection:function(id)
{
for(var type in this.hashPOIType.items)
{
if(this.hashPOIType.items[type]!=null&&this.hashPOIType.items[type].length>0)
{
var poi=this.GetPOIByIdentifiers(type,id);
if(poi)
return true;
}
}
return false;
},
Clear:function()
{
this.length=0;
this.hashPOIKeys=new TCHash();
this.hashPOIType=new TCHash();
}
};
function ShowPOIListByTypeTimeOut(arr_poi,zIndex,i)
{
var indexLimit;
if(arr_poi.length-i<BULK_SIZE)
indexLimit=arr_poi.length;
else
indexLimit=BULK_SIZE+i;
if(!zIndex)
zIndex=++maxZIndex;
for(var j=i;j<indexLimit;j++)
{
showPOIList_InProgress=true;
arr_poi[i].Show(zIndex);
i++;
}
if(arr_poi.length<=i)
showPOIList_InProgress=false;
else
window.setTimeout(function(){ShowPOIListByTypeTimeOut(arr_poi,zIndex,i)},1);
}
/*tripCart2.js*/
var sortBy;
var justClosed;
var enterTime=0;
var interval=null;
var openDialog=null;
function toggleElement(rowid)
{
var childcontainer=document.getElementById('r_ch'+rowid);
var img=document.getElementById('r_im'+rowid);
if(childcontainer&&img)
{
if(childcontainer.style.display=="none")
{
childcontainer.style.display="";
img.src="Image1/Tree/minusW.gif";
}
else
{
childcontainer.style.display="none";
img.src="Image1/Tree/plusW.gif";
justClosed=true;
}
}
resizeRegionSort();
}
function openSubmenu(rowid)
{
var childcontainer=document.getElementById(sortBy+'_ch'+rowid);
if(childcontainer!=null)
{
if(childcontainer.style.display=="none"&&!justClosed)
{
toggleElement(rowid);
}
justClosed=false;
}
}
function togleCheckBox(rowid,switchFlag,isGroupingItem)
{
var itemType;
var oldSortBy=sortBy;
var object=document.getElementById(sortBy+'_chb'+rowid);
try
{
itemType=object.itemType;
}catch(e){}
if(itemType=="Region")
{
oldSortBy=sortBy;
sortBy="r";
object=document.getElementById(sortBy+'_chb'+rowid);
}
var childcontainer=document.getElementById(sortBy+'_ch'+rowid);
switch(switchFlag)
{
case"0":
if(object.checked)
switchFlag='1';
else
switchFlag='2';
break;
case"1":
object.checked=true;
break;
case"2":
object.checked=false;
break;
}
if(object.value!='no'){
var name=object.name;
var sameNames=document.getElementsByName(name);
for(i=0;i<sameNames.length;++i){
sameNames[i].checked=object.checked;
}
}
if((childcontainer!=null&&isGroupingItem==1)||itemType=="Region")
{
var i=0;
for(var i=0;i<childcontainer.getElementsByTagName("Input").length;i++)
{
togleCheckBox(childcontainer.getElementsByTagName("Input")[i].id.substr(5),switchFlag);
}
}
sortBy=oldSortBy;
}
function resizeRegionSort()
{
var regionSort_inner=document.getElementById('regionSort_inner');
var regionSort=document.getElementById('regionSort');
var regionTblHeader=document.getElementById('regionTblHeader');
var regionSort_innerScroll=document.getElementById('regionSort_innerScroll');
if(!regionSort||!regionSort_inner||!regionTblHeader)return;
if((regionSort_innerScroll.offsetHeight+20)>regionSort.offsetHeight){
regionSort_innerScroll.style.width=regionSort.offsetWidth-20+"px";
regionTblHeader.style.width=regionSort.offsetWidth-20+"px";
}else{
regionSort_innerScroll.style.width=regionSort.offsetWidth+"px";
regionTblHeader.style.width=regionSort.offsetWidth+"px";
}
}
function checkUncheckAll(Obj)
{
var CheckBoxesNumber=document.getElementsByName('a_chb0').value;
var sel=currentCheckBox.checked;
for(i=0;i<allCheckBoxes.length;++i){
if((allCheckBoxes[i].parentNode.parentNode.style.display!="none")||(sortBy=="r"))
{
allCheckBoxes[i].checked=sel;
}
}
}
function deleteRows(chbArray)
{
var rowIds=new Array();
for(k=0;k<chbArray.length;++k){
var curChB=chbArray[k];
var curDelRow=chbArray[k].parentNode.parentNode;
var rowParent=curDelRow.parentNode;
rowIds[k]=curDelRow.id;
num=rowParent.rows.length;
}
for(k=0;k<rowIds.length;++k){
var curDelRow=document.getElementById(rowIds[k]);
var rowParent=curDelRow.parentNode;
var aa=rowParent.removeChild(curDelRow);
}
}
function RemoveTripItems(rowid,deletedRegions,deletedAttractions,deletedRegionsItems,deletedAttractionsItems)
{
var curRow;
var chbObject,childcontainer;
var i=0;
var flagChild=false,upperLevel=false,flagAllChilds=false;
var geographySortTbl;
var attrSortTbl=document.getElementById('attrSortTbl');
var allSameRow,allChb;
if(!rowid)
{
rowid="";
upperLevel=true;
geographySortTbl=document.getElementById('geographySortTbl');
var deletedRegions=new Array();
var deletedAttractions=new Array();
var deletedRegionsItems=new Array();
var deletedAttractionsItems=new Array();
}else{
geographySortTbl=document.getElementById('r_chTbl'+rowid);
}
for(i=1;i<geographySortTbl.rows.length;++i){
curRow=geographySortTbl.rows[i];
if(curRow.id.substr(2,1)=='c'){
continue;
}
rowid=curRow.id.substr(3);
chbObject=document.getElementById('r_chb'+rowid);
childcontainer=document.getElementById('r_ch'+rowid);
if(chbObject){
allChb=document.getElementsByName(chbObject.name);
}
if(childcontainer)
{
if(chbObject.checked)
{
var childTbl=document.getElementById('r_chTbl'+rowid);
if(childTbl){
if(childTbl.rows.length>1){
var message="Removing a Region also removes its attraction from your trip.\nDo you want to continue?";
var OK=confirm(message);
if(!OK)continue;
}
}
}
flagChild=RemoveTripItems(rowid,deletedRegions,deletedAttractions,deletedRegionsItems,deletedAttractionsItems);
if(chbObject.checked)
{
if(flagChild)
{
chbObject.checked=false;
flagChild=true;
}else{
deletedRegions.push(chbObject.name);
if(chbObject.ItemID!=-1)
deletedRegionsItems.push(chbObject.ItemID);
deleteRows(allChb);
--i;
--TotalRegionsValue;
try
{
var currentRegions=i;
if(i<=1)
sRegion=' Region, '+i;
else if(i>1)
sRegion=' Regions, '+i;
var sRegion,sAttraction;
if(deletedAttractions.length<=0)
sAttraction=' Attraction';
else if(deletedAttractions.length>0)
sAttraction=' Attractions';
sAttraction=deletedAttractions.length+sAttraction;
document.getElementById('NavigationBarTotal2').innerHTML="Total Items: "+sRegion+sAttraction;
TotalRegions--;
var sRegion,sAttraction;
if(TotalRegions<=1)
sRegion=TotalRegions+' Region, ';
else if(TotalRegions>1)
sRegion=TotalRegions+' Regions, ';
if(TotalAttractions<=1)
sAttraction=TotalAttractions+' Attraction';
else if(TotalAttractions>1)
sAttraction=TotalAttractions+' Attractions';
document.getElementById('NavigationBarTotal2').innerHTML="Total Items: "+sRegion+sAttraction;
}catch(e){}
}
}
}
else
{
if(chbObject.checked)
{
deletedAttractions.push(chbObject.name);
deletedAttractionsItems.push(chbObject.ItemID);
deleteRows(allChb);
--i;
--CurrPage;
--TotalItems;
document.getElementById('NavigationBarTotal').innerHTML=TotalItems;
TotalAttractions--;
var sRegion,sAttraction;
if(TotalRegions<=1)
sRegion=TotalRegions+' Region, ';
else if(TotalRegions>1)
sRegion=TotalRegions+' Regions, ';
if(TotalAttractions<=1)
sAttraction=TotalAttractions+' Attraction';
else if(TotalAttractions>1)
sAttraction=TotalAttractions+' Attractions';
document.getElementById('NavigationBarTotal2').innerHTML="Total Items: "+sRegion+sAttraction;
NavigationBarNext(false);
}
else
flagChild=true;
}
if(flagChild)
flagAllChilds=flagChild;
}
if(upperLevel)
{
TripCart.AjaxMethods.RemoveItemsFromCart(deletedRegions,deletedAttractions,'','');
RemoveItemsFromCart(deletedRegionsItems,deletedAttractionsItems,'');
return;
}
else
return flagAllChilds;
}
function toggleTabs(opt)
{
try
{
TripCar.Controls.Map.Instance.Map.CloseInfoWindow();
}
catch(e){}
var tabs=document.getElementById('tabsTbl');
var MapTab=document.getElementById('MapTab');
var ItineraryTab=document.getElementById('ItineraryTab');
var DairyTab=document.getElementById('DairyTab');
var mapDiv=document.getElementById('mapDiv');
var dairyDiv=document.getElementById('dairyDiv');
if(!tabs||!MapTab||!ItineraryTab||!DairyTab||!mapDiv||!dairyDiv)return;
var withScroll=document.getElementById('withScroll');
var addedSortTblHeader=document.getElementById('addedSortTblHeader');
var shortWidth=tabs.offsetWidth-7;
switch(opt){
case"Map":
tabs.style.backgroundImage="url(Image1/tripCart_2_3_tab.gif)";
togleNotes(false);
MapTab.style.display="";
ItineraryTab.style.display="none";
DairyTab.style.display="none";
mapDiv.style.visibility="visible";
dairyDiv.style.visibility="hidden";
try{withScroll.style.width=shortWidth+"px";
addedSortTblHeader.style.width=shortWidth-20+"px";
window.frames[1].showColumns();
window.frames[1].hideColumns();
}
catch(e){}
break;
case"Itinerary":
tabs.style.backgroundImage="url(Image1/tripCart_1_3_tab.gif)";
togleNotes(true);
MapTab.style.display="none";
ItineraryTab.style.display="";
DairyTab.style.display="none";
mapDiv.style.visibility="hidden";
dairyDiv.style.visibility="hidden";
try
{
withScroll.style.width="950px";
addedSortTblHeader.style.width="930px";
window.frames[1].showColumns();
}
catch(e){}
break;
case"Dairy":
tabs.style.backgroundImage="url(Image1/tripCart_3_3_tab.gif)";
togleNotes(false);
MapTab.style.display="none";
ItineraryTab.style.display="none";
DairyTab.style.display="";
mapDiv.style.visibility="hidden";
dairyDiv.style.visibility="visible";
try
{
withScroll.style.width=shortWidth+"px";
addedSortTblHeader.style.width=shortWidth-20+"px";
dairyDiv.getElementsByTagName("textarea")[0].style.display="block";
dairyDiv.getElementsByTagName("textarea")[0].focus();
}
catch(e){}
break;
}
}
function changeHeight(taID,flag)
{
if(!flag)
return;
var obj=document.getElementById(taID);
if(!obj)
return;
var objHeight=obj.scrollHeight;
if(objHeight<20){
objHeight=20;
obj.style.overflow="visible";
}else if(objHeight>50){
objHeight=50;
obj.style.overflow="auto";
}else{
obj.style.overflow="visible";
}
obj.style.height=objHeight+"px";
}
function togleNotes(flag)
{
var allNotes=document.getElementsByTagName('textarea');
for(i=0;i<allNotes.length;++i){
if(flag){
allNotes[i].style.display="";
}else{
allNotes[i].style.display="none";
}
}
}
function UpdateDiary(diaryObj)
{
TripCart.AjaxMethods.UpdateTripCartDiary(diaryObj.value,UpdateDiary_CallBack);
}
function UpdateDiary_CallBack(response)
{
if(response.error!=null)
{
}
}
function loadIF()
{
var withScroll=document.getElementById('withScroll');
var addedSortTblHeader=document.getElementById('addedSortTblHeader');
var tabs=window.frameElement.parentNode.ownerDocument.getElementById('tabsTbl');
var ItineraryTab=window.frameElement.parentNode.ownerDocument.getElementById('ItineraryTab');
var shortWidth=tabs.offsetWidth-7;
if(!tabs.offsetWidth||tabs.offsetWidth<100)return;
if(ItineraryTab.style.display=="none"){
withScroll.style.width=shortWidth+"px";
addedSortTblHeader.style.width=shortWidth-20+"px";
hideColumns();
}else{
try
{
withScroll.style.width="950px";
addedSortTblHeader.style.width="930px";
hideColumns();
showColumns();
}
catch(e){}
}
var iFrameCont=window.frameElement;
var parentDoc;
if(iFrameCont){
parentDoc=iFrameCont.parentNode.ownerDocument;
}else{
parentDoc=document;
}
var tripDlg=parentDoc.getElementById('tripDlg');
parentDoc.onclick=function(ev){
var el;
if(ev){
el=ev.target;
}else{
if(window.event){
el=window.event.srcElement;
}else{
if(parentDoc.parentWindow.window.event)
el==parentDoc.parentWindow.window.event.srcElement;
}
}
for(;el!=null&&el!=tripDlg;el=el.parentNode);
if(el==null){
closeReminderDlg();
}
}
}
function NewTrip(tripName)
{
document.getElementById('_ctl0_ContentPlaceHolder1_TripItems1_UpdateButton').click();
(function(){
document.getElementById("NewTripDiv").getElementsByTagName("input")[0].value=tripName;
document.location=document.getElementById("NewTripDiv").getElementsByTagName("a")[0].href;
}).delay(1000);
}
function openModalDialog(dlgName)
{
switch(dlgName)
{
case"renameTripDlg":
new Dialog("TCDialogs/RenameTrip.html");
case'newTripDlg':
new Dialog("TCDialogs/NewTrip.html");
}
}
function startBlink()
{
enterTime=0;
interval=setInterval(makeBlink,300);
}
function makeBlink()
{
var tripDlg=document.getElementById('tripDlg');
if(enterTime>=2){
clearInterval(interval);
tripDlg.style.backgroundColor="#FFFFFF";
try{openDialog.getElementsByTagName('input')[0].focus();}
catch(e){}
return;
}
if(enterTime%2==0){
tripDlg.style.backgroundColor="#D3CEDD";
enterTime++;
}else{
tripDlg.style.backgroundColor="#FFFFFF";
enterTime++;
}
}
function hideDiv(id){
var div=document.getElementById(id);
if(div==null)
{
div=document.getElementById(id);
}else{
document.onclick="";
}
div.style.display="none";
}
function openReminderDlg()
{
if(top.UserID)return;
var iFrameCont=window.frameElement;
var el,parentDoc,frameDoc;
if(iFrameCont){
el=iFrameCont.parentNode;
parentDoc=el.ownerDocument;
frameDoc=document;
}else{
parentDoc=document;
frameDoc=document;
}
var mydialog=new(parentDoc.defaultView||parentDoc.parentWindow).Dialog(top.SitePath+"/SignInV2.aspx",true);
top.TripCart.Global.Background.Show();
mydialog.setBackground();
var firstTime=true;
try
{
if(parentDoc.onclick!=""&&parentDoc.onclick&&firstTime){
parentDoc.onclick="";
}
}catch(e){}
parentDoc.onclick=function(ev){
var el;
if(ev){
el=ev.target;
}else if(window.ie){
if(window.event){
el=window.event.srcElement;
}else{
if(parentDoc.parentWindow.event)
el=parentDoc.parentWindow.event.srcElement;
}
}
if(parentDoc.defaultView)
{
dialogEl=parentDoc.defaultView.CurrentDialog?parentDoc.defaultView.CurrentDialog.element:null;
}
else if(parentDoc.parentWindow)
{
dialogEl=parentDoc.parentWindow.CurrentDialog?parentDoc.parentWindow.CurrentDialog.element:null;
}
for(;el!=null&&el!=dialogEl;el=el.parentNode);
if(el==null&&!firstTime){
closeReminderDlg();
}else{
firstTime=false;
}
};
openDialog=null;
}
function closeReminderDlg()
{
var iFrameCont=window.frameElement;
var el,parentDoc,frameDoc;
if(iFrameCont){
el=iFrameCont.parentNode;
parentDoc=el.ownerDocument;
frameDoc=document;
}else{
parentDoc=document;
frameDoc=document;
}
parentDoc.onclick="";
frameDoc.onclick=function(){
var iFrameCont=window.frameElement;
if(iFrameCont){
if(iFrameCont.parentNode.ownerDocument.onclick)
iFrameCont.parentNode.ownerDocument.onclick();
}
};
try{
(parentDoc.defaultView||document.parentWindow).CurrentDialog.close();
top.TripCart.Global.Background.Hide();
}catch(e){};
}
function RenameTripTCModal(tripName)
{
if(tripName!="")
{
var selElement=GetElementsByAttributes("select","triplist")[0];
var selectedElement=selElement.options[selElement.selectedIndex];
var tripID=selectedElement.value;
var response=TripCart.AjaxMethods.UpdateTripCartName_FromMyTripCart(tripID,tripName);
if(response.value==null)
{
selectedElement.innerHTML=tripName;
CurrentDialog.close();
return true;
}
}
return false;
}
function EnterClickNew(event)
{
if(!DisableEnterSubmit(event))
{
var elements=document.getElementById("newTripDlg").getElementsByTagName("input");
for(var i=0;i<elements.length;i++)
{
if(elements[i].getAttribute("value")=="OK")
{
elements[i].click();
return false;
}
}
return false;
}
else{return true;}
}
function CheckLength(TargetObject,MaxLength)
{
LenString=TargetObject.value.length;
if(LenString>MaxLength)
{
TargetObject.value=TargetObject.value.substring(0,MaxLength);
}
}
function CloseInfoDlg()
{
try{GetElementByAttrValue("div","name","infoDlg").style.display="none";}
catch(e){}
}
function UpdateAndGo(link)
{
var element=document.getElementById("hidGotoPage");
element.value=link.href;
document.__doPostBack('_ctl0_ContentPlaceHolder1_TripItems1_UpdateButton','');
return false;
}
/*TripCartMAP.js*/
var HOTEL="Hotels";
var ATTRACTION="Attractions";
var REGION="Regions";
var onLayerShowHandler=null;
function ZoomMapToPOIS()
{
var TripPOIList=tcCTRL.Map.Instance.PoiCollection;
var map=tcCTRL.Map.Instance.Map;
if(TripPOIList.length==0)
map.CenterAndZoomOnBounds(minX,minY,maxX,maxY);
else
{
if(TripPOIList.length==1)
{
if(TripPOIList.GetPOIList()[0].type==REGION)
map.ZoomToPOIList(TripPOIList.GetPOIList(),8);
else
map.ZoomToPOIList(TripPOIList.GetPOIList(),4);
}
else
map.ZoomToPOIList(TripPOIList.GetPOIList());
}
tcCTRL.Map.Instance.removeEvent(onLayerShowHandler);
}
function DisplayAttractionBalloonFromMenu(attractionID)
{
parent.toggleTabs('Map');
tcCTRL.Map.Instance.ShowItem({attractionID:attractionID});
}
function DisplayRegionBalloonFromMenu(regionID)
{
parent.toggleTabs('Map');
tcCTRL.Map.Instance.ShowItem({regionID:regionID});
}
function DisplayHotelBalloonFromMenu(hotelID)
{
parent.toggleTabs('Map');
tcCTRL.Map.Instance.ShowItem({hotelID:hotelID});
}
function RemoveItemsFromCart(deletedRegions,deletedAttractions,deletedRoutes,deletedHotels)
{
RemoveFromMap(deletedRegions);
RemoveFromMap(deletedAttractions);
RemoveFromMap(deletedHotels);
if(tcCTRL.Map.Instance.Map)
{
tcCTRL.Map.Instance.Map.CloseInfoWindow();
}
}
function RemoveFromMap(ItemsToDelete)
{
try
{
ItemsToDelete.split(',').each(function(id)
{
tcCTRL.Map.Instance.PoiCollection.HidePOIByID(id.toInt());
});
}
catch(e){}
}
function CheckForItemID(POIHash,ID)
{
var Arr=POIHash.split(",");
for(i=0;i<Arr.length;i++)
{
if(Arr[i]==ID)
{return true;}
}
return false;
}

/*TripCart.MyTripCart.js*/
function UnLoad()
{
try
{
var tableIFrame_in=document.getElementById("tableIFrame").getElementsByTagName("iframe")[0];
tableIFrame_in.contentWindow.document.AutoSave();
}catch(e){}
}
function SetPrintView(count)
{
var btnPrintView=document.getElementById(btnPrintviewID);
if(count<=0)
{
btnPrintView.disabled=true;
btnPrintView.className="printViewDisabled";
btnPrintView.href="javascript:void(0)";
btnPrintView.removeAttribute("target");
}
}
function GoToPage(LinkTo)
{
parent.tableIFrame_in.document.getElementById("hidGotoPage").value=LinkTo;
parent.tableIFrame_in.__doPostBack('_ctl0_ContentPlaceHolder1_TripItems1_UpdateButton','');
}
function UnLoad(){}
/*TripCart.Map.Data.js*/
provide("TripCart.Map.Data");
TripCart.Map.Data=
{
PopulatePoiCollectionFromResponse:function(response)
{
var self=TripCart.Map.Data;
var Model=self.Model;
if(response.error!=null&&response.error.Type!="ConnectFailure")
{
alert(response.error.Type+","+response.error.Message);
return;
}
var pois=eval(response.value);
pois.each(function(responsePoi)
{
if((responsePoi.RegionID&&response.context.showRegions)||(!responsePoi.RegionID))
{
self.buildTCPOIFromResponsePOI(responsePoi,response.context.layerName);
}
});
if(response.context.onComplete)
response.context.onComplete(response.context);
},
buildTCPOIFromResponsePOI:function(responsePoi,layerName)
{
var self=TripCart.Map.Data;
var poi;
responsePoi.Page=tcCTRL.Map.Instance.Page;
if(responsePoi.RegionFolderName)responsePoi.RegionFolderName=responsePoi.RegionFolderName;
if(responsePoi.RegionID)
{
poi=self.buildRegionPOI(responsePoi);
}
else if(responsePoi.HotelID)
{
poi=self.buildHotelPOI(responsePoi);
}
else
{
poi=self.buildAttractionPOI(responsePoi);
}
tcCTRL.Map.Instance.PoiCollection.Add(layerName,poi.id,poi);
},
buildAttractionPOI:function(responsePoi)
{
var icon;
var self=TripCart.Map.Data;
var type=responsePoi.ActivityType;
if(type=="Airport")
{
icon=new TCIcon("Airport",IconFileNames[type]);
responsePoi.ActivityIcon=icon.Naming.Airport.BasePath+IconFileNames.Airport+".gif";
}
else
{
icon=new TCIcon("ActivityIcons",IconFileNames[type]);
responsePoi.ActivityIcon=icon.Naming.ActivityIcons.BasePath+IconFileNames[type]+".gif";
}
responsePoi.IsAddedToCart=parent.tcCTRL.Cart.Instance.IsAttractionInCart(responsePoi.AttractionID);
var balloon=new TCBalloon(responsePoi);
var poi=new TCPoi(responsePoi.Lat,responsePoi.Long,icon,balloon,responsePoi.AttractionName,null,null,null,null,tcCTRL.Map.Instance.Map);
poi.id=responsePoi.AttractionID;
return poi;
},
buildRegionPOI:function(responsePoi)
{
var icon=new TCIcon("RegionIcons",responsePoi.RegionCode);
var data={
regId:responsePoi.RegionID,
RegionFolderName:responsePoi.RegionFolderName,
IsReadOnlyTripCart:'False',
RegionPageArg:"",
imgSrc:"./Image1/RegionIcons/"+responsePoi.RegionCode,
regName:responsePoi.RegionName,
text:responsePoi.RegionBalloonInfo,
tooltip:"Explore Region",
Page:responsePoi.Page,
IsAddedToCart:parent.tcCTRL.Cart.Instance.IsRegionInCart(responsePoi.RegionID)
};
var balloon=new TCBalloon(data);
var poi=new TCPoi(responsePoi.CenterLat,responsePoi.CenterLong,icon,balloon,responsePoi.RegionName,null,null,null,null,tcCTRL.Map.Instance.Map);
poi.id=responsePoi.RegionID;
return poi;
},
buildHotelPOI:function(responsePoi)
{
var icon,type,ballon;
type=responsePoi.ActivityType="Hotel";
icon=new TCIcon("ActivityIcons",IconFileNames[type]);
responsePoi.ActivityIcon=icon.Naming.ActivityIcons.BasePath+IconFileNames[type]+".gif";
responsePoi.IsAddedToCart=parent.tcCTRL.Cart.Instance.IsHotelInCart(responsePoi.HotelID);
var balloon=new TCBalloon(responsePoi);
tooltip=responsePoi.Name;
if(responsePoi.LowRate>0&&responsePoi.LowRate<60)
tooltip+=", Rates from $"+Math.floor(responsePoi.LowRate)
else if(responsePoi.LowRate>=60&&responsePoi.LowRate<=200)
tooltip+=", Rates from $"+Math.floor(responsePoi.LowRate*0.9);
var poi=new TCPoi(responsePoi.Lat,responsePoi.Long,icon,balloon,tooltip,null,null,null,null,tcCTRL.Map.Instance.Map);
poi.id=responsePoi.HotelID;
return poi;
},
Model:function()
{
var keys=arguments;
return function(values)
{
return values.associate(keys);
};
}
};
/*tcCTRL.Map.js*/
provide("tcCTRL.Map");
tcCTRL.Map=new Class({
Page:null,
DirectionsObj:{},
isShowingDirections:false,
initialize:function()
{
this.LayersDisplayedHash={};
window.addEvent("domready",this.init.bind(this));
},
init:function(force)
{
if(tcCTRL.Map.Instance.initialized)return;
this.MapElement=$E("div.map");
this.params=this.MapElement.getProperty("params").split("|").associate(["Page","Lat","Long","Zoom","NoAutoRender"]);
if(this.params.NoAutoRender&&!force)return;
this.Map=new TCMap(this.MapElement);
tcCTRL.Map.Instance.initialized=true;
this.Page=this.params.Page;
this.PoiCollection=new TCPoiCollection(this.MapInstance);
parent.addEvent("onMapLoaded",this.SetCenterAccordingToParams.bind(this));
this.SetCenterAccordingToParams();
},
SetCenterAccordingToParams:function()
{
if(parent.MapPosition&&parent.MapPosition.Lat&&parent.MapPosition.Long&&parent.MapPosition.Zoom)
{
this.Map.SetCenter(parent.MapPosition.Lat.toFloat(),parent.MapPosition.Long.toFloat(),parent.MapPosition.Zoom.toInt());
this.zoom=parent.MapPosition.Zoom.toInt();
}
else
{
this.zoom=3;
this.Map.SetCenter(33.78659,-118.2987,this.zoom);
}
},
IsLayerDisplayed:function(layerName)
{
return this.LayersDisplayedHash[layerName]==true;
},
IsLayerDisplayedLayerInfo:function(layerInfo)
{
return this.LayersDisplayedHash[this.GetLayerName(layerInfo)]==true;
},
HideLayer:function(layerInfo)
{
var layerName=this.GetLayerName(layerInfo);
if(!this.PoiCollection.HidePOIListByType(layerName))return;
this.LayersDisplayedHash[layerName]=false;
if(layerName=="Hotels")
{
for(var type in this.PoiCollection.hashPOIType.items)
{
if(type.indexOf("NearByHotel_")==0&&this.PoiCollection.hashPOIType.items[type]!=null)
{
this.PoiCollection.HidePOIListByType(type);
if(type.split("_")[2]=="isAirPort")
this.changeNearByHotelsLinkForAttraction(type.split("_")[1].toInt(),true);
else
this.changeNearByHotelsLinkForAttraction(type.split("_")[1].toInt());
this.PoiCollection.hashPOIType.items[type]=null;
}
}
}
if(layerInfo.attractionID)
{
if(layerInfo.nearByHotels)
{
this.changeNearByHotelsLinkForAttraction(layerInfo.attractionID);
}
else
{
this.changeNearByAttractionsLinkForAttraction(layerInfo.attractionID);
}
}
this.fireEvent("onLayerHide",[layerInfo]);
},
ShowLayer:function(layerInfo,dontCache)
{
var layerName,getLayer;
var packedResult=this.getLayerNameAndShowGetFunctions(layerInfo);
layerName=packedResult[0];
getLayer=packedResult[1];
showLayer=packedResult[2];
dontCache=dontCache||layerInfo.attractionID;
this.removeDrivingDirections();
if(this.PoiCollection.HasType(layerName)&&!dontCache)
{
showLayer();
}
else
{
if(dontCache)
{
this.PoiCollection.RemoveByType(layerName);
}
getLayer();
}
},
ShowLayers:function(layerInfoArray)
{
layerInfoArray.each(function(layerInfo)
{
this.ShowLayer(layerInfo);
},this);
},
getLayerNameAndShowGetFunctions:function(layerInfo)
{
var getLayer,layerName;
var showLayer=(function()
{
this.PoiCollection.ShowPOIListByType(layerName);
this.LayersDisplayedHash[layerName]=true;
if(layerInfo.attractionID)
{
if(layerInfo.nearByHotels)
{
this.changeNearByHotelsLinkForAttraction(layerInfo.attractionID,layerInfo.isAirPort);
}
else
{
this.changeNearByAttractionsLinkForAttraction(layerInfo.attractionID);
}
}
this.fireEvent("onLayerShow",[layerInfo]);
}).bind(this);
if(layerInfo.attractionID&&!layerInfo.nearByHotels)
{
layerName="NearBy_"+layerInfo.attractionID;
getLayer=(function()
{
this.getNearByAttractions(layerInfo.attractionID,showLayer);
}).bind(this);
}
else if(layerInfo.tripID)
{
layerName="Trip_"+layerInfo.tripID;
getLayer=(function()
{
this.getTripPOIS(layerInfo.tripID,layerInfo.showRegions,showLayer)
}).bind(this);
}
else if(layerInfo.regionID&&layerInfo.interest)
{
layerName=layerInfo.interest;
getLayer=(function()
{
this.getLayerByRegionIDInterest(layerInfo.regionID,layerInfo.interest,showLayer);
}).bind(this);
}
else if(layerInfo.query)
{
layerName="SearchResults";
throw"not done";
}
else if(layerInfo.nearByHotels&&layerInfo.attractionID)
{
layerName="NearByHotel_"+layerInfo.attractionID;
var self=this;
getLayer=(function()
{
var isInCollection=this.PoiCollection.IsIdInCollection(layerInfo.attractionID);
var nearByHotelsFunc=(function()
{
var pois=this.PoiCollection.GetPOIListByID(layerInfo.attractionID);
if(pois.length>0)
this.getNearByHotels(pois[0].longitude,pois[0].latitude,layerInfo.attractionID,showLayer,pois[0].type);
}).bind(this);
if(isInCollection)
nearByHotelsFunc();
else
self.getAttraction(layerInfo.attractionID,nearByHotelsFunc);
}).bind(this);
}
else
{
throw"unsupported combination of properties";
}
return[layerName,getLayer,showLayer];
},
GetLayerName:function(layerInfo)
{
return this.getLayerNameAndShowGetFunctions(layerInfo)[0];
},
ShowHideLayer:function(layerInfo)
{
if(this.IsLayerDisplayed(this.GetLayerName(layerInfo)))
this.HideLayer(layerInfo);
else
{
this.ShowLayer(layerInfo);
if(!layerInfo.attractionID)
tcTracker("/map/"+layerInfo.regionID+"/"+layerInfo.interest+"/");
}
},
ShowLayerIfNotDisplayed:function(layerInfo)
{
if(!this.IsLayerDisplayed(this.GetLayerName(layerInfo)))
this.ShowLayer(layerInfo);
},
ShowItem:function(layerInfo)
{
var showItem,getAndShowItem;
var self=this;
var isInCollection=this.PoiCollection.IsIdInCollection(layerInfo.attractionID||layerInfo.hotelID||layerInfo.regionID);
if(layerInfo.attractionID)
{
showItem=function()
{
self.PoiCollection.ShowPOIByID(layerInfo.attractionID);
};
getAndShowItem=function()
{
self.getAttraction(layerInfo.attractionID,showItem);
};
}
else if(layerInfo.hotelID)
{
showItem=function()
{
self.PoiCollection.ShowPOIByID(layerInfo.hotelID);
};
getAndShowItem=function()
{
self.getHotel(layerInfo.hotelID,showItem);
};
}
else if(layerInfo.regionID)
{
showItem=function()
{
self.PoiCollection.ShowPOIByID(layerInfo.regionID);
};
getAndShowItem=function()
{
self.getRegion(layerInfo.regionID,showItem);
};
}
else
throw new Error("type of item not supported");
this.removeDrivingDirections();
if(isInCollection)
showItem();
else
getAndShowItem();
},
showHideTooltip:function(layerInfo,show)
{
var showHideItem,getAndShowHideItem;
var self=this;
var itemID=layerInfo.attractionID||layerInfo.hotelID||layerInfo.regionID;
var isInCollection=this.PoiCollection.IsIdInCollection(itemID);
showHideItem=function()
{
if(show)
self.PoiCollection.ShowPOITooltipByID(itemID);
else
self.PoiCollection.HidePOITooltipByID(itemID);
};
if(layerInfo.attractionID)
{
getAndShowHideItem=function()
{
self.getAttraction(itemID,showHideItem);
};
}
else if(layerInfo.hotelID)
{
getAndShowHideItem=function()
{
self.getHotel(itemID,showHideItem);
};
}
else if(layerInfo.regionID)
{
getAndShowHideItem=function()
{
self.getRegion(itemID,showHideItem);
};
}
else
throw new Error("type of item not supported");
if(isInCollection)
showHideItem();
else
getAndShowHideItem();
},
ShowTooltip:function(layerInfo)
{
this.showHideTooltip(layerInfo,true);
},
HideTooltip:function(layerInfo)
{
this.showHideTooltip(layerInfo,false);
},
ResetMap:function()
{
if(showPOIList_InProgress)
{
this.ResetMap.delay(1000,this);
return;
}
for(var type in this.PoiCollection.hashPOIType.items)
{
if(typeof(this.PoiCollection.hashPOIType.items[type])=="function"||type=="Getting-There")continue;
if(this.IsLayerDisplayed(type))
{
this.PoiCollection.HidePOIListByType(type);
this.LayersDisplayedHash[type]=false;
if(isDefined("tcCTRL.AttractionTypesStrip"))tcCTRL.AttractionTypesStrip.SetIconState(type,false);
if(type.indexOf("NearBy_")==0)
{
this.changeNearByAttractionsLinkForAttraction(type.split("_")[1].toInt());
}
else if(type.indexOf("NearByHotel_")==0)
{
if(type.split("_")[2]=="isAirPort")
this.changeNearByHotelsLinkForAttraction(type.split("_")[1].toInt(),true);
else
this.changeNearByHotelsLinkForAttraction(type.split("_")[1].toInt());
}
}
}
this.Map.CloseInfoWindow();
this.SetCenterAccordingToParams();
TripCart.Global.Events.Fire("OnMapReset");
parent.fireEvent("OnMapReset");
},
getAttraction:function(attractionID,onComplete)
{
TripCart.AjaxMethods.GetAttractionByID(attractionID,TripCart.Map.Data.PopulatePoiCollectionFromResponse,
{
layerName:attractionID.toString(),
onComplete:onComplete
});
},
getRegion:function(regionID,onComplete)
{
TripCart.AjaxMethods.GetRegionByID(regionID,TripCart.Map.Data.PopulatePoiCollectionFromResponse,
{
layerName:regionID.toString(),
onComplete:onComplete
});
},
getHotel:function(hotelID,onComplete)
{
TripCart.AjaxMethods.GetHotelByID(hotelID,TripCart.Map.Data.PopulatePoiCollectionFromResponse,
{
layerName:hotelID.toString(),
onComplete:onComplete
});
},
getNearByHotels:function(x,y,attractionID,onComplete,isAirPort)
{
TripCart.AjaxMethods.GetNearByHotels(x,y,TripCart.Map.Data.PopulatePoiCollectionFromResponse,
{
layerName:"NearByHotel_"+attractionID,
isAirPort:(isAirPort?true:false),
onComplete:onComplete
});
tcTracker("/map/attraction-nearby-hotels/"+attractionID+"/");
},
getLayerByRegionIDInterest:function(regionID,interest,onComplete)
{
TripCart.AjaxMethods.GetLayerByRegionIDInterest(regionID,interest,TripCart.Map.Data.PopulatePoiCollectionFromResponse,
{
layerName:interest,
onComplete:onComplete
});
},
getNearByAttractions:function(attractionID,onComplete)
{
TripCart.AjaxMethods.GetNearByAttractions(attractionID,TripCart.Map.Data.PopulatePoiCollectionFromResponse,
{
layerName:"NearBy_"+attractionID,
onComplete:onComplete
});
tcTracker("/map/attraction-nearby-attractions/"+attractionID+"/");
},
getTripPOIS:function(tripID,showRegions,onComplete)
{
TripCart.AjaxMethods.GetTripPOIS(tripID,TripCart.Map.Data.PopulatePoiCollectionFromResponse,
{
layerName:"Trip_"+tripID,
onComplete:onComplete,
showRegions:showRegions
});
},
changeNearByHotelsLinkForAttraction:function(attractionID,isAirPort)
{
this.setPropertyOnBalloonAndOpenIfNeeded(isAirPort?"SetAirportBalloonHTML":"SetAttractionBalloonHTML",attractionID,"IsNearByHotelsShown");;
},
changeNearByAttractionsLinkForAttraction:function(attractionID)
{
this.setPropertyOnBalloonAndOpenIfNeeded("SetAttractionBalloonHTML",attractionID,"IsNearByAttractionsShown");
},
changeAddToTripLinkForAttraction:function(attractionID)
{
this.setPropertyOnBalloonAndOpenIfNeeded("SetAttractionBalloonHTML",attractionID,"IsAddedToCart");
},
changeAddToTripLinkForHotel:function(hotelID)
{
this.setPropertyOnBalloonAndOpenIfNeeded("SetHotelBalloonHTML",hotelID,"IsAddedToCart");
},
changeAddToTripLinkForRegion:function(regionID)
{
this.setPropertyOnBalloonAndOpenIfNeeded("SetRegionBalloonHTML",regionID,"IsAddedToCart");
},
setPropertyOnBalloonAndOpenIfNeeded:function(ballonFunctionName,id,propName)
{
var pois=this.PoiCollection.GetPOIListByID(id);
if(pois)
{
pois.each(function(poi)
{
var data={};
data[propName]=poi.balloon[propName]?"$RESET$":true;
poi.balloon.ExtendBalloonObject(data);
if(poi.IsOpenedBalloon())
poi.OpenBalloon(null,null,false,true);
});
}
},
GetDirections_Click:function(fromAddress,toAddress,errorDiv)
{
if(!this.DirectionsObj.directions)
this.DirectionsObj=new TCDirections(document.getElementById('directionsPanel2'),this.Map.myGMap,errorDiv);
this.DirectionsObj.GetDirections(fromAddress,toAddress);
this.isShowingDirections=true;
},
removeDrivingDirections:function()
{
if(this.isShowingDirections)
{
this.SetCenterAccordingToParams();
this.isShowingDirections=false;
}
},
DisplayResetMapLink:function()
{
var ResetShowMap=$("ResetShowMap");
ResetShowMap.innerHTML="Reset map";
ResetShowMap.href="Javascript:tcCTRL.Map.Instance.ResetMap();";
},
DisplayShowMapLink:function()
{
var ResetShowMap=$("ResetShowMap");
ResetShowMap.innerHTML="Show Map";
ResetShowMap.href="Javascript:parent.Region.ClickHandlers.CloseModal(); tcCTRL.Map.Instance.DisplayResetMapLink();";
}
});
tcCTRL.Map.implement(new Events);
tcCTRL.Map.Instance=new tcCTRL.Map();

/*tcCTRL.Cart.js*/
provide("tcCTRL.Cart");
tcCTRL.Cart=new Class(
{
Init:function()
{
if(this.initialized)return;
var idsTypes=["regionIDS","hotelIDS","attractionIDS"];
var data=$E(".cart").getProperty("params").split("|").associate(idsTypes);
var self=this;
idsTypes.each(function(type)
{
self[type]={};
data[type].split(",").each(function(id)
{
self[type][id]=true;
});
});
this.initialized=true;
},
IsAttractionInCart:function(id)
{
return this.isItemInCart("Attraction",id);
},
IsHotelInCart:function(id)
{
return this.isItemInCart("Hotel",id);
},
IsRegionInCart:function(id)
{
return this.isItemInCart("Region",id);
},
isItemInCart:function(type,id)
{
if(this[type.toLowerCase()+"IDS"])
return this[type.toLowerCase()+"IDS"][id]===true;
else
return false;
},
AddAttractionsToCart:function(attractionIDS)
{
TripCart.AjaxMethods.AddAttractionsToCart(attractionIDS,this.onItemsAdded.bind(this),{ids:attractionIDS.split(","),type:"Attraction"});
},
AddRegionsToCart:function(regionIDS)
{
TripCart.AjaxMethods.AddRegionsToCart(regionIDS,this.onItemsAdded.bind(this),{ids:regionIDS.split(","),type:"Region"});
},
AddHotelsToCart:function(hotelIDS)
{
TripCart.AjaxMethods.AddHotelsToCart(hotelIDS,this.onItemsAdded.bind(this),{ids:hotelIDS.split(","),type:"Hotel"});
},
RemoveAttractionsFromCart:function(attractionIDS)
{
TripCart.AjaxMethods.RemoveAttractionsFromCart(attractionIDS,this.onItemRemoved.bind(this),{ids:attractionIDS.split(","),type:"Attraction"});
},
RemoveRegionsFromCart:function(regionIDS)
{
TripCart.AjaxMethods.RemoveRegionsFromCart(regionIDS,this.onItemRemoved.bind(this),{ids:regionIDS.split(","),type:"Region"});
},
RemoveHotelsFromCart:function(hotelIDS)
{
TripCart.AjaxMethods.RemoveHotelsFromCart(hotelIDS,this.onItemRemoved.bind(this),{ids:hotelIDS.split(","),type:"Hotel"});
},
onItemsAdded:function(response)
{
if(response.error!=null&&response.error.Type!="ConnectFailure")
{
alert(response.error.Type+","+response.error.Message);
return;
}
var idHash=this[response.context.type.toLowerCase()+"IDS"];
response.context.ids.each(function(id)
{
idHash[id]=true;
parent.MapWrapper.RunMapFunc('changeAddToTripLinkFor'+response.context.type,[id]);
this.fireEvent(response.context.type+"Added_"+id);
},this);
},
onItemRemoved:function(response)
{
if(response.error!=null&&response.error.Type!="ConnectFailure")
{
alert(response.error.Type+","+response.error.Message);
return;
}
var idHash=this[response.context.type.toLowerCase()+"IDS"];
response.context.ids.each(function(id)
{
idHash[id]=false;
this.fireEvent(response.context.type+"Removed_"+id);
},this);
}
});
tcCTRL.Cart.implement(new Events);
tcCTRL.Cart.Instance=new tcCTRL.Cart();
window.addEvent("domready",tcCTRL.Cart.Instance.Init.bind(tcCTRL.Cart.Instance));

/*PublishTrip.js*/
var PublishTripHandler=function(){
this.initialize.apply(this,arguments);
};
PublishTripHandler.prototype=
{
tripId:null,
isPublic:null,
ajaxClassName:null,
userID:null,
privateElement:null,
publicElement:null,
mytripStateElement:null,
changetripStateElement:null,
initialize:function(tripId,isPublic,ajaxClassName,userID)
{
this.tripId=tripId;
this.isPublic=isPublic;
this.ajaxClassName=ajaxClassName;
this.userID=userID;
this.privateElement=document.getElementById("rbMakePrivate_"+tripId+"");
this.publicElement=document.getElementById("rbMakePublic_"+tripId+"");
this.mytripStateElement=document.getElementById("tripMyState_"+tripId+"");
this.changetripStateElement=document.getElementById("tripChangeState_"+tripId+"");
if(this.isPublic==true)
{
this.publicElement.setAttribute("checked",'checked');
this.privateElement.removeAttribute("checked");
this.mytripStateElement.innerHTML="Public";
this.changetripStateElement.innerHTML="Make Private";
}
else
{
this.publicElement.removeAttribute("checked");
this.privateElement.setAttribute("checked",'checked');
this.mytripStateElement.innerHTML="Private";
this.changetripStateElement.innerHTML="Make Public";
}
},
updateTrip:function(element)
{
var response;
if(element.innerHTML=="Make Private")
{
response=eval('TripCart.AjaxMethods.UpdateTrip('+this.tripId+','+false+','+this.userID+');');
this.publicElement.removeAttribute("checked");
this.privateElement.setAttribute("cheked",'checked');
this.mytripStateElement.innerHTML="Private";
this.changetripStateElement.innerHTML="Make Public";
}
else
{
response=eval('TripCart.AjaxMethods.UpdateTrip('+this.tripId+','+true+','+this.userID+');');
this.privateElement.removeAttribute("checked");
this.publicElement.setAttribute("cheked",'checked');
this.mytripStateElement.innerHTML="Public";
this.changetripStateElement.innerHTML="Make Private";
}
return response.value;
}
}
/*PopupBubble.js*/
var BubbleWidth=200;
var BubbleHeight=100;
var BubbleX=0;
var BubbleY=0;
var MouseX=0;
var MouseY=0;
function ShowPopupBubble(element,objid){
var moreinfolink="";
if(element.href!="javascript:void;")
moreinfolink="&nbsp&nbsp&nbsp&nbsp<a href=\""+element.href+"\">More Info</a>";
else
moreinfolink="&nbsp&nbsp&nbsp&nbsp<a href=\"#\" onclick=\"forwardPage('hotBal','hot_bal_top/"+objid+"/0'); return false;\">Book Hotel</a>";
$("pbcontent").innerHTML="<div style=\"font-weight:bold\" >"+element.innerHTML+"</div><a href=\"javascript:DisplayHotelBalloonFromMenu("+objid+");\">Show on Map</a>"+moreinfolink;
SetPopupBubblePosition();
$("popupbubble").style.display="inline";
}
function ConditionalHideBubble()
{
if(MouseX<BubbleX-40||MouseX>BubbleX+BubbleWidth+40||
MouseY<BubbleY-40||MouseY>BubbleY+BubbleHeight+40)
$("popupbubble").style.display="none";
}
function SetPopupBubblePosition(){
BubbleX=MouseX+20;
BubbleY=MouseY;
var obj=$("popupbubble").style;
obj.left=BubbleX+"px";
obj.top=BubbleY+"px";
}
var IE=document.all?true:false;
if(!IE)document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=getMouseXY;
function getMouseXY(e){
var PrevMouseX=MouseX;
var PrevMouseY=MouseY;
if(IE){
MouseX=event.clientX+document.documentElement.scrollLeft;
MouseY=event.clientY+document.documentElement.scrollTop;
}else{
MouseX=e.clientX+window.pageXOffset;
MouseY=e.clientY+window.pageYOffset;
}
var DeltaX=MouseX-PrevMouseX;
var DeltaY=MouseY-PrevMouseY;
MouseX+=DeltaX*0.2;
MouseY+=DeltaY*0.2;
ConditionalHideBubble();
}

/*AjaxPro*/
if(typeof TripCart == "undefined") TripCart={};
TripCart.AjaxMethods_class = function() {};
Object.extend(TripCart.AjaxMethods_class.prototype, Object.extend(new AjaxPro.AjaxClass(), {
	GetDownTime: function() {
		return this.invoke("GetDownTime", {}, this.GetDownTime.getArguments().slice(0));
	},
	IsUserLoggedIn: function() {
		return this.invoke("IsUserLoggedIn", {}, this.IsUserLoggedIn.getArguments().slice(0));
	},
	AddRegionToTrip: function(regionsIDs) {
		return this.invoke("AddRegionToTrip", {"regionsIDs":regionsIDs}, this.AddRegionToTrip.getArguments().slice(1));
	},
	AddAttractionsToCart: function(attractionIDS) {
		return this.invoke("AddAttractionsToCart", {"attractionIDS":attractionIDS}, this.AddAttractionsToCart.getArguments().slice(1));
	},
	AddHotelsToCart: function(hotelIDS) {
		return this.invoke("AddHotelsToCart", {"hotelIDS":hotelIDS}, this.AddHotelsToCart.getArguments().slice(1));
	},
	AddRegionsToCart: function(regionIDS) {
		return this.invoke("AddRegionsToCart", {"regionIDS":regionIDS}, this.AddRegionsToCart.getArguments().slice(1));
	},
	RemoveAttractionsFromCart: function(attractionsIDS) {
		return this.invoke("RemoveAttractionsFromCart", {"attractionsIDS":attractionsIDS}, this.RemoveAttractionsFromCart.getArguments().slice(1));
	},
	RemoveHotelsFromCart: function(hotelIDS) {
		return this.invoke("RemoveHotelsFromCart", {"hotelIDS":hotelIDS}, this.RemoveHotelsFromCart.getArguments().slice(1));
	},
	RemoveRegionsFromCart: function(regionIDS) {
		return this.invoke("RemoveRegionsFromCart", {"regionIDS":regionIDS}, this.RemoveRegionsFromCart.getArguments().slice(1));
	},
	GetNearByHotels: function(x, y) {
		return this.invoke("GetNearByHotels", {"x":x, "y":y}, this.GetNearByHotels.getArguments().slice(2));
	},
	GetLayerByRegionIDInterest: function(regionID, interest) {
		return this.invoke("GetLayerByRegionIDInterest", {"regionID":regionID, "interest":interest}, this.GetLayerByRegionIDInterest.getArguments().slice(2));
	},
	GetNearByAttractions: function(attractionID) {
		return this.invoke("GetNearByAttractions", {"attractionID":attractionID}, this.GetNearByAttractions.getArguments().slice(1));
	},
	GetTripPOIS: function(tripID) {
		return this.invoke("GetTripPOIS", {"tripID":tripID}, this.GetTripPOIS.getArguments().slice(1));
	},
	GetAttractionByID: function(attractionID) {
		return this.invoke("GetAttractionByID", {"attractionID":attractionID}, this.GetAttractionByID.getArguments().slice(1));
	},
	GetRegionByID: function(regionID) {
		return this.invoke("GetRegionByID", {"regionID":regionID}, this.GetRegionByID.getArguments().slice(1));
	},
	GetHotelByID: function(hotelID) {
		return this.invoke("GetHotelByID", {"hotelID":hotelID}, this.GetHotelByID.getArguments().slice(1));
	},
	ChangeMapMetaRegion: function(MetaRegionURL) {
		return this.invoke("ChangeMapMetaRegion", {"MetaRegionURL":MetaRegionURL}, this.ChangeMapMetaRegion.getArguments().slice(1));
	},
	ChangeWhatToDo: function(Interest) {
		return this.invoke("ChangeWhatToDo", {"Interest":Interest}, this.ChangeWhatToDo.getArguments().slice(1));
	},
	UpdateTripCartName_FromMyTripCart: function(TripCartID, TripCartName) {
		return this.invoke("UpdateTripCartName_FromMyTripCart", {"TripCartID":TripCartID, "TripCartName":TripCartName}, this.UpdateTripCartName_FromMyTripCart.getArguments().slice(2));
	},
	UpdateTripCartDateSettings: function(startDate, endDate) {
		return this.invoke("UpdateTripCartDateSettings", {"startDate":startDate, "endDate":endDate}, this.UpdateTripCartDateSettings.getArguments().slice(2));
	},
	UpdateTripCartDiary: function(tripCartNotes) {
		return this.invoke("UpdateTripCartDiary", {"tripCartNotes":tripCartNotes}, this.UpdateTripCartDiary.getArguments().slice(1));
	},
	RemoveItemsFromCart: function(deletedRegions, deletedAttractions, deletedRoutes, deletedHotels) {
		return this.invoke("RemoveItemsFromCart", {"deletedRegions":deletedRegions, "deletedAttractions":deletedAttractions, "deletedRoutes":deletedRoutes, "deletedHotels":deletedHotels}, this.RemoveItemsFromCart.getArguments().slice(4));
	},
	GetPhotosForRegion: function(RegionID, OrderBy) {
		return this.invoke("GetPhotosForRegion", {"RegionID":RegionID, "OrderBy":OrderBy}, this.GetPhotosForRegion.getArguments().slice(2));
	},
	GetPhotosForActivityType: function(RegionID, ActivityType, OrderBy) {
		return this.invoke("GetPhotosForActivityType", {"RegionID":RegionID, "ActivityType":ActivityType, "OrderBy":OrderBy}, this.GetPhotosForActivityType.getArguments().slice(3));
	},
	GetPhotosForAttraction: function(AttractionID, OrderBy) {
		return this.invoke("GetPhotosForAttraction", {"AttractionID":AttractionID, "OrderBy":OrderBy}, this.GetPhotosForAttraction.getArguments().slice(2));
	},
	CopyTrip: function(TripCartID) {
		return this.invoke("CopyTrip", {"TripCartID":TripCartID}, this.CopyTrip.getArguments().slice(1));
	},
	CopyViewTrip: function(TripCartID) {
		return this.invoke("CopyViewTrip", {"TripCartID":TripCartID}, this.CopyViewTrip.getArguments().slice(1));
	},
	ProcessAffiliateImpression: function(paramsStr) {
		return this.invoke("ProcessAffiliateImpression", {"paramsStr":paramsStr}, this.ProcessAffiliateImpression.getArguments().slice(1));
	},
	SaveSearchBarStateFromQueryString: function(Mode, R, K1, D1, D2, D3, F1, F2, F3, P1, P2) {
		return this.invoke("SaveSearchBarStateFromQueryString", {"Mode":Mode, "R":R, "K1":K1, "D1":D1, "D2":D2, "D3":D3, "F1":F1, "F2":F2, "F3":F3, "P1":P1, "P2":P2}, this.SaveSearchBarStateFromQueryString.getArguments().slice(11));
	},
	GetResultsData: function(RequestQueryString) {
		return this.invoke("GetResultsData", {"RequestQueryString":RequestQueryString}, this.GetResultsData.getArguments().slice(1));
	},
	GetMetaRegionGISdata: function() {
		return this.invoke("GetMetaRegionGISdata", {}, this.GetMetaRegionGISdata.getArguments().slice(0));
	},
	AddRegionToCart_FromSerchResult: function(regionsIDs) {
		return this.invoke("AddRegionToCart_FromSerchResult", {"regionsIDs":regionsIDs}, this.AddRegionToCart_FromSerchResult.getArguments().slice(1));
	},
	AbortThread: function() {
		return this.invoke("AbortThread", {}, this.AbortThread.getArguments().slice(0));
	},
	UpdateTrip: function(tripID, isPublic, userID) {
		return this.invoke("UpdateTrip", {"tripID":tripID, "isPublic":isPublic, "userID":userID}, this.UpdateTrip.getArguments().slice(3));
	},
	ViewTrip: function(TripCartID) {
		return this.invoke("ViewTrip", {"TripCartID":TripCartID}, this.ViewTrip.getArguments().slice(1));
	},
	url: '/ajaxpro/TripCart.AjaxMethods,App_Code.ashx'
}));
TripCart.AjaxMethods = new TripCart.AjaxMethods_class();


/*JSHashes*/
var JSHashes={'ActivityToFolder':{'Airport':'airport','ArtMuseum':'art-museums','Beach':'beaches','Biking':'mountain-biking','Boating':'boating','BotanicalGarden':'botanical-gardens','Diving':'scuba-diving','Entertainment':'shows','FactoryTour':'factory-tours','FallFoliage':'fall-foliage','Fishing':'fishing','Gambling':'gambling','GeneralMuseum':'museums','Golf':'golf','Hiking':'hiking','HistoricalSite':'historical-sites','HistoryMuseum':'history-museums','Hotel':'hotels','MountainClimbing':'mountain-climbing','NaturalHistoryMuseum':'natural-history-museums','Nature':'nature','Place':'vacation-ideas','RockGym':'rock-climbing-gym','ScienceMuseum':'science-museums','Shopping':'shopping-malls','Ski':'ski','Spa':'spas','SpectatorSports':'spectator-sports','Surfing':'surfing','ThemeParks':'theme-parks','WhiteWater':'white-water-rafting','Winery':'wineries','Zoo':'zoo-aquarium-botanical-garden'},'InterestToInterestName':{'Tourist-Information':'Tourist Information','Tourist-Attractions-Highlights':'Tourist Attractions - Highlights','Best-Time-to-Visit':'Best Time to Visit','Hotels':'Hotels','Restaurants-Fine-Dining':'Restaurants and Fine Dining','Cost':'Cost','History':'History','Society-Culture':'Society and Culture','Special-Events':'Special Events','Geography':'Geography','Getting-Around':'Getting Around','Getting-There':'Getting There','Fun-Facts':'Fun Facts','Weather':'Weather','Places-to-Visit':'Places to Visit','Guided-Tours':'Guided Tours','Family-Vacation-Ideas':'Family Vacation Ideas','Luxury-Vacations':'Luxury Vacations','Romantic-Vacations-Getaways':'Romantic Vacations and Getaways','Outdoor-Sports-Recreation':'Outdoor Sports and Recreation','Adventure-Travel':'Adventure Travel','Beaches':'Beaches','Biking':'Biking','Boating-Cruise-Vacations':'Cruises and Boating','Breweries':'Breweries','Indoor-Rock-Climbing-Walls':'Indoor Rock Climbing Walls','Cool-Things-to-Do':'Cool and Fun Things to Do','Alcohol-Distilleries':'Alcohol Distilleries','Arts-Entertainment':'Arts and Entertainment','Fishing':'Fishing','Casino-Gambling':'Casino Gambling','Golf':'Golf','Sea-Kayaking-Canoeing':'Sea Kayaking and Canoeing','Public-Recreational-Parks':'Public Recreational Parks','Scuba-Diving':'Scuba Diving','Shopping':'Shopping','Skiing':'Skiing','Snorkeling':'Snorkeling','Spas':'Spas','Theme-Parks':'Theme Parks','White-Water-Rafting':'White Water Rafting','Architecture':'Architecture','Botanical-Gardens':'Botanical Gardens','Behind-Scenes-Factory-Tours':'Behind-the-Scenes and Factory Tours','Fall-Foliage':'Fall Foliage','Historical-Sites':'Historical Sites','Museums':'Museums','Nature-Wildlife':'Nature and Wildlife','Off-the-Beaten-Path':'Off the Beaten Path','Most-Scenic-Drives':'Most Scenic Drives','Scenery-Scenic-Views':'Scenery - Scenic Views','Sporting-Events':'Sporting Events','Wineries':'Wineries','Zoos-Aquariums':'Zoos and Aquariums'},'ActivityTypeToIsMixedType':{'Highlights':true,'Hotel':false,'History':true,'Airport':false,'Place':false,'Family':true,'Luxury':true,'Romantic':true,'Outdoors':true,'AdventureTravel':true,'Beach':false,'RockGym':false,'CoolActivities':true,'Entertainment':false,'Fishing':true,'Gambling':false,'Golf':false,'ScubaDiving':true,'Shopping':false,'Ski':false,'Snorkeling':true,'Spa':false,'ThemeParks':false,'WhiteWater':false,'BotanicalGarden':false,'FactoryTour':false,'FallFoliage':false,'HistoricalSite':false,'GeneralMuseum':false,'Nature':false,'OffPath':true,'SpectatorSports':false,'Winery':false,'Zoo':false},'ActivityTypeToInterest':{'Airport':'Getting-There','ArtMuseum':'','Beach':'Beaches','Biking':'','Boating':'','BotanicalGarden':'Botanical-Gardens','Diving':'','Entertainment':'Arts-Entertainment','FactoryTour':'Behind-Scenes-Factory-Tours','FallFoliage':'Fall-Foliage','Fishing':'Fishing','Gambling':'Casino-Gambling','GeneralMuseum':'Museums','Golf':'Golf','Hiking':'','HistoricalSite':'Historical-Sites','HistoryMuseum':'','Hotel':'Hotels','MountainClimbing':'','NaturalHistoryMuseum':'','Nature':'Nature-Wildlife','Place':'Places-to-Visit','RockGym':'Indoor-Rock-Climbing-Walls','ScienceMuseum':'','Shopping':'Shopping','Ski':'Skiing','Spa':'Spas','SpectatorSports':'Sporting-Events','Surfing':'','ThemeParks':'Theme-Parks','WhiteWater':'White-Water-Rafting','Winery':'Wineries','Zoo':'Zoos-Aquariums'}}