// CYE Xmas scripts

function doChange(PartyType, Capacity, Budget, County, TownCity) {
	document.location.href = "index.asp?PartyType="+PartyType+"&Capacity="+Capacity+"&Budget="+Budget+"&County="+County+"&TownCity="+TownCity;
}

function doSearchChange(PartyType, Capacity, Budget, County, TownCity) {
	document.location.href = "party-venues-search.asp?PartyType="+PartyType+"&Capacity="+Capacity+"&Budget="+Budget+"&County="+County+"&TownCity="+TownCity;
}

function moveTo(container, element){
	Position.prepare();
	container_y = Position.cumulativeOffset($(container))[1]
	element_y = Position.cumulativeOffset($(element))[1]
	new Effect.Scroll(container, {x:0, y:(element_y-container_y)});
	return false;
}

function swapCal(oldCal, newCal) {
	Effect.Fade(oldCal);
	setTimeout("Effect.Appear('"+newCal+"');", 850);
}

function switchTab(showname, hidename) {
	document.getElementById(hidename+"Tab").style.display = 'none';
	document.getElementById(hidename+"Links").style.display = 'none';
	document.getElementById(showname+"Tab").style.display = 'block';
	document.getElementById(showname+"Links").style.display = 'block';
}

function venueEmail(venue_id) {
	window.open("venueemail.asp?id="+venue_id, "emailpopup", "width=700,height=600,toolbar=0,scrollbars=0")
}

function venueOfferEmail(venue_id) {
	window.open("venueemail.asp?offer=true&id="+venue_id, "emailpopup", "width=700,height=600,toolbar=0,scrollbars=0")
}

function venueEventEmail(venue_id, EventName, theDate, RunsFor) {
	window.open("venueemail.asp?id="+venue_id+"&theDate="+theDate+"&RunsFor="+RunsFor+"&EventName="+escape(EventName), "emailpopup", "width=700,height=600,toolbar=0,scrollbars=0")
}

function venueBrochure(venue_id) {
	window.open("requestbrochure.asp?id="+venue_id, "brochurepopup", "width=700,height=550,toolbar=0,scrollbars=0")
}

function popup(thepage,thewidth,theheight,thetoolbar,thescrollbars) {
	window.open(thepage, "popup", "width="+thewidth+",height="+theheight+",toolbar="+thetoolbar+",scrollbars="+thescrollbars)
}

function addToNotepad(venueId, venueName) {
	var url = 'addtonotepad.asp';
	var pars = 'venueId='+venueId+'&venueName='+venueName;
	var target = 'notepadContent';
	var myAjax = new Ajax.Updater(target, url, {method: 'post', parameters: pars, onComplete:function(request){getNotepadCount()}});
}

function getNotepad(venueId, venueName) {
	var url = 'addtonotepad.asp';
	var target = 'notepadContent';
	var pars = 'thing=test';
	var myAjax = new Ajax.Updater(target, url, {method: 'post', parameters: pars, onComplete:function(request){getNotepadCount()}});
}

function getNotepadCount() {
	var url = 'getnotepadnum.asp';
	var pars = 'thing=test';
	var target = 'topNotepad';
	var myAjax = new Ajax.Updater(target, url, {method: 'post', parameters: pars});
}

function delNotepadVenue(venueId) {
	var url = 'addtonotepad.asp';
	var pars = 'delvenueId='+venueId;
	var target = 'notepadContent';
	var myAjax = new Ajax.Updater(target, url, {method: 'post', parameters: pars, onComplete:function(request){getNotepadCount()}});
}

function sendNotepad() {
	window.open("notepadsend.asp", "emailpopup", "width=700,height=600,toolbar=0,scrollbars=0")
}
