function resizeBody() {
	$("#blogsDropdown").animate({
		top: ''+(($("#blogsButton").position().top)+37)+'px',
		left: ''+($("#blogsButton").position().left)+'px'
	},1);
	$("#linksDropdown").animate({
		top: ''+(($("#linksButton").position().top)+37)+'px',
		left: ''+($("#linksButton").position().left)+'px'
	},1);
}
function dropdownSubCat(ple,img) {
	if(img.src=='http://www.thelandmarktour.com/images/transparent.gif?aex-a') {
		$('#'+ple).slideDown(500);
		img.src = 'http://www.thelandmarktour.com/images/transparent.gif?aex-b';
	} else {
		$('#'+ple).slideUp(500);
		img.src = 'http://www.thelandmarktour.com/images/transparent.gif?aex-a';
	}
}
function toggleBlogDownImage(id) {
	img = document.getElementById(id).getElementsByTagName('img').item(0);
	if(img.src=='http://www.thelandmarktour.com/images/transparent.gif?aex-a') {
		img.src = 'http://www.thelandmarktour.com/images/transparent.gif?aex-b';
	} else {
		img.src = 'http://www.thelandmarktour.com/images/transparent.gif?aex-a';
	}
}
function facebox_iframe(src,width,height) {
	spinshow();
	if(!width) { width = 600; }
	if(!height) { height = 450; }
	www = '<iframe frameborder=\'0\' height=\''+height+'\' width=\''+width+'\' allowtransparency=\'true\' src=\''+src+'\' onload=\'spinhide()\'></iframe>';
	jQuery.facebox(www);
}
function facebox_video(file,type,width,height,image) {
	if(!image) { image = '#'; }
	if(type=='youtube') {
		vidId = file.split('=');
		videId = vidId[1];
		videoId = videId.split('&');
		vId = videoId[0];
		embed = '<embed src="http://www.youtube.com/v/'+vId+'&hl=en&fs=1&fmt=18" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+width+'" height="'+height+'"></embed>';
	} else if(type=='flash') {
		embed = '<embed src="'+file+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+width+'" height="'+height+'"'+($('body').attr('loggedin')?' flashvars="username="'+$('body').attr('loggedin')+'':'')+'></embed>';
	} else if(type=='JW') {
		embed = ''+
		'<object type="application/x-shockwave-flash" data="http://new.shizkit.com/player/player.swf" height="'+height+'" width="'+width+'">'+
			'<param name="movie" value="http://new.shizkit.com/player/player.swf">'+
			'<param name="allowfullscreen" value="true">'+
			'<param name="allowscriptaccess" value="always">'+
			'<param name="flashvars" value="file='+file+'&image='+image+'&autostart=true">'+
			'Please download the latest version of <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash Player</a>'+
		'</object>'+
		'<div id="<?=encrypt('+'.$currentStamp.$userName.'+')?>" align="center">This video may take a while to load. Please be patient.</div>';
	}
	jQuery.facebox(embed);
	if(type=='JW') { setTimeout("$('#<?=encrypt('+'.$currentStamp.$userName.'+')?>').slideUp(1000);",5500); }
}
function lockToggle(padlock,input,titleA,titleB) {
	padName = padlock.getAttribute('name');
	if(padName=='a') {
		input.value = 'Unlocked';
		padlock.setAttribute('name','b');
		if(titleB) { padlock.setAttribute('title',titleB); }
	} else if(padName=='b') {
		input.value = 'Locked';
		padlock.setAttribute('name','a');
		if(titleA) { padlock.setAttribute('title',titleA); }
	} else { alert('Invalid Parameters'); }
}
function addPhotoToBlog(tId,photoUrl) {
	thumbUrl = photoUrl.replace(/\/photos\//g,'/photos/thumbs/');
	module = '<a href="'+photoUrl+'" target="_blank" onclick="jQuery.facebox(\'<img src="'+photoUrl+'" border="0" />\'); return false;"><img src="'+thumbUrl+'" border="0" /></a>';
	alert('Copy & Paste this code into your Blog:\n\n'+module);
}
function addPhotoToList(photoUrl,listDiv) {
	thumbUrl = photoUrl.replace(/\/photos\//g,'/photos/thumbs/');
	module = '<div class="photoOpp">' +
				'<img src="'+thumbUrl+'" />' +
				'<a href="#newblog"><div title="Add photo to Blog" onclick="addPhotoToBlog(\'content\',\''+photoUrl+'\')"></div></a>' +
				 photoUrl +
			'</div>';
	originalhtml = $('#'+listDiv).html();
	$('#'+listDiv).html(module+'\n'+originalhtml);
	$('.photoOpp').slideDown(500);
}
$(document).ready(function(){
	if(screen.width<900) {
		document.body.style.zoom = screen.width/900;
		document.Fm.TxAre.value = 900;
	}
	$("#blogsDropdown").animate({
		top: ''+(($("#blogsButton").position().top)+37)+'px',
		left: ''+($("#blogsButton").position().left)+'px'
	},1);
	$("#blogsButton").click(function() {
		toggleBlogDownImage('blogsButton');
		$("#blogsDropdown").slideToggle(350);
		return false;
	});
	$("#linksDropdown").animate({
		top: ''+(($("#linksButton").position().top)+37)+'px',
		left: ''+($("#linksButton").position().left)+'px'
	},1);
	$("#linksButton").click(function() {
		toggleBlogDownImage('linksButton');
		$("#linksDropdown").slideToggle(350);
		return false;
	});
});
