// JavaScript Document
function extract ( urlStr ){
	var tmpstr = urlStr.split(":");
	if ( tmpstr[1].substring(0,5) == "//www")
		tmpstr[1] = tmpstr[1].substring(6,tmpstr[1].length);
	else
		tmpstr[1] = tmpstr[1].substring(2,tmpstr[1].length);
	return tmpstr;
	
}

function checkURL ( urlStr ){
	/*incomplete reg exp */
	var tmp = new RegExp ("(http:\/\/)(www\.)?(([a-zA-Z0-9\-\_])+)([\.][a-zA-Z])");
	if (!tmp.test(urlStr) ){
		alert ( "String is NOT in good condition\nEX:\n  http://www.domain-name.com \n OR \n  http://domain-name.com");
		return false;
	}return true;
		
}

function capitalize( urlStr ){
	var i, str, t1, t2, finalstr = "";
	str = urlStr.split(" ");
	for( i = 0; i < str.length; i++ ){
		str[i] = (str[i].substring(0,1)).toUpperCase() + str[i].substring(1,str[i].length);
	}
	for ( i = 0; i < str.length; i++ ){
		if ( finalstr == "" ) finalstr = str[i];
		else finalstr = finalstr + " " + str[i];
	}
	return finalstr;
}



function display( clientURL, anchortitle, description ){
	var client0, client,email, anctitle;
email="buyproperty4less@yahoo.com?Subject=BuyProperty4Less Link Request";
	var test = checkURL ( clientURL );	
	if (test){
		client0 = extract (clientURL);
		client = client0[1];
		anctitle = capitalize ( anchortitle );

      document.write("<div style='width:250px; height:15px; padding-left:31px; padding-top:26px;'>");
      document.write("<h1 class='deepred16font'>Link To BuyProperty4Less.com </h1>");
      document.write("</div><div style='width:510px; padding-left:31px; padding-top:25px; padding-right:40px;'>");
      document.write("<span class='maincontentfont'>Link popularity is fast becoming one of the highest weighted criteria used in ranking your site in the search engines. The more related sites linking to yours the higher your sites ranking climbs in the search engine results. We like to link with sites that complement ours or can offer our clients a valid service. We will not exchange links with any website that is unduly offensive or fraudulently boastful in its claims.<br /><br />");
      document.write("</span><span class='deepred11font'>How do I swap links with buyproperty4less.com ?</span><span class='maincontentfont'><br />");
      document.write("<br />Exchanging links between our two sites is easy. <a href=\"mailto:" + email + "\" class='bulletbluelink11'>Send us an email </a>with a one or two sentence description of your site and the exact URL. We'll review your site as soon as possible, validate the reciprocal link on your site and if we feel that your site provides good complimentary content, we will reciprocate the link.<br />");
      document.write("<br /></span><span class='deepred11font'>To add buyproperty4less.com link to your website, simply use the following html code:</span><br />");
      document.write("<br /><div class='maincontentfont' style='padding:7px; background-color:#f5f4f4;'>&lt;a href=\"" + clientURL + "\" title=\"" + anctitle + "\"&gt;" + anctitle + "&lt;/a&gt;&lt;br&gt;" + description + "</div><br /><span class='maincontentfont'><br />");
      document.write("Thank you kindly,<br />BuyProperty4Less.com</span><h1 class='deepred14font'><br />Premium Resources</h1><br />");

	}
	else{
		document.write ("<div style=\"font-size:14px;font-weight:bold;color:#ff0000;\">PLEASE CORRECT URL STRING ! </div>");
	}
}





