$(
	function()
	{
	/*
		if ($("#birth").length > 0 )
		{
			$("#birth").datepicker( 
				{
					'dateFormat' : 'yy-mm-dd',
					'numberOfMonths' : [1,3],
					//'showOtherMonths' : true
					'stepMonths'	 : 3
				}
			);
		}
	*/
		if ($("table.cssMainOption").length > 0 )
		{
			intFail = 0;
			
			if ($("table.cssMainOption tbody tr td.cssOption input:checked").length > 0)
			{
				intFail = ($("table.cssMainOption tbody tr td.cssOption input:checked").val() == 1 )? 1 : 0;
			}
																										
			if (intFail)
			{
			
			}
			else
				$("table.cssMainOption tbody tr td div.cssExtra").css("display","none");
			
			$("table.cssMainOption tbody tr td.cssOption input").each(
				function(i)
				{
					$(this).click(
						function()
						{
							$("table.cssMainOption tbody tr td div.cssExtra").css("display","none");
							//$("table.cssMainOption tbody tr:eq("+i+") td div.cssExtra").css("display","block");
							
							$(this).parent().parent().children("td:eq(1)").children("div.cssExtra").css("display","block");
							
						}
						
					);
					
				}
				
			);
					
			$("input.cssName").each(
				function()
				{
					$(this).blur(
						function()
						{
							//$("input.cssName").val($(this).val());
							clearInterval(intSSid);
							
							intSSid = setInterval(setText,100,$(this));
							
						}
						
					);	
				}	
			);
		
		}
	
		if ($("#capturevideo").length > 0)
		{
			objPara = new Object();
			objPara.uID = $("#capturevideo").attr('tt');
		
			swfobject.embedSWF("images/swf/webcamCaptureWill.swf","capturevideo",500,200,'9.0.0.0',objPara,objPara,objPara);		
		}
		
		if ($("#willvideo").length > 0)
		{
			objPara = new Object();
			objPara.u = "../../"+$("#willvideo").attr('tt');
		
			swfobject.embedSWF("images/swf/normalplayer.swf","willvideo",212,180,'9.0.0.0',objPara,objPara,objPara);		
		}
	}
)

var intSSid = -1;

function setText(s)
{
	$("input.cssName").val(s.val());
	clearInterval(intSSid);
}

