<!--

// window.onerror = stoperror;
 
function stoperror()
{
	// supress javascript runtime errors
	return true;
}


function OpenWindow(theURL,winName,features)
{
	// opens new window
	new_window = null;
	new_window = window.open(theURL,winName,features);
	new_window.focus();
	return false;
}

function printPage(area)
{

	// generates print version of content page
	// content areas are marked with id=printPageContent1 and id=printPageContent2
	
	var windowparams = 'location=no,directories=no,status=yes,menubar=no,toolbar=yes,scrollbars=yes,resizable=yes,width=550,height=600,top=10,left=10'
	var content1, content2;
	content1 = "";
	content2 = "";

	if (document.getElementById)
	{
		if (document.getElementById("printPageButton"))
			document.getElementById("printPageButton").style.visibility="hidden";
			
		if (document.getElementById("printPageContent1"))
			content1 = document.getElementById("printPageContent1").innerHTML ;

		content1 = content1.replace(/>top</gi,"><");

		if (document.getElementById("printPageContent2"))
			content2 = document.getElementById("printPageContent2").innerHTML ;
	}


	if ((content1 == "")&&(content2 == "")) // ancient browser
		window.print();
	else
	{
		printIt = window.open("","PrintPage",windowparams);
		printIt.document.open();
		printIt.document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/transitional.dtd\">\n");
		printIt.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n");
		printIt.document.write("<html><head><title>printversion: YOUR LIFE</title>\n");
		printIt.document.write("<link rel=\"stylesheet\" href=\"/html/css/common.css\" type=\"text/css\">\n");
		printIt.document.write("<link rel=\"stylesheet\" href=\"/html/css/"+area+".css\" type=\"text/css\">\n");

		printIt.document.write("<link rel=\"stylesheet\" href=\"/html/css/"+area+".css\" type=\"text/css\">\n");
		printIt.document.write("<link rel=\"stylesheet\" href=\"/html/css/"+area+".css\" type=\"text/css\">\n");

		printIt.document.write("<script type=\"text/javascript\">\n");
		printIt.document.write("<!--\n");
		printIt.document.write("function printpage() {\n");
		printIt.document.write("	document.getElementById(\"button1\").style.visibility=\"hidden\";\n");
		printIt.document.write("	document.getElementById(\"button2\").style.visibility=\"hidden\";\n");
		printIt.document.write("	window.print();\n");
		printIt.document.write("	document.getElementById(\"button1\").style.visibility=\"visible\";\n");
		printIt.document.write("	document.getElementById(\"button2\").style.visibility=\"visible\";\n");
		printIt.document.write("}\n");
		printIt.document.write("//-->\n");
		printIt.document.write("</script>\n");

		printIt.document.write("</head>\n<body>\n");


		printIt.document.write("<TABLE WIDTH=530 CELLSPACING=0 CELLPADDING=0 BORDER=0>\n");

		printIt.document.write("<TR>\n");
		printIt.document.write("<TD width=8></TD>\n");
		printIt.document.write("<TD style=\"padding-top:5px;\" width=500 valign=\"top\" align=\"right\">\n");
		printIt.document.write("<img src=http://test.your-life.com/"/html/img/your_life.gif/" width=\"66\" height=\"110\" alt=\"YOUR LIFE\" border=\"0\" vspace=\"0\" hspace=\"0\">\n");
		printIt.document.write("</TD></TR>\n");

		printIt.document.write("<TR>\n");
		printIt.document.write("<TD width=8></TD>\n");
		printIt.document.write("<TD width=500 valign=\"top\" class=\"text\"><br>\n");

		printIt.document.write(content1);

		printIt.document.write("</TD>\n");

		// printIt.document.write("<TD width=8></TD>\n");
		// printIt.document.write("<TD width=7></TD>\n");
		// printIt.document.write("<TD width=214 align=\"center\" valign=\"top\">\n");
		// printIt.document.write(content2);
		// printIt.document.write("</TD>\n");

		printIt.document.write("</TR>\n");
		printIt.document.write("</TABLE>\n");

		printIt.document.write("<input id=button1 class=button_search style=\"width:60px;margin-left:10px;margin-top:10px;margin-bottom:10px;\" type=button value=\"Print\" onclick=\"printpage()\">\n");
		
		printIt.document.write("<input id=button2 class=button_search style=\"width:60px;margin-left:30px;margin-top:10px;margin-bottom:10px;\" type=button value=\"Close\" onclick=\"window.close()\">\n");

		printIt.document.write("\n</body>\n<!-- Mirrored from test.your-life.com/html/js/common.js by HTTrack Website Copier/3.x [XR&CO'2007], Fri, 17 Aug 2007 07:49:35 GMT --></html>");
		printIt.document.close();
		printIt.focus();
		// problems with opera and safari:
		// printIt.print(); 
		// printIt.close();

	}

	if (document.getElementById("printPageButton"))
		document.getElementById("printPageButton").style.visibility="visible";

}


function trim(str)
{
 while(str.substring(0,1)==' ')
 	str=str.substring(1,str.length);
 while(str.substring(str.length-1,str.length)==' ')
 	str=str.substring(0,str.length-1);
 return str;
}


function check_form_search()
{
  var input_error = 0;

  if (js_alert_search_1 == "")
  	 js_alert_search_1 = "Please enter a search word.";

  if (js_alert_search_2 == "")
  	 js_alert_search_2 = "Your query must be at least 3 characters in length.";
 
  if ((input_error == 0) && (trim(document.search_form.search_input.value) == "" ))
  {
	  alert(js_alert_search_1);
	  document.search_form.search_input.focus();
	  input_error = 1;
  }

  if ((input_error == 0) && (trim(document.search_form.search_input.value) != "" ))
  {
  	  temp = trim(document.search_form.search_input.value);
  	  if (temp.length < 3)
	  {
	  	alert(js_alert_search_2);
	  	document.search_form.search_input.focus();
	  	input_error = 1;
  	  }
  }

  if (input_error == 1)
	  return false;
  else
	  return true;

}

function confirmAction()
{
	// Display a confirmation popup informing the user that they're leaving the site. Returns true if they click OK, false if they click Cancel.
	
	var confirmMsg = "You are about leave this website.\n\n";
	confirmMsg = confirmMsg + "*     the information you are about to be referred to may not comply with the Australian regulatory environment and you should refer to the Consumer Medical Information (CMI) for products to fully understand the terms of a product's registration in Australia;\n\n";
	confirmMsg = confirmMsg + "*     the intent of providing this material is informational and not as advice; and\n\n";
	confirmMsg = confirmMsg + "*     any information provided by this source should be discussed with your healthcare professional and does not replace their advice\n\n";
	confirmMsg = confirmMsg + "Do you wish to proceed?";
	
	return confirm(confirmMsg);
}

// -->
 
