var loc = new String(document.location.href);

//-----[ swfobject ]-----

var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();

//-----[ sizzle ]-----

(function(){var k=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString,hasDuplicate=false;var n=function(a,b,c,d){c=c||[];var e=b=b||document;if(b.nodeType!==1&&b.nodeType!==9){return[]}if(!a||typeof a!=="string"){return c}var f=[],m,set,checkSet,check,mode,extra,prune=true,contextXML=u(b);k.lastIndex=0;while((m=k.exec(a))!==null){f.push(m[1]);if(m[2]){extra=RegExp.rightContext;break}}if(f.length>1&&p.exec(a)){if(f.length===2&&o.relative[f[0]]){set=v(f[0]+f[1],b)}else{set=o.relative[f[0]]?[b]:n(f.shift(),b);while(f.length){a=f.shift();if(o.relative[a])a+=f.shift();set=v(a,set)}}}else{if(!d&&f.length>1&&b.nodeType===9&&!contextXML&&o.match.ID.test(f[0])&&!o.match.ID.test(f[f.length-1])){var g=n.find(f.shift(),b,contextXML);b=g.expr?n.filter(g.expr,g.set)[0]:g.set[0]}if(b){var g=d?{expr:f.pop(),set:r(d)}:n.find(f.pop(),f.length===1&&(f[0]==="~"||f[0]==="+")&&b.parentNode?b.parentNode:b,contextXML);set=g.expr?n.filter(g.expr,g.set):g.set;if(f.length>0){checkSet=r(set)}else{prune=false}while(f.length){var h=f.pop(),pop=h;if(!o.relative[h]){h=""}else{pop=f.pop()}if(pop==null){pop=b}o.relative[h](checkSet,pop,contextXML)}}else{checkSet=f=[]}}if(!checkSet){checkSet=set}if(!checkSet){throw"Syntax error, unrecognized expression: "+(h||a);}if(toString.call(checkSet)==="[object Array]"){if(!prune){c.push.apply(c,checkSet)}else if(b&&b.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&t(b,checkSet[i]))){c.push(set[i])}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){c.push(set[i])}}}}else{r(checkSet,c)}if(extra){n(extra,e,c,d);n.uniqueSort(c)}return c};n.uniqueSort=function(a){if(s){hasDuplicate=false;a.sort(s);if(hasDuplicate){for(var i=1;i<a.length;i++){if(a[i]===a[i-1]){a.splice(i--,1)}}}}};n.matches=function(a,b){return n(a,null,null,b)};n.find=function(a,b,c){var d,match;if(!a){return[]}for(var i=0,l=o.order.length;i<l;i++){var e=o.order[i],match;if((match=o.match[e].exec(a))){var f=RegExp.leftContext;if(f.substr(f.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");d=o.find[e](match,b,c);if(d!=null){a=a.replace(o.match[e],"");break}}}}if(!d){d=b.getElementsByTagName("*")}return{set:d,expr:a}};n.filter=function(a,b,c,d){var e=a,result=[],curLoop=b,match,anyFound,isXMLFilter=b&&b[0]&&u(b[0]);while(a&&b.length){for(var f in o.filter){if((match=o.match[f].exec(a))!=null){var g=o.filter[f],found,item;anyFound=false;if(curLoop==result){result=[]}if(o.preFilter[f]){match=o.preFilter[f](match,curLoop,c,result,d,isXMLFilter);if(!match){anyFound=found=true}else if(match===true){continue}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=g(item,match,i,curLoop);var h=d^!!found;if(c&&found!=null){if(h){anyFound=true}else{curLoop[i]=false}}else if(h){result.push(item);anyFound=true}}}}if(found!==undefined){if(!c){curLoop=result}a=a.replace(o.match[f],"");if(!anyFound){return[]}break}}}if(a==e){if(anyFound==null){throw"Syntax error, unrecognized expression: "+a;}else{break}}e=a}return curLoop};var o=n.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b,c){var d=typeof b==="string",isTag=d&&!/\W/.test(b),isPartStrNotTag=d&&!isTag;if(isTag&&!c){b=b.toUpperCase()}for(var i=0,l=a.length,elem;i<l;i++){if((elem=a[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}a[i]=isPartStrNotTag||elem&&elem.nodeName===b?elem||false:elem===b}}if(isPartStrNotTag){n.filter(b,a,true)}},">":function(a,b,c){var d=typeof b==="string";if(d&&!/\W/.test(b)){b=c?b:b.toUpperCase();for(var i=0,l=a.length;i<l;i++){var e=a[i];if(e){var f=e.parentNode;a[i]=f.nodeName===b?f:false}}}else{for(var i=0,l=a.length;i<l;i++){var e=a[i];if(e){a[i]=d?e.parentNode:e.parentNode===b}}if(d){n.filter(b,a,true)}}},"":function(a,b,c){var d=done++,checkFn=dirCheck;if(!/\W/.test(b)){var e=b=c?b:b.toUpperCase();checkFn=dirNodeCheck}checkFn("parentNode",b,d,a,e,c)},"~":function(a,b,c){var d=done++,checkFn=dirCheck;if(typeof b==="string"&&!/\W/.test(b)){var e=b=c?b:b.toUpperCase();checkFn=dirNodeCheck}checkFn("previousSibling",b,d,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var m=b.getElementById(a[1]);return m?[m]:[]}},NAME:function(a,b,c){if(typeof b.getElementsByName!=="undefined"){var d=[],results=b.getElementsByName(a[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===a[1]){d.push(results[i])}}return d.length===0?null:d}},TAG:function(a,b){return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(/\\/g,"")+" ";if(f){return a}for(var i=0,elem;(elem=b[i])!=null;i++){if(elem){if(e^(elem.className&&(" "+elem.className+" ").indexOf(a)>=0)){if(!c)d.push(elem)}else if(c){b[i]=false}}}return false},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a,b){for(var i=0;b[i]===false;i++){}return b[i]&&u(b[i])?a[1]:a[1].toUpperCase()},CHILD:function(a){if(a[1]=="nth"){var b=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(a[2]=="even"&&"2n"||a[2]=="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=(b[1]+(b[2]||1))-0;a[3]=b[3]-0}a[0]=done++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1].replace(/\\/g,"");if(!f&&o.attrMap[g]){a[1]=o.attrMap[g]}if(a[2]==="~="){a[4]=" "+a[4]+" "}return a},PSEUDO:function(a,b,c,d,e){if(a[1]==="not"){if(k.exec(a[3]).length>1||/^\w/.test(a[3])){a[3]=n(a[3],null,null,b)}else{var f=n.filter(a[3],b,c,true^e);if(!c){d.push.apply(d,f)}return false}}else if(o.match.POS.test(a[0])||o.match.CHILD.test(a[0])){return true}return a},POS:function(a){a.unshift(true);return a}},filters:{enabled:function(a){return a.disabled===false&&a.type!=="hidden"},disabled:function(a){return a.disabled===true},checked:function(a){return a.checked===true},selected:function(a){a.parentNode.selectedIndex;return a.selected===true},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,i,b){return!!n(b[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toUpperCase()==="BUTTON"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,i){return i===0},last:function(a,i,b,c){return i===c.length-1},even:function(a,i){return i%2===0},odd:function(a,i){return i%2===1},lt:function(a,i,b){return i<b[3]-0},gt:function(a,i,b){return i>b[3]-0},nth:function(a,i,b){return b[3]-0==i},eq:function(a,i,b){return b[3]-0==i}},filter:{PSEUDO:function(a,b,i,c){var d=b[1],filter=o.filters[d];if(filter){return filter(a,i,b,c)}else if(d==="contains"){return(a.textContent||a.innerText||"").indexOf(b[3])>=0}else if(d==="not"){var e=b[3];for(i=0,l=e.length;i<l;i++){if(e[i]===a){return false}}return true}},CHILD:function(a,b){var c=b[1],node=a;switch(c){case'only':case'first':while((node=node.previousSibling)){if(node.nodeType===1)return false}if(c=='first')return true;node=a;case'last':while((node=node.nextSibling)){if(node.nodeType===1)return false}return true;case'nth':var d=b[2],last=b[3];if(d==1&&last==0){return true}var e=b[0],parent=a.parentNode;if(parent&&(parent.sizcache!==e||!a.nodeIndex)){var f=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++f}}parent.sizcache=e}var g=a.nodeIndex-last;if(d==0){return g==0}else{return(g%d==0&&g/d>=0)}}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return(b==="*"&&a.nodeType===1)||a.nodeName===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],result=o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),value=result+"",q=b[2],check=b[4];return result==null?q==="!=":q==="="?value===check:q==="*="?value.indexOf(check)>=0:q==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:q==="!="?value!=check:q==="^="?value.indexOf(check)===0:q==="$="?value.substr(value.length-check.length)===check:q==="|="?value===check||value.substr(0,check.length+1)===check+"-":false},POS:function(a,b,i,c){var d=b[2],filter=o.setFilters[d];if(filter){return filter(a,i,b,c)}}}};var p=o.match.POS;for(var q in o.match){o.match[q]=new RegExp(o.match[q].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var r=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(e){r=function(a,b){var c=b||[];if(toString.call(a)==="[object Array]"){Array.prototype.push.apply(c,a)}else{if(typeof a.length==="number"){for(var i=0,l=a.length;i<l;i++){c.push(a[i])}}else{for(var i=0;a[i];i++){c.push(a[i])}}}return c}}var s;if(document.documentElement.compareDocumentPosition){s=function(a,b){var c=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(c===0){hasDuplicate=true}return c}}else if("sourceIndex"in document.documentElement){s=function(a,b){var c=a.sourceIndex-b.sourceIndex;if(c===0){hasDuplicate=true}return c}}else if(document.createRange){s=function(a,b){var c=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();c.selectNode(a);c.collapse(true);bRange.selectNode(b);bRange.collapse(true);var d=c.compareBoundaryPoints(Range.START_TO_END,bRange);if(d===0){hasDuplicate=true}return d}}(function(){var d=document.createElement("div"),id="script"+(new Date).getTime();d.innerHTML="<a name='"+id+"'/>";var e=document.documentElement;e.insertBefore(d,e.firstChild);if(!!document.getElementById(id)){o.find.ID=function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var m=b.getElementById(a[1]);return m?m.id===a[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===a[1]?[m]:undefined:[]}};o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}}e.removeChild(d);e=d=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var i=0;c[i];i++){if(c[i].nodeType===1){d.push(c[i])}}c=d}return c}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){o.attrHandle.href=function(a){return a.getAttribute("href",2)}}e=null})();if(document.querySelectorAll)(function(){var f=n,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return}n=function(a,b,c,d){b=b||document;if(!d&&b.nodeType===9&&!u(b)){try{return r(b.querySelectorAll(a),c)}catch(e){}}return f(a,b,c,d)};for(var g in f){n[g]=f[g]}div=null})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName)(function(){var d=document.createElement("div");d.innerHTML="<div class='test e'></div><div class='test'></div>";if(d.getElementsByClassName("e").length===0)return;d.lastChild.className="e";if(d.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS");o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c){return b.getElementsByClassName(a[1])}};d=null})();function dirNodeCheck(a,b,c,d,e,f){var g=a=="previousSibling"&&!f;for(var i=0,l=d.length;i<l;i++){var h=d[i];if(h){if(g&&h.nodeType===1){h.sizcache=c;h.sizset=i}h=h[a];var j=false;while(h){if(h.sizcache===c){j=d[h.sizset];break}if(h.nodeType===1&&!f){h.sizcache=c;h.sizset=i}if(h.nodeName===b){j=h;break}h=h[a]}d[i]=j}}}function dirCheck(a,b,c,d,e,f){var g=a=="previousSibling"&&!f;for(var i=0,l=d.length;i<l;i++){var h=d[i];if(h){if(g&&h.nodeType===1){h.sizcache=c;h.sizset=i}h=h[a];var j=false;while(h){if(h.sizcache===c){j=d[h.sizset];break}if(h.nodeType===1){if(!f){h.sizcache=c;h.sizset=i}if(typeof b!=="string"){if(h===b){j=true;break}}else if(n.filter(b,[h]).length>0){j=h;break}}h=h[a]}d[i]=j}}}var t=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};var u=function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&a.ownerDocument.documentElement.nodeName!=="HTML"};var v=function(a,b){var c=[],later="",match,root=b.nodeType?[b]:b;while((match=o.match.PSEUDO.exec(a))){later+=match[0];a=a.replace(o.match.PSEUDO,"")}a=o.relative[a]?a+"*":a;for(var i=0,l=root.length;i<l;i++){n(a,root[i],c)}return n.filter(later,c)};window.Sizzle=n})();

//-----[ phpjs ]-----

function isset(){var a=arguments,l=a.length,i=0;if(l===0){throw new Error('Empty isset');}while(i!==l){if(typeof(a[i])=='undefined'||a[i]===null){return false}else{i++}}return true}function empty(mixed_var){var key;if(mixed_var===""||mixed_var===0||mixed_var==="0"||mixed_var===null||mixed_var===false||mixed_var===undefined){return true}if(typeof mixed_var=='object'){for(key in mixed_var){return false}return true}return false}function is_object(mixed_var){if(mixed_var instanceof Array){return false}else{return(mixed_var!==null)&&(typeof(mixed_var)=='object')}}function in_array(needle,haystack,argStrict){var key='',strict=!!argStrict;if(strict){for(key in haystack){if(haystack[key]===needle){return true}}}else{for(key in haystack){if(haystack[key]==needle){return true}}}return false}function is_object(mixed_var){if(mixed_var instanceof Array){return false}else{return(mixed_var!==null)&&(typeof(mixed_var)=='object')}}function UrlVars(){var vars=[],hash;var hashes=window.location.href.slice(window.location.href.indexOf('?')+1).split('&');for(var i=0;i<hashes.length;i++){hash=hashes[i].split('=');vars.push(hash[0]);vars[hash[0]]=hash[1]}return vars}function base64_encode(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,enc="",tmp_arr=[];if(!data){return data}data=this.utf8_encode(data+'');do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&0x3f;h2=bits>>12&0x3f;h3=bits>>6&0x3f;h4=bits&0x3f;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4)}while(i<data.length);enc=tmp_arr.join('');switch(data.length%3){case 1:enc=enc.slice(0,-2)+'==';break;case 2:enc=enc.slice(0,-1)+'=';break}return enc}function utf8_encode(argString){var string=(argString+'').replace(/\r\n/g,"\n").replace(/\r/g,"\n");var utftext="";var start,end;var stringl=0;start=end=0;stringl=string.length;for(var n=0;n<stringl;n++){var c1=string.charCodeAt(n);var enc=null;if(c1<128){end++}else if(c1>127&&c1<2048){enc=String.fromCharCode((c1>>6)|192)+String.fromCharCode((c1&63)|128)}else{enc=String.fromCharCode((c1>>12)|224)+String.fromCharCode(((c1>>6)&63)|128)+String.fromCharCode((c1&63)|128)}if(enc!==null){if(end>start){utftext+=string.substring(start,end)}utftext+=enc;start=end=n+1}}if(end>start){utftext+=string.substring(start,string.length)}return utftext}

//-----[ domready ]-----

(function(){var d=window.DomReady={};var e=navigator.userAgent.toLowerCase();var f={version:(e.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(e),opera:/opera/.test(e),msie:(/msie/.test(e))&&(!/opera/.test(e)),mozilla:(/mozilla/.test(e))&&(!/(compatible|webkit)/.test(e))};var g=false;var h=false;var j=[];function domReady(){if(!h){h=true;if(j){for(var a=0;a<j.length;a++){j[a].call(window,[])}j=[]}}};function addLoadEvent(a){var b=window.onload;if(typeof window.onload!='function'){window.onload=a}else{window.onload=function(){if(b){b()}a()}}};function bindReady(){if(g){return}g=true;if(document.addEventListener&&!f.opera){document.addEventListener("DOMContentLoaded",domReady,false)}if(f.msie&&window==top)(function(){if(h)return;try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return}domReady()})();if(f.opera){document.addEventListener("DOMContentLoaded",function(){if(h)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return}domReady()},false)}if(f.safari){var c;(function(){if(h)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return}if(c===undefined){var a=document.getElementsByTagName("link");for(var i=0;i<a.length;i++){if(a[i].getAttribute('rel')=='stylesheet'){c++}}var b=document.getElementsByTagName("style");c+=b.length}if(document.styleSheets.length!=c){setTimeout(arguments.callee,0);return}domReady()})()}addLoadEvent(domReady)};d.ready=function(a,b){bindReady();if(h){a.call(window,[])}else{j.push(function(){return a.call(window,[])})}};bindReady()})();

