function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function checkrequired(which) {
	var pass=true;
	
	if (document.images) {
		for (i=0;i<which.length;i++) {
			var tempobj=which.elements[i];
			
			if (tempobj.name.substring(0,8)=="required") {
				if (((tempobj.type=="text"||tempobj.type=="textarea")&& tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==0)) {
					pass=false;
					break;
	         		}
				if ((tempobj.type=="checkbox") && (tempobj.checked==0)) {
					pass=false;
					break;
	         		}
	      		}
	   	}
	}
	
	if (!pass) {
		shortFieldName=tempobj.name.substring(8,30).toUpperCase();
		alert("Please agree to our terms & conditions before continuing");
		return false;
	} else {
		openWindow('http://www.sitesuite.com.au/cgi-bin/standard_form.cgi?fromsite=financesmart.com.au&recipient=financesmart_finapp@savemoney.com.au&sender=application@financesmart.com.au','','scrollbars=yes,status=yes,width=780,height=500');
		return false;
	}
}

function checkWholeForm(theForm) {
	var why = "";
			
	why+= isEmpty(theForm.fullname.value, "NAME");
	if (why != "") {
		alert(why);
		theForm.fullname.focus();
       		return false;
	}
		
	why+= isEmpty(theForm.phone.value, "PHONE");
	if (why != "") {
		alert(why);
		theForm.phone.focus();
       		return false;
	}
		
	return true;
}

function CaricaFoto(ssimg){
  foto1= new Image();
  foto1.src=(ssimg);
  Controlla(ssimg);
}
function Controlla(ssimg){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(ssimg);
  }
  else{
    funzione="Controlla('"+ssimg+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(ssimg){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(ssimg,"",stringa);
}

PositionX = 0;
PositionY = 0;
defaultWidth  = 500;
defaultHeight = 500;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Aussie Car Loans</title><style>body{margin:0px;}</style>');
writeln('<sc'+'ript>');
writeln('var isNN,isIE;');
writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');
writeln('if (isIE){');
writeln('window.resizeTo(100,100);');
writeln('width=(document.images[0].width);');
writeln('height=(document.images[0].height);');
writeln('window.resizeTo(width,height);}');
writeln('if (isNN){');       
writeln('window.innerWidth=document.images["Aussie"].width;');
writeln('window.innerHeight=document.images["Aussie"].height;}}');
writeln('function doTitle(){document.title="Aussie Car Loans";}');
writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=#FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="DPE" src='+imageURL+' style="display:block"></body></html>');
close();  
}}



