
function makeURL(href){
     var is_4patpro = href.match(/4patpro.com/);
     if (is_4patpro) {
	href = href.replace(/4patpro.com/, 'patentpro.us');
     }

     var is_4patpro = href.match(/patentproplus.com/);
     if (is_4patpro) {
	href = href.replace(/patentproplus.com/, 'patentpro.us');
     }

     var is_wrong_patpro = href.match(/http:\/\/patentpro.us/);
     if (is_wrong_patpro) {
	href = href.replace(/http:\/\/patentpro.us/, 'http://www.patentpro.us');
     }

     var is_https_4 = href.match(/index.php\?menu\=4/);
     var is_https = href.match(/index.php\?menu\=14/);
     if(is_https){
       href = href.replace(/http:\/\/www.patentpro.us\/index.php\?menu\=14/,'https://secure.patentpro.us/index.php?menu=14');
     }else if(is_https_4){
       href = href.replace(/http:\/\/www.patentpro.us\/index.php\?menu\=4/,'https://secure.patentpro.us/index.php?menu=4');
     }else{
       href = href.replace(/https:\/\/secure.patentpro.us\//,'http://www.patentpro.us/');
     }
     return href;
}

function parseLinks(){
     var links = document.links;
     for(var i=0;i<links.length;i++){
        links[i].href = makeURL(links[i].href);
	//alert(links[i].href);	
     }
} 
