//Start Flash scripts
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
	var version;
	var axo;
	var e;
	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}
	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";
			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";
			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }
  document.write(str);
}
function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    
    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

//End Flash scripts




//start Preload

var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
preloadimages("img/header1_bg.jpg","img/menu.gif","img/menu_hov.gif","img/header2_bg.gif","img/left_menu.gif","img/left_menu_hov.gif","img/cat.jpg","img/left_li.gif","img/ten.gif","img/cont_bg.gif","img/cont_top.gif","img/cont_bot.gif","img/footer_bg.gif","img/logo.png","")

//End Preload






//Start Popup


function popUp0(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=750,height=500');");
}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=510,height=500');");
}
function popUp1(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=430,height=200');");
}
function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=430,height=350');");
}
function popUp3(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=700');");
}
function popUp4(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=700,height=300');");
}
//End Popup

// Start Saving Calculator


var i = 0; // interest
var m = 0; // months
var f = 0; // factor
var den = 0; 
var s = "0"; // string
var d = 0; // decimal place
function CalcA() {
if(document.calform.interest.value=="" || document.calform.months.value=="" || document.calform.payment.value=="") {
alert("Please fill in all of the required fields.");
}
else { 
if(document.calform.period.options[1].selected == true) {
m = document.calform.months.value * 12;
}
else {
m = document.calform.months.value;
} 
i = Math.pow(((document.calform.interest.value/100)+1),.0833333)-1;
den = i / (i+1);
f = Math.pow((i+1),m)-1;
f /= den;
f *= document.calform.payment.value;
d = String(f).indexOf(".");
s = String(f).substring(0,(d+3));
document.calform.total.value = "$" + s;  
   }
}

//  End Saving Calculator


//Start Income Calculator