//-----[ regioncms ]-----

DomReady.ready(function(){
	
	var oConfig = Sizzle('img[alt^="regioncms="]')[0];
	
	if (!empty(oConfig))
	{
		// settings 
		var sHttps = new String(document.location.href);
		var bHttps = sHttps.indexOf('https://');
		if (bHttps != -1) { var sSecure = 'yes'; } else { var sSecure = 'no'; }
		
		var sServer = 'http://regions.vw.ca/server.php';
		var sConfig = oConfig.alt;
		
		if (/page:legal/.test(sConfig) == true)
		{
			var aVars = UrlVars();
			
			if (!empty(aVars['offer']))
			{
				sConfig += ',offer:' + aVars['offer'];
			}
		}
		
		var sUrl = sServer + '?' + sConfig + '&secure=' + sSecure + '&callback=RegionCallback';
	
		// jsonp 
		var oHead = Sizzle('head')[0];
		var oScript = document.createElement('script');
			oScript.id = 'regioncms_jsonp';
			oScript.type = 'text/javascript';
			oScript.src = sUrl;
		
		oHead.appendChild(oScript);
		
		// callback 
		RegionCallback = window.RegionCallback = function(oResponse)
		{
			var bInjected = false;
			
			if (!empty(oResponse))
			{
				for (var iWork in oResponse)
				{
					var oZone = oResponse[iWork];
					
					// remove elements 
					if (!empty(oZone['remove']))
					{
						var oElements = Sizzle(oZone['remove']);
						
						if (!empty(oElements))
						{
							for (var iZone in oElements)
							{
								if (!empty(oElements[iZone]) && is_object(oElements[iZone]))
								{
									oElements[iZone].parentNode.removeChild(oElements[iZone]);
								}
							}
						}
					}
					
					// empty elements 
					if (!empty(oZone['empty']))
					{
						var oElements = Sizzle(oZone['empty']);
						
						if (!empty(oElements))
						{
							for (var iZone in oElements)
							{
								if (!empty(oElements[iZone]) && is_object(oElements[iZone]))
								{
									oElements[iZone].innerHTML = '';
								}
							}
						}
					}
					
					// layout modification 
					if (!empty(oZone['layout']))
					{
						var sHttps = new String(document.location.href);
						var bHttps = sHttps.indexOf('https://');
						
						if (oZone['layout'] == 'medium')
						{
							var oBody = Sizzle('body')[0];
							var oStage = Sizzle('div.row_stage_large')[0];
							var oSubNav = Sizzle('div.subnav_large')[0];
							var oContent = Sizzle('div.row_content_large')[0];
							
							if (!empty(oBody) && !empty(oStage) && !empty(oSubNav) && !empty(oContent))
							{
								if (bHttps != -1) 
								{
									oBody.setAttribute('background', '/amvwcms/vwcms_author/vwcms_virtualmaster/images/bg_medium.gif');
								}
								else
								{
									oBody.setAttribute('background', '/vwcms_virtualmaster/images/bg_medium.gif');
								}
								
								oStage.className = 'row_stage_medium';
								oSubNav.className = 'subnav_medium';
								oContent.className = 'row_content_medium';
							}
						}
						else if (oZone['layout'] == 'large')
						{
							var oBody = Sizzle('body')[0];
							var oStage = Sizzle('div.row_stage_medium')[0];
							var oSubNav = Sizzle('div.subnav_medium')[0];
							var oContent = Sizzle('div.row_content_medium')[0];
							
							if (!empty(oBody) && !empty(oStage) && !empty(oSubNav) && !empty(oContent))
							{
								if (bHttps != -1) 
								{
									oBody.setAttribute('background', '/amvwcms/vwcms_author/vwcms_virtualmaster/images/bg_large.gif');
								}
								else
								{
									oBody.setAttribute('background', '/vwcms_virtualmaster/images/bg_large.gif');
								}
								
								oStage.className = 'row_stage_large';
								oSubNav.className = 'subnav_large';
								oContent.className = 'row_content_large';
							}
						}
					}
					
					// inject elements 
					if (!empty(oZone['select']) && (!empty(oZone['append']) || !empty(oZone['overwrite'])))
					{
						var oParent = Sizzle(oZone['select'])[0];
						
						if (!empty(oParent))
						{
							if (!empty(oZone['append']))
							{
								var oElement = document.createElement('div');
									oElement.innerHTML = oZone['append'];
								
								oParent.appendChild(oElement);
								bInjected = true;
							}
							else if (!empty(oZone['overwrite'])) 
							{
								var oElement = document.createElement('div');
									oElement.innerHTML = oZone['overwrite'];
								
								oParent.innerHTML = '';
								oParent.appendChild(oElement);
								bInjected = true;
							}
						}
					}
				}
			}
			
			// remove place holder 
			var oConfig = Sizzle('img[alt^="regioncms="]')[0];
			
			if (bInjected == true && !empty(oConfig))
			{
				oConfig.parentNode.removeChild(oConfig);
			}
			
			// free memory 
			var oScript = Sizzle('#regioncms_jsonp')[0];
			var sUserAgent = navigator.userAgent.toLowerCase();
			
			if (!empty(oScript))
			{
				oScript.parentNode.removeChild(oScript);
			
				if (/msie/.test(sUserAgent) != true)
				{
					for (var aProperties in oScript) 
					{
						delete oScript[aProperties];
					}
				}
			}
		}
	}

});

