function cartUpdate(carttype)
{
	document.editcart.submit();
}

var dropinfo = new Array('info_return','info_shipping','info_priv');
function showPolicy(which)
{

dropinfo.each(function(id){
$(id).setStyle('visibility','hidden');
});

var btn = 'btn_'+which
//var top = $(btn).getTop() ;
//var left = $(btn).getLeft() - 400;

var top = 10 ;
var left = 300;

$(which).setStyle('top',top +'px');
$(which).setStyle('left',left + 'px');
$(which).setStyle('visibility','visible');
}

function closePolicy(which)
{
dropinfo.each(function(id){
$(id).setStyle('visibility','hidden');
});
}

function sendForm2()
{
	//$("theCCForm").setStyle('display','none');
	//$("processGif").setStyle('display','visible');
	document.form2.submit();
}

function sendToAuth()
{
	
	var inv = window.frames['frame_auth'].document.forms['gotoauth'].elements['x_Invoice_Num'].value;
	var id = window.frames['frame_auth'].document.forms['gotoauth'].elements['x_cust_id'].value;
	window.frames['frame_auth'].document.forms['gotoauth'].submit();
	//$('panel_btntocc').setStyle('display','none');

var objBranch = document.getElementById('panel_btntocc').style;
        if(objBranch.display=="block")
                objBranch.display="none";
        else
                objBranch.display="block";

	//getSetContent(inv,id);
	
	//alert(inv);
	//window.frames['frame_auth'].document.forms['gotoauth'].submit();

}

function getSetContent(inv,id)
{
        //var inv = window.frames['frame_auth'].document.forms['gotoauth'].elements['x_Invoice_Num'].value;
  	//var id = window.frames['frame_auth'].document.forms['gotoauth'].elements['x_cust_id'].value;

	alert('AJAX' + inv + '-'+id);
        var pars = 'request=ajax';
        var url = '/authreply/checkoutccform/going';
                if (inv != '') pars += '&inv='+inv;
                if (id != '') pars += '&custid='+id;

        var myAjax = new Ajax.Request(  url, { method: 'post', parameters: pars, onComplete: showSetContent, onFailure: reportError });

}

function showSetContent(t)
{
       alert("repsonse "+ t.responseText);
return;
        eval("var decoded_data = " + t.responseText);
        $("setContent").innerHTML = decoded_data.text;
  //      alert(decoded_data.showDraggableFunction);
        eval(decoded_data.showDraggableFunction);
}

function reportError()
{
alert('ERR');
}

