var rv=-1;if(navigator.appName=='Microsoft Internet Explorer')
{var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null)
rv=parseFloat(RegExp.$1);}
if(rv!='6'){window.onresize=function(){document.getElementsByTagName('body')[0].style.display="none";document.getElementsByTagName('body')[0].style.display="block";changecss('.threecol .colmask','display','none');changecss('.threecol .colmask','display','block');}}
function correct_image(){var divCollection=document.getElementsByTagName("dt");foundme="0";for(var i=0;i<divCollection.length;i++){if(divCollection[i].getAttribute("class")=="quicklink"||divCollection[i].getAttribute("className")=="quicklink"){findMeText=divCollection[i].innerHTML;foundme="1";}}
if(foundme=="0"){var divCollection=document.getElementsByTagName("div");for(var i=0;i<divCollection.length;i++){if(divCollection[i].getAttribute("id")=="navigation"){divCollection[i].className="sideboxhead";}}}}
function tableRows(){if(document.getElementsByTagName){var tables=document.getElementsByTagName('table');for(var i=0;i<tables.length;i++){if(tables[i].className.indexOf("noaltrow")==-1){var trs=tables[i].getElementsByTagName('tr');for(var j=1;j<trs.length;j+=2){trs[j].className='alt';}}}}}
function clearDefault(el){if(el.defaultValue==el.value)el.value=""}
function onloadloginpassbox()
{if(document.getElementById('loginpassspan_text'))document.getElementById('loginpassspan_text').style.display='inline';if(document.getElementById('loginpassspan_password'))document.getElementById('loginpassspan_password').style.display='none';}
function changeloginpassbox()
{document.getElementById('loginpassspan_text').style.display='none';document.getElementById('loginpassspan_password').style.display='inline';document.getElementById('cams_cb_password').focus();}
function validateLogin(userName,passWd){var pwdRe=new RegExp("^.{7,128}$");var userRe=new RegExp("^(?=.{5,60}$)[-a-z0-9!#$%&'*+/=?^_`{|}~.]+@[a-z0-9](?:[-_a-z0-9]*[a-z0-9])*(?:\\.[a-z0-9](?:[-_a-z0-9]*[a-z0-9])*)+$","i");var user=document.getElementById(userName).value;var pwd=document.getElementById(passWd).value;var result=true;if(!user||user.length==0){result=false;alert("User Name must be provided");}else if(!user.match(userRe)){result=false;alert("Invalid username has been entered");}else if(!pwd||pwd.length==0){result=false;alert("Password must be provided");}else if(!pwd.match(pwdRe)){result=false;alert("Invalid password has been entered");}
return(result);}
function changecss(theClass,element,value){var cssRules;if(document.all){cssRules='rules';}
else if(document.getElementById){cssRules='cssRules';}
var added=false;for(var S=0;S<document.styleSheets.length;S++){if(null===document.styleSheets[S].href||document.styleSheets[S].href.indexOf('sharethis')=="-1"){for(var R=0;R<document.styleSheets[S][cssRules].length;R++){if(document.styleSheets[S][cssRules][R].selectorText==theClass){if(document.styleSheets[S][cssRules][R].style[element]){document.styleSheets[S][cssRules][R].style[element]=value;added=true;break;}}}
if(!added){if(document.styleSheets[S].insertRule){document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);}else if(document.styleSheets[S].addRule){document.styleSheets[S].addRule(theClass,element+': '+value+';');}}}}}
function collapseright(){changecss('.threecol .col3','width','20px');changecss('.threecol .col1','margin','0 0 0 209px');changecss('.threecol .col1','margin-right','40px');document.getElementById('rightbox').style.display='none';document.getElementById('rightcolbox').style.display='block';}
function expandright(){changecss('.threecol .col3','width','198px');changecss('.threecol .col1','margin-right','245px');document.getElementById('rightbox').style.display='block';document.getElementById('rightcolbox').style.display='none';}
function collapseright_ext(){document.getElementById('rightbox').style.display='none';document.getElementById('rightcolbox').style.display='block';document.getElementById('col3id').style.width='20px';document.getElementById('col1id').style.marginRight='60px';}
function expandright_ext(){document.getElementById('rightbox').style.display='block';document.getElementById('rightcolbox').style.display='none';document.getElementById('col3id').style.width='200px';document.getElementById('col1id').style.marginRight='250px';}
function SelectLeft(){document.getElementById("left").style.backgroundImage="url(/images/site/homepagesprite.png)";document.getElementById("leftcontent").style.backgroundImage="url(/images/site/CommunityRepeatWhite.gif)";document.getElementById("midbar").style.backgroundImage="url(/images/site/homepagesprite.png)";document.getElementById("midbar").style.backgroundPosition="0 -265px";document.getElementById("rightcontent").style.backgroundImage="url(/images/site/CommunityRepeatGrey.gif)";document.getElementById("right").style.backgroundImage="url(/images/site/CommunityRightGrey.gif)";document.getElementById('findapartner').style.display='none';document.getElementById('communitydialog').style.display='block';document.getElementById('rfindapartner').style.display='none';document.getElementById('rcommunitydialog').style.display='block';document.getElementById('comimages').style.display='block';changecss('.rtitle a','color','#7f7f7f');changecss('.ltitle a','color','black');}
function SelectRight(){document.getElementById("left").style.backgroundImage="url(/images/site/CommunityLeftGrey.gif)";document.getElementById("leftcontent").style.backgroundImage="url(/images/site/CommunityRepeatGrey.gif)";document.getElementById("midbar").style.backgroundImage="url(/images/site/homepagesprite.png)";document.getElementById("midbar").style.backgroundPosition="0 -530px";document.getElementById("rightcontent").style.backgroundImage="url(/images/site/CommunityRepeatWhite.gif)";document.getElementById("right").style.backgroundImage="url(/images/site/CommunityRightWhite.gif)";document.getElementById('findapartner').style.display='block';document.getElementById('communitydialog').style.display='none';document.getElementById('comimages').style.display='none';document.getElementById('rfindapartner').style.display='block';document.getElementById('rcommunitydialog').style.display='none';changecss('.rtitle a','color','black');changecss('.ltitle a','color','#7f7f7f');}
function textCounter(field,countfield,maxlimit)
{if(field.value.length>maxlimit)
{field.value=field.value.substring(0,maxlimit);countfield.value=0;}
else
{document.getElementById(countfield).innerHTML=maxlimit-field.value.length;}}
function switchMenu(num){if(document.getElementById){var myImg=eval("document.getElementById('box"+num+"')");var myObj='sub'+num;var el=document.getElementById(myObj);if(el.style.display!='block'&&el.style.display!=''){el.style.display='block';myImg.src='/images/icons/box_minus.gif';}else{el.style.display='none';myImg.src='/images/icons/box_plus.gif';}}}
var last_expanded='';var last_imgswap='';function showHide(id){var obj=document.getElementById(id);var status=obj.className;var imgobj=document.getElementById('img'+id);if(status=='hide'){obj.className='show';imgobj.src='/images/site/n-minus.gif';imgobj.alt='collapse';}
if(status=='show'){obj.className='hide';imgobj.src='/images/site/n-plus.gif';imgobj.alt='expand';}}
var imagesPath="/images/site/";var selectRightWidthSimple=19;var selectRightWidthScroll=2;var selectMaxHeight=200;var textareaTopPadding=10;var textareaSidePadding=10;var nonload=0;var NF=new Array();var isIE=false;var resizeTest=1;function NFInit(){try{document.execCommand('BackgroundImageCache',false,true);}catch(e){}
if(!document.getElementById){return false;}
NFDo('start');}
function NFDo(what){var niceforms=document.getElementsByTagName('form');var identifier=new RegExp('(^| )'+'niceform'+'( |$)');if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var ieversion=new Number(RegExp.$1);if(ieversion<7){return false;}
isIE=true;}
for(var q=0;q<niceforms.length;q++){if(identifier.test(niceforms[q].className)){if(what=="start"){NF[q]=new niceform(niceforms[q]);niceforms[q].start();}
else{niceforms[q].unload();NF[q]="";}}}}
function NFFix(){NFDo('stop');NFDo('start');}
function niceform(nf){nf._inputText=new Array();nf._inputRadio=new Array();nf._inputCheck=new Array();nf._inputSubmit=new Array();nf._inputFile=new Array();nf._textarea=new Array();nf._select=new Array();nf._multiselect=new Array();nf.add_select=function(obj){this._select[this._select.length]=obj;selects(obj);}
nf.start=function(){var allInputs=this.getElementsByTagName('input');var allSelects=this.getElementsByTagName('select');for(var w=0;w<allSelects.length;w++){if(allSelects[w].size=="1"){this.add_select(allSelects[w]);}
else{this.add_multiselect(allSelects[w]);}}
for(w=0;w<this._select.length;w++){this._select[w].init(w);}
for(w=0;w<this._multiselect.length;w++){this._multiselect[w].init(w);}}
nf.unload=function(){for(w=0;w<this._select.length;w++){this._select[w].unload();}
for(w=0;w<this._multiselect.length;w++){this._multiselect[w].unload();}}}
function inputText(el){}
function inputRadio(el){}
function inputCheck(el){}
function inputSubmit(el){}
function inputFile(el){}
function textarea(el){}
function selects(el){el.oldClassName=el.className;el.dummy=document.createElement('div');el.dummy.className="NFSelect";el.dummy.style.width=el.offsetWidth+'px';el.dummy.ref=el;el.left=document.createElement('img');el.left.src=imagesPath+"0.png";el.left.className="NFSelectLeft";el.right=document.createElement('div');el.right.className="NFSelectRight";el.txt=document.createTextNode(el.options[0].text);el.bg=document.createElement('div');el.bg.className="NFSelectTarget";el.bg.style.display="none";el.opt=document.createElement('ul');el.opt.className="NFSelectOptions";el.dummy.style.left=findPosX(el)+'px';el.dummy.style.top=findPosY(el)+'px';el.opts=new Array(el.options.length);el.init=function(pos){this.dummy.appendChild(this.left);this.right.appendChild(this.txt);this.dummy.appendChild(this.right);this.bg.appendChild(this.opt);this.dummy.appendChild(this.bg);for(var q=0;q<this.options.length;q++){this.opts[q]=new option(this.options[q],q);this.opt.appendChild(this.options[q].li);this.options[q].lnk.onclick=function(){this._onclick();this.ref.dummy.getElementsByTagName('div')[0].innerHTML=this.ref.options[this.pos].text;this.ref.options[this.pos].selected="selected";for(var w=0;w<this.ref.options.length;w++){this.ref.options[w].lnk.className="";}
this.ref.options[this.pos].lnk.className="NFOptionActive";}}
if(this.options.selectedIndex){this.dummy.getElementsByTagName('div')[0].innerHTML=this.options[this.options.selectedIndex].text;this.options[this.options.selectedIndex].lnk.className="NFOptionActive";}
this.dummy.style.zIndex=999-pos;this.parentNode.insertBefore(this.dummy,this);this.className="NFhidden";}
el.unload=function(){this.parentNode.removeChild(this.dummy);this.className=this.oldClassName;}
el.dummy.onclick=function(){var allDivs=document.getElementsByTagName('div');for(var q=0;q<allDivs.length;q++){if((allDivs[q].className=="NFSelectTarget")&&(allDivs[q]!=this.ref.bg)){allDivs[q].style.display="none";}}
if(this.ref.bg.style.display=="none"){this.ref.bg.style.display="block";}
else{this.ref.bg.style.display="none";}
if(this.ref.opt.offsetHeight>selectMaxHeight){this.ref.bg.style.width=this.ref.offsetWidth-selectRightWidthScroll+33+'px';this.ref.opt.style.width=this.ref.offsetWidth-selectRightWidthScroll+'px';}
else{this.ref.bg.style.width=this.ref.offsetWidth-selectRightWidthSimple+33+'px';this.ref.opt.style.width=this.ref.offsetWidth-selectRightWidthSimple+'px';}}
el.bg.onmouseout=function(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;if((reltg.nodeName=='A')||(reltg.nodeName=='LI')||(reltg.nodeName=='UL'))return;if((reltg.nodeName=='DIV')||(reltg.className=='NFSelectTarget'))return;else{this.style.display="none";}}
el.dummy.onmouseout=function(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;if((reltg.nodeName=='A')||(reltg.nodeName=='LI')||(reltg.nodeName=='UL'))return;if((reltg.nodeName=='DIV')||(reltg.className=='NFSelectTarget'))return;else{this.ref.bg.style.display="none";}}
el.onfocus=function(){this.dummy.className+=" NFfocused";}
el.onblur=function(){this.dummy.className=this.dummy.className.replace(/ NFfocused/g,"");}
el.onkeydown=function(e){if(!e)var e=window.event;var thecode=e.keyCode;var active=this.selectedIndex;switch(thecode){case 40:if(active<this.options.length-1){for(var w=0;w<this.options.length;w++){this.options[w].lnk.className="";}
var newOne=active+1;this.options[newOne].selected="selected";this.options[newOne].lnk.className="NFOptionActive";this.dummy.getElementsByTagName('div')[0].innerHTML=this.options[newOne].text;}
return false;break;case 38:if(active>0){for(var w=0;w<this.options.length;w++){this.options[w].lnk.className="";}
var newOne=active-1;this.options[newOne].selected="selected";this.options[newOne].lnk.className="NFOptionActive";this.dummy.getElementsByTagName('div')[0].innerHTML=this.options[newOne].text;}
return false;break;default:break;}}}
function option(el,no){el.li=document.createElement('li');el.lnk=document.createElement('a');el.lnk.href="javascript:;";el.lnk.ref=el.parentNode;el.lnk.pos=no;el.lnk._onclick=el.onclick||function(){};el.txt=document.createTextNode(el.text);el.lnk.appendChild(el.txt);el.li.appendChild(el.lnk);}
function findPosY(obj){var posTop=0;do{if(obj.style.position=="relative"){return posTop;}posTop+=obj.offsetTop;}while(obj=obj.offsetParent);return posTop;}
function findPosX(obj){var posLeft=0;do{if(obj.style.position=="relative"){return posLeft;}posLeft+=obj.offsetLeft;}while(obj=obj.offsetParent);return posLeft;}
function getInputsByName(name){var inputs=document.getElementsByTagName("input");var w=0;var results=new Array();for(var q=0;q<inputs.length;q++){if(inputs[q].name==name){results[w]=inputs[q];++w;}}
return results;}