//-----[ vars ]-----

var lightBoxVisibleId;
var lightBoxTopBarHeight = 17;
var lightBoxShadowSize = 3;
var ResizeTimer;
var ResizeCounter = 0;
var origHeight;
var lightBoxTrigger = false;
var onLoadCall = new Array();
var heightTrigger;
var widthTrigger;
var stopResize;
var windowResizeEvent;
var ResizeTimer;
var ResizeCounter;
var pageTracker;
var pageLoaded = false;
var localSwitch = true;
var gJSFile;
var GJS;
var swf_url;
var swf_container;
var min_flash_version;
var express_install;
var swf_flash_vars;
var swf_parameters;
var swf_attributes;
var pageHeight;

//-----[ analytics ]-----

var _gaq = _gaq || [];

DomReady.ready(function(){

	// elements 
	var oHead = Sizzle('head')[0];
	var oBody = Sizzle('body')[0];
	
	// google analytics 
	var oScript = document.createElement('script');
		oScript.async = true;
		oScript.type = 'text/javascript';
		oScript.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	
	(oHead || oBody).appendChild(oScript);

	// custom analytics 
	var oScript = document.createElement('script');
		oScript.type = 'text/javascript';
		oScript.src = 'http://regions.vw.ca/analytics.php';
	
	(oHead || oBody).appendChild(oScript);

});

