function slideSwitch() {
	var $active = $('#slideshow img.active');
	if ( $active.length == 0 ) $active = $('#slideshow img:last');
	var $next =  $active.next().length ? $active.next() : $('#slideshow img:first');
	$active.addClass('last-active');
	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
		});
}
$(function() {
	setInterval( "slideSwitch()", 6000 );
});

function clickTopBtn(i){
	var elem = $(i); 
	var $active = $('#slideshow img.active');
	elem.removeClass('active last-active');
}

function goSubmit(){
	document.atom_form.action="request.html";
	document.atom_form.submit();
}

function goSubmit2(){
	document.atom_form.action="#";
	document.atom_form.submit();
}

function clearFormAll() {
    for (var i=0; i<document.forms.length; ++i) {
        clearForm(document.forms[i]);
    }
}
function clearForm(form) {
    for(var i=0; i<form.elements.length; ++i) {
        clearElement(form.elements[i]);
    }
}
function clearElement(element) {
    switch(element.type) {
        case "hidden":
        case "submit":
        case "reset":
        case "button":
        case "image":
            return;
        case "file":
            return;
        case "text":
        case "password":
        case "textarea":
            element.value = "";
            return;
        case "checkbox":
        case "radio":
            element.checked = false;
            return;
        case "select-one":
        case "select-multiple":
            element.selectedIndex = 0;
            return;
        default:
    }
}

