
(function(){var
window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;this.context=selector;return this;}
if(typeof selector==="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])
selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem&&elem.id!=match[3])
return jQuery().find(selector);var ret=jQuery(elem||[]);ret.context=document;ret.selector=selector;return ret;}}else
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))
return jQuery(document).ready(selector);if(selector.selector&&selector.context){this.selector=selector.selector;this.context=selector.context;}
return this.setArray(jQuery.isArray(selector)?selector:jQuery.makeArray(selector));},selector:"",jquery:"1.3.2",size:function(){return this.length;},get:function(num){return num===undefined?Array.prototype.slice.call(this):this[num];},pushStack:function(elems,name,selector){var ret=jQuery(elems);ret.prevObject=this;ret.context=this.context;if(name==="find")
ret.selector=this.selector+(this.selector?" ":"")+selector;else if(name)
ret.selector=this.selector+"."+name+"("+selector+")";return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(typeof name==="string")
if(value===undefined)
return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}
return this.each(function(i){for(name in options)
jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)
value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!=="object"&&text!=null)
return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)
ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).clone();if(this[0].parentNode)
wrap.insertBefore(this[0]);wrap.map(function(){var elem=this;while(elem.firstChild)
elem=elem.firstChild;return elem;}).append(this);}
return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)
this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)
this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},push:[].push,sort:[].sort,splice:[].splice,find:function(selector){if(this.length===1){var ret=this.pushStack([],"find",selector);ret.length=0;jQuery.find(selector,this[0],ret);return ret;}else{return this.pushStack(jQuery.unique(jQuery.map(this,function(elem){return jQuery.find(selector,elem);})),"find",selector);}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML;if(!html){var div=this.ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML;}
return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0];}else
return this.cloneNode(true);});if(events===true){var orig=this.find("*").andSelf(),i=0;ret.find("*").andSelf().each(function(){if(this.nodeName!==orig[i].nodeName)
return;var events=jQuery.data(orig[i],"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data);}}
i++;});}
return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,jQuery.grep(this,function(elem){return elem.nodeType===1;})),"filter",selector);},closest:function(selector){var pos=jQuery.expr.match.POS.test(selector)?jQuery(selector):null,closer=0;return this.map(function(){var cur=this;while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector)){jQuery.data(cur,"closest",closer);return cur;}
cur=cur.parentNode;closer++;}});},not:function(selector){if(typeof selector==="string")
if(isSimple.test(selector))
return this.pushStack(jQuery.multiFilter(selector,this,true),"not",selector);else
selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector==="string"?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return!!selector&&this.is("."+selector);},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,'option'))
return(elem.attributes.value||{}).specified?elem.value:elem.text;if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)
return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one)
return value;values.push(value);}}
return values;}
return(elem.value||"").replace(/\r/g,"");}
return undefined;}
if(typeof value==="number")
value+='';return this.each(function(){if(this.nodeType!=1)
return;if(jQuery.isArray(value)&&/radio|checkbox/.test(this.type))
this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)
this.selectedIndex=-1;}else
this.value=value;});},html:function(value){return value===undefined?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,+i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,callback){if(this[0]){var fragment=(this[0].ownerDocument||this[0]).createDocumentFragment(),scripts=jQuery.clean(args,(this[0].ownerDocument||this[0]),fragment),first=fragment.firstChild;if(first)
for(var i=0,l=this.length;i<l;i++)
callback.call(root(this[i],first),this.length>1||i>0?fragment.cloneNode(true):fragment);if(scripts)
jQuery.each(scripts,evalScript);}
return this;function root(elem,cur){return table&&jQuery.nodeName(elem,"table")&&jQuery.nodeName(cur,"tr")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem;}}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)
jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)
elem.parentNode.removeChild(elem);}
function now(){return+new Date;}
jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}
if(typeof target!=="object"&&!jQuery.isFunction(target))
target={};if(length==i){target=this;--i;}
for(;i<length;i++)
if((options=arguments[i])!=null)
for(var name in options){var src=target[name],copy=options[name];if(target===copy)
continue;if(deep&&copy&&typeof copy==="object"&&!copy.nodeType)
target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)
target[name]=copy;}
return target;};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{},toString=Object.prototype.toString;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)
window.jQuery=_jQuery;return jQuery;},isFunction:function(obj){return toString.call(obj)==="[object Function]";},isArray:function(obj){return toString.call(obj)==="[object Array]";},isXMLDoc:function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&jQuery.isXMLDoc(elem.ownerDocument);},globalEval:function(data){if(data&&/\S/.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval)
script.appendChild(document.createTextNode(data));else
script.text=data;head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length===undefined){for(name in object)
if(callback.apply(object[name],args)===false)
break;}else
for(;i<length;)
if(callback.apply(object[i++],args)===false)
break;}else{if(length===undefined){for(name in object)
if(callback.call(object[name],name,object[name])===false)
break;}else
for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}
return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))
value=value.call(elem,i);return typeof value==="number"&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))
elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)
elem.className=classNames!==undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return elem&&jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}
callback.call(elem);for(var name in options)
elem.style[name]=old[name];},css:function(elem,name,force,extra){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border")
return;jQuery.each(which,function(){if(!extra)
val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;if(extra==="margin")
val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0;else
val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});}
if(elem.offsetWidth!==0)
getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,Math.round(val));}
return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;if(name=="opacity"&&!jQuery.support.opacity){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}
if(name.match(/float/i))
name=styleFloat;if(!force&&style&&style[name])
ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))
name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle)
ret=computedStyle.getPropertyValue(name);if(name=="opacity"&&ret=="")
ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}
return ret;},clean:function(elems,context,fragment){context=context||document;if(typeof context.createElement==="undefined")
context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;if(!fragment&&elems.length===1&&typeof elems[0]==="string"){var match=/^<(\w+)\s*\/?>$/.exec(elems[0]);if(match)
return[context.createElement(match[1])];}
var ret=[],scripts=[],div=context.createElement("div");jQuery.each(elems,function(i,elem){if(typeof elem==="number")
elem+='';if(!elem)
return;if(typeof elem==="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=elem.replace(/^\s+/,"").substring(0,10).toLowerCase();var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!jQuery.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)
div=div.lastChild;if(!jQuery.support.tbody){var hasBody=/<tbody/i.test(elem),tbody=!tags.indexOf("<table")&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)
if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)
tbody[j].parentNode.removeChild(tbody[j]);}
if(!jQuery.support.leadingWhitespace&&/^\s/.test(elem))
div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);elem=jQuery.makeArray(div.childNodes);}
if(elem.nodeType)
ret.push(elem);else
ret=jQuery.merge(ret,elem);});if(fragment){for(var i=0;ret[i];i++){if(jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1)
ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));fragment.appendChild(ret[i]);}}
return scripts;}
return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)
return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&elem.parentNode)
elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)
throw"type property can't be changed";elem[name]=value;}
if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))
return elem.getAttributeNode(name).nodeValue;if(name=="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:elem.nodeName.match(/(button|input|object|select|textarea)/i)?0:elem.nodeName.match(/^(a|area)$/i)&&elem.href?0:undefined;}
return elem[name];}
if(!jQuery.support.style&&notxml&&name=="style")
return jQuery.attr(elem.style,"cssText",value);if(set)
elem.setAttribute(name,""+value);var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}
if(!jQuery.support.opacity&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+
(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}
return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}
name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)
elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||typeof array==="string"||jQuery.isFunction(array)||array.setInterval)
ret[0]=array;else
while(i)
ret[--i]=array[i];}
return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)
if(array[i]===elem)
return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(!jQuery.support.getAll){while((elem=second[i++])!=null)
if(elem.nodeType!=8)
first[pos++]=elem;}else
while((elem=second[i++])!=null)
first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}
return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)
if(!inv!=!callback(elems[i],i))
ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)
ret[ret.length]=value;}
return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,'0'])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")
ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret),name,selector);};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector);for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems);}
return this.pushStack(ret,name,selector);};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)
this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames,state){if(typeof state!=="boolean")
state=!jQuery.className.has(this,classNames);jQuery.className[state?"add":"remove"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).length){jQuery("*",this).add([this]).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)
this.parentNode.removeChild(this);}},empty:function(){jQuery(this).children().remove();while(this.firstChild)
this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}
var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)
id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])
jQuery.cache[id]={};if(data!==undefined)
jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])
break;if(!name)
jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)
elem.removeAttribute(expando);}
delete jQuery.cache[id];}},queue:function(elem,type,data){if(elem){type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!q||jQuery.isArray(data))
q=jQuery.data(elem,type,jQuery.makeArray(data));else if(data)
q.push(data);}
return q;},dequeue:function(elem,type){var queue=jQuery.queue(elem,type),fn=queue.shift();if(!type||type==="fx")
fn=queue[0];if(fn!==undefined)
fn.call(elem);}});jQuery.fn.extend({data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)
data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}
if(data===undefined)
return jQuery.queue(this[0],type);return this.each(function(){var queue=jQuery.queue(this,type,data);if(type=="fx"&&queue.length==1)
queue[0].call(this);});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});}});(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString;var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;if(context.nodeType!==1&&context.nodeType!==9)
return[];if(!selector||typeof selector!=="string"){return results;}
var parts=[],m,set,checkSet,check,mode,extra,prune=true;chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break;}}
if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector])
selector+=parts.shift();set=posProcess(selector,set);}}}else{var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&context.parentNode?context.parentNode:context,isXML(context));set=Sizzle.filter(ret.expr,ret.set);if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}
while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}
if(pop==null){pop=context;}
Expr.relative[cur](checkSet,pop,isXML(context));}}
if(!checkSet){checkSet=set;}
if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector);}
if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}
if(extra){Sizzle(extra,context,results,seed);if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}}
return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}
for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}
if(!set){set=context.getElementsByTagName("*");}
return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[];}
if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else if(match===true){continue;}}
if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}
if(found!==undefined){if(!inplace){curLoop=result;}
expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}
break;}}}
if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr;}else{break;}}
old=expr;}
return curLoop;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase();}
for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}
checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part;}}
if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}
if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}
return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}
for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").indexOf(match)>=0)){if(!inplace)
result.push(elem);}else if(inplace){curLoop[i]=false;}}}
return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}
return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase();},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}
match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}
if(match[2]==="~="){match[4]=" "+match[4]+" ";}
return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}
return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}
return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0==i;},eq:function(elem,i,match){return match[3]-0==i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}
return true;}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while(node=node.previousSibling){if(node.nodeType===1)return false;}
if(type=='first')return true;node=elem;case'last':while(node=node.nextSibling){if(node.nodeType===1)return false;}
return true;case'nth':var first=match[2],last=match[3];if(first==1&&last==0){return true;}
var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}
parent.sizcache=doneName;}
var diff=elem.nodeIndex-last;if(first==0){return diff==0;}else{return(diff%first==0&&diff/first>=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);}
var makeArray=function(array,results){array=Array.prototype.slice.call(array);if(results){results.push.apply(results,array);return results;}
return array;};try{Array.prototype.slice.call(document.documentElement.childNodes);}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}
return ret;};}
var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}
return ret;};}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}
return ret;};}else if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}
return ret;};}
(function(){var form=document.createElement("form"),id="script"+(new Date).getTime();form.innerHTML="<input name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}
root.removeChild(form);})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}
results=tmp;}
return results;};}
div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}})();if(document.querySelectorAll)(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}
Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}
return oldSizzle(query,context,extra,seed);};Sizzle.find=oldSizzle.find;Sizzle.filter=oldSizzle.filter;Sizzle.selectors=oldSizzle.selectors;Sizzle.matches=oldSizzle.matches;})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName)(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0)
return;div.lastChild.className="e";if(div.getElementsByClassName("e").length===1)
return;Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(elem.nodeName===cur){match=elem;break;}
elem=elem[dir];}
checkSet[i]=match;}}}
function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}
elem=elem[dir];}
checkSet[i]=match;}}}
var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16;}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&isXML(elem.ownerDocument);};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}
selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}
return Sizzle.filter(later,tmpSet);};jQuery.find=Sizzle;jQuery.filter=Sizzle.filter;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;Sizzle.selectors.filters.hidden=function(elem){return elem.offsetWidth===0||elem.offsetHeight===0;};Sizzle.selectors.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0;};Sizzle.selectors.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};jQuery.multiFilter=function(expr,elems,not){if(not){expr=":not("+expr+")";}
return Sizzle.matches(expr,elems);};jQuery.dir=function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)
matched.push(cur);cur=cur[dir];}
return matched;};jQuery.nth=function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])
if(cur.nodeType==1&&++num==result)
break;return cur;};jQuery.sibling=function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)
r.push(n);}
return r;};return;window.Sizzle=Sizzle;})();jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)
return;if(elem.setInterval&&elem!=window)
elem=window;if(!handler.guid)
handler.guid=this.guid++;if(data!==undefined){var fn=handler;handler=this.proxy(fn);handler.data=data;}
var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(arguments.callee.elem,arguments):undefined;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();handler.type=namespaces.slice().sort().join(".");var handlers=events[type];if(jQuery.event.specialAll[type])
jQuery.event.specialAll[type].setup.call(elem,data,namespaces);if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem,data,namespaces)===false){if(elem.addEventListener)
elem.addEventListener(type,handle,false);else if(elem.attachEvent)
elem.attachEvent("on"+type,handle);}}
handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)
return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types===undefined||(typeof types==="string"&&types.charAt(0)=="."))
for(var type in events)
this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}
jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");if(events[type]){if(handler)
delete events[type][handler.guid];else
for(var handle in events[type])
if(namespace.test(events[type][handle].type))
delete events[type][handle];if(jQuery.event.specialAll[type])
jQuery.event.specialAll[type].teardown.call(elem,namespaces);for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem,namespaces)===false){if(elem.removeEventListener)
elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)
elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}
ret=null;delete events[type];}}});}
for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(event,data,elem,bubbling){var type=event.type||event;if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true;}
if(!elem){event.stopPropagation();if(this.global[type])
jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type])
jQuery.event.trigger(event,data,this.handle.elem);});}
if(!elem||elem.nodeType==3||elem.nodeType==8)
return undefined;event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event);}
event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle)
handle.apply(elem,data);if((!elem[type]||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)
event.result=false;if(!bubbling&&elem[type]&&!event.isDefaultPrevented()&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}
this.triggered=false;if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;if(parent)
jQuery.event.trigger(event,data,parent,true);}},handle:function(event){var all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;var namespaces=event.type.split(".");event.type=namespaces.shift();all=!namespaces.length&&!event.exclusive;var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||namespace.test(handler.type)){event.handler=handler;event.data=handler.data;var ret=handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}
if(event.isImmediatePropagationStopped())
break;}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando])
return event;var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop];}
if(!event.target)
event.target=event.srcElement||document;if(event.target.nodeType==3)
event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)
event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}
if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))
event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)
event.metaKey=event.ctrlKey;if(!event.which&&event.button)
event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy=proxy||function(){return fn.apply(this,arguments);};proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler);},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type))
remove++;});if(remove<1)
jQuery.event.remove(this,namespaces[0],liveHandler);}}}}};jQuery.Event=function(src){if(!this.preventDefault)
return new jQuery.Event(src);if(src&&src.type){this.originalEvent=src;this.type=src.type;}else
this.type=src;this.timeStamp=now();this[expando]=true;};function returnFalse(){return false;}
function returnTrue(){return true;}
jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e)
return;if(e.preventDefault)
e.preventDefault();e.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e)
return;if(e.stopPropagation)
e.stopPropagation();e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;while(parent&&parent!=this)
try{parent=parent.parentNode;}
catch(e){parent=this;}
if(parent!=this){event.type=event.data;jQuery.event.handle.apply(this,arguments);}};jQuery.each({mouseover:'mouseenter',mouseout:'mouseleave'},function(orig,fix){jQuery.event.special[fix]={setup:function(){jQuery.event.add(this,orig,withinElement,fix);},teardown:function(){jQuery.event.remove(this,orig,withinElement);}};});jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result;}},toggle:function(fn){var args=arguments,i=1;while(i<args.length)
jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)
fn.call(document,jQuery);else
jQuery.readyList.push(fn);return this;},live:function(type,fn){var proxy=jQuery.event.proxy(fn);proxy.guid+=this.selector+type;jQuery(document).bind(liveConvert(type,this.selector),this.selector,proxy);return this;},die:function(type,fn){jQuery(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);return this;}});function liveHandler(event){var check=RegExp("(^|\\.)"+event.type+"(\\.|$)"),stop=true,elems=[];jQuery.each(jQuery.data(this,"events").live||[],function(i,fn){if(check.test(fn.type)){var elem=jQuery(event.target).closest(fn.data)[0];if(elem)
elems.push({elem:elem,fn:fn});}});elems.sort(function(a,b){return jQuery.data(a.elem,"closest")-jQuery.data(b.elem,"closest");});jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false)
return(stop=false);});return stop;}
function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"|")].join(".");}
jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document,jQuery);});jQuery.readyList=null;}
jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);jQuery.ready();},false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);jQuery.ready();}});if(document.documentElement.doScroll&&window==window.top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}
jQuery.ready();})();}
jQuery.event.add(window,"load",jQuery.ready);}
jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,"+"change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});jQuery(window).bind('unload',function(){for(var id in jQuery.cache)
if(id!=1&&jQuery.cache[id].handle)
jQuery.event.remove(jQuery.cache[id].handle.elem);});(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();div.style.display="none";div.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return;}
jQuery.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"));}catch(e){}
root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id];}
root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",arguments.callee);});div.cloneNode(true).fireEvent("onclick");}
jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display='none';});})();var styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat";jQuery.props={"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string")
return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}
var type="GET";if(params)
if(jQuery.isFunction(params)){callback=params;params=null;}else if(typeof params==="object"){params=jQuery.param(params);type="POST";}
var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")
self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);if(callback)
self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}
return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}
return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string")
s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))
s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))
s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}
if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)
s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}
if(head)
head.removeChild(script);};}
if(s.dataType=="script"&&s.cache==null)
s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}
if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}
if(s.global&&!jQuery.active++)
jQuery.event.trigger("ajaxStart");var parts=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);if(s.dataType=="script"&&type=="GET"&&parts&&(parts[1]&&parts[1]!=location.protocol||parts[2]!=location.host)){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)
script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;head.removeChild(script);}};}
head.appendChild(script);return undefined;}
var requestDone=false;var xhr=s.xhr();if(s.username)
xhr.open(type,s.url,s.async,s.username,s.password);else
xhr.open(type,s.url,s.async);try{if(s.data)
xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)
xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}
if(s.beforeSend&&s.beforeSend(xhr,s)===false){if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");xhr.abort();return false;}
if(s.global)
jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(xhr.readyState==0){if(ival){clearInterval(ival);ival=null;if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");}}else if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}
status=isTimeout=="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s);}catch(e){status="parsererror";}}
if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}
if(s.ifModified&&modRes)
jQuery.lastModified[s.url]=modRes;if(!jsonp)
success();}else
jQuery.handleError(s,xhr,status);complete();if(isTimeout)
xhr.abort();if(s.async)
xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)
setTimeout(function(){if(xhr&&!requestDone)
onreadystatechange("timeout");},s.timeout);}
try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}
if(!s.async)
onreadystatechange();function success(){if(s.success)
s.success(data,status);if(s.global)
jQuery.event.trigger("ajaxSuccess",[xhr,s]);}
function complete(){if(s.complete)
s.complete(xhr,status);if(s.global)
jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");}
return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)
jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223;}catch(e){}
return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url];}catch(e){}
return false;},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")
throw"parsererror";if(s&&s.dataFilter)
data=s.dataFilter(data,type);if(typeof data==="string"){if(type=="script")
jQuery.globalEval(data);if(type=="json")
data=window["eval"]("("+data+")");}
return data;},param:function(a){var s=[];function add(key,value){s[s.length]=encodeURIComponent(key)+'='+encodeURIComponent(value);};if(jQuery.isArray(a)||a.jquery)
jQuery.each(a,function(){add(this.name,this.value);});else
for(var j in a)
if(jQuery.isArray(a[j]))
jQuery.each(a[j],function(){add(j,this);});else
add(j,jQuery.isFunction(a[j])?a[j]():a[j]);return s.join("&").replace(/%20/g,"+");}});var elemdisplay={},timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}
jQuery.fn.extend({show:function(speed,callback){if(speed){return this.animate(genFx("show",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var tagName=this[i].tagName,display;if(elemdisplay[tagName]){display=elemdisplay[tagName];}else{var elem=jQuery("<"+tagName+" />").appendTo("body");display=elem.css("display");if(display==="none")
display="block";elem.remove();elemdisplay[tagName]=display;}
jQuery.data(this[i],"olddisplay",display);}}
for(var i=0,l=this.length;i<l;i++){this[i].style.display=jQuery.data(this[i],"olddisplay")||"";}
return this;}},hide:function(speed,callback){if(speed){return this.animate(genFx("hide",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none")
jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"));}
for(var i=0,l=this.length;i<l;i++){this[i].style.display="none";}
return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();}):this.animate(genFx("toggle",3),fn,fn2);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType==1&&jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)
return opt.complete.call(this);if((p=="height"||p=="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}
if(opt.overflow!=null)
this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))
e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}
if(parts[1])
end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
e.custom(start,val,"");}});return true;});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)
this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)
if(timers[i].elem==this){if(gotoEnd)
timers[i](true);timers.splice(i,1);}});if(!gotoEnd)
this.dequeue();return this;}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)
jQuery(this).dequeue();if(jQuery.isFunction(opt.old))
opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)
options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)
this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style)
this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))
return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd);}
t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)
if(!timers[i]())
timers.splice(i--,1);if(!timers.length){clearInterval(timerId);timerId=undefined;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)
if(this.options.curAnim[i]!==true)
done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")
this.elem.style.display="block";}
if(this.options.hide)
jQuery(this.elem).hide();if(this.options.hide||this.options.show)
for(var p in this.options.curAnim)
jQuery.attr(this.elem.style,p,this.options.orig[p]);this.options.complete.call(this.elem);}
return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}
return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null)
fx.elem.style[fx.prop]=fx.now+fx.unit;else
fx.elem[fx.prop]=fx.now;}}});if(document.documentElement["getBoundingClientRect"])
jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left};};else
jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);jQuery.offset.initialized||jQuery.offset.initialize();var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);top-=elem.scrollTop,left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName)))
top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;}
if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible")
top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevComputedStyle=computedStyle;}
if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static")
top+=body.offsetTop,left+=body.offsetLeft;if(prevComputedStyle.position==="fixed")
top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft);return{top:top,left:left};};jQuery.offset={initialize:function(){if(this.initialized)return;var body=document.body,container=document.createElement('div'),innerDiv,checkDiv,table,td,rules,prop,bodyMarginTop=body.style.marginTop,html='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';rules={position:'absolute',top:0,left:0,margin:0,border:0,width:'1px',height:'1px',visibility:'hidden'};for(prop in rules)container.style[prop]=rules[prop];container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);innerDiv.style.overflow='hidden',innerDiv.style.position='relative';this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);body.style.marginTop='1px';this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);body.style.marginTop=bodyMarginTop;body.removeChild(container);this.initialized=true;},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();var top=body.offsetTop,left=body.offsetLeft;if(jQuery.offset.doesNotIncludeMarginInBodyOffset)
top+=parseInt(jQuery.curCSS(body,'marginTop',true),10)||0,left+=parseInt(jQuery.curCSS(body,'marginLeft',true),10)||0;return{top:top,left:left};}};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}
return results;},offsetParent:function(){var offsetParent=this[0].offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))
offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return null;return val!==undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom",lower=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],lower,false,"padding"):null;};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],lower,false,margin?"margin":"border"):null;};var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px");};});})();;(function($){var ver='2.30';var ie6=$.browser.msie&&/MSIE 6.0/.test(navigator.userAgent);function log(){if(window.console&&window.console.log)
window.console.log('[cycle] '+Array.prototype.join.call(arguments,''));};$.fn.cycle=function(options){var opt2=arguments[1];return this.each(function(){if(options===undefined||options===null)
options={};if(options.constructor==String){switch(options){case'stop':if(this.cycleTimeout)clearTimeout(this.cycleTimeout);this.cycleTimeout=0;$(this).data('cycle.opts','');return;case'pause':this.cyclePause=1;return;case'resume':this.cyclePause=0;if(opt2===true){options=$(this).data('cycle.opts');if(!options){log('options not found, can not resume');return;}
if(this.cycleTimeout){clearTimeout(this.cycleTimeout);this.cycleTimeout=0;}
go(options.elements,options,1,1);}
return;default:options={fx:options};};}
else if(options.constructor==Number){var num=options;options=$(this).data('cycle.opts');if(!options){log('options not found, can not advance slide');return;}
if(num<0||num>=options.elements.length){log('invalid slide index: '+num);return;}
options.nextSlide=num;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);this.cycleTimeout=0;}
go(options.elements,options,1,num>=options.currSlide);return;}
if(this.cycleTimeout)clearTimeout(this.cycleTimeout);this.cycleTimeout=0;this.cyclePause=0;var $cont=$(this);var $slides=options.slideExpr?$(options.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log('terminating; too few slides: '+els.length);return;}
var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop)
opts.countdown=opts.autostopCount||els.length;$cont.data('cycle.opts',opts);opts.container=this;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});if(opts.continuous)
opts.after.push(function(){go(els,opts,0,!opts.rev);});if(ie6&&opts.cleartype&&!opts.cleartypeNoBg)
clearTypeFix($slides);var cls=this.className;opts.width=parseInt((cls.match(/w:(\d+)/)||[])[1])||opts.width;opts.height=parseInt((cls.match(/h:(\d+)/)||[])[1])||opts.height;opts.timeout=parseInt((cls.match(/t:(\d+)/)||[])[1])||opts.timeout;if($cont.css('position')=='static')
$cont.css('position','relative');if(opts.width)
$cont.width(opts.width);if(opts.height&&opts.height!='auto')
$cont.height(opts.height);if(opts.startingSlide)opts.startingSlide=parseInt(opts.startingSlide);if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++)
opts.randomMap.push(i);opts.randomMap.sort(function(a,b){return Math.random()-0.5;});opts.randomIndex=0;opts.startingSlide=opts.randomMap[0];}
else if(opts.startingSlide>=els.length)
opts.startingSlide=0;var first=opts.startingSlide||0;$slides.css({position:'absolute',top:0,left:0}).hide().each(function(i){var z=first?i>=first?els.length-(i-first):first-i:els.length-i;$(this).css('z-index',z)});$(els[first]).css('opacity',1).show();if($.browser.msie)els[first].style.removeAttribute('filter');if(opts.fit&&opts.width)
$slides.width(opts.width);if(opts.fit&&opts.height&&opts.height!='auto')
$slides.height(opts.height);if(opts.pause)
$cont.hover(function(){this.cyclePause=1;},function(){this.cyclePause=0;});var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init))
init($cont,$slides,opts);else if(opts.fx!='custom')
log('unknown transition: '+opts.fx);$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:$el.height();this.cycleW=(opts.fit&&opts.width)?opts.width:$el.width();});opts.cssBefore=opts.cssBefore||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(':eq('+first+')').css(opts.cssBefore);if(opts.cssFirst)
$($slides[first]).css(opts.cssFirst);if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String)
opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed);if(!opts.sync)
opts.speed=opts.speed/2;while((opts.timeout-opts.speed)<250)
opts.timeout+=opts.speed;}
if(opts.easing)
opts.easeIn=opts.easeOut=opts.easing;if(!opts.speedIn)
opts.speedIn=opts.speed;if(!opts.speedOut)
opts.speedOut=opts.speed;opts.slideCount=els.length;opts.currSlide=first;if(opts.random){opts.nextSlide=opts.currSlide;if(++opts.randomIndex==els.length)
opts.randomIndex=0;opts.nextSlide=opts.randomMap[opts.randomIndex];}
else
opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;var e0=$slides[first];if(opts.before.length)
opts.before[0].apply(e0,[e0,e0,opts,true]);if(opts.after.length>1)
opts.after[1].apply(e0,[e0,e0,opts,true]);if(opts.click&&!opts.next)
opts.next=opts.click;if(opts.next)
$(opts.next).bind('click',function(){return advance(els,opts,opts.rev?-1:1)});if(opts.prev)
$(opts.prev).bind('click',function(){return advance(els,opts,opts.rev?1:-1)});if(opts.pager)
buildPager(els,opts);opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount)
opts.countdown++;els[prepend?'unshift':'push'](s);if(opts.els)
opts.els[prepend?'unshift':'push'](s);opts.slideCount=els.length;$s.css('position','absolute');$s[prepend?'prependTo':'appendTo']($cont);if(prepend){opts.currSlide++;opts.nextSlide++;}
if(ie6&&opts.cleartype&&!opts.cleartypeNoBg)
clearTypeFix($s);if(opts.fit&&opts.width)
$s.width(opts.width);if(opts.fit&&opts.height&&opts.height!='auto')
$slides.height(opts.height);s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager)
$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);if(typeof opts.onAddSlide=='function')
opts.onAddSlide($s);};if(opts.timeout||opts.continuous)
this.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},opts.continuous?10:opts.timeout+(opts.delay||0));});};function go(els,opts,manual,fwd){if(opts.busy)return;var p=opts.container,curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleTimeout===0&&!manual)
return;if(!manual&&!p.cyclePause&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end)
opts.end(opts);return;}
if(manual||!p.cyclePause){if(opts.before.length)
$.each(opts.before,function(i,o){o.apply(next,[curr,next,opts,fwd]);});var after=function(){if($.browser.msie&&opts.cleartype)
this.style.removeAttribute('filter');$.each(opts.after,function(i,o){o.apply(next,[curr,next,opts,fwd]);});};if(opts.nextSlide!=opts.currSlide){opts.busy=1;if(opts.fxFn)
opts.fxFn(curr,next,opts,after,fwd);else if($.isFunction($.fn.cycle[opts.fx]))
$.fn.cycle[opts.fx](curr,next,opts,after);else
$.fn.cycle.custom(curr,next,opts,after,manual&&opts.fastOnEvent);}
if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length)
opts.randomIndex=0;opts.nextSlide=opts.randomMap[opts.randomIndex];}
else{var roll=(opts.nextSlide+1)==els.length;opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}
if(opts.pager)
$.fn.cycle.updateActivePagerLink(opts.pager,opts.currSlide);}
if(opts.timeout&&!opts.continuous)
p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},opts.timeout);else if(opts.continuous&&p.cyclePause)
p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},10);};$.fn.cycle.updateActivePagerLink=function(pager,currSlide){$(pager).find('a').removeClass('activeSlide').filter('a:eq('+currSlide+')').addClass('activeSlide');};function advance(els,opts,val){var p=opts.container,timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}
if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2)
opts.randomIndex=els.length-2;else if(opts.randomIndex==-1)
opts.randomIndex=els.length-1;opts.nextSlide=opts.randomMap[opts.randomIndex];}
else if(opts.random){if(++opts.randomIndex==els.length)
opts.randomIndex=0;opts.nextSlide=opts.randomMap[opts.randomIndex];}
else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap)return false;opts.nextSlide=els.length-1;}
else if(opts.nextSlide>=els.length){if(opts.nowrap)return false;opts.nextSlide=0;}}
if(opts.pnClick&&typeof opts.pnClick=='function')
opts.pnClick(val>0,opts.nextSlide,els[opts.nextSlide]);go(els,opts,1,val>=0);return false;};function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});$.fn.cycle.updateActivePagerLink(opts.pager,opts.startingSlide);};$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var $a=(typeof opts.pagerAnchorBuilder=='function')?$(opts.pagerAnchorBuilder(i,el)):$('<a href="#">'+(i+1)+'</a>');if($a.parents('body').length==0)
$a.appendTo($p);$a.bind(opts.pagerEvent,function(){opts.nextSlide=i;var p=opts.container,timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}
if(typeof opts.pagerClick=='function')
opts.pagerClick(opts.nextSlide,els[opts.nextSlide]);go(els,opts,1,opts.currSlide<i);return false;});if(opts.pauseOnPagerHover)
$a.hover(function(){opts.container.cyclePause=1;},function(){opts.container.cyclePause=0;});};function clearTypeFix($slides){function hex(s){var s=parseInt(s).toString(16);return s.length<2?'0'+s:s;};function getBg(e){for(;e&&e.nodeName.toLowerCase()!='html';e=e.parentNode){var v=$.css(e,'background-color');if(v.indexOf('rgb')>=0){var rgb=v.match(/\d+/g);return'#'+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}
if(v&&v!='transparent')
return v;}
return'#ffffff';};$slides.each(function(){$(this).css('background-color',getBg(this));});};$.fn.cycle.custom=function(curr,next,opts,cb,immediate){var $l=$(curr),$n=$(next);$n.css(opts.cssBefore);var speedIn=immediate?1:opts.speedIn;var speedOut=immediate?1:opts.speedOut;var easeIn=immediate?null:opts.easeIn;var easeOut=immediate?null:opts.easeOut;var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,cb)};$l.animate(opts.animOut,speedOut,easeOut,function(){if(opts.cssAfter)$l.css(opts.cssAfter);if(!opts.sync)fn();});if(opts.sync)fn();};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(':eq('+opts.startingSlide+')').css('opacity',0);opts.before.push(function(){$(this).show()});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={opacity:0};opts.cssAfter={display:'none'};opts.onAddSlide=function($s){$s.hide();};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={fx:'fade',timeout:4000,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,pnClick:null,pager:null,pagerClick:null,pagerEvent:'click',pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:'auto',startingSlide:0,sync:1,random:0,fit:0,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:0,nowrap:0,fastOnEvent:0};})(jQuery);(function($){$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css('overflow','hidden').width();$slides.show();opts.before.push(function(curr,next,opts){$(curr).css('zIndex',1);});opts.cssBefore={left:w,zIndex:2};opts.cssAfter={zIndex:1};opts.animIn={left:0};opts.animOut={left:w};};})(jQuery);(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var running=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var div=$(this),ul=$("ul",div),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v;}
var li=$("li",ul),itemLength=li.size(),curr=o.start;div.css("visibility","visible");li.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});div.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var liSize=o.vertical?height(li):width(li);var ulSize=liSize*itemLength;var divSize=liSize*v;li.css({width:li.width(),height:li.height()});ul.css(sizeCss,ulSize+"px").css(animCss,-(curr*liSize));div.css(sizeCss,divSize+"px");if(o.btnPrev)
$(o.btnPrev).click(function(){return go(curr-o.scroll);});if(o.btnNext)
$(o.btnNext).click(function(){return go(curr+o.scroll);});if(o.btnGo)
$.each(o.btnGo,function(i,val){$(val).click(function(){return go(o.circular?o.visible+i:i);});});if(o.mouseWheel&&div.mousewheel)
div.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll);});if(o.auto)
setInterval(function(){go(curr+o.scroll);},o.auto+o.speed);function vis(){return li.slice(curr).slice(0,v);};function go(to){if(!running){if(o.beforeStart)
o.beforeStart.call(this,vis());if(o.circular){if(to<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*liSize)+"px");curr=to==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll;}else if(to>=itemLength-v+1){ul.css(animCss,-((v)*liSize)+"px");curr=to==itemLength-v+1?v+1:v+o.scroll;}else curr=to;}else{if(to<0||to>itemLength-v)return;else curr=to;}
running=true;ul.animate(animCss=="left"?{left:-(curr*liSize)}:{top:-(curr*liSize)},o.speed,o.easing,function(){if(o.afterEnd)
o.afterEnd.call(this,vis());running=false;});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled");}}
return false;};});};function css(el,prop){return parseInt($.css(el[0],prop))||0;};function width(el){return el[0].offsetWidth+css(el,'marginLeft')+css(el,'marginRight');};function height(el){return el[0].offsetHeight+css(el,'marginTop')+css(el,'marginBottom');};})(jQuery);;(function($){$.ui={plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},cssCache:{},css:function(name){if($.ui.cssCache[name]){return $.ui.cssCache[name];}
var tmp=$('<div class="ui-gen">').addClass(name).css({position:'absolute',top:'-5000px',left:'-5000px',display:'block'}).appendTo('body');$.ui.cssCache[name]=!!((!(/auto|default/).test(tmp.css('cursor'))||(/^[1-9]/).test(tmp.css('height'))||(/^[1-9]/).test(tmp.css('width'))||!(/none/).test(tmp.css('backgroundImage'))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))));try{$('body').get(0).removeChild(tmp.get(0));}catch(e){}
return $.ui.cssCache[name];},disableSelection:function(el){$(el).attr('unselectable','on').css('MozUserSelect','none');},enableSelection:function(el){$(el).attr('unselectable','off').css('MozUserSelect','');},hasScroll:function(e,a){var scroll=/top/.test(a||"top")?'scrollTop':'scrollLeft',has=false;if(e[scroll]>0)return true;e[scroll]=1;has=e[scroll]>0?true:false;e[scroll]=0;return has;}};var _remove=$.fn.remove;$.fn.remove=function(){$("*",this).add(this).triggerHandler("remove");return _remove.apply(this,arguments);};function getter(namespace,plugin,method){var methods=$[namespace][plugin].getter||[];methods=(typeof methods=="string"?methods.split(/,?\s+/):methods);return($.inArray(method,methods)!=-1);}
$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&getter(namespace,name,options)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);if(isMethodCall&&instance&&$.isFunction(instance[options])){instance[options].apply(instance,args);}else if(!isMethodCall){$.data(this,name,new $[namespace][name](this,options));}});};$[namespace][name]=function(element,options){var self=this;this.widgetName=name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,options);this.element=$(element).bind('setData.'+name,function(e,key,value){return self.setData(key,value);}).bind('getData.'+name,function(e,key){return self.getData(key);}).bind('remove',function(){return self.destroy();});this.init();};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);};$.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName);},getData:function(key){return this.options[key];},setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled');}},enable:function(){this.setData('disabled',false);},disable:function(){this.setData('disabled',true);}};$.widget.defaults={disabled:false};$.ui.mouse={mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(e){return self.mouseDown(e);});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
this.started=false;},mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},mouseDown:function(e){(this._mouseStarted&&this.mouseUp(e));this._mouseDownEvent=e;var self=this,btnIsLeft=(e.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(e.target).parents().add(e.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this.mouseCapture(e)){return true;}
this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self._mouseDelayMet=true;},this.options.delay);}
if(this.mouseDistanceMet(e)&&this.mouseDelayMet(e)){this._mouseStarted=(this.mouseStart(e)!==false);if(!this._mouseStarted){e.preventDefault();return true;}}
this._mouseMoveDelegate=function(e){return self.mouseMove(e);};this._mouseUpDelegate=function(e){return self.mouseUp(e);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);return false;},mouseMove:function(e){if($.browser.msie&&!e.button){return this.mouseUp(e);}
if(this._mouseStarted){this.mouseDrag(e);return false;}
if(this.mouseDistanceMet(e)&&this.mouseDelayMet(e)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,e)!==false);(this._mouseStarted?this.mouseDrag(e):this.mouseUp(e));}
return!this._mouseStarted;},mouseUp:function(e){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(e);}
return false;},mouseDistanceMet:function(e){return(Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance);},mouseDelayMet:function(e){return this._mouseDelayMet;},mouseStart:function(e){},mouseDrag:function(e){},mouseStop:function(e){},mouseCapture:function(e){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);(function($){$.widget("ui.tabs",{init:function(){this.options.event+='.tabs';this.tabify(true);},setData:function(key,value){if((/^selected/).test(key))
this.select(value);else{this.options[key]=value;this.tabify();}},length:function(){return this.$tabs.length;},tabId:function(a){return a.title&&a.title.replace(/\s/g,'_').replace(/[^A-Za-z0-9\-_:\.]/g,'')||this.options.idPrefix+$.data(a);},ui:function(tab,panel){return{options:this.options,tab:tab,panel:panel,index:this.$tabs.index(tab)};},tabify:function(init){this.$lis=$('li:has(a[href])',this.element);this.$tabs=this.$lis.map(function(){return $('a',this)[0];});this.$panels=$([]);var self=this,o=this.options;this.$tabs.each(function(i,a){if(a.hash&&a.hash.replace('#',''))
self.$panels=self.$panels.add(a.hash);else if($(a).attr('href')!='#'){$.data(a,'href.tabs',a.href);$.data(a,'load.tabs',a.href);var id=self.tabId(a);a.href='#'+id;var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.panelClass).insertAfter(self.$panels[i-1]||self.element);$panel.data('destroy.tabs',true);}
self.$panels=self.$panels.add($panel);}
else
o.disabled.push(i+1);});if(init){this.element.addClass(o.navClass);this.$panels.each(function(){var $this=$(this);$this.addClass(o.panelClass);});if(o.selected===undefined){if(location.hash){this.$tabs.each(function(i,a){if(a.hash==location.hash){o.selected=i;if($.browser.msie||$.browser.opera){var $toShow=$(location.hash),toShowId=$toShow.attr('id');$toShow.attr('id','');setTimeout(function(){$toShow.attr('id',toShowId);},500);}
scrollTo(0,0);return false;}});}
else if(o.cookie){var index=parseInt($.cookie('ui-tabs'+$.data(self.element)),10);if(index&&self.$tabs[index])
o.selected=index;}
else if(self.$lis.filter('.'+o.selectedClass).length)
o.selected=self.$lis.index(self.$lis.filter('.'+o.selectedClass)[0]);}
o.selected=o.selected===null||o.selected!==undefined?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.$lis.filter('.'+o.disabledClass),function(n,i){return self.$lis.index(n);}))).sort();if($.inArray(o.selected,o.disabled)!=-1)
o.disabled.splice($.inArray(o.selected,o.disabled),1);this.$panels.addClass(o.hideClass);this.$lis.removeClass(o.selectedClass);if(o.selected!==null){this.$panels.eq(o.selected).show().removeClass(o.hideClass);this.$lis.eq(o.selected).addClass(o.selectedClass);var onShow=function(){$(self.element).triggerHandler('tabsshow',[self.fakeEvent('tabsshow'),self.ui(self.$tabs[o.selected],self.$panels[o.selected])],o.show);};if($.data(this.$tabs[o.selected],'load.tabs'))
this.load(o.selected,onShow);else
onShow();}
$(window).bind('unload',function(){self.$tabs.unbind('.tabs');self.$lis=self.$tabs=self.$panels=null;});}
for(var i=0,li;li=this.$lis[i];i++)
$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass(o.selectedClass)?'addClass':'removeClass'](o.disabledClass);if(o.cache===false)
this.$tabs.removeData('cache.tabs');var hideFx,showFx,baseFx={'min-width':0,duration:1},baseDuration='normal';if(o.fx&&o.fx.constructor==Array)
hideFx=o.fx[0]||baseFx,showFx=o.fx[1]||baseFx;else
hideFx=showFx=o.fx||baseFx;var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie)
resetCSS.opacity='';function hideTab(clicked,$hide,$show){$hide.animate(hideFx,hideFx.duration||baseDuration,function(){$hide.addClass(o.hideClass).css(resetCSS);if($.browser.msie&&hideFx.opacity)
$hide[0].style.filter='';if($show)
showTab(clicked,$show,$hide);});}
function showTab(clicked,$show,$hide){if(showFx===baseFx)
$show.css('display','block');$show.animate(showFx,showFx.duration||baseDuration,function(){$show.removeClass(o.hideClass).css(resetCSS);if($.browser.msie&&showFx.opacity)
$show[0].style.filter='';$(self.element).triggerHandler('tabsshow',[self.fakeEvent('tabsshow'),self.ui(clicked,$show[0])],o.show);});}
function switchTab(clicked,$li,$hide,$show){$li.addClass(o.selectedClass).siblings().removeClass(o.selectedClass);hideTab(clicked,$hide,$show);}
this.$tabs.unbind('.tabs').bind(o.event,function(){var $li=$(this).parents('li:eq(0)'),$hide=self.$panels.filter(':visible'),$show=$(this.hash);if(($li.hasClass(o.selectedClass)&&!o.unselect)||$li.hasClass(o.disabledClass)||$(this).hasClass(o.loadingClass)||$(self.element).triggerHandler('tabsselect',[self.fakeEvent('tabsselect'),self.ui(this,$show[0])],o.select)===false){this.blur();return false;}
self.options.selected=self.$tabs.index(this);if(o.unselect){if($li.hasClass(o.selectedClass)){self.options.selected=null;$li.removeClass(o.selectedClass);self.$panels.stop();hideTab(this,$hide);this.blur();return false;}else if(!$hide.length){self.$panels.stop();var a=this;self.load(self.$tabs.index(this),function(){$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(a,$show);});this.blur();return false;}}
if(o.cookie)
$.cookie('ui-tabs'+$.data(self.element),self.options.selected,o.cookie);self.$panels.stop();if($show.length){var a=this;self.load(self.$tabs.index(this),$hide.length?function(){switchTab(a,$li,$hide,$show);}:function(){$li.addClass(o.selectedClass);showTab(a,$show);});}else
throw'jQuery UI Tabs: Mismatching fragment identifier.';if($.browser.msie)
this.blur();return false;});if(!(/^click/).test(o.event))
this.$tabs.bind('click.tabs',function(){return false;});},add:function(url,label,index){if(index==undefined)
index=this.$tabs.length;var o=this.options;var $li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label));$li.data('destroy.tabs',true);var id=url.indexOf('#')==0?url.replace('#',''):this.tabId($('a:first-child',$li)[0]);var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.hideClass).data('destroy.tabs',true);}
$panel.addClass(o.panelClass);if(index>=this.$lis.length){$li.appendTo(this.element);$panel.appendTo(this.element[0].parentNode);}else{$li.insertBefore(this.$lis[index]);$panel.insertBefore(this.$panels[index]);}
o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n});this.tabify();if(this.$tabs.length==1){$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href=$.data(this.$tabs[0],'load.tabs');if(href)
this.load(index,href);}
this.element.triggerHandler('tabsadd',[this.fakeEvent('tabsadd'),this.ui(this.$tabs[index],this.$panels[index])],o.add);},remove:function(index){var o=this.options,$li=this.$lis.eq(index).remove(),$panel=this.$panels.eq(index).remove();if($li.hasClass(o.selectedClass)&&this.$tabs.length>1)
this.select(index+(index+1<this.$tabs.length?1:-1));o.disabled=$.map($.grep(o.disabled,function(n,i){return n!=index;}),function(n,i){return n>=index?--n:n});this.tabify();this.element.triggerHandler('tabsremove',[this.fakeEvent('tabsremove'),this.ui($li.find('a')[0],$panel[0])],o.remove);},enable:function(index){var o=this.options;if($.inArray(index,o.disabled)==-1)
return;var $li=this.$lis.eq(index).removeClass(o.disabledClass);if($.browser.safari){$li.css('display','inline-block');setTimeout(function(){$li.css('display','block');},0);}
o.disabled=$.grep(o.disabled,function(n,i){return n!=index;});this.element.triggerHandler('tabsenable',[this.fakeEvent('tabsenable'),this.ui(this.$tabs[index],this.$panels[index])],o.enable);},disable:function(index){var self=this,o=this.options;if(index!=o.selected){this.$lis.eq(index).addClass(o.disabledClass);o.disabled.push(index);o.disabled.sort();this.element.triggerHandler('tabsdisable',[this.fakeEvent('tabsdisable'),this.ui(this.$tabs[index],this.$panels[index])],o.disable);}},select:function(index){if(typeof index=='string')
index=this.$tabs.index(this.$tabs.filter('[href$='+index+']')[0]);this.$tabs.eq(index).trigger(this.options.event);},load:function(index,callback){var self=this,o=this.options,$a=this.$tabs.eq(index),a=$a[0],bypassCache=callback==undefined||callback===false,url=$a.data('load.tabs');callback=callback||function(){};if(!url||!bypassCache&&$.data(a,'cache.tabs')){callback();return;}
var inner=function(parent){var $parent=$(parent),$inner=$parent.find('*:last');return $inner.length&&$inner.is(':not(img)')&&$inner||$parent;};var cleanup=function(){self.$tabs.filter('.'+o.loadingClass).removeClass(o.loadingClass).each(function(){if(o.spinner)
inner(this).parent().html(inner(this).data('label.tabs'));});self.xhr=null;};if(o.spinner){var label=inner(a).html();inner(a).wrapInner('<em></em>').find('em').data('label.tabs',label).html(o.spinner);}
var ajaxOptions=$.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(a.hash).html(r);cleanup();if(o.cache)
$.data(a,'cache.tabs',true);$(self.element).triggerHandler('tabsload',[self.fakeEvent('tabsload'),self.ui(self.$tabs[index],self.$panels[index])],o.load);o.ajaxOptions.success&&o.ajaxOptions.success(r,s);callback();}});if(this.xhr){this.xhr.abort();cleanup();}
$a.addClass(o.loadingClass);setTimeout(function(){self.xhr=$.ajax(ajaxOptions);},0);},url:function(index,url){this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs',url);},destroy:function(){var o=this.options;this.element.unbind('.tabs').removeClass(o.navClass).removeData('tabs');this.$tabs.each(function(){var href=$.data(this,'href.tabs');if(href)
this.href=href;var $this=$(this).unbind('.tabs');$.each(['href','load','cache'],function(i,prefix){$this.removeData(prefix+'.tabs');});});this.$lis.add(this.$panels).each(function(){if($.data(this,'destroy.tabs'))
$(this).remove();else
$(this).removeClass([o.selectedClass,o.unselectClass,o.disabledClass,o.panelClass,o.hideClass].join(' '));});},fakeEvent:function(type){return $.event.fix({type:type,target:this.element[0]});}});$.ui.tabs.defaults={unselect:false,event:'click',disabled:[],cookie:null,spinner:'Loading&#8230;',cache:false,idPrefix:'ui-tabs-',ajaxOptions:{},fx:null,tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>',panelTemplate:'<div></div>',navClass:'ui-tabs-nav',selectedClass:'ui-tabs-selected',unselectClass:'ui-tabs-unselect',disabledClass:'ui-tabs-disabled',panelClass:'ui-tabs-panel',hideClass:'ui-tabs-hide',loadingClass:'ui-tabs-loading'};$.ui.tabs.getter="length";$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){continuing=continuing||false;var self=this,t=this.options.selected;function start(){self.rotation=setInterval(function(){t=++t<self.$tabs.length?t:0;self.select(t);},ms);}
function stop(e){if(!e||e.clientX){clearInterval(self.rotation);}}
if(ms){start();if(!continuing)
this.$tabs.bind(this.options.event,stop);else
this.$tabs.bind(this.options.event,function(){stop();t=self.options.selected;start();});}
else{stop();this.$tabs.unbind(this.options.event,stop);}}});})(jQuery);(function(){function $m(){var elements=[];for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof(element)=='string'){element=document.getElementById(element);}
if(arguments.length==1){return element;}
elements.push(element);}
return elements;}
function loadScript(src,callback){var script=document.createElement('script');script.type='text/javascript';script.src=src;if(callback){var evl={};evl.handleEvent=function(e){callback();};script.addEventListener('load',evl,true);}
document.getElementsByTagName('head')[0].appendChild(script);return;}
function convertLatLonXY_Yahoo(point,level){var size=1<<(26-level);var pixel_per_degree=size/360.0;var pixel_per_radian=size/(2*Math.PI);var origin=new YCoordPoint(size/2,size/2);var answer=new YCoordPoint();answer.x=Math.floor(origin.x+point.lon*pixel_per_degree);var sin=Math.sin(point.lat*Math.PI/180.0);answer.y=Math.floor(origin.y+0.5*Math.log((1+sin)/(1-sin))*-pixel_per_radian);return answer;}
function loadStyle(href){var link=document.createElement('link');link.type='text/css';link.rel='stylesheet';link.href=href;document.getElementsByTagName('head')[0].appendChild(link);return;}
function getStyle(el,prop){var y;if(el.currentStyle){y=el.currentStyle[prop];}
else if(window.getComputedStyle){y=window.getComputedStyle(el,'').getPropertyValue(prop);}
return y;}
function lonToMetres(lon,lat){return lon*(111200*Math.cos(lat*(Math.PI/180)));}
function metresToLon(m,lat){return m/(111200*Math.cos(lat*(Math.PI/180)));}
function KMToMiles(km){return km/1.609344;}
function milesToKM(miles){return miles*1.609344;}
function getDegreesFromGoogleZoomLevel(pixels,zoom){return(360*pixels)/(Math.pow(2,zoom+8));}
function getGoogleZoomLevelFromDegrees(pixels,degrees){return logN((360*pixels)/degrees,2)-8;}
function logN(number,base){return Math.log(number)/Math.log(base);}
function Mapstraction(element,api,debug){this.api=api;this.maps={};this.currentElement=$m(element);this.eventListeners=[];this.markers=[];this.layers=[];this.polylines=[];this.images=[];this.loaded={};this.onload={};if(debug===true){this.debug=true;}
else{this.debug=false;}
this.svn_revision_string='$Revision$';this.addControlsArgs={};this.addAPI($m(element),api);}
Mapstraction.prototype.swap=function(element,api){if(this.api==api){return;}
var center=this.getCenter();var zoom=this.getZoom();this.currentElement.style.visibility='hidden';this.currentElement.style.display='none';this.currentElement=$m(element);this.currentElement.style.visibility='visible';this.currentElement.style.display='block';this.api=api;if(this.maps[this.api]===undefined){this.addAPI($m(element),api);this.setCenterAndZoom(center,zoom);for(var i=0;i<this.markers.length;i++){this.addMarker(this.markers[i],true);}
for(var j=0;j<this.polylines.length;j++){this.addPolyline(this.polylines[j],true);}}
else{this.setCenterAndZoom(center,zoom);}
this.addControls(this.addControlsArgs);};Mapstraction.prototype.addAPI=function(element,api){this.loaded[api]=false;this.onload[api]=[];var me=this;switch(api){case'yahoo':if(YMap){this.maps[api]=new YMap(element);YEvent.Capture(this.maps[api],EventsList.MouseClick,function(event,location){me.clickHandler(location.Lat,location.Lon,location,me);});YEvent.Capture(this.maps[api],EventsList.changeZoom,function(){me.moveendHandler(me);});YEvent.Capture(this.maps[api],EventsList.endPan,function(){me.moveendHandler(me);});this.loaded[api]=true;}
else{alert(api+' map script not imported');}
break;case'google':if(GMap2){if(GBrowserIsCompatible()){this.maps[api]=new GMap2(element);GEvent.addListener(this.maps[api],'click',function(marker,location){if(location){me.clickHandler(location.y,location.x,location,me);}});GEvent.addListener(this.maps[api],'moveend',function(){me.moveendHandler(me);});this.loaded[api]=true;}
else{alert('browser not compatible with Google Maps');}}
else{alert(api+' map script not imported');}
break;case'microsoft':if(VEMap){element.style.position='relative';var msft_width=parseFloat(getStyle($m(element),'width'));var msft_height=parseFloat(getStyle($m(element),'height'));var ffv=0;var ffn="Firefox/";var ffp=navigator.userAgent.indexOf(ffn);if(ffp!=-1){ffv=parseFloat(navigator.userAgent.substring(ffp+ffn.length));}
if(ffv>=1.5){Msn.Drawing.Graphic.CreateGraphic=function(f,b){return new Msn.Drawing.SVGGraphic(f,b);};}
this.maps[api]=new VEMap(element.id);this.maps[api].LoadMap();this.maps[api].AttachEvent("onclick",function(e){me.clickHandler(e.view.LatLong.Latitude,e.view.LatLong.Longitude,me);});this.maps[api].AttachEvent("onchangeview",function(e){me.moveendHandler(me);});this.resizeTo(msft_width,msft_height);this.loaded[api]=true;}
else{alert(api+' map script not imported');}
break;case'openlayers':this.maps[api]=new OpenLayers.Map(element.id,{maxExtent:new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),maxResolution:156543,numZoomLevels:18,units:'meters',projection:"EPSG:41001"});this.layers['osmmapnik']=new OpenLayers.Layer.TMS('OSM Mapnik',["http://a.tile.openstreetmap.org/","http://b.tile.openstreetmap.org/","http://c.tile.openstreetmap.org/"],{type:'png',getURL:function(bounds){var res=this.map.getResolution();var x=Math.round((bounds.left-this.maxExtent.left)/(res*this.tileSize.w));var y=Math.round((this.maxExtent.top-bounds.top)/(res*this.tileSize.h));var z=this.map.getZoom();var limit=Math.pow(2,z);if(y<0||y>=limit){return null;}else{x=((x%limit)+limit)%limit;var path=z+"/"+x+"/"+y+"."+this.type;var url=this.url;if(url instanceof Array){url=this.selectUrl(path,url);}
return url+path;}},displayOutsideMaxExtent:true});this.layers['osm']=new OpenLayers.Layer.TMS('OSM',["http://a.tah.openstreetmap.org/Tiles/tile.php/","http://b.tah.openstreetmap.org/Tiles/tile.php/","http://c.tah.openstreetmap.org/Tiles/tile.php/"],{type:'png',getURL:function(bounds){var res=this.map.getResolution();var x=Math.round((bounds.left-this.maxExtent.left)/(res*this.tileSize.w));var y=Math.round((this.maxExtent.top-bounds.top)/(res*this.tileSize.h));var z=this.map.getZoom();var limit=Math.pow(2,z);if(y<0||y>=limit){return null;}else{x=((x%limit)+limit)%limit;var path=z+"/"+x+"/"+y+"."+this.type;var url=this.url;if(url instanceof Array){url=this.selectUrl(path,url);}
return url+path;}},displayOutsideMaxExtent:true});this.maps[api].addLayer(this.layers['osmmapnik']);this.maps[api].addLayer(this.layers['osm']);this.loaded[api]=true;break;case'openstreetmap':if(GMap2){if(GBrowserIsCompatible()){this.maps[api]=new GMap2(element);GEvent.addListener(this.maps[api],'click',function(marker,location){if(location){me.clickHandler(location.y,location.x,location,me);}});GEvent.addListener(this.maps[api],'moveend',function(){me.moveendHandler(me);});var copyright=new GCopyright(1,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),0,"copyleft");var copyrightCollection=new GCopyrightCollection('OSM');copyrightCollection.addCopyright(copyright);var tilelayers=[];tilelayers[0]=new GTileLayer(copyrightCollection,1,18);tilelayers[0].getTileUrl=function(a,b){return"http://tile.openstreetmap.org/"+b+"/"+a.x+"/"+a.y+".png";};tilelayers[0].isPng=function(){return true;};tilelayers[0].getOpacity=function(){return 1.0;};var custommap=new GMapType(tilelayers,new GMercatorProjection(19),"OSM",{errorMessage:"More OSM coming soon"});this.maps[api].addMapType(custommap);this.loaded[api]=true;var myPoint=new LatLonPoint(50.6805,-1.4062505);this.setCenterAndZoom(myPoint,11);this.maps[api].setMapType(custommap);}
else{alert('browser not compatible with Google Maps');}}
else{alert(api+' map script not imported');}
break;case'multimap':if(MultimapViewer){if(this.debug){window.print_debug=function(strMessage){var dbg=document.getElementById('debug');if(dbg){dbg.innerHTML+='<p>MUlTIMAP: '+strMessage+'</p>';}
else{alert(strMessage);}};}
this.maps[api]=new MultimapViewer(element);this.maps[api].addEventHandler('click',function(eventType,eventTarget,arg1,arg2,arg3){if(arg1){me.clickHandler(arg1.lat,arg1.lon,me);}});this.maps[api].addEventHandler('changeZoom',function(eventType,eventTarget,arg1,arg2,arg3){me.moveendHandler(me);});this.maps[api].addEventHandler('endPan',function(eventType,eventTarget,arg1,arg2,arg3){me.moveendHandler(me);});this.loaded[api]=true;}
else{alert(api+' map script not imported');}
break;case'map24':if(Map24){Map24.loadApi(["core_api","wrapper_api"],function(){Map24.MapApplication.init
({NodeName:element.id,MapType:"Static"});me.maps[api]=Map24.MapApplication.Map;Map24.MapApplication.Map.addListener('Map24.Event.MapClick',function(e){me.clickHandler(e.Coordinate.Latitude/60,e.Coordinate.Longitude/60,me);e.stop();});Map24.MapApplication.Map.addListener("MapPanStop",function(e){me.moveendHandler(me);});var client=Map24.MapApplication.Map.MapClient['Static'];me.loaded[api]=true;for(var i=0;i<me.onload[api].length;i++){me.onload[api][i]();}},"2.0.1247");}else{alert(api+' api not loaded');}
break;case'mapquest':if(MQA.TileMap){this.maps[api]=new MQA.TileMap(element);this.loaded[api]=true;MQA.EventManager.addListener(this.maps[api],"click",function(eventType,eventTarget,arg1,arg2,arg3){if(arg1){me.clickHandler(arg1.lat,arg1.lon,me);}});MQA.EventManager.addListener(this.maps[api],"zoomend",function(){me.moveendHandler(me)});MQA.EventManager.addListener(this.maps[api],"moveend",function(){me.moveendHandler(me)});}
else{alert(api+' map script not imported');}
break;case'freeearth':this.maps[api]=new FE.Map($m(element));this.maps[api].onLoad=function(){me.freeEarthLoaded=true;me.loaded[api]=true;for(var i=0;i<me.onload[api].length;i++){me.onload[api][i]();}};this.maps[api].load();break;case'openspace':this.maps[api]=new OpenSpace.Map(element,{controls:[],centreInfoWindow:false});this.maps[api].addControl(new OpenLayers.Control.Navigation());this.maps[api].addControl(new OpenLayers.Control.KeyboardDefaults());this.maps[api].addControl(new OpenSpace.Control.CopyrightCollection());this.maps[api].events.register("click",this.maps[api],function(evt){var point=this.getLonLatFromViewPortPx(evt.xy);var llPoint=new LatLonPoint;llPoint.fromOpenSpace(point);me.clickHandler(llPoint.lat,llPoint.lon);return false;});this.loaded[api]=true;break;case'viamichelin':if(VMMap){this.maps[api]=new VMMap(element);this.maps[api].addEventHandler('onClick',function(eventType,eventTarget,arg1,arg2,arg3){if(arg1){me.clickHandler(arg1.lat,arg1.lon,me);}});this.maps[api].addEventHandler('onZoomIn',function(eventType,eventTarget,arg1,arg2,arg3){me.moveendHandler(me);});this.maps[api].addEventHandler('onZoomOut',function(eventType,eventTarget,arg1,arg2,arg3){me.moveendHandler(me);});this.maps[api].addEventHandler('onStopPan',function(eventType,eventTarget,arg1,arg2,arg3){me.moveendHandler(me);});this.loaded[api]=true;}
else{alert(api+' map script not imported');}
break;default:if(this.debug){alert(api+' not supported by mapstraction');}}};Mapstraction._getScriptLocation=function(){var scriptLocation='';var SCRIPT_NAME='mapstraction.js';var scripts=document.getElementsByTagName('script');for(var i=0;i<scripts.length;i++){var src=scripts[i].getAttribute('src');if(src){var index=src.lastIndexOf(SCRIPT_NAME);if((index>-1)&&(index+SCRIPT_NAME.length==src.length)){scriptLocation=src.slice(0,-SCRIPT_NAME.length);break;}}}
return scriptLocation;};Mapstraction.writeInclude=function(api,key,version){var jsfiles=[];var allScriptTags='';var host=Mapstraction._getScriptLocation()+'lib/';switch(api){case'google':if(version===null){version='2';}
jsfiles.push('http://maps.google.com/maps?file=api&v='+version+'&key='+key);break;case'microsoft':if(version===null){version='v3';}
jsfiles.push('http://dev.virtualearth.net/mapcontrol/'+version+'/mapcontrol.js');break;case'yahoo':if(version===null){version='3.8';}
jsfiles.push('http://api.maps.yahoo.com/ajaxymap?v='+version+'&appid='+key);break;case'openlayers':jsfiles.push('http://openlayers.org/api/OpenLayers.js');break;case'multimap':if(version===null){version='1.2';}
jsfiles.push('http://developer.multimap.com/API/maps/'+version+'/'+key);break;case'map24':jsfiles.push('http://api.maptp.map24.com/ajax?appkey='+key);break;case'mapquest':if(version===null){version="5.3";}
jsfiles.push('http://btilelog.access.mapquest.com/tilelog/transaction?transaction=script&key='+key+'&ipr=true&itk=true&ipkg=controls1&v='+version);jsfiles.push('mapquest-js/mqcommon.js');jsfiles.push('mapquest-js/mqutils.js');jsfiles.push('mapquest-js/mqobjects.js');jsfiles.push('mapquest-js/mqexec.js');break;case'freeearth':jsfiles.push('http://freeearth.poly9.com/api.js');break;case'openspace':jsfiles.push('http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js?key='+key);jsfiles.push('mapstraction-js/mapstraction-openspace.js');break;case'viamichelin':jsfiles.push('http://api.viamichelin.com/apijs/js/api.js');break;}
for(var i=0;i<jsfiles.length;i++){if(/MSIE/.test(navigator.userAgent)||/Safari/.test(navigator.userAgent)){var currentScriptTag=jsfiles[i];allScriptTags+=currentScriptTag;}
else{var s=document.createElement('script');s.src=jsfiles[i];s.type='text/javascript';var h=document.getElementsByTagName('head').length?document.getElementsByTagName('head')[0]:document.body;h.appendChild(s);}}
if(allScriptTags){document.write(allScriptTags);}};Mapstraction.prototype.isLoaded=function(api){if(api===null){api=this.api;}
return this.loaded[api];};Mapstraction.prototype.setDebug=function(debug){if(debug!==null){this.debug=debug;}
return this.debug;};Mapstraction.prototype.resizeTo=function(width,height){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.resizeTo(width,height);});return;}
switch(this.api){case'yahoo':this.maps[this.api].resizeTo(new YSize(width,height));break;case'google':case'openstreetmap':this.currentElement.style.width=width;this.currentElement.style.height=height;this.maps[this.api].checkResize();break;case'openspace':this.currentElement.style.width=width;this.currentElement.style.height=height;this.maps[this.api].updateSize();break;case'openlayers':this.currentElement.style.width=width;this.currentElement.style.height=height;this.maps[this.api].updateSize();break;case'microsoft':this.maps[this.api].Resize(width,height);break;case'multimap':this.currentElement.style.width=width;this.currentElement.style.height=height;this.maps[this.api].resize();break;case'mapquest':this.currentElement.style.width=width;this.currentElement.style.height=height;this.maps[this.api].setSize(new MQA.Size(width,height));break;case'map24':Map24.MapApplication.Map.Canvas['c'].resizeTo(width,height);break;case'viamichelin':this.maps[this.api].resizeTo(width,height);break;}};Mapstraction.prototype.clickHandler=function(lat,lon,me){this.callEventListeners('click',{location:new LatLonPoint(lat,lon)});};Mapstraction.prototype.moveendHandler=function(me){this.callEventListeners('moveend',{});};Mapstraction.prototype.addEventListener=function(){var listener={};listener.event_type=arguments[0];listener.callback_function=arguments[1];if(arguments.length==3){listener.back_compat_mode=false;listener.callback_object=arguments[2];}
else{listener.back_compat_mode=true;listener.callback_object=null;}
this.eventListeners.push(listener);};Mapstraction.prototype.callEventListeners=function(sEventType,oEventArgs){oEventArgs.source=this;for(var i=0;i<this.eventListeners.length;i++){var evLi=this.eventListeners[i];if(evLi.event_type==sEventType){if(evLi.back_compat_mode){if(evLi.event_type=='click'){evLi.callback_function(oEventArgs.location);}
else{evLi.callback_function();}}
else{var scope=evLi.callback_object||this;evLi.callback_function.call(scope,oEventArgs);}}}};Mapstraction.prototype.addMapListener=function(event,callback)
{if(this.loaded[this.api]==false)
{myself=this;this.onload[this.api].push(function()
{myself.addMapListener(event,callback);});return;}
var map=this.maps[this.api];switch(this.api)
{case'google':return GEvent.addListener(map,event,callback);break;case'yahoo':case'openstreetmap':case'microsoft':case'openlayers':case'multimap':case'mapquest':case'map24':alert(this.api+' not supported by Mapstraction.addEvent');break;}};Mapstraction.prototype.removeMapListener=function(handler)
{if(this.loaded[this.api]==false)
{myself=this;this.onload[this.api].push(function()
{myself.removeMapListener(handler);});return;}
var map=this.maps[this.api];switch(this.api)
{case'google':GEvent.removeListener(handler);break;case'yahoo':case'openstreetmap':case'microsoft':case'openlayers':case'multimap':case'mapquest':case'map24':alert(this.api+' not supported by Mapstraction.removeEvent');break;}};Mapstraction.prototype.addControls=function(args){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.addControls(args);});return;}
var map=this.maps[this.api];this.addControlsArgs=args;switch(this.api){case'google':case'openstreetmap':if(this.controls){while((ctl=this.controls.pop())){map.removeControl(ctl);}}
else{this.controls=[];}
c=this.controls;if(args.zoom||args.pan){if(args.zoom=='large'){c.unshift(new GLargeMapControl());map.addControl(c[0]);}else{c.unshift(new GSmallMapControl());map.addControl(c[0]);}}
if(args.scale){c.unshift(new GScaleControl());map.addControl(c[0]);}
if(this.api!="openstreetmap"){if(args.overview){c.unshift(new GOverviewMapControl());map.addControl(c[0]);}
if(args.map_type){c.unshift(new GMapTypeControl());map.addControl(c[0]);}}
break;case'yahoo':if(args.pan){map.addPanControl();}
else{map.removePanControl();}
if(args.zoom=='large'){map.addZoomLong();}
else if(args.zoom=='small'){map.addZoomShort();}
else{map.removeZoomScale();}
break;case'openlayers':for(var i=map.controls.length;i>1;i--){map.controls[i-1].deactivate();map.removeControl(map.controls[i-1]);}
if(args.pan){map.addControl(new OpenLayers.Control.PanZoomBar());}
else{}
if(args.zoom=='large'){map.addControl(new OpenLayers.Control.PanZoomBar());}
else if(args.zoom=='small'){map.addControl(new OpenLayers.Control.ZoomBox());}
else{map.addControl(new OpenLayers.Control.ZoomBox());}
if(args.overview){map.addControl(new OpenLayers.Control.OverviewMap());}
if(args.map_type){map.addControl(new OpenLayers.Control.LayerSwitcher());}
break;case'openspace':for(var i=map.controls.length;i>3;i--){map.controls[i-1].deactivate();map.removeControl(map.controls[i-1]);}
if(args.zoom=='large'){map.addControl(new OpenSpace.Control.LargeMapControl());}
else if(args.zoom=='small'||args.pan){map.addControl(new OpenSpace.Control.SmallMapControl());}
if(args.overview){var osOverviewControl=new OpenSpace.Control.OverviewMap();map.addControl(osOverviewControl);osOverviewControl.maximizeControl();}
if(args.map_type){map.addControl(new OpenLayers.Control.LayerSwitcher());}
break;case'multimap':pan_zoom_widget='MM';if(args.zoom&&args.zoom=="small"){pan_zoom_widget=pan_zoom_widget+"Small";}
if(args.pan){pan_zoom_widget=pan_zoom_widget+"Pan";}
if(args.zoom){pan_zoom_widget=pan_zoom_widget+"Zoom";}
pan_zoom_widget=pan_zoom_widget+"Widget";if(pan_zoom_widget!="MMWidget"){eval(' map.addWidget( new '+pan_zoom_widget+'() );');}
if(args.map_type){map.addWidget(new MMMapTypeWidget());}
if(args.overview){map.addWidget(new MMOverviewWidget());}
break;case'mapquest':if(this.controls){while((ctl=this.controls.pop())){map.removeControl(ctl);}}
else{this.controls=[];}
c=this.controls;if(args.pan){c.unshift(new MQA.PanControl());map.addControl(c[0],new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT,new MQA.Size(0,0)));}
if(args.zoom=='large'){c.unshift(new MQA.LargeZoomControl());map.addControl(c[0],new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT,new MQA.Size(0,0)));}
else if(args.zoom=='small'){c.unshift(new MQA.ZoomControl());map.addControl(c[0],new MQA.MapCornerPlacement(MQA.MapCorner.BOTTOM_LEFT,new MQA.Size(0,0)));}
if(args.map_type){c.unshift(new MQA.ViewControl());map.addControl(c[0],new MQA.MapCornerPlacement(MQA.MapCorner.TOP_RIGHT,new MQA.Size(0,0)));}
break;case'viamichelin':if(args.zoom=='large'){map.activateZoom(true);map.showMapTools();}
else if(args.zoom=='small'){map.activateMiniZoom(true);map.showMapTools();}
else{map.hideMapTools();}
break;}};Mapstraction.prototype.addSmallControls=function(){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.addSmallControls();});return;}
var map=this.maps[this.api];switch(this.api){case'yahoo':map.addPanControl();map.addZoomShort();this.addControlsArgs.pan=true;this.addControlsArgs.zoom='small';break;case'google':case'openstreetmap':map.addControl(new GSmallMapControl());this.addControlsArgs.zoom='small';break;case'openlayers':map.addControl(new OpenLayers.Control.ZoomBox());map.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':false}));break;case'multimap':smallPanzoomWidget=new MMSmallPanZoomWidget();map.addWidget(smallPanzoomWidget);this.addControlsArgs.pan=true;this.addControlsArgs.zoom='small';break;case'mapquest':map.addControl(new MQA.ZoomControl(map));map.addControl(new MQA.PanControl(map));this.addControlsArgs.pan=true;this.addControlsArgs.zoom='small';break;case'openspace':map.addControl(new OpenSpace.Control.SmallMapControl());break;case'viamichelin':map.activateMiniZoom(true);this.addControlsArgs.zoom='small';map.showMapTools();break;}};Mapstraction.prototype.addLargeControls=function(){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.addLargeControls();});return;}
var map=this.maps[this.api];switch(this.api){case'yahoo':map.addPanControl();map.addZoomLong();this.addControlsArgs.pan=true;this.addControlsArgs.zoom='large';break;case'openlayers':map.addControl(new OpenLayers.Control.PanZoomBar());break;case'google':map.addControl(new GMapTypeControl());map.addControl(new GOverviewMapControl());this.addControlsArgs.overview=true;this.addControlsArgs.map_type=true;case'openstreetmap':map.addControl(new GLargeMapControl());map.addControl(new GScaleControl());this.addControlsArgs.pan=true;this.addControlsArgs.zoom='large';this.addControlsArgs.scale=true;break;case'multimap':panzoomWidget=new MMPanZoomWidget();map.addWidget(panzoomWidget);this.addControlsArgs.pan=true;this.addControlsArgs.zoom='large';break;case'mapquest':map.addControl(new MQA.LargeZoomControl(map));map.addControl(new MQA.PanControl(map));map.addControl(new MQA.ViewControl(map));this.addControlsArgs.pan=true;this.addControlsArgs.zoom='large';this.addControlsArgs.map_type=true;break;case'openspace':map.addControl(new OpenSpace.Control.LargeMapControl());break;case'viamichelin':map.activateZoom(true);this.addControlsArgs.zoom='large';map.showMapTools();break;}};Mapstraction.prototype.addMapTypeControls=function(){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.addMapTypeControls();});return;}
var map=this.maps[this.api];switch(this.api){case'yahoo':map.addTypeControl();break;case'google':case'openstreetmap':map.addControl(new GMapTypeControl());break;case'multimap':map.addWidget(new MMMapTypeWidget());break;case'mapquest':map.addControl(new MQA.ViewControl(map));break;case'openlayers':map.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':false}));break;case'viamichelin':map.activateSatelliteHybrid(true);break;}};Mapstraction.prototype.dragging=function(on){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.dragging(on);});return;}
var map=this.maps[this.api];switch(this.api){case'openspace':for(var i=0;i<map.controls.length;i++){if(map.controls[i].displayClass=="olControlNavigation"){if(on){map.controls[i].activate();}else{map.controls[i].deactivate();}
break;}}
break;case'google':case'openstreetmap':if(on){map.enableDragging();}else{map.disableDragging();}
break;case'yahoo':if(on){map.enableDragMap();}else{map.disableDragMap();}
break;case'multimap':if(on){map.setOption("drag","dragmap");}else{map.setOption("drag","");}
break;case'mapquest':map.enableDragging(on);break;case'viamichelin':if(on){map.setMapModeNav(1);}else{map.setMapModeNav(0);}
break;}};Mapstraction.prototype.setCenterAndZoom=function(point,zoom){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.setCenterAndZoom(point,zoom);});return;}
var map=this.maps[this.api];switch(this.api){case'yahoo':var yzoom=18-zoom;map.drawZoomAndCenter(point.toYahoo(),yzoom);break;case'google':case'openstreetmap':map.setCenter(point.toGoogle(),zoom);break;case'microsoft':map.SetCenterAndZoom(point.toMicrosoft(),zoom);break;case'openlayers':map.setCenter(point.toOpenLayers(),zoom);break;case'multimap':map.goToPosition(new MMLatLon(point.lat,point.lng),zoom);break;case'map24':var newSettings={};newSettings.Latitude=point.lat*60;newSettings.Longitude=point.lon*60;var client=map.MapClient['Static'];var dLon=getDegreesFromGoogleZoomLevel(client.getCanvasSize().Width,zoom);newSettings.MinimumWidth=lonToMetres(dLon,point.lat);Map24.MapApplication.center(newSettings);break;case'mapquest':map.setCenter(new MQLatLng(point.lat,point.lng),zoom-3);break;case'freeearth':if(this.freeEarthLoaded){map.setTargetLatLng(point.toFreeEarth());}
else{var me=this;this.freeEarthOnLoad.push(function(){me.setCenterAndZoom(point);});}
break;case'openspace':var oszoom=zoom-6;if(oszoom<0){oszoom=0;}
else if(oszoom>10){oszoom=10;}
map.setCenter(point.toOpenSpace(),oszoom);break;case'viamichelin':map.drawMap(new VMLonLat(point.lng,point.lat),Math.floor(zoom/19*16));break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.setCenterAndZoom');}}};Mapstraction.prototype.addMarker=function(marker,old){var map=this.maps[this.api];marker.mapstraction=this;marker.api=this.api;marker.location.api=this.api;marker.map=this.maps[this.api];if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.addMarker(marker,old);});return;}
switch(this.api){case'yahoo':var ypin=marker.toYahoo();marker.setChild(ypin);map.addOverlay(ypin);if(!old){this.markers.push(marker);}
break;case'google':case'openstreetmap':var gpin=marker.toGoogle();marker.setChild(gpin);map.addOverlay(gpin);if(!old){this.markers.push(marker);}
break;case'microsoft':var mpin=marker.toMicrosoft();marker.setChild(mpin);map.AddPushpin(mpin);if(!old){this.markers.push(marker);}
break;case'openlayers':if(!this.layers['markers']){this.layers['markers']=new OpenLayers.Layer.Markers('markers');map.addLayer(this.layers['markers']);}
var olmarker=marker.toOpenLayers();marker.setChild(olmarker);this.layers['markers'].addMarker(olmarker);if(!old){this.markers.push(marker);}
break;case'openspace':if(!this.layers['markers']){this.layers['markers']=map.getMarkerLayer();}
var osmarker=marker.toOpenSpace();marker.setChild(osmarker);if(marker.infoBubble){if(marker.hover){osmarker.events.register('mouseover',{marker:osmarker,html:marker.infoBubble},function(evt){this.marker.map.closeInfoWindow();this.marker.map.openInfoWindow(this.marker.icon,this.marker.lonlat,this.html);OpenLayers.Event.stop(evt);});osmarker.events.register('mouseout',{marker:osmarker},function(evt){this.marker.map.closeInfoWindow();OpenLayers.Event.stop(evt);});}
else{osmarker.events.register('mousedown',{marker:osmarker,html:marker.infoBubble},function(evt){this.marker.map.closeInfoWindow();this.marker.map.openInfoWindow(this.marker.icon,this.marker.lonlat,this.html);OpenLayers.Event.stop(evt);});}}
this.layers['markers'].addMarker(osmarker);if(!old){this.markers.push(marker);}
break;case'multimap':var mmpin=marker.toMultiMap();marker.setChild(mmpin);map.addOverlay(mmpin);if(!old){this.markers.push(marker);}
break;case'map24':var m24pin=marker.toMap24();marker.setChild(m24pin);m24pin.commit();if(!old){this.markers.push(marker);}
break;case'mapquest':var mqpin=marker.toMapQuest();marker.setChild(mqpin);map.addPoi(mqpin);if(!old){this.markers.push(marker);}
break;case'freeearth':var fepin=marker.toFreeEarth();marker.setChild(fepin);map.addOverlay(fepin);if(!old){this.markers.push(marker);}
break;case'viamichelin':var vmpin=marker.toViaMichelin();marker.setChild(vmpin);map.addLayer(vmpin);if(!old){this.markers.push(marker);}
break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.addMarker');}}};Mapstraction.prototype.addMarkerWithData=function(marker,data){marker.addData(data);this.addMarker(marker);};Mapstraction.prototype.addPolylineWithData=function(polyline,data){polyline.addData(data);this.addPolyline(polyline);};Mapstraction.prototype.removeMarker=function(marker){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.removeMarker(marker);});return;}
var map=this.maps[this.api];var tmparray=[];while(this.markers.length>0){current_marker=this.markers.pop();if(marker==current_marker){switch(this.api){case'google':case'openstreetmap':map.removeOverlay(marker.proprietary_marker);break;case'yahoo':map.removeOverlay(marker.proprietary_marker);break;case'microsoft':map.DeletePushpin(marker.pinID);break;case'multimap':map.removeOverlay(marker.proprietary_marker);break;case'mapquest':map.removeShape(marker.proprietary_marker);break;case'map24':marker.proprietary_marker.remove();break;case'openlayers':case'openspace':this.layers['markers'].removeMarker(marker.proprietary_marker);marker.proprietary_marker.destroy();break;case'viamichelin':map.removeLayer(marker.proprietary_marker);break;}
marker.onmap=false;break;}else{tmparray.push(current_marker);}}
this.markers=this.markers.concat(tmparray);};Mapstraction.prototype.removeAllMarkers=function(){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.removeAllMarkers();});return;}
var map=this.maps[this.api];switch(this.api){case'yahoo':map.removeMarkersAll();break;case'google':case'openstreetmap':map.clearOverlays();break;case'microsoft':map.DeleteAllPushpins();break;case'multimap':map.removeAllOverlays();break;case'mapquest':map.removeAllShapes();break;case'map24':var current_marker;while(this.markers.length>0){current_marker=this.markers.pop();current_marker.proprietary_marker.remove();}
break;case'openlayers':case'openspace':if(this.layers['markers'])this.layers['markers'].clearMarkers();break;case'viamichelin':map.removeAllLayers();break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.removeAllMarkers');}}
this.markers=[];};Mapstraction.prototype.declutterMarkers=function(opts){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.declutterMarkers(opts);});return;}
var map=this.maps[this.api];switch(this.api)
{case'multimap':map.declutterGroup(opts.groupName);break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.declutterMarkers');}}};Mapstraction.prototype.addPolyline=function(polyline,old){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.addPolyline(polyline,old);});return;}
var map=this.maps[this.api];polyline.api=this.api;polyline.map=this.maps[this.api];switch(this.api){case'openspace':ospolyline=polyline.toOpenSpace();polyline.setChild(ospolyline);map.getVectorLayer().addFeatures([ospolyline]);if(!old){this.polylines.push(polyline);}
break;case'yahoo':ypolyline=polyline.toYahoo();polyline.setChild(ypolyline);map.addOverlay(ypolyline);if(!old){this.polylines.push(polyline);}
break;case'google':case'openstreetmap':gpolyline=polyline.toGoogle();polyline.setChild(gpolyline);map.addOverlay(gpolyline);if(!old){this.polylines.push(polyline);}
break;case'microsoft':mpolyline=polyline.toMicrosoft();polyline.setChild(mpolyline);map.AddPolyline(mpolyline);if(!old){this.polylines.push(polyline);}
break;case'openlayers':if(!this.layers['polylines']){this.layers['polylines']=new OpenLayers.Layer.Vector('polylines');map.addLayer(this.layers['polylines']);}
var olpolyline=polyline.toOpenLayers();polyline.setChild(olpolyline);this.layers['polylines'].addFeatures([olpolyline]);if(!old){this.polylines.push(polyline);}
break;case'multimap':mmpolyline=polyline.toMultiMap();polyline.setChild(mmpolyline);map.addOverlay(mmpolyline);if(!old){this.polylines.push(polyline);}
break;case'mapquest':mqpolyline=polyline.toMapQuest();polyline.setChild(mqpolyline);map.addOverlay(mqpolyline);if(!old){this.polylines.push(polyline);}
break;case'map24':var m24polyline=polyline.toMap24();polyline.setChild(m24polyline);m24polyline.commit();if(!old){this.polylines.push(polyline);}
break;case'viamichelin':var vmpolyline=polyline.toViaMichelin();polyline.setChild(vmpolyline);map.addLayer(vmpolyline);if(!old){this.polylines.push(polyline);}
break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.addPolyline');}}};Mapstraction.prototype.removePolyline=function(polyline){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.removePolyline(polyline);});return;}
var map=this.maps[this.api];var tmparray=[];while(this.polylines.length>0){current_polyline=this.polylines.pop();if(polyline==current_polyline){switch(this.api){case'openspace':map.getVectorLayer().removeFeatures([polyline.proprietary_polyline]);break;case'google':case'openstreetmap':map.removeOverlay(polyline.proprietary_polyline);break;case'yahoo':map.removeOverlay(polyline.proprietary_polyline);break;case'microsoft':map.DeletePolyline(polyline.pllID);break;case'multimap':polyline.proprietary_polyline.remove();break;case'mapquest':map.removeOverlay(polyline.proprietary_polyline);break;case'map24':polyline.proprietary_polyline.remove();break;case'openlayers':this.layers['polylines'].removeFeatures([polyline.proprietary_polyline]);break;case'viamichelin':map.removeLayer(polyline.proprietary_polyline);break;}
polyline.onmap=false;break;}else{tmparray.push(current_polyline);}}
this.polylines=this.polylines.concat(tmparray);};Mapstraction.prototype.removeAllPolylines=function(){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.removeAllPolylines();});return;}
var map=this.maps[this.api];switch(this.api){case'openspace':for(var i=0,length=this.polylines.length;i<length;i++){map.getVectorLayer().removeFeatures([this.polylines[i].proprietary_polyline]);}
break;case'yahoo':for(var i=0,length=this.polylines.length;i<length;i++){map.removeOverlay(this.polylines[i].proprietary_polyline);}
break;case'google':case'openstreetmap':for(var i=0,length=this.polylines.length;i<length;i++){map.removeOverlay(this.polylines[i].proprietary_polyline);}
break;case'microsoft':map.DeleteAllPolylines();break;case'multimap':for(var i=0,length=this.polylines.length;i<length;i++){this.polylines[i].proprietary_polyline.remove();}
break;case'mapquest':map.removeAllShapes();break;case'map24':var current_polyline;while(this.polylines.length>0){current_polyline=this.polylines.pop();current_polyline.proprietary_polyline.remove();}
break;case'openlayers':var olpolylines=[];for(var i=0,length=this.polylines.length;i<length;i++){olpolylines.push(this.polylines[i].proprietary_polyline);}
if(this.layers['polylines'])this.layers['polylines'].removeFeatures(olpolylines);break;case'viamichelin':for(var i=0,length=this.polylines.length;i<length;i++){map.removeLayer(this.polylines[i].proprietary_polyline);}
break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.removeAllPolylines');}}
this.polylines=[];};Mapstraction.prototype.getCenter=function(){if(this.loaded[this.api]===false){return null;}
var map=this.maps[this.api];var point=undefined;var pt;switch(this.api){case'openspace':pt=map.getCenter();point=new LatLonPoint();point.fromOpenSpace(pt);break;case'yahoo':pt=map.getCenterLatLon();point=new LatLonPoint(pt.Lat,pt.Lon);break;case'google':case'openstreetmap':pt=map.getCenter();point=new LatLonPoint(pt.lat(),pt.lng());break;case'openlayers':pt=map.getCenter();point=new LatLonPoint(pt.lat,pt.lon);break;case'microsoft':pt=map.GetCenter();point=new LatLonPoint(pt.Latitude,pt.Longitude);break;case'multimap':pt=map.getMapBounds().getCenter();point=new LatLonPoint(pt.lat,pt.lon);break;case'mapquest':pt=map.getCenter();point=new LatLonPoint(pt.getLatitude(),pt.getLongitude());break;case'map24':pt=map.MapClient['Static'].getCurrentMapView().getCenter();point=new LatLonPoint(pt.Y/60,pt.X/60);break;case'viamichelin':pt=map.GetCenter();point=new LatLonPoint(pt.lat,pt.lon);break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.getCenter');}}
return point;};Mapstraction.prototype.setCenter=function(point,options){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.setCenter(point,options);});return;}
var map=this.maps[this.api];switch(this.api){case'openspace':map.setCenter(point.toOpenSpace());break;case'yahoo':map.panToLatLon(point.toYahoo());break;case'google':case'openstreetmap':if(options!=null&&options['pan']){map.panTo(point.toGoogle());}
else{map.setCenter(point.toGoogle());}
break;case'openlayers':map.setCenter(point.toOpenLayers());break;case'microsoft':if(options!=null&&options['pan']){map.PanToLatLong(point.toMicrosoft());}
else{map.SetCenter(point.toMicrosoft());}
break;case'multimap':map.goToPosition(point.toMultiMap());break;case'mapquest':map.setCenter(point.toMapQuest());break;case'freeearth':if(this.freeEarthLoaded){map.setTargetLatLng(point.toFreeEarth());}
else{var me=this;this.freeEarthOnLoad.push(function(){me.setCenterAndZoom(point);});}
break;case'map24':var mv=map.MapClient['Static'].getCurrentMapView();var newSettings={};newSettings.MinimumWidth=lonToMetres
(mv.LowerRight.Longitude-mv.TopLeft.Longitude,(mv.LowerRight.Latitude+mv.TopLeft.Latitude)/2);newSettings.Latitude=point.lat*60;newSettings.Longitude=point.lon*60;Map24.MapApplication.center(newSettings);break;case'viamichelin':map.panTo(point.toViaMichelin());break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.setCenter');}}};Mapstraction.prototype.setZoom=function(zoom){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.setZoom(zoom);});return;}
var map=this.maps[this.api];switch(this.api){case'openspace':var oszoom=zoom-6;if(oszoom<0){oszoom=0;}
else if(oszoom>10){oszoom=10;}
map.zoomTo(oszoom);break;case'yahoo':var yzoom=18-zoom;map.setZoomLevel(yzoom);break;case'google':case'openstreetmap':map.setZoom(zoom);break;case'openlayers':map.zoomTo(zoom);break;case'microsoft':map.SetZoomLevel(zoom);break;case'multimap':map.setZoomFactor(zoom);break;case'mapquest':map.setZoomLevel(zoom-3);break;case'map24':var point=this.getCenter();var newSettings={};newSettings.Latitude=point.lat*60;newSettings.Longitude=point.lon*60;var client=map.MapClient['Static'];var dLon=getDegreesFromGoogleZoomLevel(client.getCanvasSize().Width,zoom);newSettings.MinimumWidth=lonToMetres(dLon,point.lat);Map24.MapApplication.center(newSettings);break;case'viamichelin':map.changeMapScale(Math.floor(zoom/19*16));break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.setZoom');}}};Mapstraction.prototype.autoCenterAndZoom=function(){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.autoCenterAndZoom();});return;}
var lat_max=-90;var lat_min=90;var lon_max=-180;var lon_min=180;for(var i=0;i<this.markers.length;i++){lat=this.markers[i].location.lat;lon=this.markers[i].location.lon;if(lat>lat_max){lat_max=lat;}
if(lat<lat_min){lat_min=lat;}
if(lon>lon_max){lon_max=lon;}
if(lon<lon_min){lon_min=lon;}}
for(var i=0;i<this.polylines.length;i++){for(var j=0;j<this.polylines[i].points.length;j++){lat=this.polylines[i].points[j].lat;lon=this.polylines[i].points[j].lon;if(lat>lat_max){lat_max=lat;}
if(lat<lat_min){lat_min=lat;}
if(lon>lon_max){lon_max=lon;}
if(lon<lon_min){lon_min=lon;}}}
this.setBounds(new BoundingBox(lat_min,lon_min,lat_max,lon_max));};Mapstraction.prototype.centerAndZoomOnPoints=function(points){var bounds=new BoundingBox(points[0].lat,points[0].lon,points[0].lat,points[0].lon);for(var i=1,len=points.length;i<len;i++){bounds.extend(points[i]);}
this.setBounds(bounds);};Mapstraction.prototype.visibleCenterAndZoom=function()
{if(this.loaded[this.api]==false)
{myself=this;this.onload[this.api].push(function()
{myself.autoCenterAndZoom();});return;}
var lat_max=-90;var lat_min=90;var lon_max=-180;var lon_min=180;for(var i=0;i<this.markers.length;i++)
{if(this.markers[i].getAttribute("visible"))
{lat=this.markers[i].location.lat;lon=this.markers[i].location.lon;if(lat>lat_max)lat_max=lat;if(lat<lat_min)lat_min=lat;if(lon>lon_max)lon_max=lon;if(lon<lon_min)lon_min=lon;}}
for(i=0;i<this.polylines.length;i++)
{if(this.polylines[i].getAttribute("visible"))
{for(j=0;j<this.polylines[i].points.length;j++)
{lat=this.polylines[i].points[j].lat;lon=this.polylines[i].points[j].lon;if(lat>lat_max)lat_max=lat;if(lat<lat_min)lat_min=lat;if(lon>lon_max)lon_max=lon;if(lon<lon_min)lon_min=lon;}}}
this.setBounds(new BoundingBox(lat_min,lon_min,lat_max,lon_max));};Mapstraction.prototype.polylineCenterAndZoom=function(radius)
{if(this.loaded[this.api]==false)
{myself=this;this.onload[this.api].push(function()
{myself.polylineCenterAndZoom();});return;}
radius=(radius==null)?0:radius;var lat_max=-90;var lat_min=90;var lon_max=-180;var lon_min=180;for(i=0;i<mapstraction.polylines.length;i++)
{for(j=0;j<mapstraction.polylines[i].points.length;j++)
{lat=mapstraction.polylines[i].points[j].lat;lon=mapstraction.polylines[i].points[j].lon;latConv=lonConv=radius;if(radius>0)
{latConv=(radius/mapstraction.polylines[i].points[j].latConv());lonConv=(radius/mapstraction.polylines[i].points[j].lonConv());}
if((lat+latConv)>lat_max)lat_max=(lat+latConv);if((lat-latConv)<lat_min)lat_min=(lat-latConv);if((lon+lonConv)>lon_max)lon_max=(lon+lonConv);if((lon-lonConv)<lon_min)lon_min=(lon-lonConv);}}
this.setBounds(new BoundingBox(lat_min,lon_min,lat_max,lon_max));};Mapstraction.prototype.getZoom=function(){if(this.loaded[this.api]===false){var me=this;return-1;}
var map=this.maps[this.api];switch(this.api){case'openspace':return map.zoom+6;case'yahoo':return 18-map.getZoomLevel();case'google':case'openstreetmap':return map.getZoom();case'openlayers':return map.zoom;case'microsoft':return map.GetZoomLevel();case'multimap':return map.getZoomFactor();case'mapquest':return map.getZoomLevel()+3;case'map24':var mv=map.MapClient['Static'].getCurrentMapView();var dLon=(mv.LowerRight.Longitude-mv.TopLeft.Longitude)/60;var width=map.MapClient['Static'].getCanvasSize().Width;var zoom=getGoogleZoomLevelFromDegrees(width,dLon);return Math.round(zoom);case'viamichelin':return Math.floor(map.getMapScale()/16*19);break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.getZoom');}}};Mapstraction.prototype.getZoomLevelForBoundingBox=function(bbox){if(this.loaded[this.api]===false){var me=this;return-1;}
var map=this.maps[this.api];var ne=bbox.getNorthEast();var sw=bbox.getSouthWest();var zoom;switch(this.api){case'openspace':var obounds=new OpenSpace.MapBounds();obounds.extend(new LatLonPoint(sw.lat,sw.lon).toOpenSpace());obounds.extend(new LatLonPoint(ne.lat,ne.lon).toOpenSpace());zoom=map.getZoomForExtent(obounds)+6;return zoom
case'google':case'openstreetmap':var gbox=new GLatLngBounds(sw.toGoogle(),ne.toGoogle());zoom=map.getBoundsZoomLevel(gbox);return zoom;case'openlayers':return zoom;case'multimap':var mmlocation=map.getAutoScaleLocation([sw.toMultiMap(),ne.toMultiMap()]);zoom=mmlocation.zoom_factor;return zoom;case'map24':var dLon=ne.lon-sw.lon;var width=map.MapClient['Static'].getCanvasSize().Width;zoom=getGoogleZoomLevelFromDegrees(width,dLon);return Math.round(zoom);case'viamichelin':map.drawMapFromLayers();return map.getMapScale();default:if(this.debug){alert(this.api+' not supported by Mapstraction.getZoomLevelForBoundingBox');}}};Mapstraction.ROAD=1;Mapstraction.SATELLITE=2;Mapstraction.HYBRID=3;Mapstraction.prototype.setMapType=function(type){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.setMapType(type);});return;}
var map=this.maps[this.api];switch(this.api){case'yahoo':switch(type){case Mapstraction.ROAD:map.setMapType(YAHOO_MAP_REG);break;case Mapstraction.SATELLITE:map.setMapType(YAHOO_MAP_SAT);break;case Mapstraction.HYBRID:map.setMapType(YAHOO_MAP_HYB);break;default:map.setMapType(YAHOO_MAP_REG);}
break;case'google':case'openstreetmap':switch(type){case Mapstraction.ROAD:map.setMapType(G_NORMAL_MAP);break;case Mapstraction.SATELLITE:map.setMapType(G_SATELLITE_MAP);break;case Mapstraction.HYBRID:map.setMapType(G_HYBRID_MAP);break;default:map.setMapType(G_NORMAL_MAP);}
break;case'microsoft':switch(type){case Mapstraction.ROAD:map.SetMapStyle(Msn.VE.MapStyle.Road);break;case Mapstraction.SATELLITE:map.SetMapStyle(Msn.VE.MapStyle.Aerial);break;case Mapstraction.HYBRID:map.SetMapStyle(Msn.VE.MapStyle.Hybrid);break;default:map.SetMapStyle(Msn.VE.MapStyle.Road);}
break;case'multimap':maptypes=map.getAvailableMapTypes();maptype=-1;for(var i=0;i<maptypes.length;i++){switch(maptypes[i]){case MM_WORLD_MAP:if(type==Mapstraction.ROAD){maptype=maptypes[i];}
default_type=maptypes[i];break;case MM_WORLD_AERIAL:if(type==Mapstraction.SATELLITE){maptype=maptypes[i];}
break;case MM_WORLD_HYBRID:if(type==Mapstraction.HYBRID){maptype=maptypes[i];}
break;}}
if(maptype==-1){maptype=default_type;}
map.setMapType(maptype);break;case'mapquest':switch(type){case Mapstraction.ROAD:map.setMapType("map");break;case Mapstraction.SATELLITE:map.setMapType("sat");break;case Mapstraction.HYBRID:map.setMapType("hyb");break;}
break;case'viamichelin':map.activateSatelliteHybrid(true);break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.setMapType');}}};Mapstraction.prototype.getMapType=function(){if(this.loaded[this.api]===false){var me=this;return-1;}
var map=this.maps[this.api];var type;switch(this.api){case'yahoo':type=map.getCurrentMapType();switch(type){case YAHOO_MAP_REG:return Mapstraction.ROAD;case YAHOO_MAP_SAT:return Mapstraction.SATELLITE;case YAHOO_MAP_HYB:return Mapstraction.HYBRID;default:return null;}
break;case'google':case'openstreetmap':type=map.getCurrentMapType();switch(type){case G_NORMAL_MAP:return Mapstraction.ROAD;case G_SATELLITE_MAP:return Mapstraction.SATELLITE;case G_HYBRID_MAP:return Mapstraction.HYBRID;default:return null;}
break;case'microsoft':type=map.GetMapStyle();switch(type){case Msn.VE.MapStyle.Road:return Mapstraction.ROAD;case Msn.VE.MapStyle.Aerial:return Mapstraction.SATELLITE;case Msn.VE.MapStyle.Hybrid:return Mapstraction.HYBRID;default:return null;}
break;case'multimap':maptypes=map.getAvailableMapTypes();type=map.getMapType();switch(type){case MM_WORLD_MAP:return Mapstraction.ROAD;case MM_WORLD_AERIAL:return Mapstraction.SATELLITE;case MM_WORLD_HYBRID:return Mapstraction.HYBRID;default:return null;}
break;case'mapquest':type=map.getMapType();switch(type){case"map":return Mapstraction.ROAD;case"sat":return Mapstraction.SATELLITE;case"hyb":return Mapstraction.HYBRID;default:return null;}
break;case'viamichelin':default:if(this.debug){alert(this.api+' not supported by Mapstraction.getMapType');}}};Mapstraction.prototype.getBounds=function(){if(this.loaded[this.api]===false){return null;}
var map=this.maps[this.api];var ne,sw,nw,se;switch(this.api){case'openspace':var olbox=map.calculateBounds().toArray();var ossw=new OpenSpace.MapPoint(olbox[0],olbox[1]);var osne=new OpenSpace.MapPoint(olbox[2],olbox[3]);sw=new LatLonPoint;sw.fromOpenSpace(ossw);ne=new LatLonPoint;ne.fromOpenSpace(osne);return new BoundingBox(sw.lat,sw.lon,ne.lat,ne.lon);case'google':case'openstreetmap':var gbox=map.getBounds();sw=gbox.getSouthWest();ne=gbox.getNorthEast();return new BoundingBox(sw.lat(),sw.lng(),ne.lat(),ne.lng());case'openlayers':var olbox=map.calculateBounds();return new BoundingBox(olbox.bottom,olbox.left,olbox.top,olbox.right);case'yahoo':var ybox=map.getBoundsLatLon();return new BoundingBox(ybox.LatMin,ybox.LonMin,ybox.LatMax,ybox.LonMax);case'microsoft':var mbox=map.GetMapView();nw=mbox.TopLeftLatLong;se=mbox.BottomRightLatLong;return new BoundingBox(se.Latitude,nw.Longitude,nw.Latitude,se.Longitude);case'multimap':var mmbox=map.getMapBounds();sw=mmbox.getSouthWest();ne=mmbox.getNorthEast();return new BoundingBox(sw.lat,sw.lon,ne.lat,ne.lon);case'mapquest':var mqbox=map.getMapBounds();se=mqbox.getLowerRightLatLng();nw=mqbox.getUpperLeftLatLng();return new MQA.BoundingBox(se.lat,nw.lon,nw.lat,se.lon);case'map24':var mv=map.MapClient['Static'].getCurrentMapView();se=mv.LowerRight;nw=mv.TopLeft;return new BoundingBox(se.Latitude/60,nw.Longitude/60,nw.Latitude/60,se.Longitude/60);case'viamichelin':default:if(this.debug){alert(this.api+' not supported by Mapstraction.getBounds');}}};Mapstraction.prototype.setBounds=function(bounds){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.setBounds(bounds);});return;}
var map=this.maps[this.api];var sw=bounds.getSouthWest();var ne=bounds.getNorthEast();switch(this.api){case'openspace':var obounds=new OpenSpace.MapBounds();obounds.extend(new LatLonPoint(sw.lat,sw.lon).toOpenSpace());obounds.extend(new LatLonPoint(ne.lat,ne.lon).toOpenSpace());map.zoomToExtent(obounds);break;case'google':case'openstreetmap':var gbounds=new GLatLngBounds(new GLatLng(sw.lat,sw.lon),new GLatLng(ne.lat,ne.lon));map.setCenter(gbounds.getCenter(),map.getBoundsZoomLevel(gbounds));break;case'openlayers':var obounds=new OpenLayers.Bounds();obounds.extend(new LatLonPoint(sw.lat,sw.lon).toOpenLayers());obounds.extend(new LatLonPoint(ne.lat,ne.lon).toOpenLayers());map.zoomToExtent(obounds);break;case'yahoo':if(sw.lon>ne.lon){sw.lon-=360;}
var center=new YGeoPoint((sw.lat+ne.lat)/2,(ne.lon+sw.lon)/2);var container=map.getContainerSize();for(var zoom=1;zoom<=17;zoom++){var sw_pix=convertLatLonXY_Yahoo(sw,zoom);var ne_pix=convertLatLonXY_Yahoo(ne,zoom);if(sw_pix.x>ne_pix.x){sw_pix.x-=(1<<(26-zoom));}
if(Math.abs(ne_pix.x-sw_pix.x)<=container.width&&Math.abs(ne_pix.y-sw_pix.y)<=container.height){map.drawZoomAndCenter(center,zoom);break;}}
break;case'microsoft':map.SetMapView([new VELatLong(sw.lat,sw.lon),new VELatLong(ne.lat,ne.lon)]);break;case'multimap':var mmlocation=map.getAutoScaleLocation([sw.toMultiMap(),ne.toMultiMap()]);map.goToPosition(mmlocation.coords,mmlocation.zoom_factor);break;case'mapquest':var mqcenter=new LatLonPoint((sw.lat+ne.lat)/2,(ne.lon+sw.lon)/2);var dLon=ne.lon-sw.lon;var mqsize=map.getSize();var zoom=getGoogleZoomLevelFromDegrees(mqsize.getWidth(),dLon);this.setCenterAndZoom(mqcenter,Math.floor(zoom));break;case'freeearth':var center=new LatLonPoint((sw.lat+ne.lat)/2,(ne.lon+sw.lon)/2);this.setCenter(center);break;case'map24':var settings={};settings.Latitude=((sw.lat+ne.lat)/2)*60;settings.Longitude=((sw.lon+ne.lon)/2)*60;settings.MinimumWidth=lonToMetres(ne.lon-sw.lon,(ne.lat+sw.lat)/2);settings.MinimumWidth*=2.4;Map24.MapApplication.center(settings);break;case'viamichelin':var vmpoints=new Array(new LatLonPoint(sw.lat,sw.lon),new LatLonPoint(ne.lat,ne.lon));var vmpoly=new VMPolyLine(vmpoints);map.addLayer(vmpoly);map.drawMapFromLayers();break;default:if(this.debug){alert(this.api+' not supported by Mapstraction.setBounds');}}};Mapstraction.prototype.addImageOverlay=function(id,src,opacity,west,south,east,north){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.addImageOverlay(id,src,opacity,west,south,east,north);});return;}
var map=this.maps[this.api];var b=document.createElement("img");b.style.display='block';b.setAttribute('id',id);b.setAttribute('src',src);b.style.position='absolute';b.style.zIndex=1;b.setAttribute('west',west);b.setAttribute('south',south);b.setAttribute('east',east);b.setAttribute('north',north);switch(this.api){case'google':case'openstreetmap':map.getPane(G_MAP_MAP_PANE).appendChild(b);this.setImageOpacity(id,opacity);this.setImagePosition(id);GEvent.bind(map,"zoomend",this,function(){this.setImagePosition(id);});GEvent.bind(map,"moveend",this,function(){this.setImagePosition(id);});break;case'multimap':map.getContainer().appendChild(b);this.setImageOpacity(id,opacity);this.setImagePosition(id);me=this;map.addEventHandler('changeZoom',function(eventType,eventTarget,arg1,arg2,arg3){me.setImagePosition(id);});map.addEventHandler('drag',function(eventType,eventTarget,arg1,arg2,arg3){me.setImagePosition(id);});map.addEventHandler('endPan',function(eventType,eventTarget,arg1,arg2,arg3){me.setImagePosition(id);});break;case'viamichelin':default:b.style.display='none';if(this.debug){alert(this.api+"not supported by Mapstraction.addImageOverlay not supported");}
break;}};Mapstraction.prototype.setImageOpacity=function(id,opacity){if(opacity<0){opacity=0;}
if(opacity>=100){opacity=100;}
var c=opacity/100;var d=document.getElementById(id);if(typeof(d.style.filter)=='string'){d.style.filter='alpha(opacity:'+opacity+')';}
if(typeof(d.style.KHTMLOpacity)=='string'){d.style.KHTMLOpacity=c;}
if(typeof(d.style.MozOpacity)=='string'){d.style.MozOpacity=c;}
if(typeof(d.style.opacity)=='string'){d.style.opacity=c;}};Mapstraction.prototype.setImagePosition=function(id){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.setImagePosition(id);});return;}
var map=this.maps[this.api];var x=document.getElementById(id);var d;var e;switch(this.api){case'google':case'openstreetmap':d=map.fromLatLngToDivPixel(new GLatLng(x.getAttribute('north'),x.getAttribute('west')));e=map.fromLatLngToDivPixel(new GLatLng(x.getAttribute('south'),x.getAttribute('east')));break;case'multimap':d=map.geoPosToContainerPixels(new MMLatLon(x.getAttribute('north'),x.getAttribute('west')));e=map.geoPosToContainerPixels(new MMLatLon(x.getAttribute('south'),x.getAttribute('east')));break;case'viamichelin':}
x.style.top=d.y.toString()+'px';x.style.left=d.x.toString()+'px';x.style.width=(e.x-d.x).toString()+'px';x.style.height=(e.y-d.y).toString()+'px';};Mapstraction.prototype.addOverlay=function(url,autoCenterAndZoom){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.addOverlay(georssURL);});return;}
if(autoCenterAndZoom==null)
autoCenterAndZoom=false;var map=this.maps[this.api];switch(this.api){case'yahoo':map.addOverlay(new YGeoRSS(url));break;case'openstreetmap':case'google':var geoXML=new GGeoXml(url);map.addOverlay(geoXML,function(){if(autoCenterAndZoom){geoXML.gotoDefaultViewport(map);}});break;case'microsoft':var shapeLayer=new VEShapeLayer();var shapeSpec=new VEShapeSourceSpecification(VEDataType.ImportXML,url,shapeLayer);map.ImportShapeLayerData(shapeSpec,function(feed){},autoCenterAndZoom);break;case'multimap':break;case'freeearth':if(this.freeEarthLoaded){var ferss=new FE.GeoRSS(url);map.addOverlay(ferss);}
else{var me=this;this.freeEarthOnLoad.push(function(){me.addOverlay(url);});}
break;case'viamichelin':default:if(this.debug){alert(this.api+' not supported by Mapstraction.addOverlay');}}};Mapstraction.prototype.addJSON=function(json){var features;if(typeof(json)=="string"){features=eval('('+json+')');}else{features=json;}
features=features.features;var map=this.maps[this.api];var html="";var item;var polyline;var marker;var markers=[];if(features.type=="FeatureCollection"){this.addJSON(features.features);}
for(var i=0;i<features.length;i++){item=features[i];switch(item.geometry.type){case"Point":html="<strong>"+item.title+"</strong><p>"+item.description+"</p>";marker=new Marker(new LatLonPoint(item.geometry.coordinates[1],item.geometry.coordinates[0]));markers.push(marker);this.addMarkerWithData(marker,{infoBubble:html,label:item.title,date:"new Date(\""+item.date+"\")",iconShadow:item.icon_shadow,marker:item.id,date:"new Date(\""+item.date+"\")",iconShadowSize:item.icon_shadow_size,icon:"http://boston.openguides.org/markers/AQUA.png",iconSize:item.icon_size,category:item.source_id,draggable:false,hover:false});break;case"Polygon":var points=[];polyline=new Polyline(points);mapstraction.addPolylineWithData(polyline,{fillColor:item.poly_color,date:"new Date(\""+item.date+"\")",category:item.source_id,width:item.line_width,opacity:item.line_opacity,color:item.line_color,polygon:true});markers.push(polyline);default:}}
return markers;};Mapstraction.prototype.addTileLayer=function(tile_url,opacity,copyright_text,min_zoom,max_zoom){if(!tile_url){return;}
if(!this.tileLayers){this.tileLayers=[];}
if(!opacity){opacity=0.6;}
if(!copyright_text){copyright_text="Mapstraction";}
if(!min_zoom){min_zoom=1;}
if(!max_zoom){max_zoom=18;}
switch(this.api){case'google':case'openstreetmap':var copyright=new GCopyright(1,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),0,"copyleft");var copyrightCollection=new GCopyrightCollection(copyright_text);copyrightCollection.addCopyright(copyright);var tilelayers=[];tilelayers[0]=new GTileLayer(copyrightCollection,min_zoom,max_zoom);tilelayers[0].isPng=function(){return true;};tilelayers[0].getOpacity=function(){return opacity;};tilelayers[0].getTileUrl=function(a,b){url=tile_url;url=url.replace(/\{Z\}/,b);url=url.replace(/\{X\}/,a.x);url=url.replace(/\{Y\}/,a.y);return url;};tileLayerOverlay=new GTileLayerOverlay(tilelayers[0]);this.tileLayers.push([tile_url,tileLayerOverlay,true]);this.maps[this.api].addOverlay(tileLayerOverlay);break;}
return tileLayerOverlay;};Mapstraction.prototype.toggleTileLayer=function(tile_url){switch(this.api){case'google':case'openstreetmap':for(var f=0;f<this.tileLayers.length;f++){if(this.tileLayers[f][0]==tile_url){if(this.tileLayers[f][2]){this.maps[this.api].removeOverlay(this.tileLayers[f][1]);this.tileLayers[f][2]=false;}
else{this.maps[this.api].addOverlay(this.tileLayers[f][1]);this.tileLayers[f][2]=true;}}}
break;}};Mapstraction.prototype.addFilter=function(field,operator,value){if(!this.filters){this.filters=[];}
this.filters.push([field,operator,value]);};Mapstraction.prototype.removeFilter=function(field,operator,value){if(!this.filters){return;}
var del;for(var f=0;f<this.filters.length;f++){if(this.filters[f][0]==field&&(!operator||(this.filters[f][1]==operator&&this.filters[f][2]==value))){this.filters.splice(f,1);f--;}}};Mapstraction.prototype.toggleFilter=function(field,operator,value){if(!this.filters){this.filters=[];}
var found=false;for(var f=0;f<this.filters.length;f++){if(this.filters[f][0]==field&&this.filters[f][1]==operator&&this.filters[f][2]==value){this.filters.splice(f,1);f--;found=true;}}
if(!found){this.addFilter(field,operator,value);}};Mapstraction.prototype.removeAllFilters=function(){this.filters=[];};Mapstraction.prototype.doFilter=function(showCallback,hideCallback){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.doFilter(showCallback,hideCallback);});return;}
var map=this.maps[this.api];var visibleCount=0;if(this.filters){switch(this.api){case'multimap':var mmfilters=[];for(var f=0;f<this.filters.length;f++){mmfilters.push(new MMSearchFilter(this.filters[f][0],this.filters[f][1],this.filters[f][2]));}
map.setMarkerFilters(mmfilters);map.redrawMap();break;default:var vis;for(var m=0;m<this.markers.length;m++){vis=true;for(var f=0;f<this.filters.length;f++){if(!this.applyFilter(this.markers[m],this.filters[f])){vis=false;}}
if(vis){visibleCount++;if(showCallback)showCallback(this.markers[m]);else this.markers[m].show();}else{if(hideCallback)hideCallback(this.markers[m]);else this.markers[m].hide();}
this.markers[m].setAttribute("visible",vis);}
break;}}
return visibleCount;};Mapstraction.prototype.applyFilter=function(o,f){var vis=true;switch(f[1]){case'ge':if(o.getAttribute(f[0])<f[2]){vis=false;}
break;case'le':if(o.getAttribute(f[0])>f[2]){vis=false;}
break;case'eq':if(o.getAttribute(f[0])==f[2]){vis=false;}
break;}
return vis;};Mapstraction.prototype.getAttributeExtremes=function(field){var min;var max;for(var m=0;m<this.markers.length;m++){if(!min||min>this.markers[m].getAttribute(field)){min=this.markers[m].getAttribute(field);}
if(!max||max<this.markers[m].getAttribute(field)){max=this.markers[m].getAttribute(field);}}
for(var p=0;m<this.polylines.length;m++){if(!min||min>this.polylines[p].getAttribute(field)){min=this.polylines[p].getAttribute(field);}
if(!max||max<this.polylines[p].getAttribute(field)){max=this.polylines[p].getAttribute(field);}}
return[min,max];};Mapstraction.prototype.getPixelRatio=function()
{if(this.loaded[this.api]==false)
{myself=this;this.onload[this.api].push(function()
{myself.getPixelRatio();});return;}
var map=this.maps[this.api];switch(this.api)
{case'google':var projection=G_NORMAL_MAP.getProjection();var centerPoint=map.getCenter();var zoom=map.getZoom();var centerPixel=projection.fromLatLngToPixel(centerPoint,zoom);var distancePoint=projection.fromPixelToLatLng(new GPoint(centerPixel.x+3,centerPixel.y+4),zoom);return 10000/distancePoint.distanceFrom(centerPoint);break;case'yahoo':case'openstreetmap':case'microsoft':case'openlayers':case'multimap':case'mapquest':case'map24':alert(this.api+' not supported by Mapstraction.getPixelRatio');break;}};Mapstraction.prototype.getMap=function(){return this.maps[this.api];};function LatLonPoint(lat,lon){this.lat=lat;this.lon=lon;this.lng=lon;}
LatLonPoint.prototype.toYahoo=function(){return new YGeoPoint(this.lat,this.lon);};LatLonPoint.prototype.toGoogle=function(){return new GLatLng(this.lat,this.lon);};LatLonPoint.prototype.fromGoogle=function(googlePoint)
{this.lat=googlePoint.lat();this.lon=googlePoint.lng();};LatLonPoint.prototype.toOpenLayers=function(){var ollon=this.lon*20037508.34/180;var ollat=Math.log(Math.tan((90+this.lat)*Math.PI/360))/(Math.PI/180);ollat=ollat*20037508.34/180;return new OpenLayers.LonLat(ollon,ollat);};LatLonPoint.prototype.fromOpenLayers=function(){var lon=(this.lon/20037508.34)*180;var lat=(this.lat/20037508.34)*180;lat=180/Math.PI*(2*Math.atan(Math.exp(lat*Math.PI/180))-Math.PI/2);this.lon=lon;this.lat=lat;};LatLonPoint.prototype.toMicrosoft=function(){return new VELatLong(this.lat,this.lon);};LatLonPoint.prototype.toMultiMap=function(){return new MMLatLon(this.lat,this.lon);};LatLonPoint.prototype.toMapQuest=function(){return new MQA.LatLng(this.lat,this.lon);};LatLonPoint.prototype.toFreeEarth=function(){return new FE.LatLng(this.lat,this.lon);};LatLonPoint.prototype.toMap24=function(){return new Map24.Point(this.lon,this.lat);};LatLonPoint.prototype.toOpenSpace=function(){var lonlat=new OpenLayers.LonLat(this.lon,this.lat);var gridProjection=new OpenSpace.GridProjection();return gridProjection.getMapPointFromLonLat(lonlat);};LatLonPoint.prototype.fromOpenSpace=function(osPoint){var gridProjection=new OpenSpace.GridProjection();olpt=gridProjection.getLonLatFromMapPoint(osPoint);this.lon=olpt.lon;this.lat=olpt.lat;};LatLonPoint.prototype.toViaMichelin=function(){return new VMLonLat(this.lon,this.lat);};LatLonPoint.prototype.toString=function(){return this.lat+', '+this.lon;};LatLonPoint.prototype.distance=function(otherPoint){var rads=Math.PI/180;var diffLat=(this.lat-otherPoint.lat)*rads;var diffLon=(this.lon-otherPoint.lon)*rads;var a=Math.sin(diffLat/2)*Math.sin(diffLat/2)+
Math.cos(this.lat*rads)*Math.cos(otherPoint.lat*rads)*Math.sin(diffLon/2)*Math.sin(diffLon/2);return 2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))*6371;};LatLonPoint.prototype.equals=function(otherPoint){return this.lat==otherPoint.lat&&this.lon==otherPoint.lon;};LatLonPoint.prototype.latConv=function()
{return this.distance(new LatLonPoint(this.lat+0.1,this.lon))*10;}
LatLonPoint.prototype.lonConv=function()
{return this.distance(new LatLonPoint(this.lat,this.lon+0.1))*10;}
function BoundingBox(swlat,swlon,nelat,nelon){this.sw=new LatLonPoint(swlat,swlon);this.ne=new LatLonPoint(nelat,nelon);}
BoundingBox.prototype.getSouthWest=function(){return this.sw;};BoundingBox.prototype.getNorthEast=function(){return this.ne;};BoundingBox.prototype.isEmpty=function(){return this.ne==this.sw;};BoundingBox.prototype.contains=function(point){return point.lat>=this.sw.lat&&point.lat<=this.ne.lat&&point.lon>=this.sw.lon&&point.lon<=this.ne.lon;};BoundingBox.prototype.toSpan=function(){return new LatLonPoint(Math.abs(this.sw.lat-this.ne.lat),Math.abs(this.sw.lon-this.ne.lon));};BoundingBox.prototype.extend=function(point){if(this.sw.lat>point.lat){this.sw.lat=point.lat;}
if(this.sw.lon>point.lon){this.sw.lon=point.lon;}
if(this.ne.lat<point.lat){this.ne.lat=point.lat;}
if(this.ne.lon<point.lon){this.ne.lon=point.lon;}
return;};function Marker(point){this.location=point;this.onmap=false;this.proprietary_marker=false;this.attributes=[];this.pinID="mspin-"+new Date().getTime()+'-'+(Math.floor(Math.random()*Math.pow(2,16)));}
Marker.prototype.setChild=function(some_proprietary_marker){this.proprietary_marker=some_proprietary_marker;this.onmap=true;};Marker.prototype.setLabel=function(labelText){this.labelText=labelText;};Marker.prototype.addData=function(options){for(var sOptKey in options){switch(sOptKey){case'label':this.setLabel(options.label);break;case'infoBubble':this.setInfoBubble(options.infoBubble);break;case'icon':if(options.iconSize&&options.iconAnchor){this.setIcon(options.icon,options.iconSize,options.iconAnchor);}
else if(options.iconSize){this.setIcon(options.icon,options.iconSize);}
else{this.setIcon(options.icon);}
break;case'iconShadow':if(options.iconShadowSize)
this.setShadowIcon(options.iconShadow,new Array(options.iconShadowSize[0],options.iconShadowSize[1]));else
this.setIcon(options.iconShadow);break;case'infoDiv':this.setInfoDiv(options.infoDiv[0],options.infoDiv[1]);break;case'draggable':this.setDraggable(options.draggable);break;case'hover':this.setHover(options.hover);case'hoverIcon':this.setHoverIcon(options.hoverIcon);break;case'openBubble':this.openBubble();break;case'groupName':this.setGroupName(options.groupName);break;default:this.setAttribute(sOptKey,options[sOptKey]);break;}}};Marker.prototype.setInfoBubble=function(infoBubble){this.infoBubble=infoBubble;};Marker.prototype.setInfoDiv=function(infoDiv,div){this.infoDiv=infoDiv;this.div=div;};Marker.prototype.setIcon=function(iconUrl,iconSize,iconAnchor){this.iconUrl=iconUrl;if(iconSize){this.iconSize=iconSize;}
if(iconAnchor){this.iconAnchor=iconAnchor;}};Marker.prototype.setIconSize=function(iconSize){if(iconSize){this.iconSize=iconSize;}};Marker.prototype.setIconAnchor=function(iconAnchor){if(iconAnchor){this.iconAnchor=iconAnchor;}};Marker.prototype.setShadowIcon=function(iconShadowUrl,iconShadowSize){this.iconShadowUrl=iconShadowUrl;if(iconShadowSize){this.iconShadowSize=iconShadowSize;}};Marker.prototype.setHoverIcon=function(hoverIconUrl){this.hoverIconUrl=hoverIconUrl;};Marker.prototype.setDraggable=function(draggable){this.draggable=draggable;};Marker.prototype.setHover=function(hover){this.hover=hover;};Marker.prototype.setGroupName=function(sGrpName){this.groupName=sGrpName;};Marker.prototype.toYahoo=function(){var ymarker;var size;if(this.iconSize){size=new YSize(this.iconSize[0],this.iconSize[1]);}
if(this.iconUrl){if(this.iconSize)
ymarker=new YMarker(this.location.toYahoo(),new YImage(this.iconUrl,size));else
ymarker=new YMarker(this.location.toYahoo(),new YImage(this.iconUrl));}
else{if(this.iconSize)
ymarker=new YMarker(this.location.toYahoo(),null,size);else
ymarker=new YMarker(this.location.toYahoo());}
if(this.labelText){ymarker.addLabel(this.labelText);}
if(this.infoBubble){var theInfo=this.infoBubble;var event_action;if(this.hover){event_action=EventsList.MouseOver;}
else{event_action=EventsList.MouseClick;}
YEvent.Capture(ymarker,event_action,function(){ymarker.openSmartWindow(theInfo);});}
if(this.infoDiv){var theInfo=this.infoDiv;var div=this.div;var event_div;if(this.hover){event_action=EventsList.MouseOver;}
else{event_action=EventsList.MouseClick;}
YEvent.Capture(ymarker,event_action,function(){document.getElementById(div).innerHTML=theInfo;});}
return ymarker;};Marker.prototype.toGoogle=function(){var options={};if(this.labelText){options.title=this.labelText;}
if(this.iconUrl){var icon=new GIcon(G_DEFAULT_ICON,this.iconUrl);icon.printImage=icon.mozPrintImage=icon.image;if(this.iconSize){icon.iconSize=new GSize(this.iconSize[0],this.iconSize[1]);var anchor;if(this.iconAnchor){anchor=new GPoint(this.iconAnchor[0],this.iconAnchor[1]);}
else{anchor=new GPoint(this.iconSize[0]/2,this.iconSize[1]/2);}
icon.iconAnchor=anchor;}
if(this.iconShadowUrl){icon.shadow=this.iconShadowUrl;if(this.iconShadowSize){icon.shadowSize=new GSize(this.iconShadowSize[0],this.iconShadowSize[1]);}}
options.icon=icon;}
if(this.draggable){options.draggable=this.draggable;}
var gmarker=new GMarker(this.location.toGoogle(),options);if(this.infoBubble){var theInfo=this.infoBubble;var event_action;if(this.hover){event_action="mouseover";}
else{event_action="click";}
GEvent.addListener(gmarker,event_action,function(){gmarker.openInfoWindowHtml(theInfo,{maxWidth:100});});}
if(this.hoverIconUrl){GEvent.addListener(gmarker,"mouseover",function(){gmarker.setImage(this.hoverIconUrl);});GEvent.addListener(gmarker,"mouseout",function(){gmarker.setImage(this.iconUrl);});}
if(this.infoDiv){var theInfo=this.infoDiv;var div=this.div;var event_action;if(this.hover){event_action="mouseover";}
else{event_action="click";}
GEvent.addListener(gmarker,event_action,function(){document.getElementById(div).innerHTML=theInfo;});}
return gmarker;};Marker.prototype.toOpenLayers=function(){var size,anchor,icon;if(this.iconSize){size=new OpenLayers.Size(this.iconSize[0],this.iconSize[1]);}
else{size=new OpenLayers.Size(21,25);}
if(this.iconAnchor){anchor=new OpenLayers.Pixel(this.iconAnchor[0],this.iconAnchor[1]);}
else{anchor=new OpenLayers.Pixel(-(size.w/2),-size.h);}
if(this.iconUrl){icon=new OpenLayers.Icon(this.iconUrl,size,anchor);}
else{icon=new OpenLayers.Icon('http://openlayers.org/dev/img/marker-gold.png',size,anchor);}
var marker=new OpenLayers.Marker(this.location.toOpenLayers(),icon);if(this.infoBubble){var popup=new OpenLayers.Popup(null,this.location.toOpenLayers(),new OpenLayers.Size(100,100),this.infoBubble,true);popup.autoSize=true;var theMap=this.map;if(this.hover){marker.events.register("mouseover",marker,function(event){theMap.addPopup(popup);popup.show();});marker.events.register("mouseout",marker,function(event){popup.hide();theMap.removePopup(popup);});}
else{var shown=false;marker.events.register("mousedown",marker,function(event){if(shown){popup.hide();theMap.removePopup(popup);shown=false;}else{theMap.addPopup(popup);popup.show();shown=true;}});}}
if(this.hoverIconUrl){}
if(this.infoDiv){}
return marker;};Marker.prototype.toOpenSpace=function(){var size,anchor,icon;if(this.iconSize){size=new OpenLayers.Size(this.iconSize[0],this.iconSize[1]);}
else{size=new OpenLayers.Size(20,25);}
if(this.iconAnchor){anchor=new OpenLayers.Pixel(this.iconAnchor[0],this.iconAnchor[1]);}
else{anchor=new OpenLayers.Pixel(-(size.w/2),-size.h);}
if(this.iconUrl){icon=new OpenSpace.Icon(this.iconUrl,size,anchor);}
else{}
var marker=new OpenLayers.Marker(this.location.toOpenSpace(),icon);return marker;};Marker.prototype.toMicrosoft=function(){var pin=new VEPushpin(this.pinID,this.location.toMicrosoft(),this.iconUrl,this.labelText,this.infoBubble);return pin;};Marker.prototype.toMap24=function(){var ops={};ops.Longitude=this.location.lon*60;ops.Latitude=this.location.lat*60;if(this.infoBubble){ops.TooltipContent=this.infoBubble;}
if(this.labelText){}
ops.LogoURL=this.iconUrl;ops.SymbolId=20947;ops.TooltipLayout=Map24.MapObject.LAYOUT_BUBBLE;if(this.hover){ops.TooltipOpen="OnMouseOver";}else{ops.TooltipOpen="OnClick";}
var m24Location=new Map24.Location(ops);return m24Location;};Marker.prototype.toMultiMap=function(){var mmmarkeropts={};if(this.iconUrl){mmmarkeropts.icon=new MMIcon(this.iconUrl);if(this.iconSize){mmmarkeropts.icon.iconSize=new MMDimensions(this.iconSize[0],this.iconSize[1]);}
else{}
if(this.iconAnchor){mmmarkeropts.icon.iconAnchor=new MMPoint(this.iconAnchor[0],this.iconAnchor[1]);}
if(this.groupName){mmmarkeropts.icon.groupName=this.groupName;}}
if(this.labelText){mmmarkeropts.label=this.labelText;}
var mmmarker=new MMMarkerOverlay(this.location.toMultiMap(),mmmarkeropts);if(this.infoBubble){mmmarker.setInfoBoxContent(this.infoBubble);}
if(this.infoDiv){}
for(var key in this.attributes){mmmarker.setAttribute(key,this.attributes[key]);}
return mmmarker;};Marker.prototype.toMapQuest=function(){var mqmarker=new MQA.Poi(this.location.toMapQuest());if(this.iconUrl){var mqicon=new MQA.MapIcon();mqicon.setImage(this.iconUrl,32,32,true,false);mqmarker.setIcon(mqicon);}
if(this.labelText){mqmarker.setInfoTitleHTML(this.labelText);}
if(this.infoBubble){mqmarker.setInfoContentHTML(this.infoBubble);}
if(this.infoDiv){var theInfo=this.infoDiv;var div=this.div;MQA.EventManager.addListener(mqmarker,"click",function(){document.getElementById(div).innerHTML=theInfo;});}
return mqmarker;};Marker.prototype.toFreeEarth=function(){var feicon;if(this.iconUrl){feicon=new FE.Icon(this.iconUrl);}else{feicon=new FE.Icon("http://freeearth.poly9.com/images/bullmarker.png");}
var femarker=new FE.Pushpin(this.location.toFreeEarth(),feicon);if(this.infoBubble){var theBubble=this.infoBubble;FE.Event.addListener(femarker,'click',function(){femarker.openInfoWindowHtml(theBubble,200,100);});}
if(this.infoDiv){var theInfo=this.infoDiv;var div=this.div;FE.Event.addListener(femarker,'click',function(){document.getElementById(div).innerHTML=theInfo;});}
return femarker;};Marker.prototype.toViaMichelin=function(){var vmicon=null;if(this.iconUrl){if(this.iconSize)
vmicon=new VMIcon(this.iconUrl,this.iconSize[0],this.iconSize[1]);else
vmicon=new VMIcon(this.iconUrl);}
var vmmarker=new VMIconLayer(this.location.toViaMichelin(),vmicon,this.infoBubble);return vmmarker;};Marker.prototype.setAttribute=function(key,value){this.attributes[key]=value;};Marker.prototype.getAttribute=function(key){return this.attributes[key];};Marker.prototype.openBubble=function(){if(this.mapstraction.loaded[this.api]===false){var my_marker=this;this.mapstraction.onload[this.api].push(function(){my_marker.openBubble();});return;}
if(this.api){switch(this.api){case'yahoo':var ypin=this.proprietary_marker;ypin.openSmartWindow(this.infoBubble);break;case'google':case'openstreetmap':var gpin=this.proprietary_marker;gpin.openInfoWindowHtml(this.infoBubble);break;case'microsoft':var pin=this.proprietary_marker;var el=$m(this.pinID+"_"+this.maps[this.api].GUID).onmouseover;setTimeout(el,1000);break;case'multimap':this.proprietary_marker.openInfoBox();break;case'mapquest':this.proprietary_marker.setRolloverEnabled(false);this.proprietary_marker.showInfoWindow();this.proprietary_marker.setRolloverEnabled(true);break;}}else{if(this.debug){alert('You need to add the marker before opening it');}}};Marker.prototype.closeBubble=function(){if(this.mapstraction.loaded[this.api]===false){var my_marker=this;this.mapstraction.onload[this.api].push(function(){my_marker.closeBubble();});return;}
if(this.api){switch(this.api){case'yahoo':var ypin=this.proprietary_marker;ypin.closeSmartWindow();break;case'google':case'openstreetmap':var gpin=this.proprietary_marker;gpin.closeInfoWindow();break;case'microsoft':var pin=this.proprietary_marker;this.map.HideInfoBox();break;case'multimap':break;case'mapquest':break;}}else{if(this.debug){}}};Marker.prototype.hide=function(){if(this.api){switch(this.api){case'google':case'openstreetmap':this.proprietary_marker.hide();break;case'openlayers':case'openspace':this.proprietary_marker.display(false);break;case'yahoo':this.proprietary_marker.hide();break;case'map24':this.proprietary_marker.hide();break;case'multimap':this.proprietary_marker.setVisibility(false);break;case'mapquest':this.proprietary_marker.setVisible(false);break;case'viamichelin':default:if(this.debug){alert(this.api+"not supported by Marker.hide");}}}};Marker.prototype.show=function(){if(this.api){switch(this.api){case'google':case'openstreetmap':this.proprietary_marker.show();break;case'openlayers':case'openspace':this.proprietary_marker.display(true);break;case'map24':this.proprietary_marker.show();break;case'yahoo':this.proprietary_marker.unhide();break;case'multimap':this.proprietary_marker.setVisibility(true);break;case'mapquest':this.proprietary_marker.setVisible(true);break;case'viamichelin':default:if(this.debug){alert(this.api+"not supported by Marker.show");}}}};Marker.prototype.addListener=function(event,callback){if(this.mapstraction.loaded[this.api]===false){var my_marker=this;this.mapstraction.onload[this.api].push(function(){my_marker.addListener();});return;}
if(this.api){switch(this.api){case'google':case'openstreetmap':return GEvent.addListener(this.proprietary_marker,event,callback);break;default:if(this.debug){alert(api+' not supported by Marker.addListener');}
break;}}else{if(this.debug){alert('You need to add the marker before adding an event to it');}}};Marker.prototype.removeListener=function(event){if(this.mapstraction.loaded[this.api]===false){var my_marker=this;this.mapstraction.onload[this.api].push(function(){my_marker.removeListener();});return;}
if(this.api){switch(this.api){case'google':case'openstreetmap':GEvent.clearListeners(this.proprietary_marker,event);break;default:if(this.debug){alert(api+' not supported by Marker.removeListener');}
break;}}else{if(this.debug){alert('You need to add the marker before adding an event to it');}}};Marker.prototype.update=function(){if(this.api){switch(this.api){case'google':case'openstreetmap':point=new LatLonPoint();point.fromGoogle(this.proprietary_marker.getPoint());this.location=point;break;default:if(this.debug){alert(api+' not supported by Marker.updateLocation');}
break;}}else{if(this.debug){alert('You need to add the marker before updating its location');}}};function Polyline(points){this.points=points;this.attributes=[];this.onmap=false;this.proprietary_polyline=false;this.pllID="mspll-"+new Date().getTime()+'-'+(Math.floor(Math.random()*Math.pow(2,16)));}
Polyline.prototype.addData=function(options){for(var sOpt in options){switch(sOpt){case'color':this.setColor(options.color);break;case'width':this.setWidth(options.width);break;case'opacity':this.setOpacity(options.opacity);break;case'closed':this.setClosed(options.closed);break;case'fillColor':this.setFillColor(options.fillColor);break;default:this.setAttribute(sOpt,options[sOpt]);break;}}};Polyline.prototype.setChild=function(some_proprietary_polyline){this.proprietary_polyline=some_proprietary_polyline;this.onmap=true;};Polyline.prototype.setColor=function(color){this.color=(color.length==7&&color[0]=="#")?color.toUpperCase():color;};Polyline.prototype.setWidth=function(width){this.width=width;};Polyline.prototype.setOpacity=function(opacity){this.opacity=opacity;};Polyline.prototype.setClosed=function(bClosed){this.closed=bClosed;};Polyline.prototype.setFillColor=function(sFillColor){this.fillColor=sFillColor;};Polyline.prototype.toOpenSpace=function(){var ospolyline;var ospoints=[];for(var i=0,length=this.points.length;i<length;i++){var ospoint=this.points[i].toOpenSpace();var olgpoint=new OpenLayers.Geometry.Point(ospoint.getEasting(),ospoint.getNorthing());ospoints.push(olgpoint);}
if(this.closed){ospolyline=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing(ospoints),null,{fillColor:this.color,strokeColor:this.color,strokeOpacity:this.opacity,fillOpacity:this.opacity,strokeWidth:this.width});}
else{ospolyline=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(ospoints),null,{fillColor:0,strokeColor:this.color,strokeOpacity:this.opacity,fillOpacity:0,strokeWidth:this.width});}
return ospolyline;};Polyline.prototype.toYahoo=function(){var ypolyline;var ypoints=[];for(var i=0,length=this.points.length;i<length;i++){ypoints.push(this.points[i].toYahoo());}
ypolyline=new YPolyline(ypoints,this.color,this.width,this.opacity);return ypolyline;};Polyline.prototype.toGoogle=function(){var gpoints=[];for(var i=0,length=this.points.length;i<length;i++){gpoints.push(this.points[i].toGoogle());}
if(this.closed||gpoints[0].equals(gpoints[length-1])){var gpoly=new GPolygon(gpoints,this.color,this.width,this.opacity,this.fillColor||"#5462E3",this.opacity||"0.3");}else{var gpoly=new GPolyline(gpoints,this.color,this.width,this.opacity);}
return gpoly;};Polyline.prototype.toMap24=function(){var m24poly;var m24longs="";var m24lats="";for(var i=0,length=this.points.length;i<length;i++){if(i){m24longs+="|";m24lats+="|";}
m24longs+=(this.points[i].lon*60);m24lats+=(this.points[i].lat*60);}
if(this.closed||this.points[0].equals(this.points[length-1])){m24poly=new Map24.Polygon({Longitudes:m24longs,Latitudes:m24lats,FillColor:[this.color||"grey",this.opacity||"0.5"],BorderColor:this.color});}else{m24poly=new Map24.Polyline({Longitudes:m24longs,Latitudes:m24lats,Color:this.color||"black",Width:this.width||3});}
return m24poly;};Polyline.prototype.toMicrosoft=function(){var mpolyline;var mpoints=[];for(var i=0,length=this.points.length;i<length;i++){mpoints.push(this.points[i].toMicrosoft());}
var color;var opacity=this.opacity||1.0;if(this.color){color=new VEColor(parseInt(this.color.substr(1,2),16),parseInt(this.color.substr(3,2),16),parseInt(this.color.substr(5,2),16),opacity);}else{color=new VEColor(0,255,0,opacity);}
mpolyline=new VEPolyline(this.pllID,mpoints,color,this.width);return mpolyline;};Polyline.prototype.toMultiMap=function(){var mmpolyline;var mmpoints=[];for(var i=0,length=this.points.length;i<length;i++){mmpoints.push(this.points[i].toMultiMap());}
mmpolyline=new MMPolyLineOverlay(mmpoints,this.color,this.opacity,this.width,this.closed,this.fillColor);return mmpolyline;};Polyline.prototype.toMapQuest=function(){if(this.closed||this.points[0].equals(this.points[this.points.length-1])){var mqpoly=new MQA.PolygonOverlay();mqpoly.setFillColor(this.color||"#E90000");mqpoly.setFillColorAlpha(this.opacity||0.3);}
else{var mqpoly=new MQA.LineOverlay();}
mqpoly.setKey("Line");mqpoly.setBorderWidth(this.width||3);mqpoly.setColor(this.color||"#E90000");mqpoly.setColorAlpha(this.opacity||0.5);var mqpoints=new MQA.LatLngCollection();for(var i=0,length=this.points.length;i<length;i++){mqpoints.add(this.points[i].toMapQuest());}
mqpoly.setShapePoints(mqpoints);return mqpoly;};Polyline.prototype.toFreeEarth=function(){var fepoints=[];for(var i=0,length=this.points.length;i<length;i++){fepoints.push(this.points[i].toFreeEarth());}
var fepolyline=new FE.Polyline(fepoints,this.color||'0xff0000',this.width||1,this.opacity||1);return fepolyline;};Polyline.prototype.toOpenLayers=function(){var olpolyline;var olpoints=[];var ring;var style={strokeColor:this.color||"#000000",strokeOpacity:this.opacity||1,strokeWidth:this.width||1,fillColor:this.fillColor||"#000000",fillOpacity:this.getAttribute('fillOpacity')||0.2};for(var i=0,length=this.points.length;i<length;i++){olpoint=this.points[i].toOpenLayers();olpoints.push(new OpenLayers.Geometry.Point(olpoint.lon,olpoint.lat));}
if(this.closed){ring=new OpenLayers.Geometry.LinearRing(olpoints);}else{ring=new OpenLayers.Geometry.LineString(olpoints);}
olpolyline=new OpenLayers.Feature.Vector(ring,null,style);return olpolyline;};Polyline.prototype.toViaMichelin=function(){var vmpoints=[];for(var i=0,length=this.points.length;i<length;i++){vmpoints.push(this.points[i].toViaMichelin());}
if(this.closed||this.points[0].equals(this.points[length-1])){var vmpoly=new VMPolygonShape(vmpoints,this.color,this.width||5,this.fillColor,this.opacity||0.2);}
else{var vmpoly=new VMPolyLine(vmpoints,this.color,this.width||5,this.opacity||0.5);}
return vmpoly;};Polyline.prototype.setAttribute=function(key,value){this.attributes[key]=value;};Polyline.prototype.getAttribute=function(key){return this.attributes[key];};Polyline.prototype.show=function(){switch(this.api){case'multimap':if(!this.onmap){this.map.addOverlay(this.proprietary_polyline);}
break;default:if(this.debug){alert(api+' not supported by Polyline.show');}
break;}};Polyline.prototype.hide=function(){switch(this.api){case'multimap':if(this.onmap){this.map.removeOverlay(this.proprietary_polyline);this.onmap=false;}
break;default:if(this.debug){alert(api+' not supported by Polyline.hide');}
break;}};Polyline.prototype.simplify=function(tolerance){var reduced=new Array();reduced[0]=this.points[0];var markerPoint=0;var length=this.points.length;for(var i=1;i<length-1;i++)
if(this.points[i].distance(this.points[markerPoint])>=tolerance)
{reduced[reduced.length]=this.points[i];markerPoint=i;}
reduced[reduced.length]=this.points[this.points.length-1];this.points=reduced;};Mapstraction.prototype.mousePosition=function(element){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.mousePosition(element);});return;}
var locDisp=document.getElementById(element);if(locDisp!=null){var map=this.maps[this.api];switch(this.api){case'openlayers':try{map.events.register('mousemove',map,function(e){var lonLat=map.getLonLatFromViewPortPx(e.xy);var lon=lonLat.lon*(180.0/20037508.34);var lat=lonLat.lat*(180.0/20037508.34);lat=(180/Math.PI)*(2*Math.atan(Math.exp(lat*Math.PI/180))-(Math.PI/2));var loc=numFormatFloat(lat,4)+' / '+numFormatFloat(lon,4);locDisp.innerHTML=loc;});locDisp.innerHTML='0.0000 / 0.0000';}catch(x){}
break;case'microsoft':try{map.AttachEvent('onmousemove',function(e){var latLon=map.PixelToLatLong(new VEPixel(e.mapX,e.mapY));var loc=numFormatFloat(latLon.Latitude,4)+' / '+numFormatFloat(latLon.Longitude,4);locDisp.innerHTML=loc;if(e.rightMouseButton==false){element.style.cursor='crosshair';return false;}else{return true;}});locDisp.innerHTML='0.0000 / 0.0000';}catch(e){}
break;case'google':GEvent.addListener(map,'mousemove',function(point){var loc=point.lat().toFixed(4)+' / '+point.lng().toFixed(4);locDisp.innerHTML=loc;});locDisp.innerHTML='0.0000 / 0.0000';break;}}};Mapstraction.prototype.enableScrollWheelZoom=function(){if(this.loaded[this.api]==false)
{myself=this;this.onload[this.api].push(function()
{myself.enableScrollWheelZoom();});return;}
var map=this.maps[this.api];switch(this.api)
{case'google':case'openstreetmap':map.enableContinuousZoom();map.enableScrollWheelZoom();break;default:if(this.debug){alert(api+' not supported by Mapstration.enableScrollWheelZoom');}
break;}};Mapstraction.prototype.addPolygon=function(polygon){if(this.loaded[this.api]==false)
{myself=this;this.onload[this.api].push(function()
{myself.addPolygon(polygon);});return;}
var map=this.maps[this.api];switch(this.api)
{case'google':case'openstreetmap':var gpoints=[];for(var i=0;i<polygon.points.length;i++)
gpoints.push(polygon.points[i].toGoogle());gpolygon=new GPolygon(gpoints,polygon.color,0,polygon.opacity,polygon.color,polygon.opacity);polygon.setChild(gpolygon);map.addOverlay(gpolygon);this.polylines.push(polygon);break;default:if(this.debug){alert(api+' not supported by Mapstration.addPolygon');}
break;}};function Radius(center,quality){this.center=center;var latConv=center.latConv();var lonConv=center.lonConv();var rad=Math.PI/180;this.calcs=new Array();for(var i=0;i<360;i+=quality)
this.calcs.push([Math.cos(i*rad)/latConv,Math.sin(i*rad)/lonConv]);}
Radius.prototype.getPolyline=function(radius,colour){var points=Array();for(var i=0;i<this.calcs.length;i++){var point=new LatLonPoint(this.center.lat+(radius*this.calcs[i][0]),this.center.lon+(radius*this.calcs[i][1]));points.push(point);}
points.push(points[0]);var line=new Polyline(points);line.setColor(colour);return line;};window.mxn={'BoundingBox':BoundingBox,'LatLonPoint':LatLonPoint,'Mapstraction':Mapstraction,'Marker':Marker,'Polyline':Polyline,'Radius':Radius,'fn':{'milesToKM':milesToKM,'KMToMiles':KMToMiles,'metresToLon':metresToLon,'lonToMetres':lonToMetres,'loadScript':loadScript},activatePolluteMode:function(){if(window.BoundingBox||window.LatLonPoint||window.Mapstraction||window.Marker||window.Polyline||window.Radius){alert('Warning: Mapstraction pollute mode naming clash.');}
window['BoundingBox']=BoundingBox;window['LatLonPoint']=LatLonPoint;window['Mapstraction']=Mapstraction;window['Marker']=Marker;window['Polyline']=Polyline;window['Radius']=Radius;}};})();mxn.activatePolluteMode();function cargarMapa()
{jQuery(function($){var $searchIn=$('.content');$searchIn.each(function(index){var $containerMap=$(this).find('.container-map');var mapName="themap-"+(index+1);var $theMap=$('<div class="real-map"><div class="themap" id='+mapName+'></div></div>');$containerMap.append($theMap);var mapstraction=new Mapstraction(mapName,'google');mapstraction.addControls({zoom:'small',map_type:true});var myLatitude=$containerMap.find('.geo .latitude').text();var myLongitude=$containerMap.find('.geo .longitude').text();var myPoint=new LatLonPoint(myLatitude,myLongitude);var myZoom=parseInt($containerMap.find('.geo .zoom').text());mapstraction.setCenterAndZoom(myPoint,myZoom);mapstraction.enableScrollWheelZoom();$(this).find('.list-vcard .vcard').each(function(){var hcard=$(this);var latitude=hcard.find('.geo .latitude').text();var longitude=hcard.find('.geo .longitude').text();var marker=new Marker(new LatLonPoint(latitude,longitude));marker.setInfoBubble('<div class="bubble">'+hcard.html()+'</div>');mapstraction.addMarker(marker);});});});};function js_localizacion_run(gMapsApi){$(document).ready(function(){try{$.getScript('http://maps.google.com/maps?file=api&v=2.x&key='+gMapsApi+'&async=2&callback=cargarMapa');}catch(err){if(window.console)console.log('Failed to load Google Maps:'+err);}});}
var tb_pathToImage="images/thickbox-3.1.loadingAnimation.gif";$(document).ready(function(){tb_init('a.thickbox, area.thickbox, input.thickbox');imgLoader=new Image();imgLoader.src=tb_pathToImage;});function tb_init(domChunk){$(domChunk).click(function(){var t=this.title||this.name||null;var a=this.href||this.alt;var g=this.rel||false;tb_show(t,a,g);this.blur();return false;});}
function tb_show(caption,url,imageGroup){try{if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});$("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(tb_remove);}}else{if(document.getElementById("TB_overlay")===null){$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(tb_remove);}}
if(tb_detectMacXFF()){$("#TB_overlay").addClass("TB_overlayMacFFBGHack");}else{$("#TB_overlay").addClass("TB_overlayBG");}
if(caption===null){caption="";}
$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");$('#TB_load').show();var baseURL;if(url.indexOf("?")!==-1){baseURL=url.substr(0,url.indexOf("?"));}else{baseURL=url;}
var urlString=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;var urlType=baseURL.toLowerCase().match(urlString);if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'||urlType=='.bmp'){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(imageGroup){TB_TempArray=$("a[@rel="+imageGroup+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var urlTypeTemp=TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);if(!(TB_TempArray[TB_Counter].href==url)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length);}}}
imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var pagesize=tb_getPageSize();var x=pagesize[0]-150;var y=pagesize[1]-150;var imageWidth=imgPreloader.width;var imageHeight=imgPreloader.height;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;}}else if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;}}
TB_WIDTH=imageWidth+30;TB_HEIGHT=imageHeight+60;$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>"+"<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>Cerrar</a> o pulsa <strong>Esc</strong></div>");$("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function goPrev(){if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption,TB_PrevURL,imageGroup);return false;}
$("#TB_prev").click(goPrev);}
if(!(TB_NextHTML==="")){function goNext(){$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption,TB_NextURL,imageGroup);return false;}
$("#TB_next").click(goNext);}
document.onkeydown=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
if(keycode==27){tb_remove();}else if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";goNext();}}else if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";goPrev();}}};tb_position();$("#TB_load").remove();$("#TB_ImageOff").click(tb_remove);$("#TB_window").css({display:"block"});};imgPreloader.src=url;}else{var queryString=url.replace(/^[^\?]+\??/,'');var params=tb_parseQuery(queryString);TB_WIDTH=(params['width']*1)+30||630;TB_HEIGHT=(params['height']*1)+40||440;ajaxContentW=TB_WIDTH-30;ajaxContentH=TB_HEIGHT-45;if(url.indexOf('TB_iframe')!=-1){urlNoQuery=url.split('TB_');$("#TB_iframeContent").remove();if(params['modal']!="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>Cerrar</a> o pulsa <strong>Esc</strong></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;' > </iframe>");}else{$("#TB_overlay").unbind();$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;'> </iframe>");}}else{if($("#TB_window").css("display")!="block"){if(params['modal']!="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>Cerrar</a> o pulsa <strong>Esc</strong></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");}else{$("#TB_overlay").unbind();$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");}}else{$("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";$("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";$("#TB_ajaxContent")[0].scrollTop=0;$("#TB_ajaxWindowTitle").html(caption);}}
$("#TB_closeWindowButton").click(tb_remove);if(url.indexOf('TB_inline')!=-1){$("#TB_ajaxContent").append($('#'+params['inlineId']).children());$("#TB_window").unload(function(){$('#'+params['inlineId']).append($("#TB_ajaxContent").children());});tb_position();$("#TB_load").remove();$("#TB_window").css({display:"block"});}else if(url.indexOf('TB_iframe')!=-1){tb_position();if($.browser.safari){$("#TB_load").remove();$("#TB_window").css({display:"block"});}}else{$("#TB_ajaxContent").load(url+="&random="+(new Date().getTime()),function(){tb_position();$("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");$("#TB_window").css({display:"block"});});}}
if(!params['modal']){document.onkeyup=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
if(keycode==27){tb_remove();}};}}catch(e){}}
function tb_showIframe(){$("#TB_load").remove();$("#TB_window").css({display:"block"});}
function tb_remove(){$("#TB_imageOff").unbind("click");$("#TB_closeWindowButton").unbind("click");$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});$("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","");}
document.onkeydown="";document.onkeyup="";return false;}
function tb_position(){$("#TB_window").css({marginLeft:'-'+parseInt((TB_WIDTH/2),10)+'px',width:TB_WIDTH+'px'});if(!(jQuery.browser.msie&&jQuery.browser.version<7)){$("#TB_window").css({marginTop:'-'+parseInt((TB_HEIGHT/2),10)+'px'});}}
function tb_parseQuery(query){var Params={};if(!query){return Params;}
var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2){continue;}
var key=unescape(KeyVal[0]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}
return Params;}
function tb_getPageSize(){var de=document.documentElement;var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;arrayPageSize=[w,h];return arrayPageSize;}
function tb_detectMacXFF(){var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf('mac')!=-1&&userAgent.indexOf('firefox')!=-1){return true;}}
(function($){$.gaTracker=function(code,opts){opts=jQuery.extend({extensions:['pdf','doc','xls','csv','jpg','gif','mp3','swf','txt','ppt','zip','gz','dmg','xml']},opts);function decorateLink(u){if(u.indexOf('://')==-1&&u.indexOf('mailto:')!=0){var ext=u.split('.')[u.split('.').length-1];var exts=opts.extensions;for(i=0;i<exts.length;i++){if(ext==exts[i]){return"download";}}}else{if(u.indexOf('mailto:')==0){return"mailto";}else{return"external";}}}
function addTracking(){if(!window._gat){var interval=setInterval(function(){if(!window._gat)return;clearInterval(interval);addTracking();},500);}
var tracker=_gat._getTracker(code);tracker._initData();tracker._trackPageview();var downloadTracker=tracker._createEventTracker('Downloads');var mailtoTracker=tracker._createEventTracker('Mailto Links');var externalTracker=tracker._createEventTracker('External Links');$('a[href]').each(function(){var u=$(this).attr('href');if(!u)return;var action=decorateLink(u);if(!action)return;if(action=='download'){var ext=u.split('.')[u.split('.').length-1];$(this).click(function(){downloadTracker._trackEvent('Download '+ext,u);});}else if(action=='mailto'){u=u.substring(7);$(this).click(function(){mailtoTracker._trackEvent('Mailto Link',u);});}else if(action=='external'){$(this).click(function(){externalTracker._trackEvent('External Link',u);});}
if(window.console)console.log('Added '+action+' tracking event for '+u);});}
function initGA(){try{var gaURL=(location.protocol=='https:')?'https://ssl':'http://www';gaURL+='.google-analytics.com/ga.js';$.getScript(gaURL,function(){addTracking();});}catch(err){if(window.console)console.log('Failed to load Google Analytics:'+err);}}
initGA();}})(jQuery);function document_ready_run()
{var gMapsAPI='ABQIAAAALDXOoI_TM7OKWFa-_cwSAxThMRurL6JLwOn0O6CigVEzWOSGIRSnkN0ccQIpFV9KiMLY8jBrKzoqTw'
var gAnalyticsID='UA-4022334-2'
$(function(){switch(pageActive){case"dr-inicio":$('.list-cy').cycle({fx:'blindX',delay:-1000});break;case"dr-localizacion":js_localizacion_run(gMapsAPI);break;case"dr-faq":case"dr-metodo":case"dr-planifica":case"dr-partners":case"dr-porque":var ulTabsNav=$('#list-nav-Level2');var divTabsCont=$('.container-pan');var liTabsPan=$('.list-pan > li');var liTabsPan=divTabsCont.children('.list-pan').children('li');if(liTabsPan.length>0){if(pageActive=="dr-metodo"||pageActive=="dr-planifica"){$('.list-pan h2.list-pan-h2').wrap('<div class="list-nav-pn"></div>');$('.list-pan .list-nav-pn:not(:first)').prepend('<a class="prev" title="anterior" href="#"></a>');$('.list-pan .list-nav-pn:not(:last)').append('<a class="next" title="siguiente" href="#"></a>');$('.list-pan-showIfAccOn .show-all').click(function(){$('#list-nav-Level2').tabs("destroy").addClass("hide");$('.list-pan .pan').removeClass("ui-tabs-hide");$('body').removeClass('with-Nav-VL');});}
$('.list-nav-pn > a.prev').click(function(){var ulTabsNavSelected=ulTabsNav.data('selected.tabs');ulTabsNav.tabs('select',ulTabsNavSelected-1)});$('.list-nav-pn > a.next').click(function(){var ulTabsNavSelected=ulTabsNav.data('selected.tabs');ulTabsNav.tabs('select',ulTabsNavSelected+1)});ulTabsNav.tabs({navClass:'list-nav',panelClass:'pan',fx:{opacity:'toggle'}});}
if(pageActive=="dr-metodo"||pageActive=="dr-planifica"){$('.divImgTR').prependTo('.list-pan > li > .list-pf');}
if(pageActive=="dr-porque"){$('.divImgTR').prependTo('.list-pan > li');}
break;default:}
$(".container-fpm-inner").jCarouselLite({visible:5,scroll:2,auto:2000});$.gaTracker(gAnalyticsID);$('body').addClass('jqEnd');});}
function main()
{try
{$(document).ready(function(){$('body').addClass('jqOn').addClass('jqIni').removeClass('jqOff');document_ready_run();$('body').addClass('jqEnd').removeClass('jqOff').removeClass('jqIni');});window.onload=function(){}}
catch(err)
{if(window.console)console.log('oops! '+err);alert('oops! '+err);$('body').addClass('jqEnd').addClass('jqErr').removeClass('jqOff').removeClass('jqIni');}};main();