function triggerForward(int) {
		new Effect.Opacity('actualContent', {duration:0.25, from:1.0, to:0.0});
		
		setTimeout('ajax_upd(' + int + ')', 250);

}
function triggerBack(int) {
		new Effect.Opacity('actualContent', {duration:0.25, from:1.0, to:0.0});
		
		setTimeout('ajax_upd(' + int + ')', 250);

}
function ajax_upd(int) {
	new Ajax.Updater('actualContent', '/welcome/page_upd', {
	  parameters: { page: int }, evalScripts:true, onComplete:function() {new Effect.Opacity('actualContent', {duration:0.25, from:0.0, to:1.0});}
	});
}
function switch_tab(target, id) {
	Element.hide(currentdiv);
	Element.show(id);
	Element.setStyle(target, {color:'#FFFFFF',background:'#707070'});
	Element.setStyle(currenttab2, {color:'#333333',background:'#F7F7F7'});
	currenttab2 = target;
	currentdiv = id;
}
function link_mouseover(id) {
	if (currenttab2 == id) {
		
	} else {
		Element.setStyle(id, {color:'#FFFFFF',background:'#70A100'});
	}
}
function trackclick() {
	
}
function link_mouseout(target) {
	if (currenttab2 == target) {
		
	} else {
		Element.setStyle(target, {color:'#333333',background:'#F7F7F7'});
	}
}
function add_to_cart(size, id) {
	setTimeout("Element.hide('imgloading')", 1000);
	Element.show('imgloading');$('formupdater').update('Please wait...');new Ajax.Updater('formupdater', '/posters/add_to_cart/' + id + '?size=' + size, {asynchronous:true, onComplete:function(){eval($('formupdater').innerHTML);Element.hide('imgloading');}});
}
function remove_from_cart(id) {
	setTimeout("Element.hide('imgloading')", 1000);
	Element.show('imgloading');$('formupdater').update('Please wait...');new Ajax.Updater('formupdater', '/posters/remove_from_cart/' + id + '?session=true', {asynchronous:true, onComplete:function(){eval($('formupdater').innerHTML);Element.hide('imgloading');}});
}
function empty_cart() {
	setTimeout("Element.hide('imgloading')", 1000);
	Element.show('imgloading');$('formupdater').update('Please wait...');new Ajax.Updater('formupdater', '/posters/empty_cart', {asynchronous:true, onComplete:function(){eval($('formupdater').innerHTML);Element.hide('imgloading');}});
}
function update_cart(price) {
	setTimeout("Element.hide('imgloading')", 1000);
	$('cartlink').update('Cart ($' + price + ')');
	new Effect.Highlight('cartlink');
	$('total').update(price);
	new Effect.Highlight('total');
	Element.show('imgloading');
	new Ajax.Updater('cart', '/posters/cart', {asynchronous:true, onComplete:function(){Element.hide('imgloading');}});
}
function initiateBusiness(url) {
	// Download File
	Element.show('bSpinner');
	rand = Math.random();
	
	$('bFrame').src=url + "?" + rand;
	setTimeout("Element.hide('bSpinner');", 3000);
}
function reportBugs(uri) {
	new Ajax.Request('http://terrasave.com/company/cocap_bug_report?uri=' + uri, {asynchronous:true});
	alert("Thank you for reporting this bug. We work hard to ensure that our website is bug free, and appreciate your report.");
}
function showWallpapers() {
	Effect.Appear('pageCover', {from:0.0, to:0.5});
	Effect.Appear('wallpapers')
}
function hideWallpapers() {
	Effect.Fade('pageCover', {from:0.5, to:0.0});
	Effect.Fade('wallpapers')
}
function finishLoading(bInt, id) {
	if (bInt == 1) {
		$('tbl').style.visibility='visible';
		Element.hide('cocapLoading');
	}
	if (Element.getDimensions(this).width > 200) {
		$(id).style.left = '-45px';
		$(id).style.position='relative'
	}
	
}
function downloadWallpaper(id, desc) {
	alert('Downloading Wallpaper... Find CoasterCaptureDesktop_' + desc + '.jpg and set it as your desktop.');
	document.location.href='/welcome/send_desktop_bg/' + id + '?height=' + screen.height + '&width=' + screen.width;
}
function send_search(search) {
	new Ajax.Request('/welcome/receive_search/' + search, {asynchronous:true});
}
// Real-Time Functions
if (document.location.href.indexOf("park") != -1) {
	setTimeout("$('tbl').style.visibility='visible';Element.hide('cocapLoading')", 5000);
}
var currenttab = "affiliateslink";
if (document.location.href.indexOf("order") != -1) {
	var currenttab2 = "twelvelink";
} else {
	var currenttab2 = "posterlink";
}
var currentdiv = "posters";
var pid;
var lightboxMod;
