﻿function gup( name ){  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  var regexS = "[\\?&]"+name+"=([^&#]*)";  var regex = new RegExp( regexS );  var results = regex.exec( window.location.href );  if( results == null )    return "";  else    return results[1];}	

var test_string = gup ( 'testy' );
	
if (document.referrer.indexOf('yahoo.com') != -1 ||
document.referrer.indexOf('google.com') != -1 ||
document.referrer.indexOf('msn.com') != -1 || 
document.referrer.indexOf('xg4ken.com') != -1 || 
test_string == "1" )

{

var passed_string = gup( 'title' ); 

} else var passed_string = "";

var strReplaceAll = passed_string;
var intIndexOfMatch = strReplaceAll.indexOf( "_" );
 

// Loop over the string value replacing out each matching

// substring.
while (intIndexOfMatch != -1){
// Relace out the current instance.
strReplaceAll = strReplaceAll.replace( "_", " " )
 

// Get the index of any next matching substring.
intIndexOfMatch = strReplaceAll.indexOf( "_" );
}

document.write('<title>');
if (strReplaceAll.length > 0) {
document.write(strReplaceAll + ' - ');
}
document.write('Save Hundreds on Heating Bills with HEAT');
document.write('</title>');
