$(document).ready(function(){
	$("#t_sponsor").autocomplete("/get/sponsor.html", {
		width: 260,
		selectFirst: true
	});
	$("#g_sponsor").autocomplete("/get/sponsor.html", {
		width: 260,
		selectFirst: true
	});
	$('.admin_list_participant').corner('5px');
	$('div.date').corner('5px');
	$('div#menu_panel2').corner('5px');
	$('div.rounded1').corner('5px');
	selectpayment();
	$('#add_more').click(function(){
		payment_confirmation($('#regcode').val());
	})
	jQuery('#list_participants').accordion({
		header: 'div.title',
		active: true,
		alwaysOpen: false,
		animated: false,
		autoheight: false
	});
	$('a.backtotop').click(function(){
		$(this).scrollTo(0, 800, { queue:true } );
	});
	$('#u_bday').DatePicker({
		format:'Y-m-d',
		date: $('#u_bday').val(),
		current: $('#u_bday').val(),
		starts: 1,
		position: 'right',
		onBeforeShow: function(){
			$('#u_bday').DatePickerSetDate($('#u_bday').val(), true);
		},
		onChange: function(formated, dates){
			$('#u_bday').val(formated);
			if ($('#closeOnSelect input').attr('checked')) {
				$('#u_bday').DatePickerHide();
			}
		}
	});	
	$("div#banner_block").carousel({ 
		direction: "horizontal",
		animSpeed: "normal",
		nextBtn: '<span class="next"><a href="#">&nbsp;</a></span>',
		prevBtn: '<span class="prev"><a href="#">&nbsp;</a></span>',
		autoSlide: true,
		autoSlideInterval: 6000,
		loop: true,
		slideEasing: "easeInOutCubic",
		animSpeed: 2000,
		pagination: true
	});
	$("#scientific_program_venue").hide();
	var toggled = false;
	$('div.view_venue_map a').click(function() {
		$('div#scientific_program_venue').slideToggle("medium", function()
			{
				if(toggled==true) {
					toggled = false;
					$('div.view_venue_map a').removeClass('show');
					$('div.view_venue_map a').addClass('hide');
				} else {
					toggled = true;
					$('div.view_venue_map a').removeClass('hide');
					$('div.view_venue_map a').addClass('show');
				}
			});
		return false;
	});
	jQuery('#list_workshop').accordion({
		header: 'div.title',
		active: false,
		alwaysOpen: false,
		animated: false,
		autoheight: false
	});
    $("input#submit").click(function () { 
		$.post("/post/sendmail.html",              
			{
				action: 'contact-venue',
				name: $('#name').val(),
				phone: $('#phone').val(),
				email: $('#email').val(),
				msg: $('#msg').val()
			},
			function (data) {
				if(data==1) {
					alert('Message has successfully sent')
				} else {
					alert(data)
				}
			},
			"html"
		);
		$("#name").val("");
		$("#phone").val("");
		$("#email").val("");
		$("#msg").val("Your Message");
    });
    if($('.occupation_radio').is(':checked')) {
	    $("#seminar_registration").show();
    } else {
    	$("#seminar_registration").hide();
    }
    $(".occupation_radio").change(function() {
    	$("#seminar_registration").fadeIn();
		get_workshop_regular($(this).val());
	});


});

function venueTextAreaBoxStyle (t) {if(t.value=='Your Message') {t.value='';t.style.color='#000000';t.style.fontStyle='normal';} else {t.value=t.value;t.style.color='#006699';t.style.fontStyle='normal';}}
function venueTextAreaBoxMouseOut (d) {if(d.value=='') {d.value='Your Message';d.style.color='#006699';d.style.fontStyle='italic';	}}

function get_workshop_regular(group) {
	$.post("/post/semreg.html", {group: group}, function(data){
		$("#workshop_regular").html(data);
	});
}
function ischeckedforiha(checkednya){
	if($(checkednya).is(':checked')) {
		$.post("/post/getprice1.html", {id: 6}, function(data){
			$("#label_6").html(formatCurrency(data));
		});
	} else {
		$.post("/post/getprice2.html", {id: 6}, function(data){
			$("#label_6").html(formatCurrency(data));
		});
	}	
}
