<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE ELEMENT SYSTEM "/u/web/ucpusa/mpc/data/dtd/element.dtd">
<ELEMENT>
	<VERSION>1</VERSION>
	<TYPE>Merc_PaymentTypes</TYPE>
	<GLOBAL TYPE="never"></GLOBAL>
	<UIGRAPHIC></UIGRAPHIC>
	<UITEXT></UITEXT>
	<!-- Can't be deleted -->
	<PERMISSIONS>666</PERMISSIONS>
	<PROPERTIES>
		<PROPERTY NAME="width">
			<VALUE>400</VALUE>
		</PROPERTY>
		<PROPERTY NAME="height">
			<VALUE>200</VALUE>
		</PROPERTY>
		<PROPERTY NAME="style">
			<VALUE>btn-shopperbackground</VALUE>
		</PROPERTY>
		<PROPERTY NAME="securestyle">
			<VALUE>secure-btn-shopperbackground</VALUE>
		</PROPERTY>
		<PROPERTY NAME="btntextstyle">
			<VALUE>btn-shoppertext</VALUE>
		</PROPERTY>
		<PROPERTY NAME="btntext">
			<VALUE>Continue</VALUE>
		</PROPERTY>
	</PROPERTIES>
	<SCRIPT NAME="common" TYPE="common" VERSION="1.0"><![CDATA[
	]]></SCRIPT>
	<SCRIPT NAME="output" TYPE="output" VERSION="1.0"><![CDATA[
	function output(type)
	{
		var commonScriptFile = doActionEx('DATA_READFILE', 'common.js', 'FileName', 
					'common.js','ObjectName', 'JS_SRC', 'FileType', 'txt');
		eval (commonScriptFile);

		if (type == "text/html")
		{
			var mode = doAction('ST_GET_STATEDATA', 'PE_OutputMode', 'PE_OutputMode');
			write('<div id="newLayer'+merc_elementid+'" name="newLayer'+merc_elementid+'" ');
			write('style="position:absolute; width:'+width+'px; ');
			write('height:'+height+'px; left:'+merc_xpos+'px; top:'+merc_ypos+'px;');
			write('z-index:'+merc_zindex+';">');

			var urlpath = doActionEx("DATA_GETLITERAL", "Result", "ObjectName", "storecfg", "LiteralID", "SecureSiteUrl");
			writeln('<form name=payment METHOD=POST action="'+urlpath+'">');

			writeln('<merc_dynamic noshow=true name=mySession action=ST_GET_STATEDATA return=Result SessionID=SessionID>');
			writeln('<merc_dynamic noshow=true name=siteID action=REQ_GET_FORMVALUE return=Result SiteID=SiteID>');
			writeln('<merc_dynamic noshow=true name=appID action=REQ_GET_FORMVALUE return=Result AppID=AppID>');

			if (mode == "PE_PreviewMode")
				writeln('<input type=hidden name=Preview value=1>');
			writeln('<input type=hidden name=SessionID value={mySession}>');
			writeln('<input type=hidden name=sh_action value=paymentType>');
			writeln('<input type=hidden name=SiteID value={siteID}>');
			writeln('<input type=hidden name=AppID value={appID}>');

			write('<scr');
				writeln('ipt runat=merc_server>');

			writeln("var scriptFile = doActionEx('DATA_READFILE', 'Payment.js', 'FileName', ");
			writeln("		'Payment.js','ObjectName', 'JS_SRC', 'FileType', 'txt');");
			writeln('eval (scriptFile);');

			writeln('var typesObj = getPaymentTypes();');

			writeln('if (typesObj.typesArray.length > 1)');
			writeln('{');
			writeln('	writeln(\'<table width="475" border="0" align="center">\');');
			writeln("	writeln('<tr>');");
			writeln("	write('<td>');");
			writeln("	writeln('<b>Please choose a form of payment: </b><br>');");
			writeln('	var i=0;');
			writeln("	writeln('<input type=radio name=paymentType value=\"' + typesObj.typesArray[i] + '\" checked>' + typesObj.typeNamesArray[i] + '<br>');");
			writeln('	for (i = 1/*0 is selected*/; i < typesObj.typesArray.length; i++)');
			writeln("		writeln('<input type=radio name=paymentType value=\"' + typesObj.typesArray[i] + '\">' + typesObj.typeNamesArray[i] + '<br>');");
			writeln("	writeln('</td>');");
			writeln("	writeln('</tr>');");
			writeln("	writeln('</table>');");
			writeln('}');
			writeln('else if (typesObj.typesArray.length == 1)');
			writeln('{');
			writeln('	writeln(\'<input type="hidden" name="paymentType" value="\' + typesObj.typesArray[0] + \'">\');');
			writeln("	writebr('<b>Form of payment is: </b>' + typesObj.typeNamesArray[0]);");
			writeln('}');
			writeln('else if (typesObj.typesArray.length == 0)');
			writeln("	writebr('Error: No payment types for this store were found. Please contact the store administrator.');");

			write('</scr');
				writeln('ipt>');

			writeln('	<br>');
			writeln('	<table border=0 cellspacing=0 cellpadding=0><tr>');
			var currentPage = doAction('ST_GET_STATEDATA', 'CurrentPageName', 'CurrentPageName');
			var seObj = generateSEObjects (currentPage);
			var pageObj = seObj.pageObjArray[currentPage];
			if (mode != "PE_EditMode" && pageObj.SecureBaseHref.toLowerCase() == "yes")
				writeln('	<td align=right valign=middle width=120 height=22 class=\''+securestyle+'\'>');
			else
				writeln('	<td align=right valign=middle width=120 height=22 class=\''+style+'\'>');
			writeln('	<a href="#" onClick="document.payment.submit();return false;">');
			writeln('	<center><span class="'+btntextstyle+'">'+btntext+'</span></center></a>');
			writeln("	</td></tr></table>");
			writeln('	  <input type="hidden" name="Check_Out" value="Check Out">');

			writeln('</form>');
			write('</div>');
			return true;
		}
		else if (type == "text/wml")
		{
			// output WML
		}
	}
	]]></SCRIPT>
	<SCRIPT NAME="output_edit_mode" TYPE="output_edit_mode" VERSION="1.0"><![CDATA[
	function output_edit_mode(type)
	{

		if (type == "text/html")
		{
			var scriptFile = doActionEx('DATA_READFILE', 'Payment.js', 'FileName', 
					'Payment.js','ObjectName', 'JS_SRC', 'FileType', 'txt');
			eval (scriptFile);

			write('<div id="newLayer'+merc_elementid+'" name="newLayer'+merc_elementid+'" ');
			write('style="position:absolute; width:'+width+'px; ');
			write('height:'+height+'px; left:'+merc_xpos+'px; top:'+merc_ypos+'px;');
			write('z-index:'+merc_zindex+';">');

			writeln('<form action=PowerCommerce.cgi METHOD=POST>');

			var typesObj = getPaymentTypes();
			if (typesObj.typesArray.length > 1)
			{
				writeln('<table width="475" border="0" align="center">');
				writeln('<tr>');
				write('<td>');
				writeln('<b>Please choose a form of payment: </b><br>');
				for (var i = 0; i < typesObj.typesArray.length; i++)
					writeln('<input type=radio name=paymentType value="' + typesObj.typesArray[i] + '">' + typesObj.typeNamesArray[i] + '<br>');
				writeln('</td>');
				writeln('</tr>');
				writeln('</table>');
			}
			else if (typesObj.typesArray.length == 1)
			{
				writeln('<input type="hidden" name="paymentType" value="' + typesObj.typesArray[0] + '">');
				writebr('<b>Form of payment is: </b>' + typesObj.typeNamesArray[0]);
			}
			else if (typesObj.typesArray.length == 0)
				writebr('Error: No payment types for this store were found. Please contact the store administrator.');

			writeln('	<br>');
			writeln('	<table border=0 cellspacing=0 cellpadding=0><tr>');
			writeln('	<td align=right valign=middle width=120 height=22 class=\''+style+'\'>');
			writeln('	<center><span class="'+btntextstyle+'">'+btntext+'</span></center>');
			writeln("	</td></tr></table>");
			writeln('</form>');

			write('</div>');
			return true;
		}
		else if (type == "text/wml")
		{
			// output WML
		}
	}
	]]></SCRIPT>
	<SCRIPT NAME="edit_properties" TYPE="edit_properties" VERSION="1.0"><![CDATA[
	function edit_properties()
	{
		//write out html for EditProperties dialog box
		// The input "names" have to match the <name> tags above.
		write('<form name="saveprop">');
		var addEditMode = doAction('REQ_GET_FORMVALUE', "ElementAddEdit", "ElementAddEdit");
		writeln('<input type=hidden name="ElementAddEdit" value="'+addEditMode+'">');
		writeln('<input type=hidden name="ElementID" value="'+merc_elementid+'">');

		writeln('<p align="center"><span class="dialog-title">Payment Types</span></p>');
		writeln('<table width="407" border="0" cellspacing="0" cellpadding="0" align="center" class="table-bkgrd-main">');
		writeln('<tr valign="top"><td colspan="2" class="field-label"><center>');

		writeln('<table width="75%" border="0" cellspacing="0" cellpadding="0">');
		writeln('<tr valign="top"><td colspan="2">');
		writeln('<br>This element does not contain any modifiable properties</td>');
		writeln('</td></tr></table>');

		writeln('<table width="407" border="0" cellspacing="0" cellpadding="0" align="center" class="table-bkgrd-main">');
		writeln('<tr><td><center>');
<!--BEGIN HELP WINDOW LINK-->
var helpdomain = doAction('DATA_GETCONFIGDATA', 'ObjectName', 'HelpCfg', 'RowName', 'helpdomain', 'ColName', 'Domain');
var helpversion = doAction('DATA_GETCONFIGDATA', 'ObjectName', 'HelpCfg', 'RowName', 'helpversion', 'ColName', 'Domain');

writeln('<a href="javascript:void(opener.parent.openHelpWindow(\'http://'+helpdomain+'/cgi-bin/helpsrvr.exe?R+helpsrvr+OH_RTL_ELMT_PAYTYPE+SoftCart+'+helpversion+'+en-us\', \'Alane\'));"> <img src="/cgi-docs/Mercantec/PC_F_6.6.1/images/help2.gif" width="97" height="30" border="0" name="help" alt="Help"></a><!--END HELP WINDOW LINK--><a>');
		writeln('<a href="javascript:opener.CloseWinSubmitForm(\'PE_Cancel\', \'Layout1.htm\', \'mainFrame\', document.saveprop);"><img src="/cgi-docs/Mercantec/PC_F_6.6.1/images/Cancel_Nbtn_base.gif" width="86" height="30" alt="Cancel" border="0"></a>');
		writeln('<a href="javascript:opener.CloseWinSubmitForm(\'PE_SaveProperties\', \'Layout1.htm\', \'mainFrame\', document.saveprop);">');
		writeln('<img src="/cgi-docs/Mercantec/PC_F_6.6.1/images/Save_Nbtn_base.gif" width="86" height="30" alt="Ok" border="0"></a>');
		writeln('</td></tr></table>');
		writeln('</td></tr></table>');
		write('</form>');
		writeln ("<SCRIPT language=javascript>");+
		writeln('self.resizeTo(500, 200);');
		writeln('</script>');
		return true;
	}
	]]></SCRIPT>
	<SCRIPT NAME="save_properties" TYPE="save_properties" VERSION="1.0"><![CDATA[
	// May not need to do anything in all cases
	// Save things to Prod DB on price/desc? - automatic based on dbentry
	// if there is a reason not to dismiss the properties dialog, return false
	function save_properties()
	{
		return true;
	}
	]]></SCRIPT>
	<SCRIPT NAME="create_element" TYPE="create_element" VERSION="1.0"><![CDATA[
	function create_element()
	{
		return true;
	}
	]]></SCRIPT>
	<SCRIPT NAME="destroy_element" TYPE="destroy_element" VERSION="1.0"><![CDATA[
	function destroy_element()
	{
		return true;
	}
	]]></SCRIPT>
</ELEMENT>