// flash tracking 
function customFlashTrackPage(sUrl)
{
	try 
	{
		customAnalytics.flashTrackPage(sUrl);
	}
	catch(sError){}
}

function customFlashTrackEvent(sCategory, sAction, sLabel)
{
	try 
	{
		customAnalytics.flashTrackEvent(sCategory, sAction, sLabel);
	}
	catch(sError){}
}

//-----[ give dynamic name to buzzbox localConnection ]-----

var isDomReady = false;
var connectId;

DomReady.ready(function(){
	
	isDomReady = true;
	
});

function getDomReady()
{
	return isDomReady;
}

function setSWFConnectionName()
{
	var ms = (new Date ()).getUTCMilliseconds();
	var sec = (new Date()).getUTCSeconds();
	connectId = (sec + "_" + ms);
	sendToActionScript("coreLoader");
	setTimeout('sendToActionScript("menuLoader") ', 750 );
}

function thisMovie(movieName) 
{
	if (navigator.appName.indexOf("Microsoft") != -1)
	{
		return window[movieName];
	}
	else
	{
		return document[movieName];
	}
}

function sendToActionScript(swfObjName) 
{
	thisMovie(swfObjName).sendToActionScript(connectId);
}

//-----[ onload ]-----

function on_load(){
	document.body.style.height = '100%';
	document.body.style.margin = '0';
	pageLoaded = true;
	var passArray = new Array();
	
	if (onLoadCall) {
		for (i = 0; i < onLoadCall.length; i++) {
			this[onLoadCall[i][0][0]](onLoadCall[i][1]);
		}
	}
}

//-----[ swf ]-----

function swf(url, container, swfWidth, swfHeight, flashVars, parameters, attributes){
	if (!pageLoaded) {
		onLoadCall[onLoadCall.length] = new Array(new Array(), new Array());
		onLoadCall[onLoadCall.length - 1][0][0] = "loadSwf";
		onLoadCall[onLoadCall.length - 1][1][0] = url;
		onLoadCall[onLoadCall.length - 1][1][1] = container;
		onLoadCall[onLoadCall.length - 1][1][2] = swfWidth;
		onLoadCall[onLoadCall.length - 1][1][3] = swfHeight;
		onLoadCall[onLoadCall.length - 1][1][4] = flashVars;
		onLoadCall[onLoadCall.length - 1][1][5] = parameters;
		onLoadCall[onLoadCall.length - 1][1][6] = attributes;
	}
	else {
		loadSwf(new Array(url, container, swfWidth, swfHeight, flashVars, parameters, attributes));
	}
}

