function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_changeSrc(object, link)
{
	document.getElementById(object).value = link;	
}

function MM_swapImgRestore() { //v3.0
			var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
			}

			function MM_preloadImages() { //v3.0
			var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
				var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
				if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
			}

			function MM_findObj(n, d) { //v4.01
			var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
				d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
			if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
			for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
			if(!x && d.getElementById) x=d.getElementById(n); return x;
			}

			function MM_swapImage() { //v3.0
			var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
			if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
			}
//NewTrend
function flvFSTI4(){//v1.01
this.style.filter="";}

function flvFSTI3(v1,v2){//v1.01
var v3;if (v1.filters[0]&&v1.filters[0].status==2){v1.filters[0].Stop();}if (v2==0){v3="blendTrans(Duration="+v1.STI8+")";}else {v3="revealTrans(Duration="+v1.STI8+",Transition="+(v2-1)+")";}v1.style.filter=v3;}

function flvFSTI2(){//v1.01
var v1,v2=document,v3=v2.STI4,v4;for (v4=0;v3&&v4<v3.length&&(v1=v3[v4])&&v1.STI5;v4++){if (v1.filters&&!v2.STI7){flvFSTI3(v1,v1.STI3);v1.filters[0].Apply();}v1.src=v1.STI5;if (v1.filters&&!v2.STI7){v1.filters[0].Play();}}}

