<html>
<head>
<title>AutoPopUp</title>
<script language="JavaScript">
// The function that will be inserted into the
// HEAD of the user's document
function apri(url_foto,des_foto){
addr="fullsize.htm?"+url_foto+"&"+escape(des_foto)
alt=150
lar=150
rszb=(document.layers)?1:0;
props='height='+alt+',width='+lar+',top='+parseInt ((screen.availHeight-alt)/2)+',left='+parseInt((screen.availWidth-lar)/2)+',scrollbars=0,resizable='+rszb+',toolbar=0,men ubar=0,location=0,status=0';
window.open(addr,'_blank',props);
}
function browseFile(fieldToStoreURL){ // Brings up the Browse box and outputs to the imageName form field
var url_foto = "";
fileName = browseForFileURL('select','Select An Image','true'); //returns a local filename
if (url_foto){
var pathArray = url_foto.split("."); // split the file name into an array, using the period as a delimiter
fileExtension = pathArray[1]; // get the last element (hopefully the file extension!)
fieldToStoreURL.value = url_foto; // bung it in the field
}
}
//******************* API **********************
function canAcceptBehavior(){
return true;
}
function behaviorFunction(){
return 'apri';
}
function applyBehavior() {
var url_foto = document.theForm.url_foto.value
var des_foto = document.theForm.des_foto.value
if (url_foto && des_foto){
return 'apri(\'' + url_foto + '\',\'' + des_foto + '\')';
}
else {
return 'Please enter data in all fields';
}
}
function inspectBehavior(fnCall){
var argArray = getTokens(fnCall, "()',");
var url_foto = escape(argArray[1]);
document.theForm.url_foto.value = url_foto;
var des_foto = escape(argArray[2]);
document.theForm.des_foto.value = des_foto;
}
function identifyBehaviorArguments(){
return 'other,other';
}
</script></head>
<body>
<form name="theForm">
<table width="408">
<tr>
<td width="82">url_foto</td>
<td width="200"><input type="text" name="url_foto"></td>
<td width="110"><input type="button" value="Browse..." onClick="browseFile(document.theForm.url_foto.valu e)" name="button"></td>
</tr>
<tr>
<td>des_foto</td>
<td colspan="2"><input type="text" name="des_foto"></td>
</tr>
</table>
</form>
</body>
</ html>