// Usage:
// 1. Parameter: div_id  
// This parameter indicates where the promptbox will be displayed.
// Add: "<div id='insert_prompt'></div>" somewhere in your code
// 2. Parameter: width
// Enter the prompt box width
// 3. Parameter: input_size
// Enter the size of the inputbox
// 4. Parameter: prompttitle
// The promptbox title
// 5. Parameter: message
// The message inside the promptbox
// 6. Parameter: sendto
// Enter a function name to execute after you pressed OK
// 7. Parameter param1 - param5
// It is possible the function in step 6, needs parameters.
// If you are not using the parameters, then paramN=''

function prompt2(div_id,width,input_size,prompttitle, message, sendto, param1,param2,param3,param4,param5) { 

	promptbox = document.createElement('div'); 
	promptbox.setAttribute ('id' , 'prompt'); 
	myselection = document.getElementById(div_id);
	myselection.appendChild(promptbox);
	promptbox = eval("document.getElementById('prompt').style"); 
	promptbox.position = 'absolute'; 
	promptbox.zIndex = '1000'; 
	strBox =  "<table cellspacing='0' cellpadding='0' border='0' width='"+width+"' class='prompt-box'>\n";
	strBox += "<tr valign='middle'><td class='prompt-titlebar'>" + prompttitle + "</td>";
	strBox += "<td class='prompt-titlebar' align='right'><img src='../../images/close_button.gif' width='16' height='14' onclick='myselection.removeChild(document.getElementById(\"prompt\"))' /></td></tr>\n";
	strBox += "<tr><td class='prompt-row' colspan='2'>" + message + "</td></tr>\n";
	if(input_size>0) {
		strBox += "<tr><td class='prompt-row' colspan='2'><input type='text' id='promptbox' onblur='this.focus()' size='"+input_size+"' maxlength='255' ></td></tr>\n";	
	}
	if(sendto!="") {
		strBox += "<tr><td align='right' class='prompt-row' colspan='2'>\n";
		strBox += "<input type='button' class='prompt-button' value='OK' onmouseover='this.className=\"prompt-button-over\"' onmouseout='this.className=\"prompt-button-out\"' onclick='" + sendto + "(document.getElementById(\"promptbox\").value,\""+param1+"\",\""+param2+"\",\""+param3+"\"); myselection.removeChild(document.getElementById(\"prompt\"))'>\n";
		strBox += "<input type='button' class='prompt-button' value='Cancel' onmouseover='this.className=\"prompt-button-over\"' onmouseout='this.className=\"prompt-button-out\"' onclick='myselection.removeChild(document.getElementById(\"prompt\"))'>\n";
		strBox += "</td></tr>\n";
	} 
	strBox += "</table>\n";
	document.getElementById('prompt').innerHTML = strBox;
	if(input_size>0) {
		document.getElementById("promptbox").focus(); 
	}	
} 
