// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults


function mark_for_destroy(element) {
// function mark_for_destroy(element, type) {
	$(element).next('.should_destroy').value = 1;
//	$(element).up('.image').hide();
// $(element).up(type).hide();
}

function sameAsBilling () {
	if (document.getElementById('checkbox_sameas').checked) {
		document.getElementById('shipping_address_contact_name').value = document.getElementById('billing_address_contact_name').value;
		document.getElementById('shipping_address_company_name').value = document.getElementById('billing_address_company_name').value;
		document.getElementById('shipping_address_address').value = document.getElementById('billing_address_address').value;
		document.getElementById('shipping_address_address2').value = document.getElementById('billing_address_address2').value;
		document.getElementById('shipping_address_phone').value = document.getElementById('billing_address_phone').value;
		document.getElementById('shipping_address_postal_code').value = document.getElementById('billing_address_postal_code').value;
		document.getElementById('shipping_address_city').value = document.getElementById('billing_address_city').value;
		document.getElementById('shipping_address_state').selectedIndex = document.getElementById('billing_address_state').selectedIndex;
		document.getElementById('shipping_address_country').selectedIndex = document.getElementById('billing_address_country').selectedIndex;
	}
 }

function openConfirm(html_code) {
//    Dialog.confirm(html_code, {top: 50, width:450, className: "alphacube"})
	Dialog.alert(html_code, {className: "alphacube", width:440, height:145});
	/*var win = new Window("win1", {className: "alphacube", top:40, left:0, width:400, height:300, maximizable: false, minimizable: false, draggable: false});
	win.setDestroyOnClose();
	win.showCenter();*/
}
function openQuoteShow(html_code) {

	Dialog.alert(html_code, {className: "alphacube", width:500, height:440});

}

function openDialog3(html) {
    var effect = new PopupEffect(html, {className: "popup_effect1"});
    Dialog.confirm("Do you like this effect?",{className:"alphacube", width: 400, height:null, showEffect:effect.show.bind(effect), hideEffect:effect.hide.bind(effect)})
}