function GrossTextTotal() {
var Calc = document.NetIncome;
if (Calc.InputRad[0].checked & Calc.HoursPerWeekText.value == "") {
Calc.GrossText.value = (parseFloat(Calc.HourlyText.value) * 2080) + " $";
}
else {
if (Calc.InputRad[0].checked & Calc.HoursPerWeekText.value < "41") {
Calc.GrossText.value = (parseFloat(Calc.HourlyText.value) * parseFloat(Calc.HoursPerWeekText.value) * 52) + " $";
}
else
if (Calc.InputRad[0].checked & Calc.HoursPerWeekText.value > "40") {
Calc.OTHoursText.value = Calc.HoursPerWeekText.value - 40;
Calc.OTWagesText.value = Calc.HourlyText.value * 2 / 4 * 3;
Calc.OTPayText.value = Calc.OTWagesText.value * Calc.OTHoursText.value + " $";
Calc.GrossText.value = (parseFloat(Calc.HourlyText.value * 40) + parseFloat(Calc.OTPayText.value)) * 52 + " $";
      }
   }
}
function TotalGrossPerYear() {
var Calc = document.NetIncome;
if (!(Calc.GrossText.value < 49800)) {
Bracket2();
}
else {
if (!(Calc.GrossText.value > 49800)) {
Bracket1();
      }
   }
}
function Bracket1() {
var Calc = document.NetIncome;
if (Calc.InputRad[0].checked) {
// This number is modified every year and per tax bracket
Calc.GH1Text.value = (parseFloat(Calc.GrossText.value) - 3090) + " $";

// This number is modified every year and per tax bracket
Calc.GH2Text.value = (parseFloat(Calc.GrossText.value) - 20600) + " $";

// This number is modified every year and per tax bracket
Calc.GH3Text.value = (parseFloat(Calc.GH2Text.value) * 28 / 100) + " $";

Calc.NetText.value = (parseFloat(Calc.GH1Text.value) - parseFloat(Calc.GH3Text.value)) + " $";
Calc.MonthlyText.value = Math.round(parseFloat(Calc.NetText.value) / 12.991) + " $";
Calc.Bi_WeeklyText.value = (parseFloat(Calc.MonthlyText.value) / 2) + " $";
Calc.WeeklyText.value = (parseFloat(Calc.Bi_WeeklyText.value) / 2) + " $";
}
else {
if (Calc.InputRad[1].checked) {
Calc.GH1Text.value = (parseFloat(Calc.GrossText.value) - 3090) + " $";
Calc.GH2Text.value = (parseFloat(Calc.GrossText.value) - 20600) + " $";
Calc.GH3Text.value = (parseFloat(Calc.GH2Text.value) * 28 / 100) + " $";   
Calc.NetText.value = (parseFloat(Calc.GH1Text.value) - parseFloat(Calc.GH3Text.value)) + " $";
Calc.MonthlyText.value = Math.round(parseFloat(Calc.NetText.value) / 12.991) + " $";
Calc.Bi_WeeklyText.value = (parseFloat(Calc.MonthlyText.value) / 2) + " $";
Calc.WeeklyText.value = (parseFloat(Calc.Bi_WeeklyText.value) / 2) + " $";
Calc.HourlyText.value = "N/A";
      }
   }
}
function Bracket2() {
var Calc = document.NetIncome;
if (Calc.InputRad[0].checked) {
Calc.GH1Text.value = (parseFloat(Calc.GrossText.value) - 11266) + " $";
Calc.GH2Text.value = (parseFloat(Calc.GrossText.value) - 49800) + " $";
Calc.GH3Text.value = (parseFloat(Calc.GH2Text.value) * 31 / 100) + " $";   
Calc.NetText.value = (parseFloat(Calc.GH1Text.value) - parseFloat(Calc.GH3Text.value)) + " $";
Calc.MonthlyText.value = Math.round(parseFloat(Calc.NetText.value) / 12.991) + " $";
Calc.Bi_WeeklyText.value = (parseFloat(Calc.MonthlyText.value) / 2) + " $";
Calc.WeeklyText.value = (parseFloat(Calc.Bi_WeeklyText.value) / 2) + " $";
}
else {
if (Calc.InputRad[1].checked) {
Calc.GH1Text.value = (parseFloat(Calc.GrossText.value) - 11266) + " $";
Calc.GH2Text.value = (parseFloat(Calc.GrossText.value) - 49800) + " $";
Calc.GH3Text.value = (parseFloat(Calc.GH2Text.value) * 31 / 100) + " $";   
Calc.NetText.value = (parseFloat(Calc.GH1Text.value) - parseFloat(Calc.GH3Text.value)) + " $";
Calc.MonthlyText.value = Math.round(parseFloat(Calc.NetText.value) / 12.991) + " $";
Calc.Bi_WeeklyText.value = (parseFloat(Calc.MonthlyText.value) / 2) + " $";
Calc.WeeklyText.value = (parseFloat(Calc.Bi_WeeklyText.value) / 2) + " $";
Calc.HourlyText.value = "N/A";
      }
   }
}
function NAHourlyText() {
var Calc = document.NetIncome;
Calc.HourlyText.value = "N/A";
Calc.HoursPerWeekText.value = "N/A";
Calc.GrossText.value = "";
}
function NAGrossText() {
var Calc = document.NetIncome;
Calc.GrossText.value = "N/A";
Calc.HoursPerWeekText.value = "";
Calc.HourlyText.value = "";
}

//end Income Calculator




//Start Interest Calculator

function checkNumber(input, min, max, msg)
{
 msg = msg + " field has invalid data: " + input.value;
 var str = input.value;
 for (var i = 0; i < str.length; i++) {
 var ch = str.substring(i, i + 1)
 if ((ch < "0" || "9" < ch) && ch != '.') {
 alert(msg);
 return false;
}
}
var num = parseFloat(str)
if (num < min || max < num) {
alert(msg + " not in range [" + min + ".." + max + "]");
return false;
}
input.value = str;
return true;
}
function computeField(input)
{
if (input.value != null && input.value.length != 0)
input.value = "" + eval(input.value);
computeForm(input.form);
}
function computeForm(form)
{
if ((form.FV.value == null || form.FV.value.length == 0) ||
(form.interest.value == null || form.interest.value.length == 0) ||
(form.PMT.value == null || form.PMT.value.length == 0) ||
(form.PV.value == null || form.PV.value.length == 0)) {
return;
}
if (!checkNumber(form.FV, -100000000, 100000000, "Financial Goal") ||
!checkNumber(form.interest, .001, 99, "Annual Rate of Return") ||
!checkNumber(form.PMT, 0, 10000000, "Monthly Contibution") ||
!checkNumber(form.PV, 0, 99999999, "Initial Investment")) {
form.N.value = "Invalid";
return;
}
var i = parseFloat(form.interest.value);
//    form.N.value = i;
if (i > 1.0) {
i = i / 100.0;
//        form.interest.value = i;
}
//    form.FV2.value = i;
i /= 12;
//    form.gain.value = i;
var FV = parseFloat(form.FV.value);
var PV = parseFloat(form.PV.value);
var PMT = parseFloat(form.PMT.value);
FV = -FV;
form.N.value = Math.ceil((Math.log((PMT-(FV*i))/((PV*i)+PMT)))/(Math.log(1+i)));
var n = parseFloat(form.N.value);
n /= 12;
//    n = Math.ceil(n);
form.N.value = n;
n *= 12;
FV = (-(-PV-PMT*((1-Math.pow(1+i,-n))/i))/(Math.pow(1+i,-n)));
form.gain.value = FV - (n*PMT+PV);
FV = parseFloat(form.FV.value);
}
function clearForm(form)
{
form.FV.value = "";
form.interest.value = "";
form.PV.value = "";
form.PMT.value= "";
}

