$(document).ready(function(){featuredcontentglider.init({gliderid:"canadaprovinces",contentclass:"glidecontent",togglerid:"p-select",remotecontent:"",selected:0,persiststate:false,speed:0,direction:"downup",autorotate:false,autorotateconfig:[8000,8]})
featuredcontentglider.init({gliderid:"canadaprovinces1",contentclass:"glidecontent1",togglerid:"p-select1",remotecontent:"",selected:0,persiststate:false,speed:500,direction:"downup",autorotate:true,autorotateconfig:[4000,20]})
featuredcontentglider.init({gliderid:"canadaprovinces2",contentclass:"glidecontent2",togglerid:"p-select2",remotecontent:"",selected:0,persiststate:false,speed:500,direction:"downup",autorotate:true,autorotateconfig:[5000,20]})
featuredcontentglider.init({gliderid:"canadaprovinces3",contentclass:"glidecontent3",togglerid:"p-select3",remotecontent:"",selected:0,persiststate:false,speed:0,direction:"leftright",autorotate:false,autorotateconfig:[10000,2]})
$("#quick_search").keyup(function(){$sim=($("#quick_search").val());$length=$sim.length;if($length>2&&$length<11){$("#quick_search_result").empty();$("#quick_search_result").load("../ajax/sim_quicksearch.php?keyword="+$sim);}})
$("#quick_search1").keyup(function(){$sim=($("#quick_search1").val());$length=$sim.length;if($length>2&&$length<11){$("#quick_search_result1").empty();$("#quick_search_result1").load("../ajax/sim_quicksearch.php?keyword="+$sim);}})
$("#check").click(function(){$gioitinh=$("#gioitinh").val();$sodienthoai=$("#sodienthoai").val();$giosinh=$("#giosinh").val();$ngaysinh=$("#ngaysinh").val();$thangsinh=$("#thangsinh").val();$namsinh=$("#namsinh").val();$("#loadcheck").empty();$("#loadcheck").load("../ajax/sim_phongthuy.php?gioitinh="+$gioitinh+"&sodienthoai="+$sodienthoai+"&giosinh="+$giosinh+"&ngaysinh="+$ngaysinh+"&thangsinh="+$thangsinh+"&namsinh="+$namsinh);})})
function check_contact(){if(document.getElementById("name_contact").value==""){alert("Điền tên của bạn");document.getElementById("name_contact").focus();return;}
if(document.getElementById("email_contact").value==""){alert("Điền email của bạn");document.getElementById("email_contact").focus();return;}
if(document.getElementById("email_contact").value.length>0){if(!isemail(document.getElementById("email_contact").value)){alert("Email không hợp lệ");document.getElementById("email_contact").focus();return;}}
if(document.getElementById("title_contact").value==""){alert("Điền tiêu đề");document.getElementById("title_contact").focus();return;}
if(document.getElementById("content_contact").value==""){alert("Điền nội dung");document.getElementById("content_contact").focus();return;}
if(document.getElementById("scode").value==""){alert("Điền mã xác nhận");document.getElementById("scode").focus();return;}
document.contact.submit();}
function isemail(email){var re=/^(\w|[^_]\.[^_]|[\-])+(([^_])(\@){1}([^_]))(([a-z]|[\d]|[_]|[\-])+|([^_]\.[^_])*)+\.[a-z]{2,3}$/i;return re.test(email);}

function ShowFlash_swf(FlashIDName, FlashFileName, FlashWidth, FlashHeight, Title, DNSSetting, WMODESetting, QSetting, FlashAlign){
	document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('CODEBASE="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=8,0,0,0" ');
	document.write(' ID="'+FlashIDName+'" WIDTH="' + FlashWidth + '" HEIGHT="' + FlashHeight + '" TITLE="' + Title + '" ALIGN="'+FlashAlign+'">');
	document.write('<PARAM NAME="movie" VALUE="'+ FlashFileName +'">');
	document.write('<PARAM NAME="quality" VALUE="'+QSetting+'">');
	/*document.write('<PARAM NAME="bgcolor" VALUE="'+FlashBGColor+'">');  BGCOLOR="'+FlashBGColor+'"*/
	document.write('<PARAM NAME="wmode" VALUE="'+WMODESetting+'">');
	document.write('<PARAM NAME="allowScriptAccess" VALUE="'+DNSSetting+'">');
	document.write('<EMBED SRC="'+ FlashFileName +'"  NAME="'+FlashIDName+'"');
	document.write(' WIDTH="' + FlashWidth + '" HEIGHT="' + FlashHeight + '" TITLE="' + Title + '" QUALITY="'+QSetting+'" ');
	document.write(' ALLOWSCRIPTACCESS="'+DNSSetting+'" ALIGN="'+FlashAlign+'" WMODE="'+WMODESetting+'" TYPE="application/x-shockwave-flash" ');
	document.write(' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" >');
	document.write('</EMBED>');
	document.write('</OBJECT>');
}

/* Toolbar */
	function showSupport(id){
		var $div = $('#'+id);		
		if($div.css("display")=='' || $div.css("display")=='none'){
			resetToollbar();
			$div.fadeIn('slow');
			$div.css({'left':$($div).parent().offset().left + 'px','bottom':'29px'});			
		}else{
			$div.fadeOut('slow');
		}
	}
	
	function resetToollbar(){
		$('.box-taskbar').css("display","none");
	}
	function showLang(){
		if($('#taskbar-lang').attr('src')=='/images/toolbar-icon-lang-v.gif'){
			$('#taskbar-lang').attr('src','/images/toolbar-icon-lang-e.gif');
			$('.taskbar-lang .toolbarLink').attr('title','Bộ gõ tiếng anh');
		}else{
			$('#taskbar-lang').attr('src','/images/toolbar-icon-lang-v.gif');
			$('.taskbar-lang .toolbarLink').attr('title','Bộ gõ tiếng việt');
		}
		Mudim.Toggle();
	}
	function taskbarPostCla(obj){
			alert("Bạn phải đăng nhập mới sử dụng được chức năng này");
			//self.location=$(obj).attr('rel');
	}
	function minimizeToolbar(id){
		var $div = $('#'+id);	
		if($div.css("display")=='block'){
			$div.css("display","none");
		}
	}
/* End */

