function addL(f){var oload=window.onload;if(typeof window.onload !='function'){window.onload=f;}else{window.onload=function(){if (oload){oload();}f()}}}function $(e){return document.getElementById(e);}
function aR(){var req=new Object();req.url=window.location.href;req.async=true;req.parameters=new Object();req.rR=false;req.qStr="";req.responseText=null;req.responseXML=null;req.xmlHttpRequest=null;req.onSuccess=null;req.onError=null;req.xmlHttpRequest=aR.getXmlHttpRequest();if(req.xmlHttpRequest==null){return null;}req.xmlHttpRequest.onreadystatechange=function(){if(req==null||req.xmlHttpRequest==null){return;}if(req.xmlHttpRequest.readyState==4){req.onCI(req);}};req.onCIH=false;req.onCI=function(){if(req.onCIH||req.aborted){return;}req.onCIH=true;req.rR=true;req.status=req.xmlHttpRequest.status;req.responseText=req.xmlHttpRequest.responseText;req.responseXML=req.xmlHttpRequest.responseXML;if(typeof(req.onComplete)=='function'){req.onComplete(req)};if(req.xmlHttpRequest.status==200 && typeof(req.onSuccess)=='function'){req.onSuccess(req)};delete req.xmlHttpRequest['onreadystatechange'];req.xmlHttpRequest=null;};req.process=function(){if(req.xmlHttpRequest!=null){if(req.unique && req.method=='GET'){req.parameters['unq']=new Date().getTime()+""+req.requestIndex};var content=null; for (var i in req.parameters){if(req.qStr.length>0){req.qStr +='&';}req.qStr+=encodeURIComponent(i)+'='+encodeURIComponent(req.parameters[i]);}if(req.method=='GET'){if(req.qStr.length>0){req.url+=((req.url.indexOf('?')>-1)?'&':'?')+req.qStr;}}req.xmlHttpRequest.open(req.method,req.url,req.async);if(req.method=='POST'){req.xmlHttpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');content=req.qStr;}req.xmlHttpRequest.send(content);}};req.handleArgs=function(args){for (var i in args){if(typeof(req[i])=='undefined'){req.parameters[i]=args[i];}else {req[i]=args[i];}}};return req;}
aR.getXmlHttpRequest=function(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else if(window.ActiveXObject){/*@cc_on @*//*@if(@_jscript_version >=5)try {return new ActiveXObject('Msxml2.XMLHTTP');}catch (e){try {return new ActiveXObject('Microsoft.XMLHTTP');}catch (E){return null;}}@end @*/}else{return null;}};
aR.get=function(args){aR.doRequest('GET',args);};aR.post=function(args){aR.doRequest('POST',args);};
aR.doRequest=function(method,args){if(typeof(args)!='undefined' && args!=null){var mReq=new aR();mReq.method=method;mReq.handleArgs(args);mReq.process();}};
aR.submit=function(theform, args){var mReq=new aR();if(mReq==null){return false;}var sForm=aR.szForm(theform);mReq.method=theform.method.toUpperCase();mReq.url=theform.action;mReq.handleArgs(args);mReq.qStr=sForm;mReq.process();return true;};
aR.szForm=function(theform){var els=theform.elements;var len=els.length;var qStr="";this.addField=function(name,value){if(qStr.length>0){qStr+='&';}qStr+=encodeURIComponent(name)+'='+encodeURIComponent(value);};for (var i=0; i<len; i++){var el=els[i];switch(el.type){case 'text':case 'textarea':case 'hidden':this.addField(el.name,el.value);break;case 'checkbox':case 'radio':if(el.checked){this.addField(el.name,el.value);}break;}}return qStr;};
function addE(el,event,h){if(el.attachEvent){el.attachEvent('on'+event,h)}else if(el.addEventListener){el.addEventListener(event,h,false)}}
function cancelE(e, c){if (!e) e = window.event;e.returnValue=false;if(e.preventDefault){e.preventDefault()};if(c){e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation()};}};
function subFForm(e){cancelE(e);var status=aR.submit(document.forms['friend'],{'url':'/friend.php?ajax=yes&send=Send','onSuccess':function(req){$('msg').innerHTML=req.responseText;}});return status;}
function submitQuote(e){/*cancelE(e);var status=aR.submit(document.forms['quoteform'],{'url':'/mquote.php?ajax=yes&go=Send','onSuccess':function(req){$('qmsg').innerHTML=req.responseText;}});return status;*/}
function submitContact(e){cancelE(e);var status=aR.submit(document.forms['contactform'],{'url':'/cont.php?ajax=yes&sendcontact=Send','onSuccess':function(req){$('reply').innerHTML=req.responseText;}});return status;}
function extL() {var anch=document.getElementsByTagName("a");for (var i=0;i<anch.length;i++){var anchor=anch[i];if(anchor.getAttribute("rel")=="nofollow" ||anchor.getAttribute("rel")=="external"){anchor.target="_blank";}}}
addL(bQuote);addL(bFriend);addL(contact);addL(extL)
function bFriend(e){if($('send')){$('send').onclick=subFForm}}function bQuote(e){if($('go')){$('go').onclick=submitQuote}}function contact(e){if($('sendcontact')){$('sendcontact').onclick=submitContact}}

