﻿function loadAjaxLogin(message){
	var win = new Window({className: "skinGreen", width:540,resizable: false, minimizable: false, maximizable:false});
	var params = {message: message};
	win.setAjaxContent("/login/proto/login.asp", {method: 'post', parameters: params}, true, true);
}



function loadSmsPayment(className, trailerGuid){
	var win = new Window({className: className, width:540,resizable: false, minimizable: false, maximizable:false});
	var params = {trailerGuid: trailerGuid};
	win.setAjaxContent("/pages/proto/smsPayment.asp", {method: 'post', parameters: params}, true, true);
}

function loadTextAboutBid(className, trailerGuid){
	var win = new Window({className: className, width:540,resizable: false, minimizable: false, maximizable:false});
	var params = {trailerGuid: trailerGuid};
	win.setAjaxContent("/pages/proto/textAboutBid.asp", {method: 'post', parameters: params}, true, true);
}

function loadCommercialCode(className, trailerGuid){
	var win = new Window({className: className, width:540, height:540,resizable: false, minimizable: false, maximizable:false});
	var params = {trailerGuid: trailerGuid};
	win.setAjaxContent("/pages/private/proto/CommercialCode.asp", {method: 'post', parameters: params}, true, true);
}

function prototypeAlert(message){
  Dialog.alert(message,  {
      width:300, 
      height:100, 
      okLabel: "Ok", 
      ok:function(win) { 
        return true;
        }
      }
    );
}

function makeBid(){
  var url="/pages/proto/makeBid.asp";
   
  new Ajax.Updater("bidContainer", url, {
    method: 'post',
    parameters: $("bidForm").serialize(),
    evalScripts: true
    }
  );
  return false;
}

function makeForumPost(formObj, containerId){
  var url="/pages/proto/makeForumPost.asp";
   
  new Ajax.Updater(containerId, url, {
    method: 'post',
    parameters: Element.extend(formObj).serialize(),
    evalScripts: true
    }
  );
  return false;
}
