var JSON=JSON||{};(function(){function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());var protectMenu;if(typeof OSLA=="undefined")
{var OSLA=new Object();}
if(typeof OSLA.HN=="undefined")
{OSLA.HN=new Object();}
if(typeof OSLA.MC=="undefined")
{OSLA.MC=new Object();}
OSLA.MC.Html={"popTable":"<table><tbody><tr><th colspan='2'><span>x</span>userN</th></tr><tr>\n\
                                 <td class='pix' width='80'>thumbnailPIX</td><td>\n\
                                 <a onclick='OSLA.HN.OpenUrl(PROFILEURL)' rel='ext'>\n\
                                 <img src='IMAGEURL12-profile.gif' hspace='0' vspace='0' border='0' width='12' height='12' /> View Profile</a><div id='poptablenotuser'><a onclick='javascript:OSLA.MC._bW(USER, msg);return false;'> \n\
                                 <img src='IMAGEURL16-ichat.gif' hspace='0' vspace='0' border='0' width='12' height='12' /> Open conversation</a> <a onclick='OSLA.HN.OpenUrl(MESSAGEURL)'\n\
                                 rel='ext'><img src='IMAGEURL12-email.gif' hspace='0' vspace='0' border='0' width='12' height='12' /> Send Message</a><a onclick='OSLA.HN.Friends.addFriend(USER);' >\n\
                                 <img src='IMAGEURLadd12.gif' hspace='0' vspace='0' border='0' width='12' height='12' /> Add as Friend</a></div><div id='poptableuser'><a onclick='OSLA.HN.OpenUrl(EDITPROFILEURL)'\n\
                                 rel='ext'><img src='IMAGEURL12-pencil.gif' hspace='0' vspace='0' border='0' width='12' height='12' /> Edit Profile & photo</a></div></td></tr></tbody></table>","usrLstHolder":"<a class='roomLink claas' onmouseover='handleSound(HOVERSOUND)' ondblclick='javascript:OSLA.MC._bW(USER, MSG);'\n\
                                  onclick='javascript:showUserOption(event, USER, sX, devce);'\n\
                                  ><p class='sexLower' style='background-image:url(USRPICSMAL)'>\n\
                                   <span class='deviceLower'> userN</span></p></a>","device":"PC"};OSLA.HN._pS={open:function(){try{OSLA.HN._e.display('processStatus');}
catch(e){return;}},hide:function(){try{OSLA.HN._e.hide('processStatus');}
catch(e){return;}}}
OSLA.HN._insTxt=function(target,tag)
{var startPos='';var endPos='';var selected='';var selected2='';var ins='';var sel='';var field=OSLA.HN._e.byId(target);if(document.selection)
{field.focus();selected=document.selection.createRange().text;ins=tag;selected2=document.selection.createRange();sel=document.selection.createRange();sel.text=tag;selected2.moveStart('character',-field.value.length);sel.moveStart('character',selected2.text.length+ins.length-selected.length);}
else if(field.selectionStart||field.selectionStart==0)
{startPos=field.selectionStart;endPos=field.selectionEnd;field.focus();field.value=field.value.substring(0,startPos)+tag+field.value.substring(endPos,field.value.length);field.setSelectionRange(endPos+tag.length,endPos+tag.length);}}
OSLA.HN._e={timeclosetime:'',id:'',elem:null,byId:function(id){var Id=(id==undefined)?this.id:id;var elem=document.getElementById(Id);return elem;},timeinvisible:function(id,val){this.id=id;this.timeclosetime=setTimeout("OSLA.HN._e.invisible()",1000*val);},stopinvisible:function(){clearTimeout(this.timeclosetime);},invisible:function(id,xtraCall){var Id=(id==undefined)?this.id:id;var elem=this.byId(Id);if(xtraCall!=undefined&&xtraCall.split(':')[0]=='zindex'){this.zIndex(id,xtraCall.split(':')[1]);}
switch(xtraCall){case'focus':this.focus(id);break;case'blur':this.blur(id);break;}
elem.style.visibility='hidden';this.stopinvisible();},visible:function(id,xtraCall,val){var elem=this.byId(id);xtraCall=xtraCall==undefined?null:xtraCall;elem.style.visibility='visible';if(xtraCall!=undefined&&xtraCall.split(':')[0]=='zindex'){this.zIndex(id,xtraCall.split(':')[1]);}
switch(xtraCall){case'focus':this.focus(id);break;case'blur':this.blur(id);break;}
if(val!=undefined){val=(val==undefined)?3:val;this.timeinvisible(id,val);}},timehide:function(id,val){this.id=id;this.timeclosetime=setTimeout("OSLA.HN._e.hide()",1000*val);},display:function(ids,xtraCall,val){var id=ids.split('|');for(var i=0;i<id.length;i++){var elem=this.byId(id[i]);elem.style.display='block';if(xtraCall!=undefined&&xtraCall.split(':')[0]=='zindex'){this.zIndex(id,xtraCall.split(':')[1]);}
switch(xtraCall){case'focus':this.focus(id);break;case'blur':this.blur(id);break;}}},hide:function(ids){var Id=(ids==undefined)?this.id:ids;var id=Id.split('|');for(var i=0;i<id.length;i++){var elem=this.byId(id[i]);elem.style.display='none';}},showHide:function(ids){var Id=(ids==undefined)?this.id:ids;var id=ids.split('|');for(var i=0;i<id.length;i++){var elem=this.byId(id[i]);if(elem.style.display=='none'){this.display(id[i]);this.visible(id[i]);}
else{this.hide(id[i]);}}},focus:function(id){var elem=this.byId(id);elem.focus();},zIndex:function(id,value){var elem=this.byId(id);elem.style.zIndex=value;},blur:function(id){var elem=this.byId(id);elem.blur();},assignClass:function(elemIds,classval){var id=elemIds.split('|');var self=this;for(var i=0;i<id.length;i++){var elem=self.byId(id[i]);elem.className=classval;}},addClass:function(elemIds,classval){var elemId=elemIds.split('|');for(var i=0;i<elemId.length;i++){var elem=this.byId(elemId[i]);var elemClass=elem.className;elem.className=elemClass+' '+classval;}},removeClass:function(elemIds,classRemove){var elemId=elemIds.split('|');for(var i=0;i<elemId.length;i++){var newclass='';var elem=this.byId(elemId[i]);var classes=trim(elem.className);var classArray=classes.split(" ");for(var c=0;c<classArray.length;c++){if(trim(classArray[c])!=trim(classRemove)){newclass+=trim(classArray[c])+' '}}
elem.className=trim(newclass);}},putHtml:function(elemId,content){var elem=this.byId(elemId);elem.innerHTML=content;},addHtml:function(elemId,content,before){var elem=this.byId(elemId);var oldcontent=elem.innerHTML;if(before!=undefined){elem.innerHTML=content+' '+oldcontent;}
else{elem.innerHTML=oldcontent+' '+content;}},Html:function(elemIds){var id=elemIds.split('||');var elem;var cnt='';for(var i=0;i<id.length;i++){elem=this.byId(id[i]);if(elem!=null){cnt+=elem.innerHTML+' ';}
else{cnt+='<p style="color:red">the element with id <b>'+id[i]+'</b> is undefined</p> ';}}
return cnt;},showi:'',appear:function(elemId,limit){this.elem=this.byId(elemId);if(appearInterval!=undefined){clearInterval(appearInterval)}
var opc=1;var self=this;OSLA.HN._e.display(elemId);self.transparency(1);this.showi=function(){if(opc>limit){window.clearInterval(appearInterval);self.transparency(limit);self.elem=null;return;}
OSLA.HN._e.transparency(opc);opc++}
limit=(limit==undefined)?100:limit;var appearInterval=window.setInterval("OSLA.HN._e.showi()",10);},transparency:function(opc,elemId){var element=(this.elem==null||this.elem==undefined)?this.byId(elemId):this.elem;element.style.filter="alpha(opacity="+opc+")";element.style.opacity=opc/100;element.style.mozOpacity=opc/100;element.style.khtmlOpacity=opc/100;},toggleButDisable:function(ids){var id=ids.split('||');var elem;for(var i=0;i<id.length;i++){elem=this.byId(id[i]);if(elem.disabled==true){elem.disabled=false;}
else{elem.disabled=true;}}},butDisable:function(ids){var id=ids.split('||');var elem;for(var i=0;i<id.length;i++){elem=this.byId(id[i]);if(elem!=null){elem.disabled=true;}}},butEnable:function(ids){var id=ids.split('||');var elem;for(var i=0;i<id.length;i++){elem=this.byId(id[i]);if(elem!=null){elem.disabled=false;}}}};OSLA.HN.Widget={display:function(name,visiblee){OSLA.HN._e.invisible(name+'-widget-up');OSLA.HN._e.visible(name+'-widget-down');if(visiblee!=undefined){OSLA.HN._e.visible(name+'-widget-cont');}
else{OSLA.HN._e.display(name+'-widget-cont');}},hide:function(name,invisible){OSLA.HN._e.visible(name+'-widget-up');OSLA.HN._e.invisible(name+'-widget-down');if(invisible!=undefined){OSLA.HN._e.invisible(name+'-widget-cont');}
else{OSLA.HN._e.hide(name+'-widget-cont');}}};OSLA.HN.OpenUrl=function(url){if(window.opener&&!window.opener.closed){window.opener.document.location.href=url;}
else{if(siteWindow&&!siteWindow.closed){siteWindow.document.location.href=url;siteWindow.focus();}
else{try{var siteWindow=window.open(url,'siteWindow');var width=window.screen.availWidth;var height=window.screen.availHeight;siteWindow.resizeTo(width,height);siteWindow.focus();}
catch(e){alert('Error opening new window. Disable any popup blocker and try again '+e);}}}}
OSLA.HN.loc=function(url,replace){if(replace==undefined){return window.document.location.href=url;}
else{return window.document.location.replace(url);}}
OSLA.HN.inputCount=function(elemen,limit,respons){if(elemen.value.length>limit){elemen.value=elemen.value.substr(0,limit);if(respons!=undefined){OSLA.HN._e.putHtml(respons,elemen.value.length);}}
else{if(respons!=undefined){OSLA.HN._e.putHtml(respons,elemen.value.length);}}}
function validateCaptcha(formid){var form=document.forms[formid];if(form['recaptcha_response_field']==undefined){return false;}
var value=form['recaptcha_response_field'].value;var value2=form['recaptcha_challenge_field'].value;if(value.length==0||value2.length==0){return false;}
else return true;}
OSLA.HN.cookieData=function(cookieName){var cookieData,cookie;cookieData=document.cookie.split(';');for(var i=0;i<cookieData.length;i++){cookie=cookieData[i].split('=');if(cookie[0]==cookieName){return cookie[1];}}
return false;}
function rand(min,max)
{return min+Math.floor(Math.random()*(max-min+1));}
function resetZIndex(tag,classval,zindex)
{var ids=document.getElementsByTagName(tag);for(var i=0;i<ids.length;i++){if(ids[i].className==classval){ids[i].style.zIndex=zindex;}}
return true;}
function focusMe(meFocus,familyTag,familyClass,indexs)
{var tags=document.getElementsByTagName(familyTag);for(var i=0;i<tags.length;i++){if(tags[i].className==familyClass)tags[i].style.zIndex=indexs[0];}
OSLA.HN._e.byId(meFocus).style.zIndex=indexs[1];return true;}
function resetNameNodeZIndex(name,zindex)
{var ids=document.getElementsByName(name);for(var i=0;i<ids.length;i++){ids.item(i).style.zIndex=zindex;}
return true;}
function addLoadListener(fn)
{if(typeof window.addeListener!='undefined')
{window.addeListener('load',fn,false);}
else if(typeof document.addeListener!='undefined')
{document.addeListener('load',fn,false);}
else if(typeof window.attache!='undefined')
{window.attache('onload',fn);}
else
{var oldfn=window.onload;if(typeof window.onload!='function')
{window.onload=fn;}
else
{window.onload=function()
{oldfn();fn();};}}}
function attacheListener(target,eType,functionRef,capture)
{if(typeof target.addeListener!="undefined")
{target.addeListener(eType,functionRef,capture);}
else if(typeof target.attache!="undefined")
{target.attache("on"+eType,functionRef);}
else
{eType="on"+eType;if(typeof target[eType]=="function")
{var oldListener=target[eType];target[eType]=function()
{oldListener();return functionRef();};}
else
{target[eType]=functionRef;}}}
function stopDefaultAction(e)
{e.returnValue=false;if(typeof e.preDefault!="undefined")
{e.preDefault();}}
function detacheListener(target,eType,functionRef,capture)
{if(typeof target.removeeListener!="undefined")
{target.removeeListener(eType,functionRef,capture);}
else if(typeof target.detache!="undefined")
{target.detache("on"+eType,functionRef);}
else
{target["on"+eType]=null;}}
function geteTarget(e)
{var targetElement=null;if(typeof e.target!="undefined")
{targetElement=e.target;}
else
{targetElement=e.srcElement;}
while(targetElement.nodeType==3&&targetElement.parentNode!=null)
{targetElement=targetElement.parentNode;}
return targetElement;}
function scrollPosition()
{var position=[0,0];if(typeof window.pageYOffset!='undefined')
{position=[window.pageXOffset,window.pageYOffset];}
else if(typeof document.documentElement.scrollTop!='undefined'&&document.documentElement.scrollTop>0||document.documentElement.scrollLeft>0)
{position=[document.documentElement.scrollLeft,document.documentElement.scrollTop];}
else if(typeof document.body.scrollTop!='undefined')
{position=[document.body.scrollLeft,document.body.scrollTop];}
return position;}
function viewportSize()
{var size=[0,0];if(typeof window.innerWidth!='undefined')
{size=[window.innerWidth,window.innerHeight];}
else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0)
{size=[document.documentElement.clientWidth,document.documentElement.clientHeight];}
else
{size=[document.getElementsByTagName('body')[0].clientWidth,document.getElementsByTagName('body')[0].clientHeight];}
return size;}
function middlePositionBox(ref){var scrollingPosition=scrollPosition();var viewport=viewportSize();ref.style.position="absolute";ref.style.left=(scrollingPosition[0]+parseInt(viewport[0]/2))-parseInt(ref.offsetWidth/2)+"px";ref.style.top=(scrollingPosition[1]+parseInt(viewport[1]/2))-parseInt(ref.offsetHeight/2)+"px";}
function posByCursor(event,ref,xAxis,yAxis,detX,detY){ref.style.position="absolute";var cod=mouseXY(event);var X=(xAxis=='left')?cod[0]+detX+"px":cod[0]+detX-parseInt(ref.offsetWidth)+"px";var Y=(yAxis=='top')?cod[1]+detY+"px":cod[1]+detY-parseInt(ref.offsetHeight)+"px";ref.style.position="absolute";ref.style.left=X;ref.style.top=Y;ref.style.visibility="visible";}
function mouseXY(event)
{var cord=[0,0];var mouseX,mouseY;if(typeof event=="undefined")
{mouseX=window.event.x+document.body.scrollLeft;mouseY=window.event.y+document.body.scrollLeft;}
else
{mouseX=(event.clientX)?event.clientX:event.pageX;mouseY=(event.clientY)?event.clientY:event.pageY;}
cord=[mouseX,mouseY];return cord;}
var hand=function(str){try
{OSLA.HN._pS.hide();if(str.indexOf("ERRNO")>=0||str.indexOf("error:")>=0||str.length==0){throw(str.length==0?"Void server response.":str);}
var res=JSON.parse(str);if(res.mode=='login'&&res.login=='yes'){OSLA.HN._e.display("ajaxResponse");OSLA.HN._e.assignClass('ajaxResponse','responsediv-success');OSLA.HN._e.putHtml('ajaxResponse','<i>Login successful. Processing next step...</i>');if(res.changePass=='yes'){OSLA.HN.loc('friendfinder.php','replace');}
else{var returnto=trim(stripTags(OSLA.HN._e.Html('routeto')));if(returnto.length>1){OSLA.HN.loc(returnto,'replace');}
else{OSLA.HN.loc('home.php','replace');}}}
else if(res.mode=='register'&&res.status=='yes'){showLoginRegisterForgot('regLogForgot1');OSLA.HN._e.display("ajaxResponse");OSLA.HN._e.assignClass('ajaxResponse','responsediv-success');OSLA.HN._e.putHtml('ajaxResponse','<i>'+res.message+'</i>');try{OSLA.HN._shade.h();}catch(e){}}
else if(res.mode=='forgotpass'&&res.status=='yes'){OSLA.HN._e.display("ajaxResponse");OSLA.HN._e.assignClass('ajaxResponse','responsediv-success');OSLA.HN._e.putHtml('ajaxResponse','<i>'+res.message+'</i>');try{OSLA.HN._shade.h();}catch(e){}}
else{(res.mode!=undefined&&res.mode=='register')?Recaptcha.reload():false;OSLA.HN._e.display("ajaxResponse");OSLA.HN._e.assignClass('ajaxResponse','responsediv-error');OSLA.HN._e.putHtml('ajaxResponse','<i>'+res.message+'</i>');try{OSLA.HN._shade.h();}catch(e){}}}
catch(e){OSLA.HN._e.display("ajaxResponse");OSLA.HN._e.assignClass('ajaxResponse','responsediv-error');OSLA.HN._e.putHtml('ajaxResponse',e);try{OSLA.HN._shade.h();}catch(e){}
return false;}}
OSLA.HN._shade={s:function(){var e=OSLA.HN._e.byId('coverScreen')
var x=viewportSize()[0]+'px';var y=viewportSize()[1]+'px';e.style.width=x;e.style.height=y;OSLA.HN._e.display('coverScreen');middlePositionBox(e);},h:function(){OSLA.HN._e.hide('coverScreen');}}
function loginRegister(section)
{OSLA.HN._pS.open();var connect=new Mag_SiteConnect(HOMEURL+'lrc.php');var form=document.forms[section];OSLA.HN._e.putHtml('ajaxResponse','');OSLA.HN._e.assignClass('ajaxResponse','')
OSLA.HN._e.hide("ajaxResponse");switch(section){case'register':var checkData=validateInput(section);if(checkData==false){OSLA.HN._pS.hide();return false}
var user=form['userN'].value;if(user.length>10){OSLA.HN.BringDialog('<font color="red"><b>Error:<\/b> Username too long (Max of 10 letters)<\/font>',18000);OSLA.HN._pS.hide();form['userN'].focus();return false;}
if(!/^[a-z0-9_]+$/i.test(user)){OSLA.HN.BringDialog('<font color="red"><b>Error:<\/b> Invalid character(s) in username<\/font>',18000);OSLA.HN._pS.hide();form['userN'].focus();return false;}
var email=form['email'].value;var sex=form['sex'].value;var day=form['day'].value;var month=form['month'].value;var year=form['year'].value;if(form['state'].value==undefined){OSLA.HN._pS.hide();alert("select state");return false}
if(form['city'].value==undefined){OSLA.HN._pS.hide();alert("select city");return false}
var country=form['country'].value;var state=form['state'].value;var city=form['city'].value;var dat=CheckDate(year,month,day,'Error: You inputed a wrong date');if(dat==false){OSLA.HN._pS.hide();return false;}
if(!form['accept'].checked){OSLA.HN._pS.hide();OSLA.HN.BringDialog('<font color="red"><b>Error:</b> You must accept Terms & conditions to continue</font>',18000);form['accept'].focus();return false;}
if(!validateCaptcha(section)){OSLA.HN._pS.hide();OSLA.HN.BringDialog('<font color="red"><b>Error:</b> Type in the two words from image</font>',18000);return false;}
var birthday=year+'-'+month+'-'+day;try{OSLA.HN._shade.s();}catch(e){}
OSLA.HN._e.display("ajaxResponse");OSLA.HN._e.putHtml('ajaxResponse','<i>Processing Registration request...</i>');var captchacha=form['recaptcha_challenge_field'].value;var captchares=form['recaptcha_response_field'].value;var param="act=register&user="+user+"&email="+email+"&sex="+sex+"&dob="+birthday+"&country="+country+"&state="+state+"&city="+city+"&captchares="+captchares+"&captchacha="+captchacha;connect.makeReq(param,hand,'POST');return false;break;case'login':var lUser=form['user'].value;var lPass=form['pass'].value;var lRem=form['rem'].value;var lParam="act=login&user="+lUser+"&pass="+lPass+"&rem="+lRem;try{OSLA.HN._shade.s();}catch(e){}
OSLA.HN._e.display("ajaxResponse");OSLA.HN._e.putHtml('ajaxResponse','<i>Processing login request...</i>');connect.makeReq(lParam,hand,'POST');return false;break;case'forgotpass':var fPass=form['remail'].value;var fParam="act=forgotpass&email="+fPass;connect.makeReq(fParam,hand,'POST');return false;break;}}
OSLA.HN.Message={url:HOMEURL+'message.php',initCon:function(){return new Mag_SiteConnect(HOMEURL+'message.php')},boxToInvisibleId:'',send:function(form,boxid){OSLA.HN._pS.open();this.boxToInvisibleId=(boxid!=undefined)?boxid:'';var message=form.elements['messageText'].value;var subject=form.elements['subject'].value;var receiver=form.elements['receiver'].value;var msgtype=form.elements['msgtype'].value;var msgid=form.elements['msgId[]'].value;var params="ajaxAction=sendreply&messageText="+message+"&subject="+subject+"&receiver="+receiver+"&msgtype="+msgtype+"&msgid[]="+msgid;var conn=this.initCon();conn.makeReq(params,this.handRes,'POST','text',this.handErr);},handErr:function(str){OSLA.HN._pS.hide();var errTxt='Error sending message; '+str;OSLA.HN._e.invisible('loadingState');OSLA.HN._e.display('ajaxResponse');OSLA.HN._e.putHtml('ajaxResponse',errTxt);OSLA.HN._e.assignClass('ajaxResponse','responsediv-error');OSLA.HN.BringDialog(errTxt);},handRes:function(str){try
{OSLA.HN._pS.hide();if(str.indexOf("ERRNO")>=0||str.indexOf("error:")>=0||str.length==0){throw(str.length==0?"Void server response.":str);}
var resp=JSON.parse(str);if(resp['0']=='yes'){OSLA.HN._e.invisible('loadingState');if(OSLA.HN.Message.boxToInvisibleId!=''){OSLA.HN._e.invisible(OSLA.HN.Message.boxToInvisibleId);}
OSLA.HN._e.display('ajaxResponse');OSLA.HN._e.putHtml('ajaxResponse',resp[1]);OSLA.HN._e.assignClass('ajaxResponse','responsediv-success')}
else{throw(resp[1]);}}
catch(e)
{OSLA.HN.Message.handErr(e);}}};OSLA.HN.getGeoFields=function(fvalue,loc){function handRes(str){var stahtml='<p><label for=\'state\'>State</label>: <select id="state" class="checkRequired" name="state" onchange="OSLA.HN.getGeoFields(this.value,\'city\')"><option value=\'\'>Select State</option>';var ctyhtml='<p><label for=\'city\'>City</label>: <select id="city" class="checkRequired" name="city"><option value=\'\'>Select City</option>';var html=(loc=='state')?stahtml:ctyhtml;var dive=(loc=='state')?"state-city-div":'city-div';if(str!=''||str.length>5){var resp=JSON.parse(str);if(resp[0]=='yes'){var datas=resp[1];for(var value in datas){var id=value;for(var i=0;i<datas[value].length;i++){html+='<option value="'+datas[value][i][0]+'">'+datas[value][i][1]+'</option>';}}}}
html+=(loc=='state')?'</select></p><div id="city-div"></div>':'</select></p>';OSLA.HN._e.putHtml(dive,html);}
if(loc=='state'){OSLA.HN._e.putHtml('state-city-div','<i>Loading '+loc+'s...</i>');}
if(loc=='city'){OSLA.HN._e.putHtml('city-div','<i>Loading '+loc+'...</i>');}
var initCo=new Mag_SiteConnect(HOMEURL+'ajaxloaders/getgeovalues.php?loc='+loc+'&id='+fvalue+'rel=');initCo.makeReq(null,handRes);}
OSLA.HN.delNotif=function(notifierid,noticetypeid,wipeDiv){var param="?act=delnotif&notifier="+notifierid+"&noticetype="+noticetypeid;new Mag_SiteConnect(HOMEURL+'notification.php'+param).makeReq(null,function(str){if(str==true){OSLA.HN._e.hide(wipeDiv);}});}
OSLA.HN.AjaxGet=function(reqUrl,elementid,callback){new Mag_SiteConnect(reqUrl).makeReq(null,function(str){if(elementid!=undefined){OSLA.HN._e.putHtml(elementid,str);if(callback!=undefined){eval(callback+'()');}}});}
OSLA.HN.AjaxPost=function(reqUrl,param,elementid,callback){new Mag_SiteConnect(reqUrl).makeReq(param,function(str){if(elementid!=undefined){OSLA.HN._e.putHtml(elementid,str);}
if(callback!=undefined){eval(callback+'()');}},'POST');}
OSLA.HN.profileview=function(type){new Mag_SiteConnect(HOMEURL+'ajaxloaders/changeview.php?type='+type+'&rel=').makeReq(null,function(str){window.location.href=window.location;});}
function validateInput(formId)
{var elements=document.forms[formId].elements;var validEmail=/^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$/;for(var i=0;i<elements.length;i++)
{if(/^(| )checkRequired(| )$/.test(elements[i].className)&&elements[i].value=="")
{elements[i].focus();alert("Please fill something in the "+elements[i].name+" field.");return false;}
if(/(^| )checkEmail(| $)/.test(elements[i].className)&&!validEmail.test(elements[i].value))
{elements[i].focus();alert("Please fill in a valid email address.");return false;}}
return true;}
OSLA.HN.dropMenu={timeclosetime:'',id:'',timeclose:function(id,val){this.id=id;this.timeclosetime=setTimeout("OSLA.HN.dropMenu.close()",1000*val);},stopclose:function(){clearTimeout(this.timeclosetime);},close:function(id){id=(id==undefined)?this.id:id;var elem=OSLA.HN._e.byId(id);elem.style.visibility='hidden';this.stopclose();},open:function(id,val){val=(val==undefined)?3:val;var elem=OSLA.HN._e.byId(id);elem.style.visibility='visible';this.timeclose(id,val);}};OSLA.HN.checkbox={checkById:function(form,id,value){var reval=(value==true)?false:true;for(var i=0;i<form.length;i++){if(form.elements[i].type=='checkbox'){if(form.elements[i].id==id){form.elements[i].checked=value;}
if(form.elements[i].id!=id){form.elements[i].checked=reval;}}}},checkByName:function(name,formid){alert('here');var elem=document.forms[formid].elements[name];alert('here');elem.checked=true;},check:function(form,name,value){for(var i=0;i<form.length;i++){if(form.elements[i].type=='checkbox'&&form.elements[i].name==name){form.elements[i].checked=value;}}}};OSLA.HN.BringDialog=function(message,interval)
{var container=OSLA.HN._e.byId("dialog");var d=document;try{if(container==null){throw("not exist");}}
catch(e){try{var closeTimer;var body=d.getElementsByTagName("body")[0];container=d.createElement("div");container.setAttribute("id","dialog");container.className="dialog";container.setAttribute("name","dialog");var inrcnt=d.createElement("div");inrcnt.className="indialog";inrcnt.setAttribute('id','indialog');var intitle=d.createElement('div');intitle.className='dialogtitle';intitle.setAttribute('id','dialogtitle');var close=d.createElement('span');close.setAttribute('name','closeX');close.className='closeX';close.setAttribute('title','Close');intitle.appendChild(close);inrcnt.appendChild(intitle);var content=d.createElement('div');content.setAttribute('id','dialogcont');content.className='dialogcont';content.setAttribute('name','dialogcont');inrcnt.appendChild(content);container.appendChild(inrcnt);container.style.zIndex='999999';d.getElementsByTagName('body')[0].appendChild(container);close.onclick=function(){body.removeChild(container);}}
catch(e){alert(e);return;}}
container.style.visibility="visible";window.clearTimeout(closeTimer);delete closeTimer;if(typeof interval!='undefined'&&interval!=0){closeTimer=window.setTimeout(function(){try{body.removeChild(container);}
catch(e){return true;}},interval);}
OSLA.HN._e.putHtml('dialogcont',message);middlePositionBox(container);}
function CheckDate(year,month,day,msg)
{var hms_maxval=31;if((month=="April"||month=="04"||month=="4")||(month=="June"||month=="06"||month=="6")||(month=="September"||month=="09"||month=="9")||(month=="November"||month=="11")){hms_maxval=30;}
if((month=="Febuary"||month=="02"||month=="2")&&(year%4)==0){hms_maxval=29;}
if((month=="Febuary"||month=="02"||month=="2")&&(year%4)!=0){hms_maxval=28;}
if(parseInt(day)>hms_maxval)
{alert(msg);return false;}
return true;}
function trim(s)
{if(s==null)return null;return s.replace(/(^\s+)|(\s+$)/g,"")}
function stripnewline(s)
{if(s==null)return null;return s.replace(/(^[\n|\r|\t]+)|([\n|\r|\t]+$)/g,"")}
function stripTags(s,all)
{if(s==null)return null;s=s.replace(/<[^>]+>(.*)<\/[^>]+>/g,"$1");return s;}
function stripURL(s){if(s==null)return null;s="  "+s+"  ";var reg=/((\w+):\/\/)([\w.]+)(\/(\S*))?/g;var url=s.replace(reg,'##d:');if(/@##d:/.test(url)){return s;}
else{return url;}}
OSLA.HN.reportAbuse=function(subject,ids){var fields=new Array();try{fields['subject']=encodeURIComponent(subject);var msg='<div>subject: '+subject+'<br \/>Abuse Url: '+window.location.href+'<br \/><\/div>';if(ids!=undefined){var id=ids.split(':');for(var i=0;i<id.length;i++){try{msg+='<div>'+OSLA.HN._e.byId(id[i]).innerHTML+'<\/div>';}
catch(e){msg+='<div style="color:red">'+e+'<\/div>';continue;}}}
fields['message']=encodeURIComponent(msg);var params='';for(var k in fields){params+=k+'='+fields[k]+'&';}
OSLA.HN._pS.open();new Mag_SiteConnect(HOMEURL+'ajaxloaders/reportabuse.php?c='+rand(1,10000)).makeReq(params,function(str){OSLA.HN._pS.hide();OSLA.HN.BringDialog(str,40000)},'POST',null,function(str){OSLA.HN._pS.hide();OSLA.HN.BringDialog(str,40000);})}
catch(e){alert('Error: request not complete. please try again later \n'+(HN_debug==true)?e:"");OSLA.HN._pS.hide();}}