// JavaScript Document

var selectTextbox = null;
$(function (){
	DropDownMenu('.top_menu ul');
	$("#newBtn").tooltip({effect: 'slide',position: "top center", offset:[10, 0], relative:true});
	$("#joinBtn").tooltip({effect: 'slide',position: "top center", offset:[10, 0], relative:true});
	vars = {};
	vars.url0 = "http://www.hkrita.com/html/projectapplication.php";
	vars.target0="_self"
	vars.url1 = "http://www.hkrita.com/html/commopportunities_detail.php?id=79";
	vars.target1="_self"
	vars.url2 = "http://www.hkrita.com/html/commopportunities_detail.php?id=80";
	vars.target2="_self"
	vars.url3 = "http://www.hkrita.com/html/commopportunities_detail.php?id=73";
	vars.target3="_self"
	vars.url4 = "http://www.hkrita.com/Symposium2011/";
	vars.target4="_blank"
	var params = {};
	params.wmode = "transparent";
	var attributes = {};
	swfobject.embedSWF("swf/banner.swf", "flash", "100%", "290", "10.0.0","expressInstall.swf", vars, params, attributes); 
	
	$(".textbox").hide();
	
/*$(".more_partners").click(function(){
		if(!$(this).parent().parent().find(".textbox").hasClass("selected")){
			if(selectTextbox!=null){
				selectTextbox.slideUp();
				selectTextbox.removeClass("selected");
			}
			selectTextbox = $(this).parent().parent().find(".textbox");
			selectTextbox.slideDown();
			selectTextbox.addClass("selected");
		}
	});
});  */
	$(".more_partners").click(function(){
		selectTextbox = $(this).parent().parent().find(".textbox");
		if(!selectTextbox.hasClass("selected")){
			selectTextbox.slideDown();
			selectTextbox.addClass("selected");
		}
		else{
			selectTextbox.slideUp();
			selectTextbox.removeClass("selected");
		}
	});
	//$(".colorbox").colorbox({iframe: true});
	
});  

$(document).ready(function(){
	$('#enewBtn').click(function(){
		postdata();	
	});

function subsuccess(){
	$('#enewform').html("<p>Success</P>");
	
}

	function postdata(){
		$.ajax({
		type:"POST",
		url:"form.php",
		data:"yourname="+$("input[name='username']").val()+"&email="+$("input[name='useremail']").val(),
		success:subsuccess()
		});	
	}  
	/*$("a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'facebook',slideshow:3000, autoplay_slideshow: true});
				//$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000});
		
				$("a[rel^='prettyPhoto']:first").prettyPhoto({
					custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>'
				//	changepicturecallback: function(){ initialize(); }
				});

				/*$("a[rel^='prettyPhoto']:last").prettyPhoto({
					custom_markup: '<div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
					changepicturecallback: function(){ _bsap.exec(); }
				});*/
});

