
if (document.images)
{
		
	off_home = new Image()
	off_home.src = "/images/health_insurance_home_off.gif"
	on_home = new Image()
	on_home.src = "/images/health_insurance_home_on.gif"
		
	off_wchcf = new Image()
	off_wchcf.src = "/images/health_insurance_whyhcf_off.gif"
	on_wchcf = new Image()
	on_wchcf.src = "/images/health_insurance_whyhcf_on.gif"
	
	off_products = new Image()
	off_products.src = "/images/health_insurance_products_off.gif"
	on_products = new Image()
	on_products.src = "/images/health_insurance_products_on.gif"
	
	off_healthCentres = new Image()
	off_healthCentres.src = "/images/health_insurance_healthCentres_off.gif"
	on_healthCentres = new Image()
	on_healthCentres.src = "/images/health_insurance_healthCentres_on.gif"
 	
	off_topics = new Image()
	off_topics.src = "/images/health_insurance_topics_off.gif"
	on_topics = new Image()
	on_topics.src = "/images/health_insurance_topics_on.gif"
		
	off_corporate = new Image()
	off_corporate.src = "/images/health_insurance_partners_off.gif"
	on_corporate = new Image()
	on_corporate.src = "/images/health_insurance_partners_on.gif"
	
	off_aboutHCF = new Image()
	off_aboutHCF.src = "/images/health_insurance_aboutHCF_off.gif"
	on_aboutHCF = new Image()
	on_aboutHCF.src = "/images/health_insurance_aboutHCF_on.gif"
	
	off_forms = new Image()
	off_forms.src = "/images/health_insurance_forms_off.gif"
	on_forms = new Image()
	on_forms.src = "/images/health_insurance_forms_on.gif"
	
	off_members = new Image()
	off_members.src = "/images/health_insurance_members_off.gif"
	on_members = new Image()
	on_members.src = "/images/health_insurance_members_on.gif"
	
	off_faq = new Image()
	off_faq.src = "/images/health_insurance_faqs_off.gif"
	on_faq = new Image()
	on_faq.src = "/images/health_insurance_faqs_on.gif"
	
	off_contactUs = new Image()
	off_contactUs.src = "/images/health_insurance_contactUs_off.gif"
	on_contactUs = new Image()
	on_contactUs.src = "/images/health_insurance_contactUs_on.gif"
	
	off_sitemap = new Image()
	off_sitemap.src = "/images/health_insurance_sitemap_off.gif"
	on_sitemap = new Image()
	on_sitemap.src = "/images/health_insurance_sitemap_on.gif"
}

function swapimage(imgLocation, imgName)
{
	if(document.images)
	{
		document.images[imgLocation].src = eval(imgName + ".src");
	}
}
//print function
function Printer()
{
	window.print();
}


//popup window
function openWindow(theURL) { //v2.0
  var winName = "popup"
  var features= "scrollbars=yes,toolbar=yes, location=1,resizable=1,width=720,height=520"
  window.open(theURL,winName,features);
}

//popup window without toolbar
function openWindow_nobar(theURL) { //v2.0
  var winName = "popup"
  var features= "scrollbars=yes,toolbar=no, location=0,resizable=0,width=320,height=320"
  window.open(theURL,winName,features);
}
//popup window without toolbar
function cover_note(theURL) { //v2.0
  var winName = "popup"
  var features= "scrollbars=yes,toolbar=no, location=0,resizable=0,width=400,height=460"
  window.open(theURL,winName,features);
}

//For product popup window (without toolbar)
function popup_product(theURL) { //v2.0
  var winName = "popup"
  var features= "scrollbars=yes,toolbar=no, location=0,resizable=0,width=510,height=500"
  window.open(theURL,winName,features);
}

function popup_flat(theURL) { //v2.0
  var winName = "popup"
  var features= "scrollbars=yes,toolbar=no, location=0,resizable=0,width=500,height=200"
  window.open(theURL,winName,features);
}

//popup window
function openSmallWindow(theURL) { //v2.0
  var winName = "popup"
  var features= "scrollbars=yes,width=180,height=250,resizable=no,scrollbars=yes,menubar=no"
  window.open(theURL,winName,features);
}

//states
function StatesList()
{
 document.write("<tr>");
 document.write("<td valign=top class='pagetext' align='right'>State:</td>");
 document.write("<td><select name='State' class='pagetext'>");
 document.write("<option value='NSW'>NSW</option>");
 document.write("<option value='VIC'>VIC</option>");
 document.write("<option value='ACT'>ACT</option>");
 document.write("<option value='QLD'>QLD</option>");
 document.write("<option value='WA'>WA</option>");
 document.write("<option value='NT'>NT</option>");
 document.write("<option value='SA'>SA</option>");
 document.write("<option value='TAS'>TAS</option>");
 document.write("</select>");
 document.write("</td>");
 document.write("</tr>");
}

//print function
function PrintPage()
{
	window.print();
}

function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}
