// AJAX INIT
var domain ="http://daithiena.com";
function $$$(id) {
return document.getElementById(id);
}
function khoitao_ajax()
{
var x;
try
{
x = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
x = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(f) { x = null; }
}
if ((!x)&&(typeof XMLHttpRequest!="undefined"))
{
x=new XMLHttpRequest();
}
return x;
}
function Forward(url)
{
window.location.href = 'http://giaquatot.com/sp-thanh-pho/'+url+'/gia-qua-tot.html';
}
function _postback()
{
return void(1);
}
//đã được load hoàn tất.
jQuery(window).load(function(){
jQuery(window).resize(function(){
});
});
//Cu font
$(function(){
Cufon.replace('.cufon', {fontFamily:'UTM Cafeta',hover:true});
//Cufon.replace('.nivo-caption', { fontFamily:'UTM Cafeta', hover: true});
//Cufon.replace('h2.title', { fontFamily:'UTM Cafeta', textShadow: '1px 1px #000'});
});
// khoi tao Ajax
$(document).ready(function()
{
//Menu
$("#accordion > li").click(function(){
if(false == $(this).next().is(':visible')) {
$('#accordion > ul').slideUp(300);
}
$(this).next().slideToggle(300);
});
$('#accordion > ul:eq(0)').show();
//Back to Top
$(document).ready(function() {
$('.main').append('
Back to Top
');
$(window).scroll(function() {
if($(window).scrollTop() != 0) {
$('#top').fadeIn();
} else {
$('#top').fadeOut();
}
});
$('#top').click(function() {
$('html, body').animate({scrollTop:0},500);
});
});
//Home san pham
$(".thanh_tich").jCarouselLite({
btnNext: ".next",
btnPrev: ".prev",
auto: true,
speed: 300, // Toc do chay hinh
auto: 8000,// Thoi gian chay hinh
visible: 3
});
// Truot len
$(".newsticker-jcarousellite").jCarouselLite({
vertical: true,
hoverPause:true,
visible: 1,
auto:2000,
speed:2000
});
$(".z_doi_tac").jCarouselLite({
btnNext: ".next",
btnPrev: ".prev",
vertical: true,
hoverPause:true,
visible: 2,
auto:3000,
speed:1000
});
// begin fancy images
$("a[rel=example_group]").fancybox({
'transitionIn' : 'none',
'transitionOut' : 'none',
'titlePosition' : 'over',
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
return 'Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' ' + title : '') + '';
}
});
//scrab_top
$(".close").click(function () {
$('.ads_content').slideToggle("slow");
});
//huy mail dang ky
$("#show_huy_bo").fancybox({
'titlePosition' : 'inside',
'transitionIn' : 'none',
'transitionOut' : 'none'
});
//support
$('#support > .content').hide();
$('#support > h2').click(function(){
$(this).siblings('.content').slideToggle();
});
});
//Hủy đăng ký
function kiem_tra_email_false(frmContactContact)
{
txt_nhan_tin = frmContactContact.txt_nhan_tin.value
if(!txt_nhan_tin)
{
alert("Vui lòng nhập email !");
frmContactContact.txt_nhan_tin.focus();
return false;
}
email=txt_nhan_tin;
if (!email.match(/^([-\d\w][-.\d\w]*)?[-\d\w]@([-\w\d]+\.)+[a-zA-Z]{2,6}$/)){
alert('Địa chỉ email không hợp lệ.');
frmContactContact.txt_nhan_tin.focus();
return false;
}
}
//Menu