$(document).ready(function(){  

	//$('#city').cornerz({radius: 10  });

	//$("div[id*='SearchForm']").cornerz({radius: 40,	corners: "tl br"});
	
	//$('#recommendation,#links,#social').cornerz({radius: 8, corners: "bl br"});
	
	//$('#recommendation_head,#links_head,#social_head').cornerz({radius: 10,	corners: "tl tr"});
	
	//$('#intro').cornerz({radius: 8,	corners: "bl br"});
	
	//$("div[id*='subtitle']").cornerz({radius: 8,	corners: "bl br"});
	
	//$('#topbar').cornerz({radius: 8,	corners: "bl br"});	

    // ** Important:** Facebox must be initialized after Corners
    if ($('a[rel*=facebox]').length > 0) {
        $('a[rel*=facebox]').facebox({
            loading_image: '/images/facebox/loading.gif',
            close_image: '/images/facebox/closelabel.gif'
        });
    }  
});

function goHome()
{
	window.location="/index.php";	
}

function goYule()
{
	window.location="/yule.php";	
}

function goNewsCenter()
{
	window.location="/newscenter.php";	
}

function goPicNews()
{
	window.location="/picnews.php?t";	
}

function goLive()
{
	window.location="/livevideo.php";	
}

function goAttraction()
{
	window.location="/attraction.php";	
}

function goTour()
{
	window.location="/tour.php";	
}

function openWin(url) {
    window.open(url,"","menubar=no,width=750,height=520,toolbar=no,scrollbars=1");
}


var downStrokeField;

function autojump(fieldName,nextFieldName,fakeMaxLength)
{
	var myForm=document.forms[document.forms.length - 1];
	var myField=myForm.elements[fieldName];
	myField.nextField=myForm.elements[nextFieldName];
	
	if (myField.maxLength == null)
	   myField.maxLength=fakeMaxLength;
	
	myField.onkeydown=autojump_keyDown;
	myField.onkeyup=autojump_keyUp;
}

function autojump_keyDown()
{
	this.beforeLength=this.value.length;
	downStrokeField=this;
}

function autojump_keyUp()
{
	if (
	   (this == downStrokeField) && 
	   (this.value.length > this.beforeLength) && 
	   (this.value.length >= this.maxLength)
	   )
	   this.nextField.focus();
	downStrokeField=null;
}




function switchCamImg(url,shortDes)
{
	$('#camDesc span').html('Loading...') ;
    var d = new Date();

    $('#camImg').attr('src', url + "?t=" + d.getTime());
	$('#camDesc span').html(shortDes) ;

}

function switchPeaceCamImg(url,shortDes)
{
	$('#camPeaceDesc span').html('Loading...') ;
    var d = new Date();

    $('#camPeaceImg').attr('src', url + "?t=" + d.getTime());
	$('#camPeaceDesc span').html(shortDes) ;

}

function ismaxlength(obj){
	var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : "";
	if (obj.getAttribute && obj.value.length>mlength)
	{
		obj.value=obj.value.substring(0,mlength);
	}
}


