if(typeof window.jQuery=="undefined"){window.undefined=window.undefined;var jQuery=function(a,c){if(window==this)
return new jQuery(a,c);a=a||document;if(jQuery.isFunction(a))
return new jQuery(document)[jQuery.fn.ready?"ready":"load"](a);if(typeof a=="string"){var m=/^[^<]*(<(.|\n)+>)[^>]*$/.exec(a);if(m)
a=jQuery.clean([m[1]]);else
return new jQuery(c).find(a);}
return this.setArray(a.constructor==Array&&a||(a.jquery||a.length&&a!=window&&!a.nodeType&&a[0]!=undefined&&a[0].nodeType)&&jQuery.makeArray(a)||[a]);};if(typeof $!="undefined")
jQuery._$=$;var $=jQuery;jQuery.fn=jQuery.prototype={jquery:"1.1.1",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(a){var ret=jQuery(this);ret.prevObject=this;return ret.setArray(a);},setArray:function(a){this.length=0;[].push.apply(this,a);return this;},each:function(fn,args){return jQuery.each(this,fn,args);},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i;});return pos;},attr:function(key,value,type){var obj=key;if(key.constructor==String)
if(value==undefined)
return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value;}
return this.each(function(index){for(var prop in obj)
jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop));});},css:function(key,value){return this.attr(key,value,"curCSS");},text:function(e){if(typeof e=="string")
return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)
t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return t;},wrap:function(){var a=jQuery.clean(arguments);return this.each(function(){var b=a[0].cloneNode(true);this.parentNode.insertBefore(b,this);while(b.firstChild)
b=b.firstChild;b.appendChild(this);});},append:function(){return this.domManip(arguments,true,1,function(a){this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild);});},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this);});},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(t){return this.pushStack(jQuery.map(this,function(a){return jQuery.find(t,a);}));},clone:function(deep){return this.pushStack(jQuery.map(this,function(a){return a.cloneNode(deep!=undefined?deep:true);}));},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index])})||jQuery.multiFilter(t,this));},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){if(t.constructor==Array||t.jquery)
return jQuery.inArray(t,a)<0;else
return a!=t;}));},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&!t.nodeName?t:[t]));},is:function(expr){return expr?jQuery.filter(expr,this).r.length>0:false;},val:function(val){return val==undefined?(this.length?this[0].value:null):this.attr("value",val);},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},domManip:function(args,table,dir,fn){var clone=this.length>1;var a=jQuery.clean(args);if(dir<0)
a.reverse();return this.each(function(){var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))
obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){fn.apply(obj,[clone?this.cloneNode(true):this]);});});}};jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0],a=1;if(arguments.length==1){target=this;a=0;}
var prop;while(prop=arguments[a++])
for(var i in prop)target[i]=prop[i];return target;};jQuery.extend({noConflict:function(){if(jQuery._$)
$=jQuery._$;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&typeof fn[0]=="undefined"&&/function/i.test(fn+"");},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},each:function(obj,fn,args){if(obj.length==undefined)
for(var i in obj)
fn.apply(obj[i],args||[i,obj[i]]);else
for(var i=0,ol=obj.length;i<ol;i++)
if(fn.apply(obj[i],args||[i,obj[i]])===false)break;return obj;},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))
return value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;if(value.constructor==Number&&type=="curCSS"&&!exclude.test(prop))
return value+"px";return value;},className:{add:function(elem,c){jQuery.each(c.split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))
elem.className+=(elem.className?" ":"")+cur;});},remove:function(elem,c){elem.className=c?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur);}).join(" "):"";},has:function(t,c){t=t.className||t;return t&&new RegExp("(^|\\s)"+c+"(\\s|$)").test(t);}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}
f.apply(e,[]);for(var i in o)
e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery.css(e,"display")!="none"){oHeight=e.offsetHeight;oWidth=e.offsetWidth;}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position");if(parPos==""||parPos=="static")
e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos==""||parPos=="static")
e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}
return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret;if(prop=="opacity"&&jQuery.browser.msie)
return jQuery.attr(elem.style,"opacity");if(prop=="float"||prop=="cssFloat")
prop=jQuery.browser.msie?"styleFloat":"cssFloat";if(!force&&elem.style[prop])
ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop=="cssFloat"||prop=="styleFloat")
prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur)
ret=cur.getPropertyValue(prop);else if(prop=="display")
ret="none";else
jQuery.swap(elem,{display:"block"},function(){var c=document.defaultView.getComputedStyle(this,"");ret=c&&c.getPropertyValue(prop)||"";});}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];}
return ret;},clean:function(a){var r=[];jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)
arg=arg.toString();if(typeof arg=="string"){var s=jQuery.trim(arg),div=document.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||(!s.indexOf("<thead")||!s.indexOf("<tbody")||!s.indexOf("<tfoot"))&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];div.innerHTML=wrap[1]+s+wrap[2];while(wrap[0]--)
div=div.firstChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)
tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)
tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)
if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)
tb[n].parentNode.removeChild(tb[n]);}
arg=div.childNodes;}
if(arg.length===0)
return;if(arg[0]==undefined)
r.push(arg);else
r=jQuery.merge(r,arg);});return r;},attr:function(elem,name,value){var fix={"for":"htmlFor","class":"className","float":jQuery.browser.msie?"styleFloat":"cssFloat",cssFloat:jQuery.browser.msie?"styleFloat":"cssFloat",innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected"};if(name=="opacity"&&jQuery.browser.msie&&value!=undefined){elem.zoom=1;return elem.filter=elem.filter.replace(/alpha\([^\)]*\)/gi,"")+
(value==1?"":"alpha(opacity="+value*100+")");}else if(name=="opacity"&&jQuery.browser.msie)
return elem.filter?parseFloat(elem.filter.match(/alpha\(opacity=(.*)\)/)[1])/100:1;if(name=="opacity"&&jQuery.browser.mozilla&&value==1)
value=0.9999;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))
return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined)elem.setAttribute(name,value);return elem.getAttribute(name);}else{name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(t){return t.replace(/^\s+|\s+$/g,"");},makeArray:function(a){var r=[];if(a.constructor!=Array)
for(var i=0,al=a.length;i<al;i++)
r.push(a[i]);else
r=a.slice(0);return r;},inArray:function(b,a){for(var i=0,al=a.length;i<al;i++)
if(a[i]==b)
return i;return-1;},merge:function(first,second){var r=[].slice.call(first,0);for(var i=0,sl=second.length;i<sl;i++)
if(jQuery.inArray(second[i],r)==-1)
first.push(second[i]);return first;},grep:function(elems,fn,inv){if(typeof fn=="string")
fn=new Function("a","i","return "+fn);var result=[];for(var i=0,el=elems.length;i<el;i++)
if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))
result.push(elems[i]);return result;},map:function(elems,fn){if(typeof fn=="string")
fn=new Function("a","return "+fn);var result=[],r=[];for(var i=0,el=elems.length;i<el;i++){var val=fn(elems[i],i);if(val!==null&&val!=undefined){if(val.constructor!=Array)val=[val];result=result.concat(val);}}
var r=result.length?[result[0]]:[];check:for(var i=1,rl=result.length;i<rl;i++){for(var j=0;j<i;j++)
if(result[i]==r[j])
continue check;r.push(result[i]);}
return r;}});new function(){var b=navigator.userAgent.toLowerCase();jQuery.browser={safari:/webkit/.test(b),opera:/opera/.test(b),msie:/msie/.test(b)&&!/opera/.test(b),mozilla:/mozilla/.test(b)&&!/(compatible|webkit)/.test(b)};jQuery.boxModel=!jQuery.browser.msie||document.compatMode=="CSS1Compat";};jQuery.each({parent:"a.parentNode",parents:"jQuery.parents(a)",next:"jQuery.nth(a,2,'nextSibling')",prev:"jQuery.nth(a,2,'previousSibling')",siblings:"jQuery.sibling(a.parentNode.firstChild,a)",children:"jQuery.sibling(a.firstChild)"},function(i,n){jQuery.fn[i]=function(a){var ret=jQuery.map(this,n);if(a&&typeof a=="string")
ret=jQuery.multiFilter(a,ret);return this.pushStack(ret);};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after"},function(i,n){jQuery.fn[i]=function(){var a=arguments;return this.each(function(){for(var j=0,al=a.length;j<al;j++)
jQuery(a[j])[n](this);});};});jQuery.each({removeAttr:function(key){jQuery.attr(this,key,"");this.removeAttribute(key);},addClass:function(c){jQuery.className.add(this,c);},removeClass:function(c){jQuery.className.remove(this,c);},toggleClass:function(c){jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c);},remove:function(a){if(!a||jQuery.filter(a,[this]).r.length)
this.parentNode.removeChild(this);},empty:function(){while(this.firstChild)
this.removeChild(this.firstChild);}},function(i,n){jQuery.fn[i]=function(){return this.each(n,arguments);};});jQuery.each(["eq","lt","gt","contains"],function(i,n){jQuery.fn[n]=function(num,fn){return this.filter(":"+n+"("+num+")",fn);};});jQuery.each(["height","width"],function(i,n){jQuery.fn[n]=function(h){return h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h.constructor==String?h:h+"px");};});jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"i<m[3]-0",gt:"i>m[3]-0",nth:"m[3]-0==i",eq:"m[3]-0==i",first:"i==0",last:"i==r.length-1",even:"i%2==0",odd:"i%2","nth-child":"jQuery.nth(a.parentNode.firstChild,m[3],'nextSibling',a)==a","first-child":"jQuery.nth(a.parentNode.firstChild,1,'nextSibling')==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"jQuery.sibling(a.parentNode.firstChild).length==1",parent:"a.firstChild",empty:"!a.firstChild",contains:"jQuery.fn.text.apply([a]).indexOf(m[3])>=0",visible:'a.type!="hidden"&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'a.type=="hidden"||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',enabled:"!a.disabled",disabled:"a.disabled",checked:"a.checked",selected:"a.selected||jQuery.attr(a,'selected')",text:"a.type=='text'",radio:"a.type=='radio'",checkbox:"a.type=='checkbox'",file:"a.type=='file'",password:"a.type=='password'",submit:"a.type=='submit'",image:"a.type=='image'",reset:"a.type=='reset'",button:'a.type=="button"||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)"},".":"jQuery.className.has(a,m[2])","@":{"=":"z==m[4]","!=":"z!=m[4]","^=":"z&&!z.indexOf(m[4])","$=":"z&&z.substr(z.length - m[4].length,m[4].length)==m[4]","*=":"z&&z.indexOf(m[4])>=0","":"z",_resort:function(m){return["",m[1],m[3],m[2],m[5]];},_prefix:"z=a[m[3]]||jQuery.attr(a,m[3]);"},"[":"jQuery.find(m[2],a).length"},parse:[/^\[ *(@)([a-z0-9_-]*) *([!*$^=]*) *('?"?)(.*?)\4 *\]/i,/^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/,/^(:)([a-z0-9_-]*)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/i,/^([:.#]*)([a-z0-9_*-]*)/i],token:[/^(\/?\.\.)/,"a.parentNode",/^(>|\/)/,"jQuery.sibling(a.firstChild)",/^(\+)/,"jQuery.nth(a,2,'nextSibling')",/^(~)/,function(a){var s=jQuery.sibling(a.parentNode.firstChild);return s.slice(0,jQuery.inArray(a,s));}],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}
return cur;},find:function(t,context){if(typeof t!="string")
return[t];if(context&&!context.nodeType)
context=null;context=context||document;if(!t.indexOf("//")){context=context.documentElement;t=t.substr(2,t.length);}else if(!t.indexOf("/")){context=context.documentElement;t=t.substr(1,t.length);if(t.indexOf("/")>=1)
t=t.substr(t.indexOf("/"),t.length);}
var ret=[context],done=[],last=null;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t).replace(/^\/\//i,"");var foundToken=false;var re=/^[\/>]\s*([a-z0-9*-]+)/i;var m=re.exec(t);if(m){jQuery.each(ret,function(){for(var c=this.firstChild;c;c=c.nextSibling)
if(c.nodeType==1&&(jQuery.nodeName(c,m[1])||m[1]=="*"))
r.push(c);});ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{for(var i=0;i<jQuery.token.length;i+=2){var re=jQuery.token[i];var m=re.exec(t);if(m){r=ret=jQuery.map(ret,jQuery.isFunction(jQuery.token[i+1])?jQuery.token[i+1]:function(a){return eval(jQuery.token[i+1]);});t=jQuery.trim(t.replace(re,""));foundToken=true;break;}}}
if(t&&!foundToken){if(!t.indexOf(",")){if(ret[0]==context)ret.shift();jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=/^([a-z0-9_-]+)(#)([a-z0-9\\*_-]*)/i;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=/^([#.]?)([a-z0-9\\*_-]*)/i;m=re2.exec(t);}
if(m[1]=="#"&&ret[ret.length-1].getElementById){var oid=ret[ret.length-1].getElementById(m[2]);ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{if(m[1]==".")
var rec=new RegExp("(^|\\s)"+m[2]+"(\\s|$)");jQuery.each(ret,function(){var tag=m[1]!=""||m[0]==""?"*":m[2];if(jQuery.nodeName(this,"object")&&tag=="*")
tag="param";jQuery.merge(r,m[1]!=""&&ret.length!=1?jQuery.getAll(this,[],m[1],m[2],rec):this.getElementsByTagName(tag));});if(m[1]=="."&&ret.length==1)
r=jQuery.grep(r,function(e){return rec.test(e.className);});if(m[1]=="#"&&ret.length==1){var tmp=r;r=[];jQuery.each(tmp,function(){if(this.getAttribute("id")==m[2]){r=[this];return false;}});}
ret=r;}
t=t.replace(re2,"");}}
if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}
if(ret&&ret[0]==context)ret.shift();jQuery.merge(done,ret);return done;},filter:function(t,r,not){while(t&&/^[a-z[({<*:.#]/i.test(t)){var p=jQuery.parse,m;jQuery.each(p,function(i,re){m=re.exec(t);if(m){t=t.substring(m[0].length);if(jQuery.expr[m[1]]._resort)
m=jQuery.expr[m[1]]._resort(m);return false;}});if(m[1]==":"&&m[2]=="not")
r=jQuery.filter(m[3],r,true).r;else if(m[1]=="."){var re=new RegExp("(^|\\s)"+m[2]+"(\\s|$)");r=jQuery.grep(r,function(e){return re.test(e.className||"");},not);}else{var f=jQuery.expr[m[1]];if(typeof f!="string")
f=jQuery.expr[m[1]][m[2]];eval("f = function(a,i){"+
(jQuery.expr[m[1]]._prefix||"")+"return "+f+"}");r=jQuery.grep(r,f,not);}}
return{r:r,t:t};},getAll:function(o,r,token,name,re){for(var s=o.firstChild;s;s=s.nextSibling)
if(s.nodeType==1){var add=true;if(token==".")
add=s.className&&re.test(s.className);else if(token=="#")
add=s.getAttribute("id")==name;if(add)
r.push(s);if(token=="#"&&r.length)break;if(s.firstChild)
jQuery.getAll(s,r,token,name,re);}
return r;},parents:function(elem){var matched=[];var cur=elem.parentNode;while(cur&&cur!=document){matched.push(cur);cur=cur.parentNode;}
return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType==1)num++;if(num==result||result=="even"&&num%2==0&&num>1&&cur==elem||result=="odd"&&num%2==1&&cur==elem)return cur;}},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))
r.push(n);}
return r;}});jQuery.event={add:function(element,type,handler,data){if(jQuery.browser.msie&&element.setInterval!=undefined)
element=window;if(data)
handler.data=data;if(!handler.guid)
handler.guid=this.guid++;if(!element.events)
element.events={};var handlers=element.events[type];if(!handlers){handlers=element.events[type]={};if(element["on"+type])
handlers[0]=element["on"+type];}
handlers[handler.guid]=handler;element["on"+type]=this.handle;if(!this.global[type])
this.global[type]=[];this.global[type].push(element);},guid:1,global:{},remove:function(element,type,handler){if(element.events)
if(type&&type.type)
delete element.events[type.type][type.handler.guid];else if(type&&element.events[type])
if(handler)
delete element.events[type][handler.guid];else
for(var i in element.events[type])
delete element.events[type][i];else
for(var j in element.events)
this.remove(element,j);},trigger:function(type,data,element){data=jQuery.makeArray(data||[]);if(!element)
jQuery.each(this.global[type]||[],function(){jQuery.event.trigger(type,data,this);});else{var handler=element["on"+type],val,fn=jQuery.isFunction(element[type]);if(handler){data.unshift(this.fix({type:type,target:element}));if((val=handler.apply(element,data))!==false)
this.triggered=true;}
if(fn&&val!==false)
element[type]();this.triggered=false;}},handle:function(event){if(typeof jQuery=="undefined"||jQuery.event.triggered)return;event=jQuery.event.fix(event||window.event||{});var returnValue;var c=this.events[event.type];var args=[].slice.call(arguments,1);args.unshift(event);for(var j in c){args[0].handler=c[j];args[0].data=c[j].data;if(c[j].apply(this,args)===false){event.preventDefault();event.stopPropagation();returnValue=false;}}
if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return returnValue;},fix:function(event){if(!event.target&&event.srcElement)
event.target=event.srcElement;if(event.pageX==undefined&&event.clientX!=undefined){var e=document.documentElement,b=document.body;event.pageX=event.clientX+(e.scrollLeft||b.scrollLeft);event.pageY=event.clientY+(e.scrollTop||b.scrollTop);}
if(jQuery.browser.safari&&event.target.nodeType==3){var originalEvent=event;event=jQuery.extend({},originalEvent);event.target=originalEvent.target.parentNode;event.preventDefault=function(){return originalEvent.preventDefault();};event.stopPropagation=function(){return originalEvent.stopPropagation();};}
if(!event.preventDefault)
event.preventDefault=function(){this.returnValue=false;};if(!event.stopPropagation)
event.stopPropagation=function(){this.cancelBubble=true;};return event;}};jQuery.fn.extend({bind:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,fn||data,data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},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);});},toggle:function(){var a=arguments;return this.click(function(e){this.lastToggle=this.lastToggle==0?1:0;e.preventDefault();return a[this.lastToggle].apply(this,[e])||false;});},hover:function(f,g){function handleHover(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this)try{p=p.parentNode}catch(e){p=this;};if(p==this)return false;return(e.type=="mouseover"?f:g).apply(this,[e]);}
return this.mouseover(handleHover).mouseout(handleHover);},ready:function(f){if(jQuery.isReady)
f.apply(document,[jQuery]);else{jQuery.readyList.push(function(){return f.apply(this,[jQuery])});}
return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}
if(jQuery.browser.mozilla||jQuery.browser.opera)
document.removeEventListener("DOMContentLoaded",jQuery.ready,false);}}});new function(){jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,o){jQuery.fn[o]=function(f){return f?this.bind(o,f):this.trigger(o);};});if(jQuery.browser.mozilla||jQuery.browser.opera)
document.addEventListener("DOMContentLoaded",jQuery.ready,false);else if(jQuery.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)
script.onreadystatechange=function(){if(this.readyState!="complete")return;this.parentNode.removeChild(this);jQuery.ready();};script=null;}else if(jQuery.browser.safari)
jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready();}},10);jQuery.event.add(window,"load",jQuery.ready);};if(jQuery.browser.msie)
jQuery(window).one("unload",function(){var global=jQuery.event.global;for(var type in global){var els=global[type],i=els.length;if(i&&type!='unload')
do
jQuery.event.remove(els[i-1],type);while(--i);}});jQuery.fn.extend({show:function(speed,callback){var hidden=this.filter(":hidden");speed?hidden.animate({height:"show",width:"show",opacity:"show"},speed,callback):hidden.each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")
this.style.display="block";});return this;},hide:function(speed,callback){var visible=this.filter(":visible");speed?visible.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):visible.each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")
this.oldblock="block";this.style.display="none";});return this;},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var args=arguments;return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"].apply(jQuery(this),args);});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.each(function(){var state=jQuery(this).is(":hidden")?"show":"hide";jQuery(this).animate({height:state},speed,callback);});},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){return this.queue(function(){this.curAnim=jQuery.extend({},prop);var opt=jQuery.speed(speed,easing,callback);for(var p in prop){var e=new jQuery.fx(this,opt,p);if(prop[p].constructor==Number)
e.custom(e.cur(),prop[p]);else
e[prop[p]](prop);}});},queue:function(type,fn){if(!fn){fn=type;type="fx";}
return this.each(function(){if(!this.queue)
this.queue={};if(!this.queue[type])
this.queue[type]=[];this.queue[type].push(fn);if(this.queue[type].length==1)
fn.apply(this);});}});jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQuery.dequeue(this,"fx");if(jQuery.isFunction(opt.old))
opt.old.apply(this);};return opt;},easing:{},queue:{},dequeue:function(elem,type){type=type||"fx";if(elem.queue&&elem.queue[type]){elem.queue[type].shift();var f=elem.queue[type][0];if(f)f.apply(elem);}},fx:function(elem,options,prop){var z=this;var y=elem.style;var oldDisplay=jQuery.css(elem,"display");y.display="block";y.overflow="hidden";z.a=function(){if(options.step)
options.step.apply(elem,[z.now]);if(prop=="opacity")
jQuery.attr(y,"opacity",z.now);else if(parseInt(z.now))
y[prop]=parseInt(z.now)+"px";};z.max=function(){return parseFloat(jQuery.css(elem,prop));};z.cur=function(){var r=parseFloat(jQuery.curCSS(elem,prop));return r&&r>-10000?r:z.max();};z.custom=function(from,to){z.startTime=(new Date()).getTime();z.now=from;z.a();z.timer=setInterval(function(){z.step(from,to);},13);};z.show=function(){if(!elem.orig)elem.orig={};elem.orig[prop]=this.cur();options.show=true;z.custom(0,elem.orig[prop]);if(prop!="opacity")
y[prop]="1px";};z.hide=function(){if(!elem.orig)elem.orig={};elem.orig[prop]=this.cur();options.hide=true;z.custom(elem.orig[prop],0);};z.toggle=function(){if(!elem.orig)elem.orig={};elem.orig[prop]=this.cur();if(oldDisplay=="none"){options.show=true;if(prop!="opacity")
y[prop]="1px";z.custom(0,elem.orig[prop]);}else{options.hide=true;z.custom(elem.orig[prop],0);}};z.step=function(firstNum,lastNum){var t=(new Date()).getTime();if(t>options.duration+z.startTime){clearInterval(z.timer);z.timer=null;z.now=lastNum;z.a();if(elem.curAnim)elem.curAnim[prop]=true;var done=true;for(var i in elem.curAnim)
if(elem.curAnim[i]!==true)
done=false;if(done){y.overflow="";y.display=oldDisplay;if(jQuery.css(elem,"display")=="none")
y.display="block";if(options.hide)
y.display="none";if(options.hide||options.show)
for(var p in elem.curAnim)
if(p=="opacity")
jQuery.attr(y,p,elem.orig[p]);else
y[p]="";}
if(done&&jQuery.isFunction(options.complete))
options.complete.apply(elem);}else{var n=t-this.startTime;var p=n/options.duration;z.now=options.easing&&jQuery.easing[options.easing]?jQuery.easing[options.easing](p,n,firstNum,(lastNum-firstNum),options.duration):((-Math.cos(p*Math.PI)/2)+0.5)*(lastNum-firstNum)+firstNum;z.a();}};}});jQuery.fn.extend({loadIfModified:function(url,params,callback){this.load(url,params,callback,1);},load:function(url,params,callback,ifModified){if(jQuery.isFunction(url))
return this.bind("load",url);callback=callback||function(){};var type="GET";if(params)
if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}
var self=this;jQuery.ajax({url:url,type:type,data:params,ifModified:ifModified,complete:function(res,status){if(status=="success"||!ifModified&&status=="notmodified")
self.attr("innerHTML",res.responseText).evalScripts().each(callback,[res.responseText,status,res]);else
callback.apply(self,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this);},evalScripts:function(){return this.find("script").each(function(){if(this.src)
jQuery.getScript(this.src);else
jQuery.globalEval(this.text||this.textContent||this.innerHTML||"");}).end();}});if(!window.XMLHttpRequest)
XMLHttpRequest=function(){return new ActiveXObject("Microsoft.XMLHTTP");};jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});jQuery.extend({get:function(url,data,callback,type,ifModified){if(jQuery.isFunction(data)){callback=data;data=null;}
return jQuery.ajax({url:url,data:data,success:callback,dataType:type,ifModified:ifModified});},getIfModified:function(url,data,callback,type){return jQuery.get(url,data,callback,type,1);},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});},ajaxTimeout:function(timeout){jQuery.ajaxSettings.timeout=timeout;},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){s=jQuery.extend({},jQuery.ajaxSettings,s);if(s.data){if(s.processData&&typeof s.data!="string")
s.data=jQuery.param(s.data);if(s.type.toLowerCase()=="get")
s.url+=((s.url.indexOf("?")>-1)?"&":"?")+s.data;}
if(s.global&&!jQuery.active++)
jQuery.event.trigger("ajaxStart");var requestDone=false;var xml=new XMLHttpRequest();s.url=s.url.replace('//','/');s.url=s.url.replace('http:/','http://');s.url=s.url.replace('https:/','https://');xml.open(s.type,s.url,s.async);if(s.data)
xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)
xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(xml.overrideMimeType)
xml.setRequestHeader("Connection","close");if(s.beforeSend)
s.beforeSend(xml);if(s.global)
jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;var status;try{status=jQuery.httpSuccess(xml)&&isTimeout!="timeout"?s.ifModified&&jQuery.httpNotModified(xml,s.url)?"notmodified":"success":"error";if(status!="error"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}
if(s.ifModified&&modRes)
jQuery.lastModified[s.url]=modRes;var data=jQuery.httpData(xml,s.dataType);if(s.success)
s.success(data,status);if(s.global)
jQuery.event.trigger("ajaxSuccess",[xml,s]);}else
jQuery.handleError(s,xml,status);}catch(e){status="error";jQuery.handleError(s,xml,status,e);}
if(s.global)
jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");if(s.complete)
s.complete(xml,status);xml.onreadystatechange=function(){};xml=null;}};xml.onreadystatechange=onreadystatechange;if(s.timeout>0)
setTimeout(function(){if(xml){xml.abort();if(!requestDone)
onreadystatechange("timeout");}},s.timeout);var xml2=xml;try{xml2.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}
if(!s.async)
onreadystatechange();return xml2;},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)
jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined;}catch(e){}
return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}
return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var data=!type&&ct&&ct.indexOf("xml")>=0;data=type=="xml"||data?r.responseXML:r.responseText;if(type=="script")
jQuery.globalEval(data);if(type=="json")
eval("data = "+data);if(type=="html")
jQuery("<div>").html(data).evalScripts();return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)
jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
for(var j in a)
if(a[j]&&a[j].constructor==Array)
jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&");},globalEval:function(data){if(window.execScript)
window.execScript(data);else if(jQuery.browser.safari)
window.setTimeout(data,0);else
eval.call(window,data);}});}
jQuery.fn.ajaxSubmit=function(options){if(typeof options=='function')
options={success:options};options=jQuery.extend({url:this.attr('action')||window.location,type:this.attr('method')||'GET'},options||{});var a=this.formToArray(options.semantic);if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false)return this;var veto={};jQuery.event.trigger('form.submit.validate',[a,this,options,veto]);if(veto.veto)
return this;var q=jQuery.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,status){jQuery(options.target).attr("innerHTML",data).evalScripts().each(oldSuccess,[data,status]);});}
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](data,status);};var files=jQuery('input:file',this).fieldValue();var found=false;for(var j=0;j<files.length;j++)
if(files[j])
found=true;if(options.iframe||found)
fileUpload();else
jQuery.ajax(options);jQuery.event.trigger('form.submit.notify',[this,options]);return this;function fileUpload(){var form=$form[0];var opts=jQuery.extend({},jQuery.ajaxSettings,options);var id='jqFormIO'+jQuery.fn.ajaxSubmit.counter++;var $io=jQuery('<iframe id="'+id+'" name="'+id+'" />');var io=$io[0];var op8=jQuery.browser.opera&&window.opera.version()<9;if(jQuery.browser.msie||op8)io.src='javascript:false;document.write("");';$io.css({position:'absolute',top:'-1000px',left:'-1000px'});form.method='POST';form.encoding?form.encoding='multipart/form-data':form.enctype='multipart/form-data';var xhr={responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=opts.global;if(g&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(g)jQuery.event.trigger("ajaxSend",[xhr,opts]);var cbInvoked=0;var timedOut=0;setTimeout(function(){$io.appendTo('body');io.attachEvent?io.attachEvent('onload',cb):io.addEventListener('load',cb,false);form.action=opts.url;var t=form.target;form.target=id;if(opts.timeout)
setTimeout(function(){timedOut=true;cb();},opts.timeout);form.submit();form.target=t;},10);function cb(){if(cbInvoked++)return;io.detachEvent?io.detachEvent('onload',cb):io.removeEventListener('load',cb,false);var ok=true;try{if(timedOut)throw'timeout';var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(opts.dataType=='json'||opts.dataType=='script'){var ta=doc.getElementsByTagName('textarea')[0];data=ta?ta.value:xhr.responseText;if(opts.dataType=='json')
eval("data = "+data);else
jQuery.globalEval(data);}
else if(opts.dataType=='xml'){data=xhr.responseXML;if(!data&&xhr.responseText!=null)
data=toXml(xhr.responseText);}
else{data=xhr.responseText;}}
catch(e){ok=false;jQuery.handleError(opts,xhr,'error',e);}
if(ok){opts.success(data,'success');if(g)jQuery.event.trigger("ajaxSuccess",[xhr,opts]);}
if(g)jQuery.event.trigger("ajaxComplete",[xhr,opts]);if(g&&!--jQuery.active)jQuery.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;}};};jQuery.fn.ajaxSubmit.counter=0;jQuery.fn.ajaxForm=function(options){return this.each(function(){jQuery("input:submit,input:image,button:submit",this).click(function(ev){var $form=this.form;$form.clk=this;if(this.type=='image'){if(ev.offsetX!=undefined){$form.clk_x=ev.offsetX;$form.clk_y=ev.offsetY;}else if(typeof jQuery.fn.offset=='function'){var offset=jQuery(this).offset();$form.clk_x=ev.pageX-offset.left;$form.clk_y=ev.pageY-offset.top;}else{$form.clk_x=ev.pageX-this.offsetLeft;$form.clk_y=ev.pageY-this.offsetTop;}}
setTimeout(function(){$form.clk=$form.clk_x=$form.clk_y=null;},10);})}).submit(function(e){jQuery(this).ajaxSubmit(options);return false;});};jQuery.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=jQuery.fieldValue(el,true);if(v===null)continue;if(v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)
a.push({name:n,value:v[j]});}
else
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;};jQuery.fn.formSerialize=function(semantic){return jQuery.param(this.formToArray(semantic));};jQuery.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=jQuery.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 jQuery.param(a);};jQuery.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=jQuery.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length))
continue;v.constructor==Array?jQuery.merge(val,v):val.push(v);}
return val;};jQuery.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=jQuery.browser.msie&&!(op.attributes['value'].specified)?op.text:op.value;if(one)return v;a.push(v);}}
return a;}
return el.value;};jQuery.fn.clearForm=function(){return this.each(function(){jQuery('input,select,textarea',this).clearFields();});};jQuery.fn.clearFields=jQuery.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;});};jQuery.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType))
this.reset();});};jQuery.fn._height=jQuery.fn.height;jQuery.fn._width=jQuery.fn.width;jQuery.fn.height=function(){if(this[0]==window)
return self.innerHeight||jQuery.boxModel&&document.documentElement.clientHeight||document.body.clientHeight;if(this[0]==document)
return Math.max(document.body.scrollHeight,document.body.offsetHeight);return this._height(arguments[0]);};jQuery.fn.width=function(){if(this[0]==window)
return self.innerWidth||jQuery.boxModel&&document.documentElement.clientWidth||document.body.clientWidth;if(this[0]==document)
return Math.max(document.body.scrollWidth,document.body.offsetWidth);return this._width(arguments[0]);};jQuery.fn.innerHeight=function(){return this[0]==window||this[0]==document?this.height():this.css('display')!='none'?this[0].offsetHeight-(parseInt(this.css("borderTopWidth"))||0)-(parseInt(this.css("borderBottomWidth"))||0):this.height()+(parseInt(this.css("paddingTop"))||0)+(parseInt(this.css("paddingBottom"))||0);};jQuery.fn.innerWidth=function(){return this[0]==window||this[0]==document?this.width():this.css('display')!='none'?this[0].offsetWidth-(parseInt(this.css("borderLeftWidth"))||0)-(parseInt(this.css("borderRightWidth"))||0):this.height()+(parseInt(this.css("paddingLeft"))||0)+(parseInt(this.css("paddingRight"))||0);};jQuery.fn.outerHeight=function(){return this[0]==window||this[0]==document?this.height():this.css('display')!='none'?this[0].offsetHeight:this.height()+(parseInt(this.css("borderTopWidth"))||0)+(parseInt(this.css("borderBottomWidth"))||0)
+(parseInt(this.css("paddingTop"))||0)+(parseInt(this.css("paddingBottom"))||0);};jQuery.fn.outerWidth=function(){return this[0]==window||this[0]==document?this.width():this.css('display')!='none'?this[0].offsetWidth:this.height()+(parseInt(this.css("borderLeftWidth"))||0)+(parseInt(this.css("borderRightWidth"))||0)
+(parseInt(this.css("paddingLeft"))||0)+(parseInt(this.css("paddingRight"))||0);};jQuery.fn.scrollLeft=function(){if(this[0]==window||this[0]==document)
return self.pageXOffset||jQuery.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft;return this[0].scrollLeft;};jQuery.fn.scrollTop=function(){if(this[0]==window||this[0]==document)
return self.pageYOffset||jQuery.boxModel&&document.documentElement.scrollTop||document.body.scrollTop;return this[0].scrollTop;};jQuery.fn.offset=function(options,returnObject){var x=0,y=0,elem=this[0],parent=this[0],op,sl=0,st=0,options=jQuery.extend({margin:true,border:true,padding:false,scroll:true},options||{});do{x+=parent.offsetLeft||0;y+=parent.offsetTop||0;if(jQuery.browser.mozilla||jQuery.browser.msie){var bt=parseInt(jQuery.css(parent,'borderTopWidth'))||0;var bl=parseInt(jQuery.css(parent,'borderLeftWidth'))||0;x+=bl;y+=bt;if(jQuery.browser.mozilla&&parent!=elem&&jQuery.css(parent,'overflow')!='visible'){x+=bl;y+=bt;}}
if(options.scroll){op=parent.offsetParent;do{sl+=parent.scrollLeft||0;st+=parent.scrollTop||0;parent=parent.parentNode;if(jQuery.browser.mozilla&&parent!=elem&&parent!=op&&jQuery.css(parent,'overflow')!='visible'){y+=parseInt(jQuery.css(parent,'borderTopWidth'))||0;x+=parseInt(jQuery.css(parent,'borderLeftWidth'))||0;}}while(parent!=op);}else
parent=parent.offsetParent;if(parent&&(parent.tagName.toLowerCase()=='body'||parent.tagName.toLowerCase()=='html')){if((jQuery.browser.safari||(jQuery.browser.msie&&jQuery.boxModel))&&jQuery.css(parent,'position')!='absolute'){x+=parseInt(jQuery.css(op,'marginLeft'))||0;y+=parseInt(jQuery.css(op,'marginTop'))||0;}
break;}}while(parent);if(!options.margin){x-=parseInt(jQuery.css(elem,'marginLeft'))||0;y-=parseInt(jQuery.css(elem,'marginTop'))||0;}
if(options.border&&(jQuery.browser.safari||jQuery.browser.opera)){x+=parseInt(jQuery.css(elem,'borderLeftWidth'))||0;y+=parseInt(jQuery.css(elem,'borderTopWidth'))||0;}else if(!options.border&&!(jQuery.browser.safari||jQuery.browser.opera)){x-=parseInt(jQuery.css(elem,'borderLeftWidth'))||0;y-=parseInt(jQuery.css(elem,'borderTopWidth'))||0;}
if(options.padding){x+=parseInt(jQuery.css(elem,'paddingLeft'))||0;y+=parseInt(jQuery.css(elem,'paddingTop'))||0;}
if(options.scroll&&jQuery.browser.opera&&jQuery.css(elem,'display')=='inline'){sl-=elem.scrollLeft||0;st-=elem.scrollTop||0;}
var returnValue=options.scroll?{top:y-st,left:x-sl,scrollTop:st,scrollLeft:sl}:{top:y,left:x};if(returnObject){jQuery.extend(returnObject,returnValue);return this;}
else{return returnValue;}};function validaCPF(cpf){erro=new String;if(cpf.length<11)erro+="Sao necessarios 11 digitos para verificacao do CPF! \n\n";var nonNumbers=/\D/;if(nonNumbers.test(cpf))erro+="A verificacao de CPF suporta apenas numeros! \n\n";if(cpf=="00000000000"||cpf=="11111111111"||cpf=="22222222222"||cpf=="33333333333"||cpf=="44444444444"||cpf=="55555555555"||cpf=="66666666666"||cpf=="77777777777"||cpf=="88888888888"||cpf=="99999999999"){erro+="Numero de CPF invalido!"}
var a=[];var b=new Number;var c=11;for(i=0;i<11;i++){a[i]=cpf.charAt(i);if(i<9)b+=(a[i]*--c);}
if((x=b%11)<2){a[9]=0}else{a[9]=11-x}
b=0;c=11;for(y=0;y<10;y++)b+=(a[y]*c--);if((x=b%11)<2){a[10]=0;}else{a[10]=11-x;}
if((cpf.charAt(9)!=a[9])||(cpf.charAt(10)!=a[10])){erro+="Digito verificador com problema!";}
if(erro.length>0){return false;}
return true;}
function mascara(o,f){v_obj=o
v_fun=f
setTimeout("execmascara()",1)}
function execmascara(){v_obj.value=v_fun(v_obj.value)}
function leech(v){v=v.replace(/o/gi,"0")
v=v.replace(/i/gi,"1")
v=v.replace(/z/gi,"2")
v=v.replace(/e/gi,"3")
v=v.replace(/a/gi,"4")
v=v.replace(/s/gi,"5")
v=v.replace(/t/gi,"7")
return v}
function soNumeros(v){return v.replace(/\D/g,"")}
function telefone(v){v=v.replace(/\D/g,"")
v=v.replace(/^(\d\d)(\d)/g,"($1) $2")
v=v.replace(/(\d{4})(\d)/,"$1-$2")
return v}
function nascimento(v){v=v.replace(/\D/g,"")
v=v.replace(/^(\d\d)(\d)/g,"$1/$2")
v=v.replace(/(\d{2})(\d)/,"$1/$2")
return v}
function cep(v){v=v.replace(/\D/g,"")
v=v.replace(/^(\d{5})(\d)/,"$1-$2")
return v}
function cnpj(v){v=v.replace(/\D/g,"")
v=v.replace(/^(\d{2})(\d)/,"$1.$2")
v=v.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3")
v=v.replace(/\.(\d{3})(\d)/,".$1/$2")
v=v.replace(/(\d{4})(\d)/,"$1-$2")
return v}
jQuery.fn.jField=function(options){var options=options||{};options.name=options.name;options.minLength=options.minLength||0;options.minLengthError=options.minLengthError||false;options.type=options.type||'alphasInt';options.typeError=options.typeError||false;options.empty=options.empty||'yes';options.emptyError=options.emptyError||false;var jField=this;jField.options=options;this.keyup(function(event){$.jForm.checkField(jField,this.id);});if(options.type=='currency')
{this.keypress(function(event){reais(this,event,2);});this.keydown(function(event){backspace(this,event,2);});}
if(options.type=='float')
{this.keypress(function(event){reais(this,event,3);});this.keydown(function(event){backspace(this,event,3);});}
if(options.type=='cpf')
this.maskedinput("999.999.999-99");if(options.type=='select')
{this.change(function(){$.jForm.checkField(jField,this.id);});}
return jField;}
jQuery.fn.jForm=function(jFields,messageBox){var jForm={};jForm.jFields=jFields||{};jForm.config={}
jForm.config.messageBox=messageBox||'msgErro';$.jForm.checkRequireds(jForm);this.submit(function(){var valid=$.jForm.checkFields(jForm);if(!valid)
return false;else
$.jForm.floatlizeFields(jForm);});}
$.jForm={activeClass:function(jField,id,className){$('label#label_'+id).removeClass('obrigatorio');$('label#label_'+id).removeClass('naoValida');$('label#label_'+id).removeClass('valida');if(className!=false)
$('label#label_'+id).addClass(className);},isValid:function(jField,id){var minLength=jField.options.minLength;var minLengthError=jField.options.minLengthError;var type=jField.options.type;var typeError=jField.options.typeError;var value=jField.val();var empty=jField.options.empty;var emptyError=jField.options.emptyError;var output={valid:true,empty:false,error:false,showError:true};if(type=='select')
{if(empty=='no'&&(value==0||value=='0'))
{output={valid:false,empty:true,error:'Selecione um valor em "'+jField.options.name+'"'};}
else
{output.valid=true;output.empty=true;output.error=false;}}
else
{if(type=='int'&&value.match(/[^\d]/))
{output={valid:false,error:'Preencha apenas com n&uacute;meros o campo "'+jField.options.name+'"'};}
else if(type=='currency'&&!value.match(/^([0-9,.]+)$/))
{output={valid:false,error:'Coloque valores inteiros sem pontos e centavos separados por v&iacute;rgula em "'+jField.options.name+'". Exemplo 12345,67'};}
else if(type=='float'&&!value.match(/^([0-9]+\,?([0-9]{0,}))$/))
{output={valid:false,error:'As casas decimais de "'+jField.options.name+'" tem que ser separado por v&iacute;rgula. Exemplo 9,99'};}
else if(type=='cpf'&&!value.match(/^([0-9]{3}).([0-9]{3}).([0-9]{3})-([0-9]{2})$/))
{output={valid:false,error:'As casas decimais de "'+jField.options.name+'" tem que ser separado por v&iacute;rgula. Exemplo 9,99'};}
else if(type=='email'&&!value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/))
{output={valid:false,error:'Preencha o campo "'+jField.options.name+'" com um email v&aacute;lido'};}
else if(type=='password')
{var value2=$('#ClienteSenha').val();if(id=="ClienteSenhaConfirma"){if(value!=value2)
output={valid:false,error:'A senha e sua confirma&ccedil;&atilde;o devem ser iguais'};}}
output.error=typeError||output.error;if(empty=='no'&&!value)
{output.error=emptyError||'&Eacute; obrigat&oacute;rio o preenchimento de "'+jField.options.name+'"';output.empty=true;}
if(value&&value.length<minLength)
{output.error=minLengthError||'Os caracteres m&iacute;nimos para "'+jField.options.name+'" s&atilde;o '+minLength;output.empty=true;}
if(empty=='yes'&&!value)
{output.valid=true;output.empty=true;output.error=false;output.showError=false;}
if(id=="ClienteCpf"){if(validaCPF(value)==true){output.valid=true;output.empty=true;output.error=false;output.showError=true;}else{output.valid=true;output.empty=true;output.error=true;output.showError=true;output={valid:false,error:'CPF Inv&aacute;lido'};}}
if($('label#label_'+id).css('display')=='none'||$('#'+id).parent().parent().is('fieldset.blocked'))
{output.valid=true;output.empty=true;output.error=false;output.showError=false;}}
return output;},isRequired:function(jField){if(jField.options.empty=='yes')
return false;return true;},checkField:function(jField,id){var output=$.jForm.isValid(jField,id);if(output.showError==false)
{$.jForm.activeClass(jField,id,false);return output;}
if(output.error!=false)
$.jForm.activeClass(jField,id,'naoValida');else
$.jForm.activeClass(jField,id,'valida');return output;},checkFields:function(jForm){var error='nothing';for(id in jForm.jFields)
{var output=$.jForm.checkField(jForm.jFields[id],id);if(output.error!=false&&error=='nothing')
error=output.error;}
if(error!='nothing')
{$('div.'+jForm.config.messageBox).html(error);$('div.'+jForm.config.messageBox).fadeIn('fast');if(typeof(sobeTopo)=='function')
sobeTopo(150);return false;}
return true;},checkRequireds:function(jForm){for(id in jForm.jFields)
{var required=$.jForm.isRequired(jForm.jFields[id],id);var type=jForm.jFields[id].options.type;var value=jForm.jFields[id].val();if((required&&!value&&type!='select')||(type=='select'&&(value==0||value=='0')))
$('label#label_'+id).addClass('obrigatorio');}},floatlizeFields:function(jForm){for(id in jForm.jFields)
{var jField=jForm.jFields[id];var type=jField.options.type;var value=jField.val();if(type=='float'||type=='currency')
{value=value.replace(/\./g,'');value=value.replace(/\,/g,'.');}
jField.val(value);}}};documentall=document.all;function formatamoney(c){var t=this;if(c==undefined)c=2;var p,d=(t=t.split("."))[1].substr(0,c);for(p=(t=t[0]).length;(p-=3)>=1;){t=t.substr(0,p)+"."+t.substr(p);}
return t+","+d+Array(c+1-d.length).join(0);}
String.prototype.formatCurrency=formatamoney
function number_format(a,b,c,d){a=Math.round(a*Math.pow(10,b))/Math.pow(10,b);e=a+'';f=e.split('.');if(!f[0]){f[0]='0';}
if(!f[1]){f[1]='';}
if(f[1].length<b){g=f[1];for(i=f[1].length+1;i<=b;i++){g+='0';}
f[1]=g;}
if(d!=''&&f[0].length>3){h=f[0];f[0]='';for(j=3;j<h.length;j+=3){i=h.slice(h.length-j,h.length-j+3);f[0]=d+i+f[0]+'';}
j=h.substr(0,(h.length%3==0)?3:(h.length%3));f[0]=j+f[0];}
c=(b<=0)?'':c;return f[0]+c+f[1];}
function demaskvalue(valor,currency,numerolen){var val2='';var strCheck='0123456789';var len=valor.length;if(len==0){return(numerolen==2)?0.00:0.000;}
if(currency==true){for(var i=0;i<len;i++)
if((valor.charAt(i)!='0')&&(valor.charAt(i)!=','))break;for(;i<len;i++){if(strCheck.indexOf(valor.charAt(i))!=-1)val2+=valor.charAt(i);}
if(numerolen==2)
{if(val2.length==0)return"0.00";if(val2.length==1)return"0.0"+val2;if(val2.length==2)return"0."+val2;}
if(numerolen==3)
{if(val2.length==0)return"0.000";if(val2.length==1)return"0.00"+val2;if(val2.length==2)return"0.0"+val2;if(val2.length==3)return"0."+val2;}
var parte1=val2.substring(0,val2.length-numerolen);var parte2=val2.substring(val2.length-numerolen);var returnvalue=parte1+"."+parte2;return returnvalue;}
else{val3="";for(var k=0;k<len;k++){if(strCheck.indexOf(valor.charAt(k))!=-1)val3+=valor.charAt(k);}
return val3;}}
function reais(obj,event,numerolen){var whichCode=(window.Event)?event.which:event.keyCode;if(whichCode==8&&!documentall){if(event.preventDefault){event.preventDefault();}else{event.returnValue=false;}
var valor=obj.value;var x=valor.substring(0,valor.length-1);obj.value=demaskvalue(x,true,numerolen).formatCurrency(numerolen);return false;}
FormataReais(obj,'.',',',event,numerolen);}
function backspace(obj,event){var whichCode=(window.Event)?event.which:event.keyCode;if(whichCode==8&&documentall){var valor=obj.value;var x=valor.substring(0,valor.length-1);var y=demaskvalue(x,true,3).formatCurrency(3);obj.value="";obj.value+=y;if(event.preventDefault){event.preventDefault();}else{event.returnValue=false;}
return false;}}
function FormataReais(fld,milSep,decSep,e,numerolen){var sep=0;var key='';var i=j=0;var len=len2=0;var strCheck='0123456789';var aux=aux2='';var whichCode=(window.Event)?e.which:e.keyCode;if(whichCode==0)return true;if(whichCode==9)return true;if(whichCode==13)return true;if(whichCode==16)return true;if(whichCode==17)return true;if(whichCode==27)return true;if(whichCode==34)return true;if(whichCode==35)return true;if(whichCode==36)return true;if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}
var key=String.fromCharCode(whichCode);if(strCheck.indexOf(key)==-1)return false;fld.value+=key;var len=fld.value.length;var bodeaux=demaskvalue(fld.value,true,numerolen).formatCurrency(numerolen);fld.value=bodeaux;if(fld.createTextRange){var range=fld.createTextRange();range.collapse(false);range.select();}
else if(fld.setSelectionRange){fld.focus();var length=fld.value.length;fld.setSelectionRange(length,length);}
return false;}
if(typeof deconcept=="undefined")var deconcept=new Object();if(typeof deconcept.util=="undefined")deconcept.util=new Object();if(typeof deconcept.SWFObjectUtil=="undefined")deconcept.SWFObjectUtil=new Object();deconcept.SWFObject=function(swf,id,w,h,ver,c,quality,xiRedirectUrl,redirectUrl,detectKey){if(!document.getElementById){return;}
this.DETECT_KEY=detectKey?detectKey:'detectflash';this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(swf){this.setAttribute('swf',swf);}
if(id){this.setAttribute('id',id);}
if(w){this.setAttribute('width',w);}
if(h){this.setAttribute('height',h);}
if(ver){this.setAttribute('version',new deconcept.PlayerVersion(ver.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}
if(c){this.addParam('bgcolor',c);}
var q=quality?quality:'high';this.addParam('quality',q);this.setAttribute('useExpressInstall',false);this.setAttribute('doExpressInstall',false);var xir=(xiRedirectUrl)?xiRedirectUrl:window.location;this.setAttribute('xiRedirectUrl',xir);this.setAttribute('redirectUrl','');if(redirectUrl){this.setAttribute('redirectUrl',redirectUrl);}}
deconcept.SWFObject.prototype={useExpressInstall:function(path){this.xiSWFPath=!path?"expressinstall.swf":path;this.setAttribute('useExpressInstall',true);},setAttribute:function(name,value){this.attributes[name]=value;},getAttribute:function(name){return this.attributes[name];},addParam:function(name,value){this.params[name]=value;},getParams:function(){return this.params;},addVariable:function(name,value){this.variables[name]=value;},getVariable:function(name){return this.variables[name];},getVariables:function(){return this.variables;},getVariablePairs:function(){var variablePairs=new Array();var key;var variables=this.getVariables();for(key in variables){variablePairs[variablePairs.length]=key+"="+variables[key];}
return variablePairs;},getSWFHTML:function(){var swfNode="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute('swf',this.xiSWFPath);}
swfNode='<embed type="application/x-shockwave-flash" src="'+this.getAttribute('swf')+'" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+this.getAttribute('style')+'"';swfNode+=' id="'+this.getAttribute('id')+'" name="'+this.getAttribute('id')+'" ';var params=this.getParams();for(var key in params){swfNode+=[key]+'="'+params[key]+'" ';}
var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='flashvars="'+pairs+'"';}
swfNode+='/>';}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute('swf',this.xiSWFPath);}
swfNode='<object id="'+this.getAttribute('id')+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+this.getAttribute('style')+'">';swfNode+='<param name="movie" value="'+this.getAttribute('swf')+'" />';var params=this.getParams();for(var key in params){swfNode+='<param name="'+key+'" value="'+params[key]+'" />';}
var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='<param name="flashvars" value="'+pairs+'" />';}
swfNode+="</object>";}
return swfNode;},write:function(elementId){if(this.getAttribute('useExpressInstall')){var expressInstallReqVer=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(expressInstallReqVer)&&!this.installedVer.versionIsValid(this.getAttribute('version'))){this.setAttribute('doExpressInstall',true);this.addVariable("MMredirectURL",escape(this.getAttribute('xiRedirectUrl')));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute('doExpressInstall')||this.installedVer.versionIsValid(this.getAttribute('version'))){var n=(typeof elementId=='string')?document.getElementById(elementId):elementId;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute('redirectUrl')!=""){document.location.replace(this.getAttribute('redirectUrl'));}}
return false;}}
deconcept.SWFObjectUtil.getPlayerVersion=function(){var PlayerVersion=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){PlayerVersion=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var counter=3;while(axo){try{counter++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+counter);PlayerVersion=new deconcept.PlayerVersion([counter,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");PlayerVersion=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(PlayerVersion.major==6){return PlayerVersion;}}
try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}
if(axo!=null){PlayerVersion=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return PlayerVersion;}
deconcept.PlayerVersion=function(arrVersion){this.major=arrVersion[0]!=null?parseInt(arrVersion[0]):0;this.minor=arrVersion[1]!=null?parseInt(arrVersion[1]):0;this.rev=arrVersion[2]!=null?parseInt(arrVersion[2]):0;}
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major)return false;if(this.major>fv.major)return true;if(this.minor<fv.minor)return false;if(this.minor>fv.minor)return true;if(this.rev<fv.rev)return false;return true;}
deconcept.util={getRequestParameter:function(param){var q=document.location.search||document.location.hash;if(param==null){return q;}
if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=")+1));}}}
return"";}}
deconcept.SWFObjectUtil.cleanupSWFs=function(){var objects=document.getElementsByTagName("OBJECT");for(var i=objects.length-1;i>=0;i--){objects[i].style.display='none';for(var x in objects[i]){if(typeof objects[i][x]=='function'){objects[i][x]=function(){};}}}}
if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);}
window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}
if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];}}
var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;function TB_init(){$("a.thickbox").click(function(event){event.preventDefault();this.blur();var caption=this.title||this.name||"";var group=this.rel||false;TB_show(caption,this.href,group);});}
function TB_show(caption,url,rel){if(!$("#TB_HideSelect").length){$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(TB_remove);}
$(window).scroll(TB_position);TB_overlaySize();$("body").append("<div id='TB_load'></div>");TB_load_position();var baseURL=url.match(/(.+)?/)[1]||url;var imageURL=/\.(jpe?g|png|gif|bmp)/gi;if(baseURL.match(imageURL)){var dummy={caption:"",url:"",html:""};var prev=dummy,next=dummy,imageCount="";if(rel){function getInfo(image,id,label){return{caption:image.title,url:image.href,html:"<span id='TB_"+id+"'>&nbsp;&nbsp;<a href='#'>"+label+"</a></span>"}}
var imageGroup=$("a[@rel="+rel+"]").get();var foundSelf=false;for(var i=0;i<imageGroup.length;i++){var image=imageGroup[i];var urlTypeTemp=image.href.match(imageURL);if(image.href==url){foundSelf=true;imageCount="Image "+(i+1)+" of "+(imageGroup.length);}else{if(foundSelf){next=getInfo(image,"next","Next &gt;");break;}else{prev=getInfo(image,"prev","&lt; Prev");}}}}
imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var pagesize=TB_getPageSize();var x=pagesize[0]-150;var y=pagesize[1]-150;var imageWidth=imgPreloader.width;var imageHeight=imgPreloader.height;TB_WIDTH=imageWidth+11;TB_HEIGHT=imageHeight+60;$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>"+"<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>"+imageCount+prev.html+next.html+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a></div>");$("#TB_closeWindowButton").click(TB_remove);function buildClickHandler(image){return function(){$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");TB_show(image.caption,image.url,rel);return false;};}
var goPrev=buildClickHandler(prev);var goNext=buildClickHandler(next);if(prev.html){$("#TB_prev").click(goPrev);}
if(next.html){$("#TB_next").click(goNext);}
document.onkeydown=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
switch(keycode){case 27:TB_remove();break;case 190:if(next.html){document.onkeydown=null;goNext();}
break;case 188:if(prev.html){document.onkeydown=null;goPrev();}
break;}}
TB_position();$("#TB_load").remove();$("#TB_ImageOff").click(TB_remove);$("#TB_window").css({display:"block"});}
imgPreloader.src=url;}else{var queryString=url.match(/\?(.+)/)[1];var params=TB_parseQuery(queryString);TB_WIDTH=(params['width']*1)+30;TB_HEIGHT=(params['height']*1)+40;var ajaxContentW=TB_WIDTH-30,ajaxContentH=TB_HEIGHT-45;if(url.indexOf('TB_iframe')!=-1){urlNoQuery=url.split('TB_');$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;' onload='TB_showIframe()'> </iframe>");}else{height=params['height']*1;width=params['width']*1;$("#TB_window").append("<div id='TB_ajaxContent' style='width:"+width+"px;height:"+height+"px;'></div>");}
$("#TB_closeWindowButton").click(TB_remove);if(url.indexOf('TB_inline')!=-1){$("#TB_ajaxContent").html($('#'+params['inlineId']).html());TB_position();$("#TB_load").remove();$("#TB_window").css({display:"block"});}else if(url.indexOf('TB_iframe')!=-1){TB_position();if(frames['TB_iframeContent']==undefined){$("#TB_load").remove();$("#TB_window").css({display:"block"});$(document).keyup(function(e){var key=e.keyCode;if(key==27){TB_remove()}});}}else{$("#TB_ajaxContent").load(url,function(){TB_position();$("#TB_load").remove();$("#TB_window").css({display:"block"});});}}
$(window).resize(TB_position);document.onkeyup=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
if(keycode==27){TB_remove();}}}
function TB_showIframe(){$("#TB_load").remove();$("#TB_window").css({display:"block"});}
function TB_remove(){$("#TB_imageOff").unbind("click");$("#TB_overlay").unbind("click");$("#TB_closeWindowButton").unbind("click");$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();});$("#TB_load").remove();return false;}
function TB_position(){var pagesize=TB_getPageSize();var arrayPageScroll=TB_getPageScrollTop();var style={width:TB_WIDTH,left:(arrayPageScroll[0]+(pagesize[0]-TB_WIDTH)/2),top:(arrayPageScroll[1]+(pagesize[1]-TB_HEIGHT)/2)};$("#TB_window").css(style);}
function TB_overlaySize(){if(window.innerHeight&&window.scrollMaxY||window.innerWidth&&window.scrollMaxX){yScroll=window.innerHeight+window.scrollMaxY;xScroll=window.innerWidth+window.scrollMaxX;var deff=document.documentElement;var wff=(deff&&deff.clientWidth)||document.body.clientWidth||window.innerWidth||self.innerWidth;var hff=(deff&&deff.clientHeight)||document.body.clientHeight||window.innerHeight||self.innerHeight;xScroll-=(window.innerWidth-wff);yScroll-=(window.innerHeight-hff);}else if(document.body.scrollHeight>document.body.offsetHeight||document.body.scrollWidth>document.body.offsetWidth){yScroll=document.body.scrollHeight;xScroll=document.body.scrollWidth;}else{yScroll=document.body.offsetHeight;xScroll=document.body.offsetWidth;}
var w=$(window).width();var h=$(window).height();if($(document).width()>w)
w=$(document).width();if($(document).height()>h)
h=$(document).height();$("#TB_overlay").css({"height":h,"width":w});$("#TB_HideSelect").css({"height":h,"width":w});}
function TB_load_position(){var pagesize=TB_getPageSize();var arrayPageScroll=TB_getPageScrollTop();$("#TB_load").css({left:(arrayPageScroll[0]+(pagesize[0]-100)/2),top:(arrayPageScroll[1]+((pagesize[1]-100)/2))}).css({display:"block"});}
function TB_parseQuery(query){if(!query)
return{};var params={};var pairs=query.split(/[;&]/);for(var i=0;i<pairs.length;i++){var pair=pairs[i].split('=');if(!pair||pair.length!=2)
continue;params[unescape(pair[0])]=unescape(pair[1]).replace(/\+/g,' ');}
return params;}
function TB_getPageScrollTop(){var yScrolltop;var xScrollleft;if(self.pageYOffset||self.pageXOffset){yScrolltop=self.pageYOffset;xScrollleft=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop||document.documentElement.scrollLeft){yScrolltop=document.documentElement.scrollTop;xScrollleft=document.documentElement.scrollLeft;}else if(document.body){yScrolltop=document.body.scrollTop;xScrollleft=document.body.scrollLeft;}
arrayPageScroll=new Array(xScrollleft,yScrolltop)
return arrayPageScroll;}
function TB_getPageSize(){var de=document.documentElement;var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight
var w=$(window).width();var h=$(window).height();arrayPageSize=new Array(w,h)
return arrayPageSize;}
function flash7(nome,id,com,alt,query){document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+flashHttp+'://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+com+'" height="'+alt+'" id="'+id+'" align="middle">'+'<param name="allowScriptAccess" value="sameDomain" />'+'<param name="movie" value="'+nome+'" />'+'<param name="FlashVars" value="'+query+'" />'+'<param name="quality" value="best" />'+'<param name="bgcolor" value="#ffffff" />'+'<param name="wmode" value="transparent" />'+'<PARAM NAME=scale VALUE=noscale>'+'<embed src="'+nome+'" quality="best" bgcolor="#ffffff" wmode="transparent" FlashVars="'+query+'" width="'+com+'" height="'+alt+'" name="'+id+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+'</object>');}
function MM_findObj(n,d){var p,i,x;if(!d){d=document;}
if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all){x=d.all[n];}
for(i=0;!x&&i<d.forms.length;i++){x=d.forms[i][n];}
for(i=0;!x&&d.layers&&i<d.layers.length;i++){x=MM_findObj(n,d.layers[i].document);}
if(!x&&document.getElementById){x=document.getElementById(n);}
return x;}
function tmt_findObj(n){var x,t;if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");}else{x=document.getElementById(n);}
return x;}
function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;if(navigator.userAgent.indexOf("Opera")==-1){if(document.getElementById){for(i=0;i<(args.length-2);i+=3){obj=tmt_findObj(args[i]);v=args[i+2];v=(v=='show')?'block':(v='hide')?'none':v;if(obj){obj.style.display=v;}}}else{for(i=0;i<(args.length-2);i+=3){if((obj=MM_findObj(args[i]))!=null){v=args[i+2];if(obj.style){obj=obj.style;v=(v=='show')?'block':(v='hide')?'none':v;}
obj.display=v;}}}}}
function url_decode(str){var n,strCode,strDecode="";for(n=0;n<str.length;n++){if(str.charAt(n)=="%"){strCode=str.charAt(n+1)+str.charAt(n+2);strDecode+=String.fromCharCode(parseInt(strCode,16));n+=2;}else{strDecode+=str.charAt(n);}}
return strDecode;}
$(document).ready(function(){$('img.thumb-produto').click(function(){$('img.foto-produto').attr({src:this.src.replace('80x80','270x270')});return false;});if(document.getElementById('abas_tamanho_1'))
{$('div#abas_tamanho_1 ul li a').click(function(){$('div#abas_tamanho_1 ul li a').each(function(){$(this.parentNode).removeClass("aba_ativo").addClass("aba_normal");})
$("div#abas_show").html($("div#"+this.parentNode.id+"_descricao").html());$(this.parentNode).removeClass("aba_normal").addClass("aba_ativo");return false;})}
function ampliar(event){var img=$('img.foto-produto').attr('src').replace('193x193','grd');event.preventDefault();var group=this.rel||false;TB_show('',img+'?height=500&width=500',group);return false;}
$('a.btAmpliar').click(function(event){return ampliar(event);});$('a.fotoAmpliar').click(function(event){return ampliar(event);});$('a.btIndique').click(function(event){event.preventDefault();var caption=this.title||this.name||"";var group=this.rel||false;TB_show(caption,this.href+'/ajax?height=245&width=300',group);return false;});$('a.btAviseme').click(function(event){event.preventDefault();var caption=this.title||this.name||"";var group=this.rel||false;TB_show(caption,this.href+'/ajax?height=245&width=300',group);return false;});$('select.quantidadeProdutos').change(function(){produtoID=this.id.replace('quantidade_','');produto=$('input#produto_'+produtoID).attr('value');url=baseURL+'pedidos/produto/'+produto+'/quantidade/'+this.value;$.get(url,function(data){document.carrinhoCompras.submit();TB_show('','','');});});$('option.tipoEntrega').change(function(){alert('aaa');});$('a.carrinhoExcluir').click(function(){produtoID=this.id.replace('excluir_','');produto=$('input#produto_'+produtoID).attr('value');url=baseURL+'pedidos/produto/'+produto+'/excluir';location.href=url;return false;});$('input.tipo_pessoa').click(function(){if(this.value==1)
{$('fieldset.pessoa_fisica').addClass('blocked');$('fieldset.pessoa_juridica').removeClass('blocked');$('fieldset.pessoa_fisica label').each(function(){$(this).addClass('blocked');});$('fieldset.pessoa_juridica label').each(function(){$(this).removeClass('blocked');});}
else
{$('fieldset.pessoa_fisica').removeClass('blocked');$('fieldset.pessoa_juridica').addClass('blocked');$('fieldset.pessoa_fisica label').each(function(){$(this).removeClass('blocked');});$('fieldset.pessoa_juridica label').each(function(){$(this).addClass('blocked');});}});$('input.dados_iguais').click(function(){if(this.value)
{if(this.value==1){$('#PedidoEntregaCep1').val('');$('#PedidoEntregaCep2').val('');$('#PedidoEntregaEndereco').val('');$('#PedidoEntregaEndereco').val('');$('#PedidoEntregaNumero').val('');$('#PedidoEntregaComplemento').val('');$('#PedidoEntregaBairro').val('');$('#PedidoEntregaCidade').val('');$('#PedidoEntregaEstado').val('');}else{$('#PedidoEntregaCep1').val($('#PedidoCobrancaCep1').val());$('#PedidoEntregaCep2').val($('#PedidoCobrancaCep2').val());$('#PedidoEntregaEndereco').val($('#PedidoCobrancaEndereco').val());$('#PedidoEntregaEndereco').val($('#PedidoCobrancaEndereco').val());$('#PedidoEntregaNumero').val($('#PedidoCobrancaNumero').val());$('#PedidoEntregaComplemento').val($('#PedidoCobrancaComplemento').val());$('#PedidoEntregaBairro').val($('#PedidoCobrancaBairro').val());$('#PedidoEntregaCidade').val($('#PedidoCobrancaCidade').val());$('#PedidoEntregaEstado').val($('#PedidoCobrancaEstado').val());}}});$('form#FormMeuCadastro').jForm({ClienteCliente:$('#ClienteCliente').jField({name:'Nome Completo',empty:'no',minLength:10}),ClienteCliente2:$('#ClienteCliente2').jField({name:'Nome Completo',empty:'no',minLength:10}),ClienteCpf:$('#ClienteCpf').jField({name:'CPF',type:'int',empty:'no',minLength:11}),ClienteDataNascimento:$('#ClienteDataNascimento').jField({name:'Data Nascimento',empty:'no',minLength:10,emptyError:'Coloque o valor de "Data Nascimento" com o padr&atilde;o dd/mm/yyyy'}),ClienteTelefoneResidencialDdd:$('#ClienteTelefoneResidencialDdd').jField({name:'Telefone Residencial (ddd)',type:'int',empty:'no',minLength:2}),ClienteTelefoneResidencial:$('#ClienteTelefoneResidencial').jField({name:'Telefone Residencial ',type:'int',empty:'no',minLength:8}),ClienteTelefoneCelularDdd:$('#ClienteTelefoneCelularDdd').jField({name:'Telefone Celular (ddd)',type:'int',empty:'yes',minLength:2}),ClienteTelefoneCelular:$('#ClienteTelefoneCelular').jField({name:'Telefone Celular ',type:'int',empty:'yes',minLength:8}),ClienteTelefoneComercialDdd:$('#ClienteTelefoneComercialDdd').jField({name:'Telefone Celular (ddd)',type:'int',empty:'yes',minLength:2}),ClienteTelefoneComercial:$('#ClienteTelefoneComercial').jField({name:'Telefone Celular ',type:'int',empty:'yes',minLength:8}),ClienteTelefoneCelularDdd2:$('#ClienteTelefoneCelularDdd2').jField({name:'Telefone Celular (ddd)',type:'int',empty:'no',minLength:2}),ClienteTelefoneCelular2:$('#ClienteTelefoneCelular2').jField({name:'Telefone Celular ',type:'int',empty:'no',minLength:8}),ClienteLogin:$('#ClienteLogin').jField({name:'Como gostaria de ser chamado',empty:'no',minLength:2}),ClienteEmail:$('#ClienteEmail').jField({name:'Email',type:'email',empty:'no'}),ClienteEmailConfirma:$('#ClienteEmailConfirma').jField({name:'Email',type:'email',empty:'no'}),ClienteSenha:$('#ClienteSenha').jField({name:'Senha',type:'password',empty:'no',minLength:6}),ClienteSenhaConfirma:$('#ClienteSenhaConfirma').jField({name:'Senha',type:'password',empty:'no',minLength:6}),PedidoCobrancaCep1:$('#PedidoCobrancaCep1').jField({name:'CEP',type:'int',empty:'no',minLength:5}),PedidoCobrancaCep2:$('#PedidoCobrancaCep2').jField({name:'CEP',type:'int',empty:'no',minLength:3}),PedidoCobrancaEndereco:$('#PedidoCobrancaEndereco').jField({name:'Endere&ccedil;o',empty:'no',minLength:2}),PedidoCobrancaNumero:$('#PedidoCobrancaNumero').jField({name:'Numero',type:'int',empty:'no',minLength:1}),PedidoCobrancaBairro:$('#PedidoCobrancaBairro').jField({name:'Bairro',empty:'no',minLength:2}),PedidoCobrancaCidade:$('#PedidoCobrancaCidade').jField({name:'Cidade',empty:'no',minLength:2}),PedidoEntregaCep1:$('#PedidoEntregaCep1').jField({name:'CEP',type:'int',empty:'no',minLength:5}),PedidoEntregaCep2:$('#PedidoEntregaCep2').jField({name:'CEP',type:'int',empty:'no',minLength:3}),PedidoEntregaEndereco:$('#PedidoEntregaEndereco').jField({name:'Endere&ccedil;o',empty:'no',minLength:2}),PedidoEntregaNumero:$('#PedidoEntregaNumero').jField({name:'Numero',type:'int',empty:'no',minLength:1}),PedidoEntregaBairro:$('#PedidoEntregaBairro').jField({name:'Bairro',empty:'no',minLength:2}),PedidoEntregaCidade:$('#PedidoEntregaCidade').jField({name:'Cidade',empty:'no',minLength:2})});$('.formularioCliente').jForm({ClienteCliente:$('#ClienteCliente').jField({name:'Nome Completo',empty:'no',minLength:10}),ClienteCpf:$('#ClienteCpf').jField({name:'CPF',type:'int',empty:'no',minLength:11}),ClienteDataNascimento:$('#ClienteDataNascimento').jField({name:'Data Nascimento',empty:'no',minLength:10,emptyError:'Coloque o valor de "Data Nascimento" com o padr&atilde;o dd/mm/yyyy'}),ClienteTelefoneDdd:$('#ClienteTelefoneDdd').jField({name:'Telefone (ddd)',type:'int',empty:'no',minLength:2}),ClienteTelefone:$('#ClienteTelefone').jField({name:'Telefone',type:'int',empty:'no',minLength:8}),ClienteTelefoneComercialDdd:$('#ClienteTelefoneComercialDdd').jField({name:'Telefone Comercial (ddd)',type:'int',empty:'yes',minLength:2}),ClienteTelefoneComercial:$('#ClienteTelefoneComercial').jField({name:'Telefone Comercial ',type:'int',empty:'yes',minLength:8}),ClienteRazaoSocial:$('#ClienteRazaoSocial').jField({name:'Raz&atilde;o Social',empty:'no',minLength:10}),ClienteCnpj:$('#ClienteCnpj').jField({name:'CNPJ',type:'int',empty:'no',minLength:11}),ClienteCpf:$('#ClienteCpf').jField({name:'CPF',type:'int',empty:'no',minLength:11}),ClienteLogin:$('#ClienteLogin').jField({name:'Como gostaria de ser chamado',empty:'no',minLength:2}),ClienteEmail:$('#ClienteEmail').jField({name:'Email',type:'email',empty:'no'}),ClienteSenha:$('#ClienteSenha').jField({name:'Senha',type:'password',empty:'no',minLength:6}),ClienteCobrancaCep1:$('#ClienteCobrancaCep1').jField({name:'CEP',type:'int',empty:'no',minLength:5}),ClienteCobrancaCep2:$('#ClienteCobrancaCep2').jField({name:'CEP',type:'int',empty:'no',minLength:3}),ClienteCobrancaEndereco:$('#ClienteCobrancaEndereco').jField({name:'Endere&ccedil;o',empty:'no',minLength:2}),ClienteCobrancaBairro:$('#ClienteCobrancaBairro').jField({name:'Bairro',empty:'no',minLength:2}),ClienteCobrancaCidade:$('#ClienteCobrancaCidade').jField({name:'Cidade',empty:'no',minLength:2})});$('a#cobranca_busca_cep').click(function(){return busca_cep('PedidoCobranca');});$('a#entrega_busca_cep').click(function(){return busca_cep('PedidoEntrega');});$('a#cliente_cobranca_busca_cep').click(function(){return busca_cep('ClienteCobranca');});$('.formularioFaleConosco').jForm({ContatoNome:$('#ContatoNome').jField({name:'Nome Completo',empty:'no',minLength:10}),ContatoTelefone:$('#ContatoTelefone').jField({name:'Telefone',empty:'no',minLength:8}),ContatoEmail:$('#ContatoEmail').jField({name:'Email',type:'email',empty:'no'}),ContatoMensagem:$('#ContatoMensagem').jField({name:'Mensagem',empty:'no',minLength:10})});$('#MenuCategorias li').hover(function(){$('div',this).show();$(this).addClass('selecionado');$('div ul li div.subMenu',this).hide();},function(){$('div',this).hide();$(this).removeClass('selecionado');});$('#MenuCategorias li div ul li').hover(function(){$('div',this).show();$(this).addClass('selecionado');},function(){$('div',this).hide();$(this).removeClass('selecionado');});$('.detalhe').hide();$('.abas a').click(function(){$(this).parent().addClass('aberto');$('.detalhe').hide();$(this).parent().next().show();});$('form#FormIndique input, form.formEsgorado  input, form#formMalaDireta input').each(function(){this.onfocus=function(){if(!this.getAttribute('hasfocused')){this.defaultValue=this.value;this.value='';this.setAttribute('hasfocused',true);}}
this.onblur=function(){if(this.getAttribute('hasfocused')&&this.value==""){this.value=this.defaultValue;this.removeAttribute('hasfocused');}}});$("div.produtoEsgotado").click(function(){})
$('form#formMalaDireta').ajaxForm({type:'post',resetForm:true,beforeSubmit:function(){var value_name=$("form#formMalaDireta label.nome input").val();var value_mail=$("form#formMalaDireta label.email input").val();var is_valid_name=Boolean(value_name!="seu nome"||value_name!="")
var is_valid_mail=Boolean(value_mail.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/));if(is_valid_mail&&is_valid_name){$('.msgOk').fadeOut(200);return true;}else{alert("Por favor, insira um nome e/ou um e-mail valido");}
return false;},success:function(responseText,statusText){pageTracker._trackPageview('/ok');window.setTimeout(function(){alert('E-mail adicionado com sucesso!');$('.msgOk').html(statusText).fadeIn(500);},250);}});$('form#FormIndique').submit(function()
{var value_my_name=$("form#FormIndique label.mynome input").val();var value_my_mail=$("form#FormIndique label.mymail input").val();var value_fr_name=$("form#FormIndique label.frnome input").val();var value_fr_mail=$("form#FormIndique label.frmail input").val();var is_valid_my_name=Boolean(value_my_name!="seu nome"||value_my_name!="")
var is_valid_fr_name=Boolean(value_fr_name!="nome do(a) amigo(a)"||value_fr_name!="")
var is_valid_my_mail=Boolean(value_my_mail.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/));var is_valid_fr_mail=Boolean(value_fr_name.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/));if(is_valid_my_name&&is_valid_my_mail&&is_valid_fr_name&&is_valid_fr_name)
{return true;}
else
{alert("Por favor, insira um nome e/ou um e-mail valido");return false;}});$('input.escolha_modo_entrega').click(function()
{})});var tipoPagamento='deposito';var bandeiraPagamento='visa';var bancoPagamento='itau_shopline';function tipoPagamentoMuda(value)
{if(value=='deposito'||value=='cartao'||value=='boleto')
{tipoPagamento=value;document.getElementById("deposito").style.display='none';document.getElementById("cartao").style.display='none';document.getElementById("boleto").style.display='none';document.getElementById(tipoPagamento).style.display='inline';$('#tipo_deposito').removeClass('selecionado');$('#tipo_cartao').removeClass('selecionado');$('#tipo_boleto').removeClass('selecionado');$("#tipo_"+tipoPagamento).addClass('selecionado');document.confirma.formadepagamento.value=value;}else if(value=='entrega'){tipoPagamento=value;}}
function bancoMuda(value)
{if(value=='bradesco'||value=='itau'||value=='real'||value=='brasil'||value=='santander')
{bancoPagamento=value;$('#banco_bradesco').addClass('blocked');$('#banco_itau').addClass('blocked');$('#banco_real').addClass('blocked');$('#banco_brasil').addClass('blocked');$('#stringNomeBanco').addClass('blocked');$('#banco_'+value).removeClass('blocked');}else if(value=='itau_shopline'){bancoPagamento=value;$('#stringNomeBanco').removeClass('blocked');$('#stringNomeBanco strong.nomeBanco').html('Ita&uacute; Shopline');}else if(value=='bradesco_visa'){bancoPagamento=value;$('#stringNomeBanco').removeClass('blocked');$('#stringNomeBanco strong.nomeBanco').html('Visa Electron');}
$('#nomeCartao').parent().hide();if(value=='bradesco_visa'){$('#nomeCartao').parent().show();}}
function bandeiraOpcoes(value)
{bandeiraPagamento=value;$('#credito_american').addClass('blocked');if(value=='american'){$('#credito_american').removeClass('blocked');$('#codigoSeguranca').attr('maxLength',4);}else{$('#codigoSeguranca').attr('maxLength',3);}}
function carregabrw(){return true;}
function passo2Submit()
{if(bancoPagamento=='bradesco_visa'){$('div#boxPagamentos').hide();$('p#btnConcluir').hide();$('div#pagamento').html('<p>Aguarde enquanto contactamos o banco e processamos as informa&ccedil;&otilde;es.</p>');$('div#pagamento').show();$.post(baseURL+'pagamentos/visa',{cliente_cartao:$('#nomeCartao').val()},function(data){window.name='loja';var retorno;$('div#pagamento').html(data);});return false;}else if(bancoPagamento=='itau_shopline'){$('div#boxPagamentos').hide();$('p#btnConcluir').hide();$('div#pagamento').html('<p>Aguarde enquanto contactamos o banco e processamos as informa&ccedil;&otilde;es.</p>');$('div#pagamento').show();$.post(baseURL+'pagamentos/itau',function(data){window.name='SHOPLINE';$('div#pagamento').html(data);});return false;}
return true;}
function imprimeBoleto(pedidoID)
{window.open(baseURL+'pedidos/boleto/'+pedidoID,'imprimir_boleto','scrollbars=1, height=580, width=780');return false;}
function sobeTopo(speed){var speed=speed||50;var scroll=0;if(window.scrollY)
scroll=window.scrollY;else if(document.documentElement.scrollTop)
scroll=document.documentElement.scrollTop;else
scroll=document.body.scrollTop;if(scroll!=0)
{window.scrollTo(0,scroll-speed);setTimeout('sobeTopo('+speed+')',4);}}
function busca_cep(tipo){var cep=$('input#'+tipo+'Cep1').val()+''+$('input#'+tipo+'Cep2').val();$.get(baseURL+'home/busca_cep/'+cep,function(data){eval(data);if(resultadoCEP!=false)
{$('input#'+tipo+'Endereco').val((resultadoCEP.endereco));$('input#'+tipo+'Bairro').val(url_decode(resultadoCEP.bairro));$('input#'+tipo+'Cidade').val(url_decode(resultadoCEP.cidade));$('select#'+tipo+'Estado').val(resultadoCEP.uf);}});return false;}
function tipoFrete(forma){$.get(baseURL+'pedidos/total_frete/?modo='+forma,function(data){valores=data.split('|');$('em.TotalVal').html(valores[0]);$('td.Sedex').html(valores[1]);});document.carrinhoCompras.submit();$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");TB_overlaySize();$("body").append("<div id='TB_load'></div>");TB_load_position();return true;}
var mensagemAtual=0;var mensagemAnterior=0;function aplicaMensagem(){if(typeof mensagensHome[mensagemAtual+1]=='undefined'){mensagemAtual=0;}else{mensagemAtual++;}
$('h3#BannerTopo').addClass('alinha troca_cor'+(mensagemAtual%3));$('h3#BannerTopo strong').html(mensagensHome[mensagemAtual].msg);setTimeout('aplicaMensagem()',mensagensHome[mensagemAtual].dur);if($('h3#BannerTopo strong a').width()>=415){$('h3#BannerTopo').removeClass('troca_cor'+((mensagemAtual-1)%3));}else{$('h3#BannerTopo').removeClass('alinha troca_cor'+((mensagemAtual-1)%3));}}
$(document).ready(function(){$("#compras_telefone").click(function(){$(this).addClass('fones');});});function valida_cartao(){var d=document.confirma;if(tipoPagamento=='entrega'){return true;}
if(d.formadepagamento.value=="cartao"){if(isNaN(d.numeroCartao.value)){alert("O campo 'Numero do Cartao' deve conter apenas numeros!");d.numeroCartao.focus();return false;}
if(d.numeroCartao.value.length<15){alert("O campo 'Numero do Cartao' deve conter 15 numeros!");d.numeroCartao.focus();return false;}
if(isNaN(d.codigoSeguranca.value)){alert("O campo 'Codigo de Seguranca' deve conter apenas numeros!");d.codigoSeguranca.focus();return false;}
if(d.codigoSeguranca.value.length<4&&bandeiraPagamento=='american'){alert("O campo 'Codigo de Seguranca' deve conter 4 numeros!");d.codigoSeguranca.focus();return false;}
if(d.codigoSeguranca.value.length<3&&(bandeiraPagamento=='visa'||bandeiraPagamento=='mastercard')){alert("O campo 'Codigo de Seguranca' deve conter 3 numeros!");d.codigoSeguranca.focus();return false;}
if(isNaN(d.validadeCartaoMes.value)){alert("O campo 'Data de Validade' deve conter apenas numeros!");d.validadeCartaoMes.focus();return false;}
if(d.validadeCartaoMes.value.length<2){alert("O campo 'Data de Validade' deve conter 2 numeros para cada campo!");d.validadeCartaoMes.focus();return false;}
if(isNaN(d.validadeCartaoAno.value)){alert("O campo 'Data de Validade' deve conter apenas numeros!");d.validadeCartaoAno.focus();return false;}
if(d.validadeCartaoAno.value.length<2){alert("O campo 'Data de Validade' deve conter 2 numeros para cada campo!");d.validadeCartaoAno.focus();return false;}}else if(d.formadepagamento.value=="boleto"){return true;}else{return passo2Submit();}}
function rastreaPedido(pedidoId){$('div#AcompanhamentoRastreamento').html('Aguarde ... carregando.');$('div#AcompanhamentoRastreamento').removeClass('blocked');$.get(baseURL+'pedidos/rastreamento/'+pedidoId,function(data){$('div#AcompanhamentoRastreamento').html(data);});}
$(function(){$("#tipo_id").mouseover(function(){$(this).css("width","auto");$(this).focus();$(".marca").css("display","none");}).change(function(){$(this).css("width","70px");$(".marca").css("display","");}).blur(function(){$(this).css("width","70px");$(".marca").css("display","");});});$(function(){$("#fabricante_id").mouseover(function(){$(this).css("width","auto");$(this).focus();$("#spmarca").css("display","none");}).change(function(){$(this).css("width","70px");$("#spmarca").css("display","");}).blur(function(){$(this).css("width","70px");$("#spmarca").css("display","");});});$(function(){$("#sortBy").mouseover(function(){$(this).css("width","auto");$(this).focus();$("#spordenar").css("display","none");}).change(function(){$(this).css("width","70px");$("#spordenar").css("display","");}).blur(function(){$(this).css("width","70px");$("#spordenar").css("display","");});});function hasSupport(){if(typeof hasSupport.support!="undefined")
return hasSupport.support;var ie55=/msie 5\.[56789]/i.test(navigator.userAgent);hasSupport.support=(typeof document.implementation!="undefined"&&document.implementation.hasFeature("html","1.0")||ie55)
if(ie55){document._getElementsByTagName=document.getElementsByTagName;document.getElementsByTagName=function(sTagName){if(sTagName=="*")
return document.all;else
return document._getElementsByTagName(sTagName);};}
return hasSupport.support;}
function WebFXTabPane(el,bUseCookie){if(!hasSupport()||el==null)return;this.element=el;this.element.tabPane=this;this.pages=[];this.selectedIndex=null;this.useCookie=bUseCookie!=null?bUseCookie:true;this.element.className=this.classNameTag+" "+this.element.className;this.tabRow=document.createElement("div");this.tabRow.className="tab-row";el.insertBefore(this.tabRow,el.firstChild);var tabIndex=0;if(this.useCookie){tabIndex=Number(WebFXTabPane.getCookie("webfxtab_"+this.element.id));if(isNaN(tabIndex))
tabIndex=0;}
this.selectedIndex=tabIndex;var cs=el.childNodes;var n;for(var i=0;i<cs.length;i++){if(cs[i].nodeType==1&&cs[i].className=="tab-page"){this.addTabPage(cs[i]);}}}
WebFXTabPane.prototype.classNameTag="dynamic-tab-pane-control";WebFXTabPane.prototype.setSelectedIndex=function(n){if(this.selectedIndex!=n){if(this.selectedIndex!=null&&this.pages[this.selectedIndex]!=null)
this.pages[this.selectedIndex].hide();this.selectedIndex=n;this.pages[this.selectedIndex].show();if(this.useCookie)
WebFXTabPane.setCookie("webfxtab_"+this.element.id,n);}};WebFXTabPane.prototype.getSelectedIndex=function(){return this.selectedIndex;};WebFXTabPane.prototype.addTabPage=function(oElement){if(!hasSupport())return;if(oElement.tabPage==this)
return oElement.tabPage;var n=this.pages.length;var tp=this.pages[n]=new WebFXTabPage(oElement,this,n);tp.tabPane=this;this.tabRow.appendChild(tp.tab);if(n==this.selectedIndex)
tp.show();else
tp.hide();return tp;};WebFXTabPane.prototype.dispose=function(){this.element.tabPane=null;this.element=null;this.tabRow=null;for(var i=0;i<this.pages.length;i++){this.pages[i].dispose();this.pages[i]=null;}
this.pages=null;};WebFXTabPane.setCookie=function(sName,sValue,nDays){var expires="";if(nDays){var d=new Date();d.setTime(d.getTime()+nDays*24*60*60*1000);expires="; expires="+d.toGMTString();}
document.cookie=sName+"="+sValue+expires+"; path=/";};WebFXTabPane.getCookie=function(sName){var re=new RegExp("(\;|^)[^;]*("+sName+")\=([^;]*)(;|$)");var res=re.exec(document.cookie);return res!=null?res[3]:null;};WebFXTabPane.removeCookie=function(name){setCookie(name,"",-1);};function WebFXTabPage(el,tabPane,nIndex){if(!hasSupport()||el==null)return;this.element=el;this.element.tabPage=this;this.index=nIndex;var cs=el.childNodes;for(var i=0;i<cs.length;i++){if(cs[i].nodeType==1&&cs[i].className=="tab"){this.tab=cs[i];break;}}
var a=document.createElement("A");this.aElement=a;a.href="#";a.onclick=function(){return false;};while(this.tab.hasChildNodes())
a.appendChild(this.tab.firstChild);this.tab.appendChild(a);var oThis=this;this.tab.onclick=function(){oThis.select();};this.tab.onmouseover=function(){WebFXTabPage.tabOver(oThis);};this.tab.onmouseout=function(){WebFXTabPage.tabOut(oThis);};}
WebFXTabPage.prototype.show=function(){var el=this.tab;var s=el.className+" selected";s=s.replace(/ +/g," ");el.className=s;this.element.style.display="block";};WebFXTabPage.prototype.hide=function(){var el=this.tab;var s=el.className;s=s.replace(/ selected/g,"");el.className=s;this.element.style.display="none";};WebFXTabPage.prototype.select=function(){this.tabPane.setSelectedIndex(this.index);};WebFXTabPage.prototype.dispose=function(){this.aElement.onclick=null;this.aElement=null;this.element.tabPage=null;this.tab.onclick=null;this.tab.onmouseover=null;this.tab.onmouseout=null;this.tab=null;this.tabPane=null;this.element=null;};WebFXTabPage.tabOver=function(tabpage){var el=tabpage.tab;var s=el.className+" hover";s=s.replace(/ +/g," ");el.className=s;};WebFXTabPage.tabOut=function(tabpage){var el=tabpage.tab;var s=el.className;s=s.replace(/ hover/g,"");el.className=s;};function setupAllTabs(){if(!hasSupport())return;var all=document.getElementsByTagName("*");var l=all.length;var tabPaneRe=/tab\-pane/;var tabPageRe=/tab\-page/;var cn,el;var parentTabPane;for(var i=0;i<l;i++){el=all[i]
cn=el.className;if(cn=="")continue;if(tabPaneRe.test(cn)&&!el.tabPane)
new WebFXTabPane(el);else if(tabPageRe.test(cn)&&!el.tabPage&&tabPaneRe.test(el.parentNode.className)){el.parentNode.tabPane.addTabPage(el);}}}
function disposeAllTabs(){if(!hasSupport())return;var all=document.getElementsByTagName("*");var l=all.length;var tabPaneRe=/tab\-pane/;var cn,el;var tabPanes=[];for(var i=0;i<l;i++){el=all[i]
cn=el.className;if(cn=="")continue;if(tabPaneRe.test(cn)&&el.tabPane)
tabPanes[tabPanes.length]=el.tabPane;}
for(var i=tabPanes.length-1;i>=0;i--){tabPanes[i].dispose();tabPanes[i]=null;}}
if(typeof window.addEventListener!="undefined")
window.addEventListener("load",setupAllTabs,false);else if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",setupAllTabs);window.attachEvent("onunload",disposeAllTabs);}
else{if(window.onload!=null){var oldOnload=window.onload;window.onload=function(e){oldOnload(e);setupAllTabs();};}
else
window.onload=setupAllTabs;}