//End Interest Calculator


//Start Popup
function hideDiv1() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv1() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow.style.visibility = 'visible'; 
} 
} 
} 

//--
function hideDiv2() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow2').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow2.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow2.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv2() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow2').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow2.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow2.style.visibility = 'visible'; 
} 
} 
} 

//--
function hideDiv3() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow3').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow3.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow3.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv3() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow3').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow3.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow3.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv4() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow4').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow4.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow4.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv4() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow4').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow4.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow4.style.visibility = 'visible'; 
} 
} 
} 


//--

function hideDiv5() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow5').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow5.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow5.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv5() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow5').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow5.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow5.style.visibility = 'visible'; 
} 
} 
} 


//--

function hideDiv6() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow6').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow6.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow6.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv6() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow6').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow6.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow6.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv7() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow7').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow7.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow7.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv7() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow7').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow7.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow7.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv8() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow8').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow8.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow8.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv8() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow8').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow8.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow8.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv9() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow9').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow9.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow9.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv9() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow9').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow9.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow9.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv10() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow10').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow10.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow10.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv10() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow10').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow10.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow10.style.visibility = 'visible'; 
} 
} 
} 


//--

function hideDiv11() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow11').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow11.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow11.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv11() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow11').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow11.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow11.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv12() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow12').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow12.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow12.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv12() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow12').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow12.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow12.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv13() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow13').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow13.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow13.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv13() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow13').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow13.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow13.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv14() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow14').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow14.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow14.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv14() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow14').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow14.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow14.style.visibility = 'visible'; 
} 
} 
} 


//--

function hideDiv15() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow15').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow15.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow15.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv15() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow15').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow15.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow15.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv16() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow16').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow16.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow16.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv16() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow16').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow16.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow16.style.visibility = 'visible'; 
} 
} 
} 


//--

function hideDiv17() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow17').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow17.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow17.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv17() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow17').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow17.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow17.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv18() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow18').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow18.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow18.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv18() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow18').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow18.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow18.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv19() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow19').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow19.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow19.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv19() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow19').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow19.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow19.style.visibility = 'visible'; 
} 
} 
} 



//--

function hideDiv20() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow20').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow20.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow20.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv20() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow20').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow20.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow20.style.visibility = 'visible'; 
} 
} 
} 


//--

function hideDiv21() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow21').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow21.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow21.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv21() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow21').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow21.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow21.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv22() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow22').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow22.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow22.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv22() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow22').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow22.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow22.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv23() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow23').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow23.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow23.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv23() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow23').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow23.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow23.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv24() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow24').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow24.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow24.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv24() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow24').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow24.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow24.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv25() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow25').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow25.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow25.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv25() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow25').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow25.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow25.style.visibility = 'visible'; 
} 
} 
} 

//--

function hideDiv26() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow26').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow26.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow26.style.visibility = 'hidden'; 
} 
} 
}
 