function loadSwf(varsArray){
	minFlashVersion = "9.0.115";
	expressInstall = "expressInstall.swf";
	
	swfobject.embedSWF(varsArray[0], varsArray[1], varsArray[2], varsArray[3], minFlashVersion, expressInstall, varsArray[4], varsArray[5], varsArray[6]);
	document.getElementById(varsArray[1]).style.outline = "none";
}

//-----[ inject id ]-----

function injectId(newId, target, targetNum, targetType){
	if (!pageLoaded) {
		onLoadCall[onLoadCall.length] = new Array(new Array(), new Array());
		onLoadCall[onLoadCall.length - 1][0][0] = "loadInjectId";
		onLoadCall[onLoadCall.length - 1][1][0] = newId;
		onLoadCall[onLoadCall.length - 1][1][1] = target;
		onLoadCall[onLoadCall.length - 1][1][2] = targetNum;
		onLoadCall[onLoadCall.length - 1][1][3] = targetType;
	}
	else {
		loadInjectId(new Array(newId, target, targetNum));
	}
}

function loadInjectId(varsArray){
	if (varsArray[3] == "name") {
		document.getElementsByName(varsArray[1])[varsArray[2]].id = varsArray[0];
	}
	else {
		getElementsByClassName(varsArray[1])[varsArray[2]].id = varsArray[0];
	}
}

//-----[ light box ]-----

var lightBoxId = new Array();

var client = {
	getPage: function(){
		var pageWidth = 720;
		var pageHeight = 576;
		var scrollArr = this.getScroll();
		var winArr = this.getWindow();
		pageWidth = winArr.width + scrollArr.left;
		pageHeight = winArr.height + scrollArr.top;
		return {
			scrollX: scrollArr.left,
			scrollY: scrollArr.top,
			winW: winArr.width,
			winH: winArr.height,
			pageW: pageWidth,
			pageY: pageHeight
		};
	},
	getScroll: function(){
		return {
			left: this.scrollLeft(),
			top: this.scrollTop()
		};
	},
	getWindow: function(){
		return {
			width: this.windowWidth(),
			height: this.windowHeight()
		};
	},
	scrollLeft: function(){
		var xScroll = 0;
		if (self.pageXOffset) xScroll = self.pageXOffset;
		else if (document.documentElement && document.documentElement.scrollLeft) xScroll = document.documentElement.scrollLeft;
		else if (document.body) xScroll = document.body.scrollLeft;
		return xScroll;
	},
	scrollTop: function(){
		var yScroll = 0;
		if (self.pageYOffset) yScroll = self.pageYOffset;
		else if (document.documentElement && document.documentElement.scrollTop) yScroll = document.documentElement.scrollTop;
		else if (document.body) yScroll = document.body.scrollTop;
		return yScroll;
	},
	windowWidth: function(){
		var xWin = 720;
		if (self.innerHeight) xWin = self.innerWidth;
		else if (document.documentElement && document.documentElement.clientWidth) xWin = document.documentElement.clientWidth;
		else if (document.body) xWin = document.body.clientWidth;
		return xWin;
	},
	windowHeight: function(){
		var yWin = 576;
		if (self.innerHeight) yWin = self.innerHeight;
		else if (document.documentElement && document.documentElement.clientHeight) yWin = document.documentElement.clientHeight;
		else if (document.body) yWin = document.body.clientHeight;
		return yWin;
	}
};

//-----[ google analytics ]-----

function google_analytics(){
	
	// DOES NOT REMOVE THE COMMENTS 
	
	/*
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
	
	if (!pageLoaded) {
		onLoadCall[onLoadCall.length] = new Array(new Array(), new Array());
		onLoadCall[onLoadCall.length - 1][0][0] = "loadGoogleAnalytics";
	}
	else {
		loadGoogleAnalytics();
	}
	*/
}

function loadGoogleAnalytics(){
	
	// DOES NOT REMOVE THE COMMENTS 
	
	/*
	try {
		pageTracker = _gat._getTracker("UA-9152678-1");
	} 
	catch (err) {
	}
	*/
}

//-----[ link ]-----

function get_url(href, target, tracking){
	target = target ? target : '_self';
	if (tracking != false && pageTracker) {
		pageTracker._trackPageview(href, target);
		window.open(href, target);
	}
	else {
		window.open(href, target);
	}
}

function track_event(tags, href, target){
	target = target ? target : '_self';
	
	if (pageTracker) {
		var tagString = '';
		for (var i = 0; i < tags.length && i <= 2; i++) {
			if (i > 0) {
				tagString += ',';
			}
			tagString += tags[i];
		}
		
		if (href) {
			while (i <= 2) {
				if (i > 0) {
					tagString += ',""';
				}
				tagString += tags[i];
				i++;
			}
			pageTracker._trackEvent(tagString, get_url(href, target));
		}
		else {
			pageTracker._trackEvent(tagString);
		}
	}
}


//-----[ golf 6 ]-----

function removeBottomBorder(target, targetNum, styleData){
	if (!pageLoaded) {
		onLoadCall[onLoadCall.length] = new Array(new Array(), new Array());
		onLoadCall[onLoadCall.length - 1][0][0] = "loadBottomBorder";
		onLoadCall[onLoadCall.length - 1][1][0] = target;
		onLoadCall[onLoadCall.length - 1][1][1] = targetNum;
		onLoadCall[onLoadCall.length - 1][1][2] = styleData;
	}
	else {
		loadBottomBorder(new Array(target, targetNum, styleData));
	}
}

function loadBottomBorder(varsArray){
	getElementsByClassName(varsArray[0])[varsArray[1]].style.borderBottom = varsArray[2];
}

//-----[ pop up ]-----

function pop_up(url, width, height, name){
	name = name ? name : 'popup';
	popup_window = window.open(url, name, 'height=' + height, 'width=' + width);
	if (window.focus) {
		popup_window.focus()
	}
	return false;
}

//-----[ light box ]-----

