$(function(){
/*	var changehashfn = function () {
		$f('*').each(function(){
			try{this.stop();}catch(e){}
		});
		var ref=location.hash;
		if(ref=='')ref='#homepage';
		$('#holder').fadeOut();
		$('.page').fadeOut();
		if(ref=='#homepage'){
			$('#holder').fadeIn();
			$('#body').addClass('black');
			$('#body').removeClass('white');
		}else{
			$('#body').addClass('white');
			$('#body').removeClass('black');
		}
		$(ref).fadeIn();
	}
	changehashfn();
	$(window).bind('hashchange',changehashfn);*/

/*	var db=$('body'),dbsize={},vid=$('#vid')[0],img=$('#holder img'),
	resizefn=function(){
		if(db.width()!=dbsize.w||db.height()!=dbsize.h){
			dbsize.w=db.width();
			dbsize.h=db.height();
			var newwidth=Math.ceil(dbsize.h*(1048/576));
			var width=(dbsize.w>newwidth?dbsize.w:newwidth),
				height=Math.ceil(width/(1048/576));
			if(vid){
				vid.width=width;
				vid.height=height;
			}
			if(img){
				img.css('width',width+'px');
				img.css('height',height+'px');
			}
		}
		$('#line').css('width',($(window).width()-(53*2))+'px');
		if(location.hash=='#reviewspage'){
			var rcontent=$('#rcontent');
			rcontent.css('width',($(window).width()-100)+'px');
			rcontent.css('height',($(window).height()-(rcontent.offset().top+110))+'px');
		}
		if(location.hash=='#projectspage'){
			var pcontent=$('#pcontent');
			pcontent.css('width',($(window).width()-100)+'px');
			pcontent.css('height',($(window).height()-(pcontent.offset().top+110))+'px');
		}
	};
	resizefn();
	setInterval(resizefn,1000);
	$(window).resize(resizefn);
	$(window).bind('keydown',function(e){
		var tag=e.target.tagName.toLowerCase();
		if(tag!='textarea'&&!(tag=='input'&&(e.target.type=='text'||e.target.type=='password'))){
			if(e.keyCode==32||e.keyCode==39||e.keyCode==40)return false;//cancel scroll:down,right,space
		}
	});

	$('.player').flowplayer(
		'flowplayer/flowplayer-3.2.4.swf',
		{
		clip:{autoPlay:true},
		screen:{height:'100pct'},
		plugins:{
			controls:{
				bufferGradient:'none',
				backgroundColor:'transparent',
				backgroundGradient:'none',
				progressGradient:'none',
				border:'0px',
				name:'controls',
				progressColor:'rgba(213,0,46,1)',
				sliderBorder:'1px solid rgba(128,128,128,0.7)',
				sliderColor:'#000000',
				sliderGradient:'none',
				all:false,
				mute:true,
				play:true,
				scrubber:true,
				height:26,
				autoHide:{enabled:true,hideDelay:500,hideStyle:'fade',mouseOutDelay:500,hideDuration:400,fullscreenOnly:false}
			}
		},
		canvas:{backgroundColor:'#000000',backgroundGradient:'none'}
	});*/

	var cache=[],imgs=[
'logo.png','logor.png','line.png','contactlink.png','weddingslink.png','copyright.png',
'wlogo.png','wlogor.png','wline.png','wcontactlink.png','wweddingslink.png','wcopyright.png',
'hblurb.png','media.png','events.png',
'mblurb.png','eblurb.png','projects.png','reviews.png','capabilities.png','contact.png',
'pblurb.png','pcontent.png',
'rblurb.png','rcontent.png',
'cablurb.png','cacontent.png',
'cblurb.png','ccontent.png'];
	for(var i=0;i<imgs.length;i++){
		var img=document.createElement('img');
		img.src=imgs[i];
		cache.push(img);
	}
});