function showDiv26() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow26').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow26.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow26.style.visibility = 'visible'; 
} 
} 
} 


//contact form

function PHPFMG( formID ){
    var frmID = formID;
    var exts = {
        'block_harmful' : '<?php echo PHPFMG_BLOCK_HARMFUL; ?>',
        'harmful_exts'  : '<?php echo PHPFMG_HARMFUL_EXTS; ?>',
        'harmful_errmsg': "<?php echo addslashes(PHPFMG_HARMFUL_EXTS_MSG); ?>"
    };

    function $( id ){
        return document.getElementById(id);
    }

    function get_form( id ){
        var frm = 'object' == typeof($(id)) ? $(id) : eval( 'document.' + id ) ;
        return frm ? frm : document.forms[0];
    } 
    
    function file_ext( f ){
        var n = f.lastIndexOf(".");
        return -1 == n ? '' : f.substr( n ).toLowerCase();
    }
    
    function addLabelEvents(){
        var labels = document.body.getElementsByTagName('LABEL');
        for( var i = 0, N = labels.length; i < N; i ++ ){
            var e = labels[i];
            if( -1 != String(e.className).indexOf('form_choice_text') ){
                var oid = e.getAttribute('oid'); 
                if( !oid ) continue;

                e.onmouseout = function(){ this.className = 'form_choice_text'; };
                e.onmouseover = function(){ this.className = 'form_choice_text form_choice_over'; };
                e.onclick = function(){
                    try{
                        var oid = this.getAttribute('oid'); 
                        var O = document.getElementById(oid);
                        O.checked = !O.checked;
                    }
                    catch(E){};
                };
            }; // if
        }; // for
    } 


    function addFieldBlockEvents(){
        var divs = document.body.getElementsByTagName('DIV');
        for( var i = 0, N = divs.length; i < N; i ++ ){
            var e = divs[i];
            if( -1 != String(e.className).indexOf('field_block') ){
                e.onmouseout = function(){  if( String(this.className).indexOf('form_error_highlight') == -1 ) this.className = 'field_block'; };
                e.onmouseover = function(){ if( String(this.className).indexOf('form_error_highlight') == -1 ) this.className = 'field_block field_block_over'; };
            }; // if
        }; // for
    } 

    function removeHighliht(){
        var divs = document.body.getElementsByTagName('DIV');
        for( var i = 0, N = divs.length; i < N; i ++ ){
            var e = divs[i];
            var cn = String(e.className);
            if( -1 != cn.indexOf('form_error_highlight') ){
                e.className = cn.replace('form_error_highlight','');
            }; // if
        }; // for
    } 
    
    function showProcessing(){
        try{
            var E = $('phpfmg_processing');
            if( !E ) return ;
            if( -1 != navigator.userAgent.toLowerCase().indexOf('msie') ){
                E.style.backgroundColor='#2960AF';
                $('phpfmg_processing_gif').style.display = 'none';
                setInterval( 'fmgHandler.dots()', 380 );
            };
            E.style.display = '' ;
        }catch(e){};
        
    }
    
    
    this.highlight_fields = function( fields ){
        var A = fields.split(',');
        for( var i = 0, N = A.length; i < N; i ++ ){
            var E = $( A[i] + '_div' );
            if( E ){
                E.className += ' form_error_highlight'; 
            };
        };
    }
    
    this.choice_clicked = function( id ){
        $(id).checked = !$(id).checked ;
    }
    
    
    this.is_ext_allow = function(){
    }
    
    
    this.init = function(){
        addLabelEvents();
        addFieldBlockEvents();
    }
    

    this.harmful = function(e){
        if( 'Y' != exts['block_harmful'] ){
            return; 
        };
        
        var ext = file_ext(e.value);
        if( -1 != exts['harmful_exts'].toLowerCase().indexOf(ext) ){
            e.value = '';
            alert( exts['harmful_errmsg'] );
        };
    }

    this.dots = function(){
        $('phpfmg_processing_dots').innerHTML += '.';
		if( $('phpfmg_processing_dots').innerHTML.length >= 38 ) {
			$('phpfmg_processing_dots').innerHTML = '.';
		};
    }
    
    this.onsubmit = function(){
        showProcessing();
        return true;
    }
    


    var Form = null;
    var err_fields=null;
}
var fmgHandler = new PHPFMG();
        

//end contact form