function lightBox(id, url, newWidth, newHeight, showLightBox){
	var i = 0;
	
	if (!lightBoxId[0]) {
		document.write('</div>');
		document.write('</div>');
		document.write('</div>');
		document.write('<div id="lightBox" style="display:none; z-index:200; position:absolute; width:100%; height:0; top:0; left:0;">');
		document.write(' <div id="lightBoxBg" style="cursor:pointer; width:100%; height:100%; background-color:#000000; opacity:.45; filter: alpha(opacity=45);"></div>');
		document.write('</div>');
	}
	
	if (id) {
		while (id != lightBoxId[i] && i < lightBoxId.length) {
			i++;
		}
	}
	else {
		id = lightBoxId[0];
	}
	
	if (lightBoxId.length < i + 1) {
		lightBoxId[lightBoxId.length] = id;
		
		var lightBoxShadowHeight = newHeight - lightBoxShadowSize;
		var lightBoxCenterWidth = newWidth + lightBoxShadowSize;
		
		document.write('<div id="lightBox' + id + '" style="z-index:201; display:none; width:' + lightBoxCenterWidth + 'px; position:absolute; left:0; top:0;">');
		document.write(' <div id="lightBox' + id + 'TopBar" style="overflow:hidden; float:left; height:' + newHeight + 'px; width:' + newWidth + 'px;">');
		document.write('  <div style="height:' + lightBoxTopBarHeight + 'px; position:relative; background-color:#5a5a5a;">');
		document.write('   <div id="lightBoxClose' + id + '" onClick="hideElement();" style="cursor:pointer; position:absolute; right:0;">');
		document.write('    <img style="border:none; margin:4px 5px 0 5px; width:10px; height:11px;" src="http://www.vw.ca/etc/medialib/vwcms/virtualmaster/en_ca/img/light_box.Par.0001.Image.jpg" />');
		document.write('   </div>');
		document.write('  </div>');
		document.write('  <div id="lightBox' + id + 'Center" style="overflow:hidden; height:100%; background-color:#ffffff;">');
		document.write('   <iframe id="lightBox' + id + 'IFrame" frameborder="no" style="overflow:hidden; width:100%; height:100%; border:none;" src="' + url + '"></iframe>');
		document.write('  </div>');
		document.write(' </div>');
		document.write(' <div id="lightBox' + id + 'ShadowRight" style="float:left; width:' + lightBoxShadowSize + 'px; top:' + lightBoxShadowSize + 'px; position:relative; height:' + lightBoxShadowHeight + 'px; background-color:#000000; opacity:.1; filter: alpha(opacity=10);overflow:hidden;"></div>');
		document.write(' <div id="lightBox' + id + 'ShadowBottom" style="float:left; height:' + lightBoxShadowSize + 'px; font-size:0; left:' + lightBoxShadowSize + 'px; position:relative; width:' + newWidth + 'px; background-color:#000000; opacity:.1; filter: alpha(opacity=10); overflow:hidden;"></div>');
		document.write('</div>');
	}
	else if (url) {
		document.getElementById("lightBox" + id + "IFrame").src = url;
		
		if (newWidth) {
			var lightBoxCenterWidth = newWidth + lightBoxShadowSize;
			document.getElementById("lightBox" + id + "Center").style.width = lightBoxCenterWidth + 'px';
			document.getElementById("lightBox" + id + "TopBar").style.width = newWidth + 'px';
		}
		
		if (newHeight) {
			var lightBoxShadowHeight = newHeight - lightBoxShadowSize;
			document.getElementById("lightBox" + id + "TopBar").style.height = newHeight + 'px';
		}
		
		if (showLightBox != false) {
			showElement(id);
		}
	}
	else {
		if (lightBoxTrigger) {
			hideElement();
		}
		else {
			showElement(id);
		}
	}
	
	if (!pageLoaded) {
		onLoadCall[onLoadCall.length] = new Array(new Array(), new Array());
		onLoadCall[onLoadCall.length - 1][0][0] = "loadLightBox";
	}
	else {
		loadLightBox();
	}
}

function light_box(id, url, newWidth, newHeight, showLightBox){
	var i = 0;
	
	if (!lightBoxId[0]) {
		document.write('</div>');
		document.write('</div>');
		document.write('</div>');
		document.write('<div id="lightBox" style="display:none; z-index:200; position:absolute; width:100%; height:0; top:0; left:0;">');
		document.write(' <div id="lightBoxBg" style="cursor:pointer; width:100%; height:100%; background-color:#000000; opacity:.45; filter: alpha(opacity=45);"></div>');
		document.write('</div>');
	}
	
	if (id) {
		while (id != lightBoxId[i] && i < lightBoxId.length) {
			i++;
		}
	}
	else {
		id = lightBoxId[0];
	}
	
	if (lightBoxId.length < i + 1) {
		lightBoxId[lightBoxId.length] = id;
		
		var lightBoxShadowHeight = newHeight - lightBoxShadowSize;
		var lightBoxCenterWidth = newWidth + lightBoxShadowSize;
		
		document.write('<div id="lightBox' + id + '" style="z-index:201; display:none; width:' + lightBoxCenterWidth + 'px; position:absolute; left:0; top:0;">');
		document.write(' <div id="lightBox' + id + 'TopBar" style="overflow:hidden; float:left; height:' + newHeight + 'px; width:' + newWidth + 'px;">');
		document.write('  <div style="height:' + lightBoxTopBarHeight + 'px; position:relative; background-color:#5a5a5a;">');
		document.write('   <div id="lightBoxClose' + id + '" onClick="hideElement();" style="cursor:pointer; position:absolute; right:0;">');
		document.write('    <img style="border:none; margin:4px 5px 0 5px; width:10px; height:11px;" src="http://www.vw.ca/etc/medialib/vwcms/virtualmaster/en_ca/img/light_box.Par.0001.Image.jpg" />');
		document.write('   </div>');
		document.write('  </div>');
		document.write('  <div id="lightBox' + id + 'Center" style="overflow:hidden; height:100%; background-color:#ffffff;">');
		document.write('   <iframe id="lightBox' + id + 'IFrame" frameborder="no" style="overflow:hidden; width:100%; height:100%; border:none;" src="' + url + '"></iframe>');
		document.write('  </div>');
		document.write(' </div>');
		document.write(' <div id="lightBox' + id + 'ShadowRight" style="float:left; width:' + lightBoxShadowSize + 'px; top:' + lightBoxShadowSize + 'px; position:relative; height:' + lightBoxShadowHeight + 'px; background-color:#000000; opacity:.1; filter: alpha(opacity=10);"></div>');
		document.write(' <div id="lightBox' + id + 'ShadowBottom" style="float:left; height:' + lightBoxShadowSize + 'px; font-size:0; left:' + lightBoxShadowSize + 'px; position:relative; width:' + newWidth + 'px; background-color:#000000; opacity:.1; filter: alpha(opacity=10);"></div>');
		document.write('</div>');
	}
	else if (url) {
		document.getElementById("lightBox" + id + "IFrame").src = url;
		
		if (newWidth) {
			var lightBoxCenterWidth = newWidth + lightBoxShadowSize;
			document.getElementById("lightBox" + id + "Center").style.width = lightBoxCenterWidth + 'px';
			document.getElementById("lightBox" + id + "TopBar").style.width = newWidth + 'px';
		}
		
		if (newHeight) {
			var lightBoxShadowHeight = newHeight - lightBoxShadowSize;
			document.getElementById("lightBox" + id + "TopBar").style.height = newHeight + 'px';
		}
		
		if (showLightBox != false) {
			showElement(id);
		}
	}
	else {
		if (lightBoxTrigger) {
			hideElement();
		}
		else {
			showElement(id);
		}
	}
	
	if (!pageLoaded) {
		onLoadCall[onLoadCall.length] = new Array(new Array(), new Array());
		onLoadCall[onLoadCall.length - 1][0][0] = "loadLightBox";
		
	}
	else {
		loadLightBox();
	}
}

