function v(obj){
if(window.console&&window.console.log){
console.log(obj);
}else{
if($('#v_debug').length==0){
var html='<div id="v_debug" style="position:absolute; width:400px; height:200px; overflow:auto; background-color:#FFF; top:0; left:0; border:1px solid #000; z-index:1000;"></div>';
$('body').append(html);
}
var obj_=$('#v_debug').html()+'<br />'+obj;
$('#v_debug').html(obj_);
}
}
function showWhiteMask(){
setWhiteMaskHeight();
$('footer, article#content')
.css('display','block');
}
function setWhiteMaskHeight(){
var top=$('header').outerHeight();
var left=0;
var width='100%';
var height=$(document).height()-top;
$('#white_mask')
.css({
left:left,
top:top,
width:width,
height:height
})
}
function hideWhiteMask(){
setWhiteMaskHeight();
$('#white_mask')
.fadeOut(1500);
}
function showAndExitWhiteMask(url){
//$('#white_mask')
//.fadeIn(1500,function(){
//location.href=url;
//});	
location.href=url;
}
$(function(){
$('header a')
.mouseenter(function(){
$(this)
.find('span')
.stop(1,1)
.animate({
width:'100%'
},'fast')
})
.mouseleave(function(){
$(this)
.find('span')
.stop(1,1)
.animate({
width:'0'
},'fast')
})
.click(function(){
var href_link=$(this).attr('href');
showAndExitWhiteMask(href_link);
return!1;
})
var can_move_logo=true;
function updateLogoCenter(){
var width=$(document).width();
var height=$(document).height();
width=width<1002?1002:width;
width=width<95?95:width;
var x=(width-214)/2
var y=(height-95)/2;
if(can_move_logo){
$('#move_logo')
.css({
'left':x
,'top':y
})
}else{
$('#move_logo')
.css({
'left':x
})
}
}
$(window)
.resize(function(){
updateLogoCenter();
setWhiteMaskHeight();
})
updateLogoCenter();
if(is_load_animiate){
$('#move_logo')
.fadeIn(function(){
setTimeout(function(){
can_move_logo=false;
$('#move_logo')
.animate({'top':9},1500,function(){
$(this)
.click(function(){
location.href='index.php';
})
$('header nav.menu a')
.css({
'display':'block'
,'opacity':0
})
$('header')
.css({
'display':'block'
,'opacity':0
})
.animate({
'opacity':1
},1000,function(){
$('header nav.menu a')
.each(function(i,e){
var time=(i+1)*300;
$(e)
.animate({
'opacity':1
},time);
});
setTimeout(function(){
showWhiteMask();
$('footer, article#content')
.animate({
},2000,function(){
setWhiteMaskHeight();
if((this.nodeName=='ARTICLE'||this.nodeName=='article')&&typeof window.init=='function'){
init();
}
});
},1500);
});
updateLogoCenter();
});
},800);
});
}else{
showWhiteMask();
can_move_logo=false;
var fade_arr=$('.fade_ele');
var is_load_init=1;
$('.fade_ele')
.css('display','none');
$('footer, article#content')
.animate({
},1000,function(){
setWhiteMaskHeight();
if(is_load_init){
if((this.nodeName=='ARTICLE'||this.nodeName=='article')&&typeof window.init=='function'){
init();
}
var ele_num=1;
for(i_=1;i_<=fade_arr.length;i_++){
var fade_time=i_*500-((i_-1)*100);
setTimeout(function(){
$('.fade_'+ele_num++)
.fadeIn(1200);
}
,fade_time);
}
is_load_init=0;
}
});
}
})
function show_flower_bg(unit_num){
setTimeout(function(){
unit_num=unit_num?unit_num:10;
$('.bgf')
.each(function(i,e){
if(i<unit_num){
var num=1000*(i*0.75+1);
$(e).fadeIn(num);
}
});
},1500)
}
function getSpContent(html){
var str_arr=new Array();
var is_same_line=0;
for(i=0,j=0;i<html.length;i++){
if(html.charAt(i)=='<'){
str_arr[j]=html.charAt(i);
is_same_line=1;
}else if(html.charAt(i)=='>'){
str_arr[j]+=html.charAt(i);
is_same_line=0;
j++;
}else{
if(is_same_line){
str_arr[j]+=html.charAt(i);
}else{
str_arr[j]=html.charAt(i);
j++;
}
}
}
return str_arr;
}
function showSingleWord(){
	
setTimeout(function(){
	$('.single_word').fadeIn(888);
},888);

return !1;
	
var arr=""
,single_word_arr=new Array()
,show_time_s=10
,html=''
,i=0
,j=0
,ele_=null
,main_int=null;
$('.single_word')
.each(function(index,ele){
single_word_arr[index]=ele;
})
main_int=setInterval(function(){
if(i>=single_word_arr.length){
clearInterval(main_int);
}else{
var is_stop=0;
if(j<1){
ele_=single_word_arr[i];
arr=getSpContent($(ele_).html());
$(ele_).html('').show();
}
if(typeof(arr[j])!='undefined'){
html+=arr[j];
$(ele_).html(html);
if(j++>arr.length-1)is_stop=1;
}else is_stop=1;
if(is_stop){
html='';
i++;
j=0;
}
}
},show_time_s);
}
function checkCruveExists(num){
var img_path=num=='1'?'images/home/home_curve.png':'images/curve.png';
var image=new Image();
image.onload=function(){
$('article#content section.banner')
.css({
'display':'none',
'visibility':'visible'
})
.fadeIn(888,function(){
});
}
image.src=img_path;
}
function loadImage(path,callback){
var image=new Image();
image.onload=callback;
image.src=path;
}
