

var http_request = false;


function makePOSTRequest(url,parameters,proc){

    http_request = false;

    if(window.XMLHttpRequest){// Mozilla, Safari etc block

        http_request = new XMLHttpRequest();

        if(http_request.overrideMimeType){

            http_request.overrideMimeType('text/xml');

        }//end overrideMimeType

    }else if(window.ActiveXObject){// IE block

        try{

            http_request = new ActiveXObject("Msxml2.XMLHTTP");

        }catch (e){

            try{//inner try block

                http_request = new ActiveXObject("Microsoft.XMLHTTP");

            }catch (e){}//end inner try block

        }//end catch(e) [outer try block]

    }//end IE

    if(!http_request){

        alert('Cannot create XMLHTTP instance');

        return false;

    }//end !http_request


    http_request.onreadystatechange = proc;
    http_request.open('POST', url, true);
    http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http_request.setRequestHeader("Content-length", parameters.length);
    http_request.setRequestHeader("Connection", "close");
    http_request.send(parameters);

}//end function makePOSTRequest

// // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // //
function rCY(){

    if(http_request.readyState == 4){

        if(http_request.status == 200){

            var update = new Array();
            result = http_request.responseText;

            if(result.indexOf('|' != -1)){

                update = result.split('|');

                    alert(update[1]);

            }//end indexOf

            }else{//error in processing request [status != 200]

                alert('There was a problem with the request.');

        }//end else

    }//end if readyState
}

// // // // // // // // // // // // // // // // // // // // // // // //

function addemail(theFormField,proc){

  var poststr =  "action=addemail&email=" +
    encodeURIComponent(document.getElementById(theFormField).value);
    makePOSTRequest('/rpc.html',poststr,proc);
}

function info(theFormField,proc){

  var poststr =  "action=info&email=" +
    encodeURIComponent(document.getElementById(theFormField).value);
    makePOSTRequest('/rpc.html',poststr,proc);
}

function showStuff(theDiv){
    theDiv.style.backgroundImage = 'url(/images/nav_over.gif)';
    }
function hideStuff(theDiv){
    theDiv.style.backgroundImage = 'url(/images/tab_background.gif)';
    }
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }




var forms = document.getElementsByTagName("form");
for(var z = 0; z < forms.length; z++)
 { 
   var form = forms[z];
   if(form.getAttribute("id").substring(0, 6) == "paypal")
   { 

      form.target = "_blank";
   } 
 } 

}

window.onload = externalLinks;