function flvFSTI1(){//v1.01
// Copyright 2003, Marja Ribbers-de Vroed, FlevOOware (www.STI1.nl/dreamweaver/)
var v1=arguments,v2=document,v3;v2.STI4=new Array();v2.STI7=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);for (var v4=0;v4<v1.length-2;v4+=5){v3=MM_findObj(v1[v4]);if (v3){v3.STI5=v3.src;v3.STI6=v1[v4+1];v3.STI2=v1[v4+2];v3.STI3=v1[v4+3];v3.STI8=v1[v4+4];v2.STI4[v2.STI4.length]=v3;if (v3.filters&&!v2.STI7){flvFSTI3(v3,v3.STI2);v3.onfilterchange=flvFSTI4;v3.filters[0].Apply();}v3.src=v3.STI6;if (v3.filters&&!v2.STI7){v3.filters[0].Play();}}}}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//
 function SetFocus(obj_id)
{
	cur_obj = document.getElementById(obj_id);
	if(cur_obj != null)
	{
		cur_obj.focus();
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}



function check_all()
{
	var i=1;
	var cb_property = document.getElementById('rpt_properties__ctl' + i + '_cb_property');
	do
	{
		cb_property.checked = true;
		i++;
		cb_property = document.getElementById('rpt_properties__ctl' + i + '_cb_property');
	} while (cb_property != null)
}
function clear_all()
{
	var i=1;
	var cb_property = document.getElementById('rpt_properties__ctl' + i + '_cb_property');
	do
	{
		cb_property.checked = false;
		i++;
		cb_property = document.getElementById('rpt_properties__ctl' + i + '_cb_property');
	} while (cb_property != null)
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//Mortgage Calculator Begin
function doCalc()
		{
			zeroBlanks(document.mortform);
			var p = numval(document.mortform.p.value);
			var r = numval(document.mortform.r.value)/100;
			var y = numval(document.mortform.y.value);

			document.mortform.payment.value = formatNumber(mortgagePayment(p,r/12,y*12),2);
		}

		function zeroBlanks(formname)
		{
			var i, ctrl;
			for (i = 0; i< formname.elements.length; i++)
			{
				ctrl = formname.elements[i];
				if ((ctrl.type == "text")&&(ctrl.id != "ucTop_tbEmail")&&(ctrl.id != "ucTop_tbPassword"))
				{
					if (makeNumeric(ctrl.value) == "")
						ctrl.value = "0";
				}
			}
		}

		function filterChars(s, charList)
		{
			var s1 = "" + s; // force s1 to be a string data type
			var i;
			for (i = 0; i< s1.length; )
			{
				if (charList.indexOf(s1.charAt(i))< 0)
					s1 = s1.substring(0,i) + s1.substring(i+1, s1.length);
				else
					i++;
			}
			return s1;
		}

		function makeNumeric(s)
		{
			return filterChars(s, "1234567890.-");
		}

		function numval(val,digits,minval,maxval)
		{
			val = makeNumeric(val);
			if (val == "" || isNaN(val)) val = 0;
			val = parseFloat(val);
			if (digits != null)
			{
				var dec = Math.pow(10,digits);
				val = (Math.round(val * dec))/dec;
			}
			if (minval != null && val< minval) val = minval;
			if (maxval != null && val > maxval) val = maxval;
			return parseFloat(val);
		}

		function formatNumber(val,digits,minval,maxval)
		{
			var sval = "" + numval(val,digits,minval,maxval);
			var i;
			var iDecpt = sval.indexOf(".");
			if (iDecpt< 0) iDecpt = sval.length;
			if (digits != null && digits > 0)
			{
				if (iDecpt == sval.length)
					sval = sval + ".";
				var places = sval.length - sval.indexOf(".") - 1;
				for (i = 0; i< digits - places; i++)
					sval = sval + "0";
			}
			var firstNumchar = 0;
			if (sval.charAt(0) == "-") firstNumchar = 1;
			for (i = iDecpt - 3; i > firstNumchar; i-= 3)
				sval = sval.substring(0, i) + "," + sval.substring(i);

			return sval;
		}

		function mortgagePayment(p,r,y)
		{
			return futureValue(p,r,y)/geomSeries(1+r,0,y-1);
		}

		function futureValue(p,r,y)
		{
			return p*Math.pow(1+r,y);
		}

		function geomSeries(z,m,n)
		{
			var amt;
			if (z == 1.0) amt = n + 1;
			else amt = (Math.pow(z,n + 1) - 1)/(z - 1);
			if (m >= 1) amt -= geomSeries(z,0,m-1);
			return amt;
		}


//Mortgage Calculator End

//----Window
function OpenWindow(link,WindowName)
{
window.open(link,WindowName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=620,height=580');
}

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 0;
PositionY = 0;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = false;

// Do not edit below this line...
// ================================

var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
var isMZ=(navigator.appName.indexOf("Mozilla")!=-1)?1:0;

var optNN='scrollbars=no,resizable=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=yes,width=150,height=100,left='+PositionX+',top='+PositionY;
var optMZ='scrollbars=no,resizable=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optDefault='scrollbars=no,resizable=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;


function popImage(imageURL,imageTitle)
{

if (isIE){imgWin=window.open('about:blank','',optIE);}
else {imgWin=window.open('about:blank','',optNN);}


with (imgWin.document){
writeln('<html><head><title>Loading...</title><link rel=stylesheet href=styles.css ><style>body{margin:0px;}</style>');
writeln('<sc'+'ript>');

writeln('var isIE;');

writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');

writeln('if (isIE){');
writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width+50,height+50);}');



writeln('else{');       
writeln('window.innerWidth=document.images["George"].width+50;');
writeln('window.innerHeight=document.images["George"].height+60;}}');


writeln('function doTitle(){document.title="'+imageTitle+'";}');

writeln('</sc'+'ript>');
if (!AutoClose) writeln('<link href="css/style.css" rel="stylesheet" type="text/css"></head><body bgcolor=white scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('<link href="css/style.css" rel="stylesheet" type="text/css"></head><body  scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<p align=center ><img name="George" src='+imageURL+' style="display:block" OnError="this.src = \'uploads/noimg.gif\'"></p>');

writeln('<p align=center ><input type=button value=Close  name=send OnClick="window.close();"  class="Button1" align="center" onmouseover="this.className = \'Button2\'  ;" onmouseout="this.className = \'Button1\';"></p><p></p></body></html>');
close();		
}
}