varar=new Array();
varcgi="";
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function main_DoFSCommand(command, args) {
	mainObj = window.document.main;
	if (command=='openwindow'){
		popUpWindow(args, 100, 100, 400, 400)
	}
	if (command=='nular'){
		for(i=0; i<varar.length; i++)
		varar=new Array();
	}
	if (command=='datear'){
		varar[varar.length]=args;
	}
	if (command=='urlcgi'){
		varcgi=args;
	}
	if (command=='send'){
		senddate(varar);
	}
}

function sendswf(varname,result){
	mainObj = window.document.main;
	mainObj.SetVariable(varname,result);
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height){
  if(popUpWin){
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function senddate(args){
	stt = "width=600,"
			+ "height=400,"
			+ "location=0,"
			+ "menubar=0,"
			+ "scrollbars=1,"
			+ "status=0,"
			+ "titlebar=0,"
			+ "hotkeys=0,"
			+ "directories=0,"
			+ "resizable=1";
	myWin= open("","",stt);
	myWin.document.open();
	myWin.document.write("<html><head><title>Оплата услуг сайта inLoveStore.com</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\"></head><body>");
	myWin.document.write("<form name='form' method=post action=" + "'"+varcgi+"'>");
	for (var i = 0; i < args.length; i++){ 
		if (Math.ceil((i+1)/2)!=((i+1)/2))
			sinp="<input type='hidden' name="+ "'"+args[i]+ "'";
		if (Math.ceil((i+1)/2)==((i+1)/2)){
			sinp+=" value="+ "'"+args[i]+ "'";
			myWin.document.write(sinp+">");
		}
	}
	myWin.document.write("</form></body></html>");
	myWin.document.close();
	myWin.document.status = " ";
	myWin.document.form.submit();
}
// Hook for Internet Explorer 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub main_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call main_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}
