
(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(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}
try{fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0],10),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1],10),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2],10),255),0)].join(",")+")";}catch(err){}};});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return[parseInt(result[1],10),parseInt(result[2],10),parseInt(result[3],10)];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];if(result=/rgba\(0, 0, 0, 0\)/.exec(color))
return colors['transparent'];return colors[jQuery.trim(color).toLowerCase()];}
function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};})(jQuery);(function($){$.fn.pagePeel=function(options){var defaults={smallWidth:120,smallHeight:120,smallBG:'pp-src/smallBG.png',introWidth:300,introHeight:300,bigWidth:500,bigHeight:500,bigBG:'pp-src/bigBG.png',bigAd:'pp-src/bigAd.jpg',bigSWF:'pp-src/page-peel-big.swf',hPosition:'right',vPosition:'top',flash:true,introAnim:false,bigSWFIntro:'pp-src/page-peel-big-intro.swf',adLink:'blank',adLinkTarget:'_blank'};var options=$.extend(defaults,options);var element=this;return this.each(function(){if(options.flash===true){if(options.introAnim===true){$(element).after("<div class='page-peel-adjuster' style='overflow:hidden; width:"+options.introWidth+"px; height: "+options.introHeight+"px; display:none; position:absolute; "+options.vPosition+":0px; "+options.hPosition+":0px;'><div class='page-peel-holder' style='width:"+options.bigWidth+"px; height: "+options.bigHeight+"px; display:block; position:absolute; "+options.vPosition+":0px; "+options.hPosition+":0px; z-index:9999;'><embed style='display: block;' src='"+options.bigSWFIntro+"' flashvars='linkURL="+options.adLink+"&linkURLTarget="+options.adLinkTarget+"&bigURL="+options.bigAd+"' type='application/x-shockwave-flash' pluginspage='http://www.adobe.com/go/getflashplayer' wmode='transparent' autoplay='false' width='"+options.bigWidth+"' height='"+options.bigHeight+"'></div></div>");}
if(options.introAnim===false){$(element).after("<div class='page-peel-adjuster' style='overflow:hidden; width:"+options.smallWidth+"px; height: "+options.smallHeight+"px; display:none; position:absolute; "+options.vPosition+":0px; "+options.hPosition+":0px;'><div class='page-peel-holder' style='width:"+options.bigWidth+"px; height: "+options.bigHeight+"px; display:block; position:absolute; "+options.vPosition+":0px; "+options.hPosition+":0px; z-index:9999;'><embed style='display: block;' src='"+options.bigSWF+" 'flashvars='linkURL="+options.adLink+"&linkURLTarget="+options.adLinkTarget+"&bigURL="+options.bigAd+"' type='application/x-shockwave-flash' pluginspage='http://www.adobe.com/go/getflashplayer' wmode='transparent' autoplay='false' width='"+options.bigWidth+"' height='"+options.bigHeight+"'></div></div>");}
$('.page-peel-adjuster').hover(function(){var w=$(this).width();if(w===300){$(this).stop().css({width:options.smallWidth,height:options.smallHeight});}else{$(this).css('z-index','9999');$(this).stop().css({width:options.bigWidth,height:options.bigHeight});}},function(){$(this).animate({width:options.smallWidth,height:options.smallHeight},1000);$(this).css('z-index','1000');});$('.page-peel-adjuster').css('display','block');}
if(options.flash!==true){$(element).after("<div class='page-peel-adjuster' style='width:"+options.smallWidth+"px; height: "+options.smallHeight+"px; display:block; position:absolute; "+options.vPosition+":0px; "+options.hPosition+":0px; background:url("+options.smallBG+") "+options.vPosition+" "+options.hPosition+" no-repeat;'");$('.page-peel-adjuster').hover(function(){$(this).css('z-index','9999');$(this).css({width:options.bigWidth,height:options.bigHeight,background:'url('+options.bigBG+') top right no-repeat'});},function(){$(this).css({width:options.smallWidth,height:options.smallHeight,background:'url('+options.smallBG+') top right no-repeat'});$(this).css('z-index','1000');});}});};})(jQuery);var _animacionPagePeel_modo='m';function _animacionPagePeel_bucle()
{var mov=0+aleatorio(0,10)/10;var tiempo=aleatorio(400,600);var dif=(_animacionPagePeel_modo==='M'?5:1);mov+=dif;if(0)$("#pagePeel span").animate({marginRight:mov+'em',marginTop:mov+'em'},tiempo,'swing');if(1)$("#pagePeel span").animate({top:-mov+'em',right:-mov+'em'},tiempo,'swing');mov+=dif;if(1)$("#pagePeel .msg_block").animate({bottom:mov+'em',left:mov+'em'},tiempo,'swing',_animacionPagePeel_bucle);if(0)$("#pagePeel .msg_block").animate({height:mov+'em',width:mov+'em'},tiempo,'swing',_animacionPagePeel_bucle);}
function animacionPagePeel()
{_animacionPagePeel_bucle();$("#pagePeel").hover(function(){$("#pagePeel, #pagePeel span, #pagePeel span img, #pagePeel .msg_block").stop();if(1)if(_animacionPagePeel_modo==='m'){if(0)$("#pagePeel span img").css('bottom','').css('left','');if(0)$("#pagePeel span").css('marginRight','').css('marginTop','');if(1)$("#pagePeel span").css('top','').css('right','');if(1)$("#pagePeel .msg_block").css('bottom','').css('left','');if(0)$("#pagePeel .msg_block").css('height','').css('width','');}
_animacionPagePeel_modo='m2M';$("#pagePeel").addClass('aCrecer').animate({height:"40em",width:"40em"},400+0*20,'swing',function(){_animacionPagePeel_modo='M';_animacionPagePeel_bucle();});},function(){$("#pagePeel, #pagePeel span, #pagePeel span img, #pagePeel .msg_block").stop();if(1)if(_animacionPagePeel_modo==='M'){if(0)$("#pagePeel span img").css('bottom','').css('left','');if(0)$("#pagePeel span").css('marginRight','').css('marginTop','');if(1)$("#pagePeel span").css('top','').css('right','');if(1)$("#pagePeel .msg_block").css('bottom','').css('left','');if(0)$("#pagePeel .msg_block").css('height','').css('width','');}
_animacionPagePeel_modo='M2m';$("#pagePeel").animate({height:"8em",width:"8em"},600-0*20,'swing',function(){$("#pagePeel").removeClass('aCrecer');_animacionPagePeel_modo='m';_animacionPagePeel_bucle();});});}
function animacionPagePeel00()
{_animacionPagePeel_bucle();$("#pagePeel").hover(function(){$("#pagePeel span, #pagePeel span img, #pagePeel .msg_block").stop();if(_animacionPagePeel_modo==='m'){$("#pagePeel span").css('right',"0em").css('top',"0em");$("#pagePeel .msg_block").css('height','6em').css('width','6em');}
_animacionPagePeel_modo='m2M';$("#pagePeel span").addClass('noHover');$("#pagePeel span img").animate({height:"40em",width:"40em",marginTop:"-5em",marginRight:"-5em"},400,'swing');$("#pagePeel .msg_block").animate({height:"30em",width:"30em"},400+0*20,'swing',function(){_animacionPagePeel_modo='M';_animacionPagePeel_bucle();});},function(){$("#pagePeel span, #pagePeel span img, #pagePeel .msg_block").stop();if(_animacionPagePeel_modo==='M'){$("#pagePeel span img").css('right',"0em").css('top',"0em");$("#pagePeel .msg_block").css('height','30em').css('width','30em');}
_animacionPagePeel_modo='M2m';$("#pagePeel span img").animate({height:"8em",width:"8em",marginTop:"-1em",marginRight:"-1em"},600,'swing');$("#pagePeel .msg_block").animate({height:"6em",width:"6em"},600-0*20,'swing',function(){$("#pagePeel span").removeClass('noHover');_animacionPagePeel_modo='m';_animacionPagePeel_bucle();});});}
function animacionPagePeel_IE6()
{$("#pagePeel").hover(function(){$("#pagePeel").addClass('hover');},function(){$("#pagePeel").removeClass('hover');});};(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.fadeX=function($cont,$slides,opts){$slides.not(':eq('+opts.startingSlide+')').css('opacity',0);if(0){$slides.not(':eq('+opts.startingSlide+')').parent().find('> dt > a').not('.self').css('opacity',0);$cont.find('> dl').each(function(i){var zIndex=parseInt($(this).find('> dd').css('zIndex'));$(this).find('> dt *').css('z-index',zIndex+1);});}
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.transitions.scrollLeft=function($cont,$slides,opts){$cont.css('overflow','hidden');opts.before.push(function(curr,next,opts){$(this).show();opts.cssBefore.left=next.offsetWidth;opts.animOut.left=0-curr.offsetWidth;});opts.cssFirst={left:0};opts.animIn={left:0};};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var w=$cont.css('overflow','visible').width();$slides.css({left:0,top:0});opts.before.push(function(){$(this).show()});opts.speed=opts.speed/2;opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(var i=0;i<$slides.length;i++)
opts.els.push($slides[i]);for(var i=0;i<opts.startingSlide;i++)
opts.els.push(opts.els.shift());opts.fxFn=function(curr,next,opts,cb,fwd){var $el=fwd?$(curr):$(next);$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());if(fwd)
for(var i=0,len=opts.els.length;i<len;i++)
$(opts.els[i]).css('z-index',len-i);else{var z=$(curr).css('z-index');$el.css('z-index',parseInt(z)+1);}
$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb)cb();});});};opts.onAddSlide=function($s){$s.hide();};};$.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};};$.fn.cycle.transitions.blindX_dc_inicio=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.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;}
if(typeof options=='function')
options={success:options};options=$.extend({url:this.attr('action')||window.location.toString(),type:this.attr('method')||'GET'},options||{});var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}
if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}
var a=this.formToArray(options.semantic);if(options.data){options.extraData=options.data;for(var n in options.data){if(options.data[n]instanceof Array){for(var k in options.data[n])
a.push({name:n,value:options.data[n][k]})}
else
a.push({name:n,value:options.data[n]});}}
if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}
this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}
var q=$.param(a);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}
else
options.data=q;var $form=this,callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm();});if(options.clearForm)callbacks.push(function(){$form.clearForm();});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){$(options.target).html(data).each(oldSuccess,arguments);});}
else if(options.success)
callbacks.push(options.success);options.success=function(data,status){for(var i=0,max=callbacks.length;i<max;i++)
callbacks[i].apply(options,[data,status,$form]);};var files=$('input:file',this).fieldValue();var found=false;for(var j=0;j<files.length;j++)
if(files[j])
found=true;if(options.iframe||found){if($.browser.safari&&options.closeKeepAlive)
$.get(options.closeKeepAlive,fileUpload);else
fileUpload();}
else
$.ajax(options);this.trigger('form-submit-notify',[this,options]);return this;function fileUpload(){var form=$form[0];if($(':input[name=submit]',form).length){alert('Error: Form elements must not be named "submit".');return;}
var opts=$.extend({},$.ajaxSettings,options);var s=jQuery.extend(true,{},$.extend(true,{},$.ajaxSettings),opts);var id='jqFormIO'+(new Date().getTime());var $io=$('<iframe id="'+id+'" name="'+id+'" />');var io=$io[0];if($.browser.msie||$.browser.opera)
io.src='javascript:false;document.write("");';$io.css({position:'absolute',top:'-1000px',left:'-1000px'});var xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;$io.attr('src','about:blank');}};var g=opts.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[xhr,opts]);if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;return;}
if(xhr.aborted)
return;var cbInvoked=0;var timedOut=0;var sub=form.clk;if(sub){var n=sub.name;if(n&&!sub.disabled){options.extraData=options.extraData||{};options.extraData[n]=sub.value;if(sub.type=="image"){options.extraData[name+'.x']=form.clk_x;options.extraData[name+'.y']=form.clk_y;}}}
setTimeout(function(){var t=$form.attr('target'),a=$form.attr('action');$form.attr({target:id,method:'POST',action:opts.url});if(!options.skipEncodingOverride){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});}
if(opts.timeout)
setTimeout(function(){timedOut=true;cb();},opts.timeout);var extraInputs=[];try{if(options.extraData)
for(var n in options.extraData)
extraInputs.push($('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />').appendTo(form)[0]);$io.appendTo('body');io.attachEvent?io.attachEvent('onload',cb):io.addEventListener('load',cb,false);form.submit();}
finally{$form.attr('action',a);t?$form.attr('target',t):$form.removeAttr('target');$(extraInputs).remove();}},10);function cb(){if(cbInvoked++)return;io.detachEvent?io.detachEvent('onload',cb):io.removeEventListener('load',cb,false);var operaHack=0;var ok=true;try{if(timedOut)throw'timeout';var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;if(doc.body==null&&!operaHack&&$.browser.opera){operaHack=1;cbInvoked--;setTimeout(cb,100);return;}
xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;xhr.getResponseHeader=function(header){var headers={'content-type':opts.dataType};return headers[header];};if(opts.dataType=='json'||opts.dataType=='script'){var ta=doc.getElementsByTagName('textarea')[0];xhr.responseText=ta?ta.value:xhr.responseText;}
else if(opts.dataType=='xml'&&!xhr.responseXML&&xhr.responseText!=null){xhr.responseXML=toXml(xhr.responseText);}
data=$.httpData(xhr,opts.dataType);}
catch(e){ok=false;$.handleError(opts,xhr,'error',e);}
if(ok){opts.success(data,'success');if(g)$.event.trigger("ajaxSuccess",[xhr,opts]);}
if(g)$.event.trigger("ajaxComplete",[xhr,opts]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(opts.complete)opts.complete(xhr,ok?'success':'error');setTimeout(function(){$io.remove();xhr.responseXML=null;},100);};function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}
else
doc=(new DOMParser()).parseFromString(s,'text/xml');return(doc&&doc.documentElement&&doc.documentElement.tagName!='parsererror')?doc:null;};};};$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().bind('submit.form-plugin',function(){$(this).ajaxSubmit(options);return false;}).each(function(){$(":submit,input:image",this).bind('click.form-plugin',function(e){var form=this.form;form.clk=this;if(this.type=='image'){if(e.offsetX!=undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$(this).offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-this.offsetLeft;form.clk_y=e.pageY-this.offsetTop;}}
setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},10);});});};$.fn.ajaxFormUnbind=function(){this.unbind('submit.form-plugin');return this.each(function(){$(":submit,input:image",this).unbind('click.form-plugin');});};$.fn.formToArray=function(semantic){var a=[];if(this.length==0)return a;var form=this[0];var els=semantic?form.getElementsByTagName('*'):form.elements;if(!els)return a;for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n)continue;if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el)
a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});continue;}
var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)
a.push({name:n,value:v[j]});}
else if(v!==null&&typeof v!='undefined')
a.push({name:n,value:v});}
if(!semantic&&form.clk){var inputs=form.getElementsByTagName("input");for(var i=0,max=inputs.length;i<max;i++){var input=inputs[i];var n=input.name;if(n&&!input.disabled&&input.type=="image"&&form.clk==input)
a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}
return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++)
a.push({name:n,value:v[i]});}
else if(v!==null&&typeof v!='undefined')
a.push({name:this.name,value:v});});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length))
continue;v.constructor==Array?$.merge(val,v):val.push(v);}
return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful=='undefined')successful=true;if(successful&&(!n||el.disabled||t=='reset'||t=='button'||(t=='checkbox'||t=='radio')&&!el.checked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.selectedIndex==-1))
return null;if(tag=='select'){var index=el.selectedIndex;if(index<0)return null;var a=[],ops=el.options;var one=(t=='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes['value'].specified)?op.text:op.value;if(one)return v;a.push(v);}}
return a;}
return el.value;};$.fn.clearForm=function(){return this.each(function(){$('input,select,textarea',this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=='text'||t=='password'||tag=='textarea')
this.value='';else if(t=='checkbox'||t=='radio')
this.checked=false;else if(tag=='select')
this.selectedIndex=-1;});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType))
this.reset();});};$.fn.enable=function(b){if(b==undefined)b=true;return this.each(function(){this.disabled=!b});};$.fn.selected=function(select){if(select==undefined)select=true;return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio')
this.checked=select;else if(this.tagName.toLowerCase()=='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type=='select-one'){$sel.find('option').selected(false);}
this.selected=select;}});};function log(){if($.fn.ajaxSubmit.debug&&window.console&&window.console.log)
window.console.log('[jquery.form] '+Array.prototype.join.call(arguments,''));};})(jQuery);(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}
var validator=$.data(this[0],'validator');if(validator){return validator;}
validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});this.submit(function(event){if(validator.settings.debug)
event.preventDefault();function handle(){if(validator.settings.submitHandler){validator.settings.submitHandler.call(validator,validator.currentForm);return false;}
return true;}
if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}
if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}
return handle();}else{validator.focusInvalid();return false;}});}
return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=false;var validator=$(this[0].form).validate();this.each(function(){valid|=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)
settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}
var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}
var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}
return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(a.value);},filled:function(a){return!!$.trim(a.value);},unchecked:function(a){return!a.checked;}});$.format=function(source,params){if(arguments.length==1)
return function(){var args=$.makeArray(arguments);args.unshift(source);return $.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}
if(params.constructor!=Array){params=[params];}
$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init();};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)
this.element(element);},highlight:function(element,errorClass){$(element).addClass(errorClass);},unhighlight:function(element,errorClass){$(element).removeClass(errorClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.format("Please enter no more than {0} characters."),minlength:$.format("Please enter at least {0} characters."),rangelength:$.format("Please enter a value between {0} and {1} characters long."),range:$.format("Please enter a value between {0} and {1}."),max:$.format("Please enter a value less than or equal to {0}."),min:$.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0]);}
$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);if(this.settings.invalidHandler)
$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())
$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}
return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}
if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}
this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}
this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}
this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)
$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)
count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))
return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.formSubmitted=false;this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}
var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value,element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}
dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}
if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method");throw e;}}
if(dependencyMismatch)
return;if(this.objectLength(rules))
this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)
return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)
return arguments[i];}
return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method);if(typeof message=="function")
message=message.call(this,rule.parameters,element);this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)
toToggle=toToggle.add(toToggle.parents(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass);this.showLabel(error.element,error.message);}
if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}
if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}
if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass);}}
this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}
if(!this.labelContainer.append(label).length)
this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}
if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}
this.toShow=this.toShow.add(label);},errorsFor:function(element){return this.errors().filter("[for='"+this.idOrName(element)+"']");},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))
return this.findByName(element.name).filter(':checked').length;}
return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)
this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}
return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}
return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}
if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}
if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}
if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}
if(rules.messages){delete rules.messages}
return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}
return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message;if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))
return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var options=$("option:selected",element);return options.length>0&&(element.type=="select-multiple"||($.browser.msie&&!(options[0].attributes['value'].specified)?options[0].text:options[0].value).length>0);case'input':if(this.checkable(element))
return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))
return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])
this.settings.messages[element.name]={};this.settings.messages[element.name].remote=typeof previous.message=="function"?previous.message(value):previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){if(response){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};errors[element.name]=response||validator.defaultMessage(element,"remote");validator.showErrors(errors);}
previous.valid=response;validator.stopRequest(element,response);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}
return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},dateDE:function(value,element){return this.optional(element)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))
return"dependency-mismatch";if(/[^0-9-]+/.test(value))
return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)
nDigit-=9;}
nCheck+=nDigit;bEven=!bEven;}
return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param:"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){return value==$(param).val();}}});})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
return(pendingRequests[port]=ajax.apply(this,arguments));}
return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})]);}})})(jQuery);function validate_run()
{jQuery(function(){var $botones=$("#buttons");var $enviar=$botones.find("#enviar");var $loader=$('<div id="loader"><img src="images/loading.gif" alt="loading..." /></div>').appendTo($botones).hide();function reseteaFormulario(){$loader.hide();$enviar.show();v.resetForm();}
jQuery().ajaxStart(function(){$enviar.hide();$loader.show();}).ajaxStop(function(){$loader.hide();$enviar.show();}).ajaxError(function(a,b,e){throw e;});var v=$("#contactForm").validate({rules:{name:{minlength:2}},submitHandler:function(form){var $cuantos=$(".at_least_one input:filled");if($cuantos.length>=1)
{jQuery(form).ajaxSubmit({target:"#contact-message-alert"});}
else
{$("#contact-message-alert").html("Recuerda incluir al menos un e-mail o un número de teléfono.").show();$(".contact-message").show();}}});$("#reset").click(reseteaFormulario);});$.validator.addMethod("esphone",function(phone_number,element){phone_number=phone_number.replace(/\s+/g,"");return this.optional(element)||(((phone_number.length==9)&&phone_number.match(/^(\+34\-)?[689]{1}[0-9]{8}$/))||((phone_number.length>=9)&&phone_number.match(/^\+[0-9]{1,3}-[0-9]{6,16}$/)));},"Por favor, especifica un número de teléfono válido. Si no es de España, agrega el código del país. Ej. para Francia: +33 - 1 23 45 67 89");}
jQuery.extend(jQuery.validator.messages,{required:"Este campo es obligatorio.",remote:"Por favor, rellena esta campo.",email:"Por favor, escribe una dirección de correo válida",url:"Por favor, escribe una URL válida.",date:"Por favor, escribe una fecha válida.",dateISO:"Por favor, escribe una fecha (ISO) válida.",number:"Por favor, escribe un número entero válido.",digits:"Por favor, escribe sólo dígitos.",creditcard:"Por favor, escribe un número de tarjeta válido.",equalTo:"Por favor, escribe el mismo valor de nuevo.",accept:"Por favor, escribe una valor con una extensión aceptada.",maxlength:jQuery.format("Por favor, no escribas más de {0} caracteres."),minlength:jQuery.format("Por favor, no escribas menos de {0} caracteres."),rangelength:jQuery.format("Por favor, escribe un valor entre {0} y {1} caracteres."),range:jQuery.format("Por favor, escribe un valor entre {0} y {1}."),max:jQuery.format("Por favor, escribe un valor igual o menor que {0}."),min:jQuery.format("Por favor, escribe un valor igual o mayor que {0}.")});(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=$('.ARTICLE');$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);}});}
(function($){$.gaTracker=function(code,domain,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(var 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();if(domain!==undefined){tracker._setDomainName(domain);}
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);jQuery.fn.wait=function(time,type){time=time||1000;type=type||"fx";return this.queue(type,function(){var self=this;setTimeout(function(){$(self).dequeue();},time);});};function aleatorio(inferior,superior){numPosibilidades=superior-inferior+1;aleat=Math.floor(Math.random()*numPosibilidades);return parseInt(inferior)+aleat;}
function gestorExternalRels()
{$('a[rel~=external]').attr('target','_blank').each(function(i){var tit=$(this).attr("title");var msg='(Abrirá en nuevo tab / ventana)';$(this).attr("title",tit===''?msg:tit+' '+msg);});}
var llamanos_telefono_color_org;function _animacionTelefono_bucle()
{var tipoColor=aleatorio(1,6);var colR=(((tipoColor&4)==0)?0:(96+aleatorio(0,256-96)));var colG=(((tipoColor&2)==0)?0:(96+aleatorio(0,256-96)));var colB=(((tipoColor&1)==0)?0:(96+aleatorio(0,256-96)));var color='rgb('+colR+','+colG+','+colB+')';$("#llamanos-telefono").animate({'color':color},2000,'swing');$("#llamanos-telefono").animate({'color':llamanos_telefono_color_org},2000,'swing',_animacionTelefono_bucle);}
function animacionTelefono()
{llamanos_telefono_color_org=$('#llamanos-telefono').css('color');_animacionTelefono_bucle();}
var _animacionTira_ImgActual;var _animacionTira_totalImgs;function _animacionTira_bucle()
{if(_animacionTira_ImgActual>=_animacionTira_totalImgs){$('#container-tira img').css('marginLeft','0');_animacionTira_ImgActual=1;}
else
{_animacionTira_ImgActual+=1;}
$('#container-tira img').wait(2000).animate({"marginLeft":"-=21em"},630,'swing',_animacionTira_bucle);}
function animacionTira()
{_animacionTira_totalImgs=($("#container-tira img").width()/10-0)/21-1;_animacionTira_ImgActual=aleatorio(0,_animacionTira_totalImgs);$('#container-tira img').css('marginLeft',_animacionTira_ImgActual*-21+'em');_animacionTira_bucle();}
function setActiveSlide($dl,hash){$dl.addClass('activeSlide').siblings().removeClass('activeSlide');if(hash!==false){if(hash===true){hash=$dl.attr('id');}
if(0){location.hash=hash;}}}
function controladorClicks(eventObject){var $dl=$(this).parent().parent();setActiveSlide($dl,true);}
function gestor_HM(startingTab){startingTab=(startingTab==-1)?0:startingTab;var $dls=$('.art-HM dl.elem-pan');var $dl=$dls.filter(':eq('+startingTab+')');setActiveSlide($dl,false);var $clicks=$dls.find('> dt a.self');$clicks.click(controladorClicks);}
_updateActivePagerLink=function(pager,currSlide){var $dl=$(pager).find('dl:eq('+currSlide+')');var hash=$dl.attr('id');setActiveSlide($dl,hash);return false;};$.fn.cycle.updateActivePagerLink=_updateActivePagerLink;function animacionListPan(sel,startingSlide,miFx,timeout,speed,delay)
{var pager=sel+' .list-pan';var slideExpr='.elem-pan .cont-pan';var zIndexPN=$(pager).find(slideExpr).size()+1;$(pager).find('.elem-pan > dt > a').css('z-index',zIndexPN);$(pager).cycle({fx:miFx,pager:pager,pagerAnchorBuilder:function(idx,slide){return pager+' dl:eq('+idx+') a';},slideExpr:slideExpr,pause:true,next:'.next',prev:'.prev',startingSlide:startingSlide===-1?0:startingSlide,timeout:(timeout!==undefined)?timeout:4000,speed:(speed!==undefined)?speed:1000,delay:(delay!==undefined)?delay:3000});}
function muestraTexto(sel,tab)
{var pager='.container-pan'+sel+' dl';$(pager).each(function(i){$(this).toggle(i===tab);});}
function getStartingTab()
{var pager='.ARTICLE .list-pan';var hash=location.hash.replace('#','');var startingTab=-1;if(hash!=''){var $dl=$(pager).children('dl#'+hash);startingTab=$(pager).children().index($dl);}
return startingTab;}
var ieVer;function document_ready_run()
{var gMapsAPI="ABQIAAAALDXOoI_TM7OKWFa-_cwSAxR05RQNtZj2r21i5itxsqQ4WMm4ZxRuU8-RCuEkgn5K1tvgtmGNH6NBUQ";var gAnalyticsID="UA-4022334-9";gestorExternalRels();var stargingTab=getStartingTab();$(function(){switch(pageActive){case"ir-inicio":break;case"ir-cartera":break;case"ir-localizacion":js_localizacion_run(gMapsAPI);break;case"ir-contacto":validate_run();break;case"ir-servicios":case"ir-complementos":gestor_HM(stargingTab);break;default:}
muestraTexto('#cp2',aleatorio(0,2));animacionTelefono();animacionListPan('#cp1',1,'fadeX',1500,200,0);if(ieVer>0&&ieVer<=6){animacionPagePeel_IE6();}else{animacionPagePeel();}
$.gaTracker(gAnalyticsID);$('body').addClass('jqEnd');});}
function window_onload_run()
{}
function main()
{if(1){try{ieVer=0;if(ieVer>0&&ieVer<6){return;}
if(0&&(ieVer===6)){alert('ie6!');return;}
$(document).ready(function(){if(0)alert('ini drr');$('body').addClass('jqOn').addClass('jqIni').removeClass('jqOff');document_ready_run();$('body').addClass('jqEnd').removeClass('jqOff').removeClass('jqIni');if(0)alert('end drr');});window.onload=function(){if(0)alert('ini wor');window_onload_run();if(0)alert('end wor');};}catch(err){if(window.console)console.log('oops! '+err);alert('oops! '+err);$('body').removeClass('jqOn').removeClass('jqIni').addClass('jqErr').addClass('jqOff');}}else{$(document).ready(function(){$('body').removeClass('jqOn').removeClass('jqIni').addClass('jqOff');});}};main();
