var _POPUP_FEATURES="toolbar=0, location=0, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=550, height=425";
var _CHAT_FEATURES="toolbar=0, location=0, directories=no, status=yes, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=678, height="+(screen.availHeight*0.8);
var _QUICK_FEATURES="toolbar=0, location=0, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, width=400, height="+(screen.availHeight*0.8);
var ndgnull;
var ndgEmptyFunc=function(){
};
function addClass(c,el){
if(typeof (el)==="string"){
el=document.getElementById(el);
}
if(!hasClass(c,el)){
el.className+=" "+c;
}
el=null;
}
function approveAndJump(_3,_4,_5,_6,_7,_8,_9,_a,_b,_c){
_b=_b||"frmComment";
_c=_c||_b;
ndg.setJumpId(_b,_c);
return approveItem(_3,_4,_5,_6,_7,_8,_9,function(_d,_e,_f,_10,_11){
var el=document.getElementById(_d).getElementsByTagName("a")[0];
if(!el){
return;
}
el.href=_a;
el=null;
});
}
function approveItem(obj,_14,_15,_16,_17,_18,_19,_1a){
if(ndg.dom){
if(!_19){
_19="images/icons/indicator_dark.gif";
}
if(typeof (_18)==="string"){
var img=document.createElement("img");
img.src=media_path+_19;
img.alt="Busy...";
document.getElementById(_18).appendChild(img);
img=null;
}else{
if(_18){
_18.fetching=true;
_18.updateStatus();
}
}
var _1c=ndg.fetch(obj.href,{onComplete:approveSuccess(_14,_15,_16,_17,_18,_1a)});
_18=null;
return false;
}
return true;
}
function approveSuccess(_1d,_1e,_1f,_20,_21,_22){
function inner(){
var _23=eval("("+this.transport.getResponseHeader("X-JSON")+")");
var _24=document.getElementById(_1f),_25=null;
document.getElementById(_1d).innerHTML=this.transport.responseText;
_24.className=!ndg.empty(_23.msgType)&&_23.msgType==="error"?"errorBlock":"successBlock";
_24.innerHTML=_23.msg;
document.getElementById(_1e).style.display="none";
ndg.setFocus(_20);
if(typeof (_21)==="string"){
_25=document.getElementById(_21);
_25.removeChild(_25.childNodes[0]);
}else{
if(_21){
_21.fetching=false;
_21.updateStatus();
}
}
if(typeof (_22)=="function"){
_22(_1d,_1e,_1f,_20,_21);
}
}
return inner;
}
function checkAllByClassName(_26){
allNodes=document.getElementsByClassName(_26);
for(i=0;i<allNodes.length;i++){
allNodes[i].checked=true;
}
}
function CommentForm(url,_28,_29,_2a){
this.url=url;
this.form=document.getElementById(_28);
this.msgId=_29;
this.form.onsubmit=this.GetEvent("form_onsubmit",this);
this.waitingSrc=!_2a?"/images/icons/indicator_light.gif":_2a;
this.xhr=null;
}
CommentForm.prototype={isSupported:!!document.getElementById,lang:{errorMsgComment:"Please enter a comment.",errorMsgPortal:"Please check where this comment should display: cars, bikes, boats and/or planes.",waiting:"Posting your comment, please wait... {$image}"},AddPreview:function(_2b,url,_2d){
this.form.elements[_2b].onclick=this.GetEvent("preview_onclick",this);
this.previewInfo={url:url,commentField:_2d};
},AddSuccess:function(xhr){
var _2f=getJson(xhr);
if(_2f&&_2f.status=="OK"){
ndg.showMessage(_2f.msg,_2f.status.toLowerCase(),this.msgId);
this.form.elements.comment.value="";
}
},GetEvent:function(_30,_31){
var fn;
switch(_30){
case "ajax_callback":
fn=function(xhr){
var _34="";
if(ndg.ajaxType()=="mootools"){
xhr=this.transport;
}
_31.AddSuccess(xhr);
};
break;
case "form_onsubmit":
fn=function(){
_31.Send();
return false;
};
break;
case "preview_onclick":
fn=function(){
if(!_31.Validate()){
return;
}
preview.send(_31.previewInfo.url,_31.form.id,_31.msgId,_31.form.elements[_31.previewInfo.commentField].id,null,null,_31.waitingSrc);
};
break;
default:
fn=function(){
};
break;
}
return fn;
},IsChecked:function(_35){
var _36=false;
if(typeof (_35.checked)=="boolean"){
_36=_35.checked;
}else{
if(typeof (_35.length)=="number"){
var i=0;
var el;
while(el=_35[i++]){
if(el.checked){
_36=true;
break;
}
}
}
}
return _36;
},Send:function(){
if(!this.isSupported||!this.Validate()){
return;
}
ndg.showMessage(this.lang.waiting.replace("{$image}",showImage(this.waitingSrc,["alt",""])),"normal",this.msgId);
this.xhr=ndg.fetch(this.url,{onComplete:this.GetEvent("ajax_callback",this),parameters:serializeForm(this.form)});
},Validate:function(){
var _39="";
if(this.form.elements.comment.value==""){
_39=this.lang.errorMsgComment;
ndg.setFocus(this.form.elements.comment);
}else{
if(this.form.elements["portal[]"]&&!this.IsChecked(this.form.elements["portal[]"])){
_39=this.lang.errorMsgPortal;
}
}
if(_39!=""){
ndg.showMessage(_39,"error",this.msgId);
return false;
}else{
ndg.showMessage("","normal",this.msgId);
document.getElementById(this.msgId).style.display="none";
return true;
}
}};
var ControlForm={isIE:window.ActiveXObject&&document.all&&document.selection?true:false,isSupported:document.createElement&&document.createTextNode&&document.appendChild?true:false,KEY_CODES:{ENTER:13},BindSubmit:function(_3a,_3b,_3c,e){
if(!this.isSupported){
return;
}
if(!e){
var e=window.event;
}
if(e.keyCode==this.KEY_CODES.ENTER){
this.SetValue(_3a,_3b,_3c);
}
_3a=null;
},CreateHiddenField:function(_3e,_3f){
if(!this.isSupported||!!_3e.elements[_3f]){
return;
}
var _40;
if(this.isIE){
_40=document.createElement("<input name="+_3f+">");
}else{
_40=document.createElement("input");
_40.name=_3f;
}
_40.type="hidden";
_3e.appendChild(_40);
_3e=_40=null;
},SetValue:function(_41,_42,_43){
if(!this.isSupported){
return;
}
if(!_41.elements[_42]){
this.CreateHiddenField(_41,_42);
}
_41.elements[_42].value=_43;
_41=null;
},SetValueConfirm:function(msg,_45,_46,_47){
if(!this.isSupported){
return;
}
var r=confirm(msg);
if(r){
this.SetValue(_45,_46,_47);
}
return r;
}};
var Cookie={enabled:function(){
return navigator.cookieEnabled?true:false;
},remove:function(_49){
this.write(_49,"",-1);
},read:function(_4a){
var _4b=_4a+"=",ca=document.cookie.split(";");
var c=null;
for(var i=0;i<ca.length;i++){
c=ca[i];
while(c.charAt(0)==" "){
c=c.substring(1,c.length);
}
if(c.indexOf(_4b)==0){
return c.substring(_4b.length,c.length);
}
}
return null;
},write:function(_4f,_50,_51){
if(_51){
var _52=new Date();
_52.setTime(_52.getTime()+(_51*24*60*60*1000));
var _53="; expires="+_52.toGMTString();
}else{
var _53="";
}
document.cookie=_4f+"="+_50+_53+"; path=/";
}};
document.getElementsByClassName=function(c,t){
var _56=[],_57=[];
if(ndg.empty(t)){
t="*";
}
if(document.getElementsByTagName){
_57=document.getElementsByTagName(t);
for(var i=0,end=_57.length;i<end;i++){
if(_57[i].className==c){
_56[_56.length]=_57[i];
}
}
}
return _56;
};
function Events(){
this.fn=[];
this.fnIds=[];
this.n=0;
}
Events.prototype={add:function(fn,_5b){
if(typeof (fn)==="function"&&this.fn.splice){
this.fn[this.n]=fn;
this.fnIds[this.n]=_5b?_5b:"fn_"+this.n;
this.n++;
return this.n-1;
}
return -1;
},execute:function(){
if(this.fn.length>0){
for(var i=0,end=this.fn.length;i<end;i++){
this.fn[i]();
}
}
},remove:function(_5e){
if(this.fn.splice){
var _5f=typeof (_5e)==="string"?get_index(_5e,this.fnIds):_5e;
if(_5f>-1){
this.fn.splice(_5f,1);
this.fnIds.splice(_5f,1);
}
}
}};
function get_index(_60,_61){
for(var i=0,end=_61.length;i<end;i++){
if(_61[i]==_60){
return i;
}
}
return -1;
}
function getClasses(el){
if(typeof (el)==="string"){
el=document.getElementById(el);
}
var _65=el.className.split(" ");
el=null;
return _65;
}
function getIndex(_66,_67){
return get_index(_66,_67);
}
function getJson(xhr,_69){
if(!xhr){
return null;
}
var _6a=null;
var _6b="";
switch(typeof (xhr)){
case "object":
_6b=(!_69)?xhr.getResponseHeader("X-JSON"):xhr.responseText;
break;
case "string":
_6b=xhr;
break;
}
try{
_6a=eval("("+_6b+")");
}
catch(e){
}
return _6a;
}
function getSelectedRadio(els){
for(var i=0,end=els.length;i<end;i++){
if(els[i].checked){
return els[i];
}
}
return null;
}
function getSelectedRadioId(_6f,_70){
if(typeof (_70)=="string"){
_70=document.getElementById(_70);
}
var _71=getSelectedRadio(_70.elements[_6f]);
return _71.id?_71.id:"";
}
function getSelectedRadioValue(_72,_73){
if(typeof (_73)=="string"){
_73=document.getElementById(_73);
}
var _74=getSelectedRadio(_73.elements[_72]);
return _74.value?_74.value:"";
}
function getValue(id){
if(ndg.dom){
var el=typeof (id)==="string"?document.getElementById(id):id;
var val;
var _78=[];
if(el.nodeName=="SELECT"){
if(el.multiple){
for(var i=0,end=el.options.length;i<end;i++){
if(el.options[i].selected){
_78.push(el.options[i].value);
}
}
val=_78.join(",");
}else{
val=el.options[el.selectedIndex].value;
}
}else{
if(el.length){
if(el[0].type=="radio"){
for(var i=0,end=el.length;i<end;i++){
if(el[i].checked){
val=el[i].value;
}
}
}else{
for(var i=0,end=el.length;i<end;i++){
if(el[i].checked){
_78.push(el[i].value);
}
}
val=_78;
}
}else{
val=el.value;
}
}
return val;
}
return "";
}
function hasClass(c,el){
return el.className.indexOf(c)>-1?true:false;
}
function HScrollBox2(_7d){
this.enabled=false;
this.enableDebug=false;
this.extraVars="";
this.fetching=false;
this.fixNodes={"viewAllPosition":null};
this.lastNext=0;
this.lastOffset=0;
this.scrolling=false;
this.slidePosition=0;
this.prototype=Object.extend(this,_7d);
}
HScrollBox2.prototype={isIE:!window.opera&&document.getElementById&&window.ActiveXObject&&document.selection&&document.all?true:false,isIE6:!window.XMLHttpRequest&&!window.opera&&document.getElementById&&window.ActiveXObject&&document.selection&&document.all?true:false,isSupported:document.getElementById?true:false,doneScrolling:function(_7e,_7f){
function inner(){
_7e.scrolling=false;
if(_7f>0){
_7e.iOffset+=_7e.iLimit;
}else{
if(_7f<0){
_7e.iOffset-=_7e.iLimit;
}
}
_7e.updateStatus();
document.getElementById(_7e.bNode.id+"_"+_7e.iOffset).focus();
_7e=null;
}
return inner;
},fetchSuccess:function(_80,_81,_82,_83){
var _84=this.bNode.id+"Scroll_";
if(this.iPages==0&&_83){
this.iOffset=0;
this.iTotal=_83.total;
this.sNode.innerHTML="";
if(this.iTotal>0){
this.iPages=Math.ceil(this.iTotal/this.iLimit);
this.iStart=1;
this.iEnd=this.iLimit<this.iTotal?this.iLimit:this.iTotal;
this.iNext=this.iOffset+this.iLimit;
this.lastOffset=(this.iPages-1)*this.iLimit;
this.lastNext=this.lastOffset-this.iLimit;
this.bWidth=this.bNode.offsetWidth;
this.sWidth=this.bWidth*this.iPages;
this.sNode.style.width=this.sWidth+"px";
this.sNode.setStyles({left:(this.iOffset/this.iLimit*this.bWidth*-1)+"px"});
this.fetching=false;
if(this.iTotal>this.iEnd){
this.newFetch(this.iLimit,this.iLimit,1);
}
}else{
this.enabled=false;
this.iTotal=-1;
this.iPages=-1;
this.fetching=false;
}
}else{
if(_82==1){
this.iNext+=this.iLimit;
}else{
if(_82==-1){
this.iPrev-=this.iLimit;
}
}
this.fetching=false;
}
if(_82==1){
this.sNode.innerHTML=this.sNode.innerHTML+"<div class=\"scrollBox\" id=\""+_84+this.iNext+"\">"+_80+"</div>";
}else{
if(_82==-1){
this.sNode.innerHTML="<div class=\"scrollBox\" id=\""+_84+this.iPrev+"\">"+_80+"</div>"+this.sNode.innerHTML;
}else{
this.sNode.innerHTML=this.sNode.innerHTML+"<div class=\"scrollBox\" id=\""+_84+_81+"\">"+_80+"</div>";
}
}
this.fixInternetExplorer("viewAllPosition");
this.updateStatus();
},fixInternetExplorer:function(_85){
var _86;
var _87;
if(this.isIE){
switch(_85){
case "viewAllPosition":
if(this.isIE6){
if(this.fixNodes[_85]==null){
_86=document.getElementById(this.bId);
while(_86!=null&&(!hasClass("tabBoxOn",_86)&&!hasClass("slider",_86))){
_86=_86.parentNode;
}
if(_86){
if(hasClass("slider",_86)){
_87=_86.getElementsByTagName("p");
if(_87.length>0){
this.fixNodes[_85]=_87[_87.length-1];
}
}else{
this.fixNodes[_85]=_86;
}
}else{
this.fixNodes[_85]=false;
}
}
if(this.fixNodes[_85]){
this.fixNodes[_85].style.display="none";
this.fixNodes[_85].style.display="";
}
}
break;
}
}
},getOnSuccessFn:function(_88,_89,_8a){
function inner(){
if(_88.iPages==0){
_88.fetchSuccess(this.transport.responseText,_89,_8a,eval("("+this.transport.getResponseHeader("X-JSON")+")"));
}else{
_88.fetchSuccess(this.transport.responseText,_89,_8a);
}
_88=null;
}
return inner;
},initialize:function(){
if(this.isSupported&&!this.enabled&&this.bId!==""&&this.sId!==""){
this.bNode=$(this.bId);
this.sNode=$(this.sId);
this.enabled=true;
if(this.enabled){
if(this.iPages>0){
if(this.iNext<0){
this.iNext=this.iTotal+this.iLimit;
}
this.lastOffset=(this.iPages-1)*this.iLimit;
this.lastNext=this.lastOffset-this.iLimit;
if(this.iNext<this.iTotal){
this.newFetch(this.iNext,this.iLimit,1);
}
if(this.iPrev>=0){
this.newFetch(this.iPrev,this.iLimit,-1);
}
this.bWidth=this.bNode.offsetWidth;
this.sWidth=this.bWidth*this.iPages;
this.sNode.style.width=this.sWidth+"px";
this.sNode.setStyles({left:(this.iOffset/this.iLimit*this.bWidth*-1)+"px"});
}else{
if(this.iPages==0){
this.sNode.innerHTML="<p class=\"emptyList\">Fetching, please wait...</p>";
this.newFetch(0,this.iLimit,0);
}
}
}
}
},newFetch:function(_8b,_8c,_8d){
this.fetching=true;
this.updateStatus();
var _8e=ndg.fetch(this.fetchURL+"/"+this.offsetName+"/"+_8b+"/"+this.limitName+"/"+_8c,{parameters:"idprefix="+this.bNode.id+"&"+this.extraVars,onComplete:this.getOnSuccessFn(this,_8b,_8d)});
},next:function(){
if(this.enabled){
if(!this.fetching&&this.iOffset+this.iLimit*2==this.iNext&&this.iNext<=this.lastOffset){
this.newFetch(this.iNext,this.iLimit,1);
}
if(!this.scrolling&&this.iOffset+this.iLimit<this.iNext&&this.iOffset<this.lastOffset){
var _8f=this.slidePosition+this.bWidth*-1;
this.scrolling=true;
this.iStart+=this.iLimit;
if(this.iEnd+this.iLimit<this.iTotal){
this.iEnd+=this.iLimit;
}else{
this.iEnd=this.iTotal;
}
this.updateStatus();
var _90=this.sNode.effect("left",{duration:1000,transition:Fx.Transitions.sineInOut,onComplete:this.doneScrolling(this,1)});
_90.custom(this.slidePosition,_8f);
this.slidePosition=_8f;
}
return false;
}
return true;
},prev:function(){
if(this.enabled){
if(!this.fetching&&this.iOffset-this.iLimit*2==this.iPrev&&this.iPrev>=0){
this.newFetch(this.iPrev,this.iLimit,-1);
}else{
if(this.iPrev===0){
this.iPrev-=this.iLimit;
}
}
if(!this.scrolling&&this.iOffset-this.iLimit>this.iPrev&&this.iOffset>0){
var _91=this.slidePosition+this.bWidth;
this.scrolling=true;
this.iStart-=this.iLimit;
this.iEnd-=(this.iEnd%this.iLimit===0?this.iLimit:this.iTotal%this.iLimit);
this.updateStatus();
var _92=this.sNode.effect("left",{duration:1000,transition:Fx.Transitions.sineInOut,onComplete:this.doneScrolling(this,-1)});
_92.custom(this.slidePosition,_91);
this.slidePosition=_91;
}
return false;
}
return true;
},updateStatus:function(){
if(this.enabled){
var _93="";
var _94=document.getElementById(this.statusId);
if(this.iPages>0){
_93=(this.iStart<this.iEnd?this.iStart+" &#8211; "+this.iEnd+" of "+this.iTotal:this.iStart+" of "+this.iTotal);
}else{
if(this.iPages==0){
_93="please wait...";
}
}
if(this.fetching){
_93+=" <img src=\"/images/icons/indicator_light.gif\" width=\"16\" height=\"16\" alt=\"Operation in progress\">";
}
if(_94){
_94.innerHTML=_93;
}
}else{
var _94=document.getElementById(this.statusId);
if(_94){
_94.innerHTML="";
}
}
}};
function in_array(_95,_96){
for(var i=0,end=_96.length;i<end;i++){
if(_96[i]==_95){
return true;
}
}
return false;
}
function isUndefined(v){
var _9a;
return v===_9a;
}
function link_popup(src,_9c){
return raw_popup(src.getAttribute("href"),src.getAttribute("target")||"_blank",_9c);
}
var ndg={_ajaxType:"",dom:document.getElementById?true:false,msgFade:1,msgTimeout:3,ajaxType:function(){
if(this._ajaxType!=""){
return this._ajaxType;
}else{
if(Ajax.implement){
this._ajaxType="mootools";
}else{
if(Ajax.Request){
this._ajaxType="prototype";
}
}
return this._ajaxType;
}
},doJump:function(){
var _9d=Cookie.read("jumpId");
var _9e=Cookie.read("jumpFocusId");
if(_9d){
window.location="#"+_9d;
Cookie.remove("jumpId");
}
if(_9e){
if(!this.focusFirstElement(_9e)){
this.setFocus(_9e);
}
Cookie.remove("jumpFocusId");
}
},empty:function(x){
var r=false;
if(x==ndgnull||(x.length&&x.length<1)||x==ndgEmptyFunc||x===""||x===null){
r=true;
}else{
if(typeof (x)==="object"){
r=true;
for(var a in x){
r=false;
break;
}
}
}
return r;
},fetch:function(url,_a3){
fetchObj=null;
_a3.method=!_a3.method?"post":_a3.method;
_a3.parameters="sess_id="+fetch_id+"&ajax_hash="+fetch_hash+(!_a3.parameters?"":"&"+_a3.parameters);
if(this.ajaxType()=="mootools"){
if(_a3.method=="post"){
_a3.postBody=_a3.parameters;
}else{
url+=(url.indexOf("?")==-1?"?":"&")+_a3.parameters;
}
fetchObj=new Ajax(url,_a3).request();
}else{
if(this.ajaxType()=="prototype"){
fetchObj=new Ajax.Request(url,_a3);
}
}
return fetchObj;
},focusFirstElement:function(id){
if(this.dom){
var _a5=document.getElementById(id);
var _a6=null;
if(_a5&&_a5.nodeName=="FORM"){
for(var a=0,z=_a5.elements.length;a<z;a++){
_a6=_a5.elements[a];
if((_a6.nodeName==="INPUT"&&_a6.getAttribute("type")==="text")||_a6.nodeName==="TEXTAREA"){
_a6.focus();
_a6.select();
return true;
}
}
_a6=null;
}
}
return false;
},GetEmailCallback:function(_a9,_aa,_ab,_ac){
function doEmailCallback(_ad,_ae){
var _af=null;
if(_ae.statusType==="error"){
_af=document.getElementById(_ab);
_af.innerHTML=_ae.status;
document.getElementById(_aa).style.display="none";
}else{
_af=document.getElementById(_aa);
_af.innerHTML=_ae.status;
document.getElementById(_ab).style.display="none";
}
_af.style.display="block";
_af=null;
}
return doEmailCallback;
},getIdFromURL:function(url){
var id=null;
var _b2=url.indexOf("#");
if(_b2>-1){
id=url.substring(_b2+1,url.length);
}
return id;
},getMsgFade:function(_b3){
function doMsgFade(){
var _b4=null;
if(!ndg.empty(window.Fx)){
_b4=new Fx.Style(_b3,"opacity",{duration:ndg.msgFade}).custom(1,0);
}else{
if(!ndg.empty(window.Effect)){
_b4=new Effect.Opacity(_b3,{duration:ndg.msgFade,from:1,to:0});
}
}
}
return doMsgFade;
},printPreview:function(_b5){
if(this.dom&&window.print){
var _b6=document.getElementsByTagName("link");
var _b7=document.getElementsByTagName("style");
var _b8=null;
for(var i=0,end=_b7.length;i<end;i++){
_b7[i].disabled=true;
}
for(var i=0,end=_b6.length;i<end;i++){
_b8=_b6[i];
if(_b8.getAttribute("rel").indexOf("alt")>-1&&_b8.getAttribute("title")==="preview"){
_b8.disabled=true;
_b8.disabled=false;
}else{
if(_b8.getAttribute("media")!=="print"){
_b8.disabled=true;
}
}
}
}
if(_b5!==null){
return _b5;
}
},printPreviewUndo:function(_bb){
if(ndg.dom&&window.print){
var _bc=document.getElementsByTagName("link");
var _bd=document.getElementsByTagName("style");
var _be=null;
for(var i=0,end=_bd.length;i<end;i++){
_bd[i].disabled=false;
}
for(var i=0,end=_bc.length;i<end;i++){
_be=_bc[i];
if(_be.getAttribute("rel").indexOf("alt")>-1&&_be.getAttribute("title")==="preview"){
_be.disabled=true;
}else{
_be.disabled=false;
}
}
_be=null;
}
if(_bb!==null){
return _bb;
}
},printWindow:function(_c1){
if(window.print){
window.print();
}
return (_c1!==null?_c1:null);
},setFocus:function(el){
if(ndg.dom){
if(typeof (el)==="string"){
el=document.getElementById(el);
}
if(el&&el.focus){
el.focus();
el=null;
return true;
}else{
return false;
}
}
},setJumpId:function(_c3,_c4){
Cookie.write("jumpId",_c3);
if(_c4){
Cookie.write("jumpFocusId",_c4);
}else{
Cookie.remove("jumpFocusId");
}
},showMessage:function(_c5,_c6,_c7,_c8,_c9){
if(this.dom){
var _ca=document.getElementById(_c7);
var _cb=null;
var _cc="";
if(_ca){
switch(_c6){
case "ok":
_cc="successBlock";
break;
case "error":
_cc="errorBlock";
break;
default:
_cc="";
break;
}
_ca.className=_cc;
_ca.innerHTML=_c5;
if(window.Fx){
$(_ca).setOpacity(1);
}else{
if(window.Effect){
Element.setOpacity(_ca,1);
}
}
if(!_c8){
_ca.style.display="block";
}
if(_c9){
setTimeout(this.getMsgFade(_c7),this.msgTimeout*1000);
}
}
}
},validateEmail:function(_cd,_ce,_cf,_d0){
var _d1=ndg.fetch(page_path+"utilities/valid_email",{parameters:"email="+_cd,onSuccess:this.GetEmailCallback(_cd,_ce,_cf,_d0)});
}};
var ndgToggle={hClassOff:"toggleHeadOff",hClassOn:"toggleHeadOn",activeSrc:media_path+"/images/"+portal+"/button_arrow_down.gif",inactiveSrc:media_path+"/images/"+portal+"/button_arrow_right.gif",doToggle:function(_d2,_d3,_d4){
if(document.getElementById){
var _d5=document.getElementById(_d2);
var _d6=null;
if(_d5.className==this.hClassOn){
_d5.className=this.hClassOff;
if(_d4){
document.getElementById(_d4).src=this.inactiveSrc;
}
_d6=new Fx.Height(_d3,{duration:500,transition:Fx.Transitions.sineInOut}).toggle();
}else{
_d5.className=this.hClassOn;
if(_d4){
document.getElementById(_d4).src=this.activeSrc;
}
_d6=new Fx.Height(_d3,{duration:500,transition:Fx.Transitions.sineInOut}).toggle();
}
return false;
}
return true;
},getIds:function(_d7,num){
var _d9=[];
for(var i=0;i<num;i++){
_d9[i]=_d7+"_"+i;
}
return _d9;
},initialize:function(_db,_dc){
if(document.getElementById){
var _dd=null;
var _de=null;
var id=ndg.getIdFromURL(new String(window.location));
var _e0=getIndex(id,_db)>-1;
for(var i=0,end=_db.length;i<end;i++){
_dd=document.getElementById(_db[i]);
_de=document.getElementById(_dc[i]);
if((_e0&&_db[i]!=id)||(!_e0&&!!_dd&&_dd.className==this.hClassOff)){
_de.style.height="0";
_de.style.overflow="hidden";
}
}
}
}};
function PaginatedBox2(_e3){
this.appearing=false;
this.enableDebug=false;
this.enabled=false;
this.extraParams="";
this.fetching=false;
this.fewerText="view fewer";
this.fixNodes={"viewAllPosition":null};
this.moreLimit=50;
this.moreText="view more";
this.viewingMore=false;
this.prototype=Object.extend(this,_e3);
this.enabled=(this.iTotal>0?true:false);
this.origLimit=this.iLimit;
this.lastOffset=this.iTotal%this.iLimit===0?this.iTotal-this.iLimit:this.iTotal-this.iTotal%this.iLimit;
this.iPrev=this.iPrev>0?this.iPrev:this.iLimit*-1;
this.iNext=this.iNext>0?this.iNext:this.lastOffset+this.iLimit;
}
PaginatedBox2.prototype={isIE:!window.opera&&document.getElementById&&window.ActiveXObject&&document.selection&&document.all?true:false,fetchSuccess:function(_e4,_e5){
this.appearing=true;
this.iNext+=this.iLimit*_e5;
this.iPrev+=this.iLimit*_e5;
this.iOffset+=this.iLimit*_e5;
this.fixInternetExplorer("viewAllPosition");
var _e6=new Fx.Style(this.bId,"opacity",{onComplete:this.finish(this)}).custom(0,1);
this.fetching=false;
this.updateStatus();
},finish:function(_e7){
function inner(){
_e7.appearing=false;
document.getElementById(_e7.bId+"_anchor").focus();
_e7.updateStatus();
}
return inner;
},fixInternetExplorer:function(_e8){
var _e9;
var _ea;
var i=0;
var end=0;
if(this.isIE){
switch(_e8){
case "viewAllPosition":
if(this.fixNodes[_e8]==null){
_e9=document.getElementById(this.cId);
for(i,end=_e9.childNodes.length;i<end;i++){
if(hasClass("scrollVertical",_e9.childNodes[i])){
_ea=_e9.childNodes[i].getElementsByTagName("span")[0];
i=end;
}
}
this.fixNodes[_e8]=!_ea?false:_ea;
}
if(this.fixNodes[_e8]){
this.fixNodes[_e8].style.visibility="hidden";
this.fixNodes[_e8].style.visibility="";
}
break;
}
}
},next:function(){
if(this.enabled){
if(!this.fetching&&!this.appearing&&this.iNext>0&&this.iNext<=this.lastOffset){
this.fetching=true;
this.iStart+=this.iLimit;
this.iEnd=this.iEnd+this.iLimit<this.iTotal?this.iEnd+this.iLimit:this.iTotal;
this.updateStatus();
$(this.bId).setOpacity(0);
this.newFetch(this.iNext,this.iLimit,1);
}
}
return false;
},newFetch:function(_ed,_ee,_ef){
this.fetching=true;
var _f0=ndg.fetch(this.fetchURL+"/"+this.offsetName+"/"+_ed+"/"+this.limitName+"/"+_ee,{parameters:"idprefix="+this.bId+this.extraParams,onComplete:this.onSuccess(this,_ef),update:this.bId});
},onSuccess:function(_f1,_f2){
function inner(_f3){
_f1.fetchSuccess(_f3,_f2);
}
return inner;
},prev:function(){
if(this.enabled){
if(!this.fetching&&!this.appearing&&this.iPrev>=0){
this.fetching=true;
this.iStart-=this.iLimit;
this.iEnd=this.iEnd%this.iLimit===0?this.iEnd-this.iLimit:this.lastOffset;
$(this.bId).setOpacity(0);
this.newFetch(this.iPrev,this.iLimit,-1);
this.updateStatus();
}
}
return false;
},updateStatus:function(){
if(this.enabled){
var _f4="";
var _f5=document.getElementById(this.statusId);
if(this.iEnd<this.iTotal){
_f4=this.iStart+" &#8211; "+this.iEnd+" of "+this.iTotal;
}else{
_f4=this.iEnd+" of "+this.iTotal;
}
if(this.fetching){
_f4+=" <img src=\"/images/icons/indicator_dark.gif\" width=\"16\" height=\"16\" alt=\"Operation pending\">";
}
document.getElementById(this.nextId).href=this.urlPrefix+this.iNext;
document.getElementById(this.prevId).href=this.urlPrefix+this.iPrev;
if(_f5){
_f5.innerHTML=_f4;
}
}else{
if(this.iTotal<1&&ndg.dom){
document.getElementById(this.statusId).innerHTML="";
}
}
_f5=null;
},viewMore:function(){
if(this.enabled){
if(!this.viewingMore){
this.viewingMore=true;
document.getElementById(this.moreId).innerHTML=this.fewerText;
this.iLimit=this.moreLimit;
}else{
this.viewingMore=false;
document.getElementById(this.moreId).innerHTML=this.moreText;
this.iLimit=this.origLimit;
}
this.iOffset=this.iOffset<this.iLimit?0:this.iOffset-this.iOffset%this.iLimit;
this.iStart=this.iOffset+1;
this.iNext=this.iOffset+this.iLimit;
this.iPrev=this.iOffset-this.iLimit;
this.iEnd=this.iOffset+this.iLimit<this.iTotal?this.iOffset+this.iLimit:this.iTotal;
this.lastOffset=this.iTotal%this.iLimit===0?this.iTotal:this.iTotal-this.iTotal%this.iLimit;
$(this.bId).setOpacity(0);
this.newFetch(this.iOffset,this.iLimit,0);
this.updateStatus();
}
return false;
}};
var PrecacheImages={cacheId:"_IMAGE_CACHE",cacheNode:null,imgs:[],supported:null,add:function(src){
var img=null;
if(!in_array(src,this.imgs)&&this.isSupported()){
if(!this.cacheNode){
this.cacheNode=document.createElement("div");
this.cacheNode.id=this.cacheId;
this.cacheNode.style.display="none";
document.getElementsByTagName("body")[0].appendChild(this.cacheNode);
}
img=document.createElement("img");
img.src=src;
this.imgs[this.imgs.length]=src;
this.cacheNode.appendChild(img);
}
},isSupported:function(){
if(this.supported===null){
this.supported=document.getElementsByTagName&&document.getElementById&&document.createElement&&document.appendChild?true:false;
}
return this.supported;
}};
var preview={waitText:"Please wait while we create the preview... ",waitImgSrc:"images/icons/indicator_light.gif",getFocusFn:function(_f8){
return function(){
document.getElementById(_f8).focus();
};
},onComplete:function(_f9){
return function(_fa){
var _fb=$(_f9);
var _fc=null;
if(ndg.ajaxType()=="mootools"){
_fa=this.transport;
}
_fb.setOpacity(0);
_fb.innerHTML=_fa.responseText;
_fb.style.height="";
if(typeof (Fx)=="object"&&Fx.Style){
_fc=new Fx.Style(_fb,"opacity",{onComplete:preview.getFocusFn(_f9+"_anchor")}).custom(0,100);
}else{
if(typeof (Effect)=="object"&&Effect.Opacity){
_fc=new Effect.Opacity(_fb,{from:0,to:1,afterFinish:preview.getFocusFn(_f9+"_anchor")});
}
}
};
},send:function(_fd,_fe,_ff,_100,_101,_102,_103){
if(!_104){
var _104=false;
}
if(ndg.dom&&!_104){
if(_103){
this.waitImgSrc=_103;
}
var _105=document.getElementById(_ff);
var _106=document.getElementById(_fe);
var _107="";
if(!_101){
_101="";
}
if(!_100){
_100="";
}
_105.className="";
_105.innerHTML=this.showWaiting();
_105.innerHTML=this.showWaiting();
_105.style.height=_106.scrollHeight+"px";
_106.style.display="none";
_105.style.display="block";
if(_102){
_107+="/"+_102.src.replace(media_path,"");
}
params=serializeForm(_106)+"&action="+_101+"&focus_id="+_100+"&form_id="+_fe+"&photo_path="+_107+"&preview_id="+_ff;
ndg.fetch(_fd,{onComplete:this.onComplete(_ff),parameters:params});
}
},showWaiting:function(){
return "<p class=\"waiting\">"+this.waitText+showImage(this.waitImgSrc,["alt","waiting..."])+"</p>";
},submitForm:function(_108){
if(ndg.dom){
var form=document.getElementById(_108);
if(typeof (form.onsubmit)!="function"||form.onsubmit()){
form.submit();
}else{
form.style.display="";
}
}
},switchToForm:function(_10a,_10b,_10c){
document.getElementById(_10b).style.display="none";
document.getElementById(_10a).style.display="block";
if(_10c){
document.getElementById(_10c).focus();
}else{
document.getElementById(_10a+"_anchor").focus();
}
}};
var QuickSearch={isSupported:!!document.getElementById,toggleObj:null,hide:function(){
if(!this.isSupported){
return;
}else{
if(!this.fading){
this.visible=true;
this.toggle(this.toggleObj);
}
}
},submit:function(form){
if(!this.isSupported){
return true;
}
var _10e=getSelectedRadioValue("search_action",form);
var id=getSelectedRadioId("search_action",form);
if(id==="search_action_albums"){
form.elements["search_type"].value="albums";
}else{
if(id==="search_action_photos"){
form.elements["search_type"].value="photos";
}
}
form.action=_10e;
return true;
},toggle:function(id){
if(!this.isSupported){
return false;
}
if(!this.toggleObj){
this.toggleObj=document.getElementById(id);
}
if(this.toggleObj.style.display==="block"){
this.toggleObj.style.display="";
removeClass("quickSrchVisible",document.body);
}else{
this.toggleObj.style.display="block";
addClass("quickSrchVisible",document.body);
document.getElementById("searchkeys").focus();
}
return false;
}};
function raw_popup(url,_112,_113){
if(isUndefined(_113)){
_113=_POPUP_FEATURES;
}
if(isUndefined(_112)){
_112="_blank";
}
var _114=window.open(url,_112,_113);
_114.focus();
return _114;
}
function removeClass(c,el){
var _117=getClasses(el),cPos=getIndex(c,_117);
var _119="";
if(cPos>-1){
_119=_117.pop(cPos);
}
el.className=_117.join(" ");
el=null;
}
function serializeForm(_11a){
if(ndg.dom){
var els=typeof (_11a)==="string"?document.getElementById(_11a).elements:_11a.elements;
var r=[],_11d=[];
for(var i=0,end=els.length;i<end;i++){
if(els[i].nodeName==="INPUT"){
if(els[i].type==="radio"||els[i].type==="checkbox"){
if(els[i].checked){
r[r.length]=els[i].name+"="+encodeURIComponent(getValue(els[i]));
}
}else{
r[r.length]=els[i].name+"="+encodeURIComponent(getValue(els[i]));
}
}else{
if(els[i].nodeName==="SELECT"){
if(els[i].multiple){
_11d=getValue(els[i]);
for(var sel=0,_121=_11d.length;sel<_121;sel++){
r[r.length]=els[i].name+"="+encodeURIComponent(_11d[sel]);
}
}else{
r[r.length]=els[i].name+"="+encodeURIComponent(getValue(els[i]));
}
}else{
r[r.length]=els[i].name+"="+encodeURIComponent(getValue(els[i]));
}
}
}
return r.join("&");
}
return "";
}
function showBusyIndicator(_122,_123){
if(ndg.dom){
if(typeof (_122)==="string"){
_122=document.getElementById(_122);
}
if(typeof (_123)==="string"){
_123=document.getElementById(_123);
}
_122.style.display="none";
_123.style.display="block";
_122=null;
_123=null;
}
}
function showImage(src,_125){
var img="<img src=\""+media_path+src+"\"";
var i=0;
var end=_125.length;
while(i<end){
img+=" "+_125[i]+"=\""+_125[i+1]+"\"";
i+=2;
}
img+=">";
return img;
}
function srchBox(obj,_12a){
if(obj.value===_12a){
obj.value="";
}
}
var Swap={getFirstIMGNode:function(el){
for(i=0,end=el.childNodes.length;i<end;i++){
if(el.childNodes[i].nodeName==="IMG"){
return el.childNodes[i];
}
}
return null;
},getHoverFn:function(){
function doHoverFn(){
var img=Swap.getFirstIMGNode(this);
if(img.src.indexOf("_off")>-1){
if(hasClass("_portal_hover",this)){
img.src=img.src.replace("_off","_"+portal+"_hover");
}else{
img.src=img.src.replace("_off","_hover");
}
}else{
if(hasClass("_portal_hover",this)){
img.src=img.src.replace("_"+portal+"_hover","_off");
}else{
img.src=img.src.replace("_hover","_off");
}
}
}
return doHoverFn;
},initialize:function(){
var _12d=[];
var _12e="";
if(document.getElementsByTagName&&document.createElement&&document.appendChild){
_12d=document.getElementsByTagName("a");
for(var i=0,end=_12d.length;i<end;i++){
if(hasClass("swap_hover",_12d[i])){
_12d[i].onmouseover=Swap.getHoverFn();
_12d[i].onmouseout=Swap.getHoverFn();
_12d[i].onfocus=Swap.getHoverFn();
_12d[i].onblur=Swap.getHoverFn();
_12e=Swap.getFirstIMGNode(_12d[i]).src;
if(hasClass("_portal_hover",_12d[i])){
_12e=_12e.replace("_off","_"+portal+"_hover");
}else{
_12e=_12e.replace("_off","_hover");
}
PrecacheImages.add(_12e);
}
}
}
}};
function Tabs(_131,_132,_133,_134,_135,_136){
this.autoOnClick=_135;
this.tabIds=_131;
this.tabBoxIds=_132;
this.wrapperId=_133;
this.onSwitchFn=!!_136?_136:function(){
};
switch(typeof (_134)){
case "string":
this.activeIndex=this.getTabBoxIndexById(_134);
if(this.activeIndex<0){
this.activeIndex=0;
}
break;
case "number":
this.activeIndex=_134>=0?_134:0;
break;
default:
this.activeIndex=0;
break;
}
if(this.isSupported){
this.activeIndex=(this.activeIndex>0?this.activeIndex:0);
if(this.autoOnClick){
for(var i=0,end=this.tabIds.length;i<end;i++){
document.getElementById(this.tabIds[i]).getElementsByTagName("a")[0].onclick=this.createOnClick(this,i);
}
}
this.detectTabByURL();
}
}
Tabs.prototype={_tab_found_in_url:false,isSupported:document.getElementById&&document.getElementsByTagName?true:false,createOnClick:function(_139,_13a){
function doSwitchTab(){
_139.switchTab(_13a);
return false;
}
return doSwitchTab;
},detectTabByURL:function(){
if(!Tabs._tab_found_in_url&&this.enabled){
var _13b=""+window.location;
var _13c=0;
var _13d="";
var _13e=0;
_13c=_13b.indexOf("#");
if(_13c>0){
_13d=_13b.substring(_13c+1,_13b.length);
if(this.getTabBoxIndexById(_13d)>-1){
this.switchTab(this.getTabBoxIndexById(_13d));
Tabs._tab_found_in_url=true;
}
}
}
},getActiveTabBoxId:function(){
return this.tabBoxIds[this.activeIndex];
},getTabBoxIndexById:function(_13f){
for(var i=0,end=this.tabBoxIds.length;i<end;i++){
if(this.tabBoxIds[i]==_13f){
return i;
}
}
return -1;
},setActiveTab:function(_142){
if(typeof (this.activeIndex)!=="number"&&typeof (_142)==="number"){
this.activeIndex=_142;
}
if(typeof (this.activeIndex)==="number"){
for(var i=0,end=this.tabBoxIds.length;i<end;i++){
if(i!=this.activeIndex){
document.getElementById(this.tabBoxIds[i]).className="tabBoxOff";
document.getElementById(this.tabIds[i]).className="tabOff";
}else{
document.getElementById(this.tabBoxIds[i]).className="tabBoxOn";
document.getElementById(this.tabIds[i]).className="tabOn";
}
}
}
},switchTab:function(_145){
if(this.isSupported&&_145!==this.activeIndex){
document.getElementById(this.tabIds[_145]).className="tabOn";
document.getElementById(this.tabBoxIds[_145]).className="tabBoxOn";
document.getElementById(this.tabIds[this.activeIndex]).className="tabOff";
document.getElementById(this.tabBoxIds[this.activeIndex]).className="tabBoxOff";
document.getElementById(this.tabBoxIds[_145]+"_anchor").focus();
this.activeIndex=_145;
this.onSwitchFn(this.activeIndex,this.tabIds[this.activeIndex],this.tabBoxIds[this.activeIndex]);
}
}};
function toggleAllByClassName(_146){
allNodes=document.getElementsByClassName(_146);
for(i=0;i<allNodes.length;i++){
allNodes[i].checked=!allNodes[i].checked;
}
}
function toggleCheckboxes(){
var i=0;
var form;
var name="";
var _14a=false;
var end=0;
if(arguments.length==1){
form=arguments[0].form;
name=arguments[0].name;
_14a=arguments[0].checked;
}else{
form=arguments[0];
name=arguments[1];
_14a=arguments[2];
}
end=form.elements[name].length;
for(i;i<end;i++){
form.elements[name][i].checked=_14a;
}
}
function TrophyWidget(url,_14d,_14e,_14f,_150,_151){
if(!this.isSupported){
return;
}
this.url=url;
this.widgetId=_14d;
this.countId=_14e;
this.linkId=_14f;
this.connectionOpened=false;
this.successMsg=_150;
this.waitingMsg=!_151?"please wait... <img src=\""+media_path+"/images/icons/indicator_light.v"+version_image+".gif\" alt=\"\" style=\"vertical-align: middle\">":_151;
this.AttachClickFn();
this.enabled=true;
}
TrophyWidget.prototype={enabled:false,isSupported:!!document.getElementById,AttachClickFn:function(){
var _152=document.getElementById(this.linkId);
var a;
if(_152){
a=_152.getElementsByTagName("a");
if(a&&a[0]){
a[0].onclick=this.GetClickFn(this);
}
}
a=_152=null;
},GetClickFn:function(_154){
return function(){
_154.GiveTrophy();
return !_154.enabled;
};
},GetOnCompleteFn:function(_155){
return function(resp){
_155.OnComplete(resp);
_155=null;
};
},GiveTrophy:function(){
if(this.connectionOpened||!this.enabled){
return;
}
this.httpObj=ndg.fetch(this.url,{onComplete:this.GetOnCompleteFn(this)});
this.ShowMessage(this.waitingMsg);
this.connectionOpened=true;
},OnComplete:function(xhr){
var resp=null;
switch(ndg.ajaxType()){
case "mootools":
resp=eval("("+xhr+")");
break;
case "prototype":
resp=eval("("+xhr.responseText+")");
break;
}
if(resp&&resp.status=="finished"){
this.ShowMessage(this.successMsg);
this.ShowCount(resp.trophies);
}
},ShowCount:function(_159){
document.getElementById(this.countId).innerHTML=_159;
},ShowMessage:function(msg){
document.getElementById(this.linkId).innerHTML=msg;
}};
function uncheckAllByClassName(_15b){
allNodes=document.getElementsByClassName(_15b);
for(i=0;i<allNodes.length;i++){
allNodes[i].checked=false;
}
}
var Uploader={isSupported:!!document.getElementById,activate:function(_15c,_15d){
if(!this.isSupported){
return;
}
document.getElementById(_15c).style.display="none";
document.getElementById(_15d).style.display="block";
},spawn:function(_15e,_15f,_160,_161,_162){
if(this.isSupported){
var _163="<iframe class=\"uploader\" src=\""+_160+"\" width=\""+(_161?_161:300)+"\" height=\""+(_162?_162:200)+"\" id=\""+_15f+"_iframe\" name=\""+_15f+"_iframe\" frameborder=\"0\"></iframe>";
document.getElementById(_15e).style.display="none";
document.getElementById(_15f).innerHTML=_163;
}
}};
var onloads=new Events();
var domload=new Events();
var unloads=new Events();
unloads.add(PrecacheImages.destroy);
onloads.add(function(){
ndg.doJump();
});
domload.add(Swap.initialize,"Swap_Initialize");