function trigger_light_box(){
	light_box();
}

function triggerLightBox(){
	light_box();
}

function loadLightBox(){
	lightBoxTrigger = false;
	centerElement();
	
	addEvent(document.getElementById('lightBoxBg'), 'click', hideElement);
}

function hideElement(){
	remove_window_resize_event();
	document.getElementById("lightBox").style.display = "none";
	document.getElementById("lightBox" + lightBoxVisibleId).style.display = "none";
	
	lightBoxTrigger = false;
}

function showElement(id){
	get_url("#");
	add_window_resize_event();
	document.getElementById("lightBox").style.display = "inline";
	document.getElementById("lightBox" + id).style.display = "inline";
	lightBoxVisibleId = id;
	lightBoxTrigger = true;
	centerElement();
}

function centerElement(id){
	if (!id && lightBoxVisibleId) {
		id = lightBoxVisibleId;
	}
	else if (!id) {
		id = lightBoxId[0];
	}
	
	if (window.innerHeight && window.scrollMaxY) {
		pageHeight = window.innerHeight + window.scrollMaxY;
	}
	else if (document.body.scrollHeight > document.body.offsetHeight) {
		pageHeight = document.body.scrollHeight;
	}
	else {
		pageHeight = document.body.offsetHeight + document.body.offsetTop;
	}
	
	if (pageHeight > client.windowHeight()) {
		origHeight = pageHeight + "px";
	}
	else {
		origHeight = "100%";
	}
	
	var offsetLeft = centerObjectLeft(document.getElementById("lightBoxBg").offsetWidth, document.getElementById("lightBox" + id));
	var offsetTop = centerObjectTop(client.getPage().pageY, document.getElementById("lightBox" + id));
	
	document.getElementById("lightBox").style.height = origHeight;
	document.getElementById("lightBox").style.overflow = 'hidden';
	document.getElementById("lightBox" + id).style.left = offsetLeft;
	document.getElementById("lightBox" + id).style.top = offsetTop;
}

function centerObjectLeft(newWidth, element){
	var elementWidth = element ? element.offsetWidth : 0;
	return String(Math.round((newWidth - elementWidth) / 2) + "px");
}

function centerObjectTop(newHeight, element){
	var elementHeight = element ? element.offsetHeight : 0;
	return String(Math.round((newHeight - elementHeight) / 2) + "px");
}

//-----[ iperceptions]-----

function iperceptions(lang){
	if (lang == "fr") {
		localSwitch = true;
		gJSFile = "http://group11.iperceptions.com/Invitations/Javascripts/Layer_540.js";
	}
	else {
		localSwitch = false;
		gJSFile = "http://ipinvite.iperceptions.com/Invitations/Javascripts/Layer_540.js";
	}
	
	if (localSwitch) {
		GJS = "http://ipinvite.iperceptions.com/Invitations/Javascripts/Layer_Global.js";
		lScript(GJS);
	}
	
	if (!pageLoaded) {
		onLoadCall[onLoadCall.length] = new Array(new Array(), new Array());
		onLoadCall[onLoadCall.length - 1][0][0] = "load_iperceptions";
	}
	else {
		load_iperceptions();
	}
}

function lScript(file){
	var script = document.createElement('script');
	script.type = 'text/javascript';
	script.src = file;
	if (typeof(script.onreadystatechange) == 'undefined') {
		script.onload = function(){
			this.onload = null;
		};
	}
	else {
		script.onreadystatechange = function(){
			if (this.readyState != 'loaded' && this.readyState != 'complete') return;
			this.onreadystatechange = null;
		};
	}
	
	document.getElementsByTagName('head')[0].appendChild(script);
}

function CC(name, value, days){
	if (days) {
		var expDate = new Date();
		expDate.setTime(expDate.getTime() + (days * 24 * 60 * 60 * 1000));
		var expires = "; expires=" + expDate.toUTCString();
	}
	else var expires = "";
	document.cookie = name + "=" + value + expires + "; path=/";
}

function RC(NameOfCookie){
	if (document.cookie.length > 0) {
		begin = document.cookie.indexOf(NameOfCookie + "=");
		if (begin != -1) {
			begin += NameOfCookie.length + 1;
			end = document.cookie.indexOf(";", begin);
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end));
		}
	}
	return null;
}

function EC(name){
	CC(name, "", -1);
}

function load_iperceptions(){
	var sCName = "IPERCEPTIONS_540";
	var sCVal = "IPERCEPTIONS_540_COOKIE";
	var sCValRet;
	var tCVName = "IPERCEPTIONS_TEST";
	var tCVVal = "IPERCEPTIONS_TEST_COOKIE";
	var tCVValRet;
	CC(tCVName, tCVVal, 1);
	tCVValRet = RC(tCVName);
	sCValRet = RC(sCName);
	EC(tCVName);
	var rndNum = Math.floor((Math.random() * 100));
	
	if (rndNum < 100 && tCVValRet != null && sCValRet == null) {
		CC(sCName, sCVal, 90);
		lScript(gJSFile);
	}
}

