﻿var IMGH=$(window).height();
var IMGW=$(window).width();
jQuery(window).resize(function(){
	IMGH=jQuery(window).height();
	IMGW=jQuery(window).width();
	setCenter(1);
	setbgimgsize(IMGW,IMGH);
});
var setbgimgsize=function(w,h){
	bgcontainer.find("img").css({
		width:w,
		height:h
	})
}
var bgcontainer=jQuery("#bg");
var imgloadbar=jQuery("#loadBg");
var imgloadprogress=jQuery("#loadingbar");
var setbgimg=function(){
	bgcontainer.append("<img src='"+imgsrc+"' alt='' />");
	bgcontainer.find("img").load(function(){
		setbgimgsize(IMGW,IMGH);
		bgcontainer.fadeIn(800);
		imgloadprogress.clearQueue();
		imgloadprogress.stop();
		imgloadprogress.animate({
			width:"100%"
		},10,function(){
			imgloadbar.fadeOut(300);
		})
	});
	imgloadprogress
		.animate({
			width:Math.floor(Math.random()*(20-0)+0)+"%"
		},800)
		.delay(3000)
		.animate({
			width:Math.floor(Math.random()*(40-20)+20)+"%"
		},800)
		.delay(2000)
		.animate({
			width:Math.floor(Math.random()*(60-40)+40)+"%"
		},800)
		.delay(1800)
		.animate({
			width:Math.floor(Math.random()*(70-60)+60)+"%"
		},400)
		.delay(2000)
		.animate({
			width:Math.floor(Math.random()*(80-70)+70)+"%"
		},400)
		.delay(1200)
		.animate({
			width:Math.floor(Math.random()*(95-80)+80)+"%"
		},400)
}

$(function(){
	//btn more;
	jQuery("a.viewmore b").css({backgroundPosition:"-10px 1px"});
	jQuery("a.viewmore").live("mouseover",function(){
		jQuery(this).find("b").animate({
			backgroundPosition:"0px 1px"
		},{duration:400,queue:false});
	}).live("mouseout",function(){
		jQuery(this).find("b").animate({
			backgroundPosition:"-10px 1px"
		},{duration:400,queue:false});
	})
	jQuery("a.viewmore2 b").css({backgroundPosition:"-26px top"});
	jQuery("a.viewmore2").live("mouseover",function(){
		jQuery(this).find("b").animate({
			backgroundPosition:"0px top"
		},{duration:600,queue:false});
	}).live("mouseout",function(){
		jQuery(this).find("b").animate({
			backgroundPosition:"-26px top"
		},{duration:600,queue:false});
	})
	jQuery("a.viewmore3 b").css({backgroundPosition:"0px 1px"});
	jQuery("a.viewmore3").live("mouseover",function(){
		jQuery(this).find("b").animate({
			backgroundPosition:"-26px 1px"
		},{duration:600,queue:false});
	}).live("mouseout",function(){
		jQuery(this).find("b").animate({
			backgroundPosition:"0px 1px"
		},{duration:600,queue:false});
	})
	//copyright;
	var copyshow=false;
	jQuery("#copy").hover(function(){
		if(!copyshow){
			copyshow=true;
			jQuery(this).find(".trigger").hide();
			jQuery(this).animate({
				width:"213px"
			},{duration:400,easing:"swing",complete:function(){jQuery(this).find(".trigger").hide();}});
		}
	},function(){
		jQuery(this).animate({
			width:"8px"
		},{duration:200,easing:'swing',complete:function(){jQuery(this).find(".trigger").show();copyshow=false;}});
	});
	
	jQuery("a").focus(function(){this.blur();});
})

document.ondragstart=function(){return false;}
document.onselectstart=function(){return false;}