//-----[ window resize event ]-----

function add_window_resize_event(){
	if (!windowResizeEvent) {
		addEvent(window, 'resize', on_window_resize);
		windowResizeEvent = true;
	}
}

function remove_window_resize_event(){
	if (windowResizeEvent) {
		removeEvent(window, 'resize', on_window_resize);
		windowResizeEvent = false;
	}
}

function on_window_resize(){
	stopResize = false;
	if (!ResizeCounter || ResizeCounter == 0) {
		start_resize_timer();
	}
	ResizeCounter = 0;
}

function start_resize_timer(){
	if (!stopResize) {
		centerElement();
		
		if (ResizeCounter < 200) {
			ResizeCounter++;
		}
		else {
			stop_resize_timer();
		}
		
		clearTimeout(ResizeTimer);
		ResizeTimer = setTimeout(start_resize_timer, 10);
	}
}

function stop_resize_timer(){
	stopResize = true;
	
	centerElement();
	
	clearTimeout(ResizeTimer);
	ResizeCounter = null;
}

//-----[ events ]-----

function addEvent(obj, evType, fn){
	if (obj.addEventListener) {
		obj.addEventListener(evType, fn, false);
		return true;
	}
	else if (obj.attachEvent) {
		var r = obj.attachEvent("on" + evType, fn);
		return r;
	}
	else { return false; }
}

function removeEvent(obj, evType, fn){
	if (obj.removeEventListener) {
		obj.removeEventListener(evType, fn, false);
		return true;
	}
	else if (obj.detachEvent) {
		obj.detachEvent("on" + evType, fn);
		return true;
	}
	else { return false; }
}

//-----[ get elements ]-----

function walkTheDOM(node, func){
	func(node);
	node = node.firstChild;
	while (node) {
		walkTheDOM(node, func);
		node = node.nextSibling;
	}
}

function getElementsByClassName(className){
	var results = [];
	walkTheDOM(document.body, function(node){
		var a, c = node.className, i;
		if (c) {
			a = c.split(' ');
			for (i = 0; i < a.length; i++) {
				if (a[i] === className) {
					results.push(node);
					break;
				}
			}
		}
	});
	return results;
}

//-----[ gallery popup ]-----

var galleryWin = undefined;
var _imageURL = '';

var url_arr = location.href.split('/');
var libPath = url_arr[0] + '/' + url_arr[1] + '/' + url_arr[2] + '/' + url_arr[3];

function makePopup(imageURL){
	_imageURL = imageURL;
	if (typeof(galleryWin) == 'undefined') {
		openPopup(_imageURL);
	}
	else {
		if (galleryWin.closed) {
			openPopup(_imageURL);
		}
		else {
			if (_imageURL.indexOf('.jpg') != -1 || _imageURL.indexOf('.gif') != -1) {
				galleryWin.document.popupSRC.src = _imageURL;
				resizePopup();
			}
			else {
				openPopup();
			}
		}
	}
}

function openPopup(){
	galleryWin = window.open(_imageURL, "galleryWin", "width=660,height=440,menubar=no,locationbar=no,statusbar=no,status=no,toolbar=no,scrollbars=no,resizable=yes");
	galleryWin.document.write('<html><title>Volkswagen - Galerie</title>' +
	'<body style="margin:10px;">');
	if (_imageURL.indexOf('.swf') != -1) {
		galleryWin.document.write('<div style="margin:0px; text-align:center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="popupSRC" align="middle">' +
		'<param name="allowScriptAccess" value="always" />' +
		'<param name="movie" value="' +
		_imageURL +
		'" />' +
		'<param name="quality" value="high" />' +
		'<embed src="' +
		_imageURL +
		'" quality="high" name="popupSRC" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
		'</object></div>');
	}
	else if (_imageURL.indexOf('.mov') != -1) {
		galleryWin.document.write('<div style="margin:0px; text-align:center;"><object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" viewastext id="popupSRC">' +
		'<param name="src" value="' +
		_imageURL +
		'">' +
		'<param name="controller" value="true">' +
		'<param name="pluginspage" value="http://www.apple.com/quicktime/download/indext.html">' +
		'<embed controller="true" src="' +
		_imageURL +
		'" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html" name="popupSRC" LOOP="TRUE" AUTOPLAY="TRUE"></embed>' +
		'</object></div>');
	}
	else {
		galleryWin.document.write('<div style="margin:0px; text-align:center;"><img name="popupSRC" src="' + _imageURL + '" border="0" alt="">');
		
	}
	
	galleryWin.document.write('<div style="margin:0px; margin-top:10px; text-align:right;"><a href="javascript:self.close();"><img name="closeBtn" src="' + libPath + '/etc/medialib/vwcms/virtualmaster/english_master/models/common/webspecial.Par.0003.Image.gif" border="0" alt="Close" width="58" height="15"></a></div>');
	
	galleryWin.document.write('</div></body>' +
	'</html>');
	
	resizePopup();
}

function resizePopup(){
	if (_imageURL.indexOf('.jpg') != -1 || _imageURL.indexOf('.gif') != -1) {
		if (typeof(galleryWin.document.popupSRC.width) != 'number' || galleryWin.document.popupSRC.width < 200) {
			setTimeout("resizePopup()", 1000);
		}
		else {
			width = galleryWin.document.popupSRC.width + 30;
			height = galleryWin.document.popupSRC.height + 115;
			if (navigator.appName.indexOf('Netscape') != -1) {
				height -= 38;
			}
			galleryWin.resizeTo(width, height);
		}
	}
	galleryWin.focus();
}

//-----[ init ]-----

function init(){
	// quit if this function has already been called
	if (arguments.callee.done) return;
	
	// flag this function so we don't do the same thing twice
	arguments.callee.done = true;
	
	// kill the timer
	if (_timer) clearInterval(_timer);
	
	// do stuff
	on_load();
};

/* for Mozilla/Opera9 */
if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", init, false);
}

// for Internet Explorer (using conditional comments)
/*@cc_on @*/
/*@if (@_win32)
 document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
 var script = document.getElementById("__ie_onload");
 script.onreadystatechange = function() {
 if (this.readyState == "complete") {
 init(); // call the onload handler
 }
 };
 /*@end @*/
/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
	var _timer = setInterval(function(){
		if (/loaded|complete/.test(document.readyState)) {
			init(); // call the onload handler
		}
	}, 10);
}

/* for other browsers */
window.onload = init;