// JavaScript Document
// COMMENT FUNCTION
function evCommentsPopup(type,ID){
document.getElementById("evPopupHolder").innerHTML = "";
var postString = ("data_only=1|module=comment|user_function[get_comment_div]=1|comment_type="+ type + "|indexID=" + ID);
formCreatePost(postString,'evPopupHolder');
evPopOpen("",500,'auto',200,400);
window.killRollovers = 1;
}
function evPostComment(type,ID,photoID){
var addedString = "";
if(null!=photoID){
addedString = "|photoID=" + photoID;
ID = document.getElementById("friendID_comment").value;
}
var postString = ("data_only=1|module=comment|user_function[post_comment]=1|comment_type="+ type + "|indexID=" + ID + "|new_comment=" + encodeURIComponent(document.getElementById("popup_comment_body").value) + addedString);
if((type=="profile" || type == "event") && null==photoID){
formCreatePost(postString,'comment_block_new');
return(evUserpopClose());
}
formCreatePost(postString,'evPopupHolder');
}
function evCommentDelete(ID,type){
var postString = ("data_only=1|module=comment|user_function[AJAXdelete_comment]=1|ID=" + ID + "|type=" + type);
if(!confirm("Are you sure you want to delete this comment? Comment deletions are permanent.")){
return;
}
formCreatePost(postString,'comment_block_' + ID);
}
// END COMMENTS
function evCountryChangeSelect(countryID,div){
if(null==div){
div = 'countrySelectHolder';
}
evFormHidden('data_only',1);
evFormHidden('module','profile');
evFormHidden('countryID',countryID);
evFormHidden('user_function[country_change_select]',1);
postForm('evform',div);
}
function evFinalChangeSelect(){
var fCityID = document.getElementById("cityID").value;
var postString = "data_only=1|module=profile|user_function[event_change_select]=1|fCityID=" + fCityID + "|cityID=" + fCityID;
if(document.getElementById("gallery_type")){
postString += "|in_gallery=1";
}
formCreatePost(postString,'eventSelectHolder');
}
function evEventChangeSelect(cityID){
setTimeout("evFinalChangeSelect();",100);
}
function evPopOpen(contents,boxwidth,boxheight,left,top,fixed){
if(window.killRollovers == 1){
return;
}
if(left == "MD")
{
return(evOpenPopModal(contents));
}
document.getElementById("evPopupHolder").innerHTML = "";
if(fixed==1){
var shiftedLeft = left;
var shiftedTop = top;
}else{
if(null!=top){
var shiftedTop = window.YmouseMove - top;
}else{
var shiftedTop = window.YmouseMove;
}
//alert(document.documentElement.scrollTop + " is the shift");
if(null!=left){
var shiftedLeft = window.XmouseMove - left;
}else if (null!=boxwidth){
var shiftedLeft = window.XmouseMove - (boxwidth/2);
}else{
var shiftedLeft = window.XmouseMove + 4;
}
}
if(null!=boxwidth && boxwidth!='auto'){
document.getElementById("evPopupHolder").style.width = (boxwidth + "px");
}else{
document.getElementById("evPopupHolder").style.width = "auto";
}
if(null!=boxheight && boxheight!=0 && boxheight!='auto'){
document.getElementById("evPopupHolder").style.height = (boxheight + "px");
}else{
document.getElementById("evPopupHolder").style.height = "auto";
}
document.getElementById("evPopupHolder").style.display = "block";
document.getElementById("evPopupHolder").style.top = (shiftedTop + "px");
document.getElementById("evPopupHolder").style.left = (shiftedLeft + "px");
document.getElementById("evPopupHolder").style.zIndex = 205;
if(contents!=0){
document.getElementById("evPopupHolder").innerHTML = contents;
}
document.getElementById("evPopupHolder").style.display = "block";
Nifty("#evPopupHolder","transparent");
}
function evThumbInfoPopOpen(viewcount){
img = viewcount + " Views";
evPopOpen(img,100);
}
function evUserpopOpen(displayName,image){
var imgURL = "http://eventvibe.platformic.com/common/storage/users/primary/" + image + ".jpg?cache=1268773294";
var img = displayName + " ";
evPopOpen(img,100);
}
function evFlyerpopOpen(image){
var imgURL = "http://eventvibe.platformic.com/common/storage/users/flyers/" + image + ".jpg?cache=1268773294";
var img = "";
evPopOpen(img,'auto','auto',0,300);
}
function picturePartyOpen(image){
var imgURL = "http://eventvibe.com/common/storage/users/" + image + ".jpg";
var img = "";
evPopOpen(img);
}
function storeSelectClick(){
if (!document.all) {
window.tmpYClick = window.XmouseMove;
window.tmpXClick = window.YmouseMove;
}else{
window.tmpYClick = 0;
window.tmpXClick = 0;
}
}
function storeMouseMoveFF(e) {
//alert(e.pageX);
window.XmouseMove = e.pageX;
window.YmouseMove =e.pageY;
window.YmouseScreen = e.screenY;
window.XmouseScreen = e.screenY;
}
function storeMouseMove() {
window.XmouseMove = event.clientX + document.documentElement.scrollLeft;
window.YmouseMove = event.clientY + document.documentElement.scrollTop;
}
function evNewFriendRequestsPopup(){
document.getElementById("evPopupHolder").innerHTML = "";
evFormHidden('data_only',1);
evFormHidden('user_function[friend_request_display]',1);
evFormHidden('module','profile');
postForm('evform','evPopupHolder');
var contents = document.getElementById("evPopupHolder").innerHTML;
evPopOpen(contents,350);
}
function evGuestListPopup(){
valueString = "data_only=1|module=event|user_function[guestlist_request_display]=1";
formCreatePost(valueString,"evPopupHolder");
evPopOpen(0,400);
window.killRollovers = 1;
}
function addToList(){
valueString = "data_only=1|module=event|user_function[guestlist_add]=1|plus=" + document.getElementById("plus").value + "|promoterID=" + document.getElementById("promoterID").value;
formCreatePost(valueString,"evPopupHolder");
}
function evSearchWindowOpen(){
valueString = "data_only=1|module=search|user_function[search_box_display]=1";
formCreatePost(valueString,"evPopupHolder");
evPopOpen(0,600,'auto',500);
}
function evFriendCommentOpen(friendID,displayname){
valueString = "data_only=1|module=comment|user_function[friend_comment_box_display]=1|friendID=" + friendID +"|displayname=" + displayname;
formCreatePost(valueString,"evPopupHolder");
evPopOpen(0,450,'auto',0,100);
}
function evEventCommentOpen(eventID,displayname){
valueString = "data_only=1|module=comment|user_function[event_comment_box_display]=1|eventID=" + eventID +"|displayname=" + displayname;
formCreatePost(valueString,"evPopupHolder");
evPopOpen(0,450,'auto',0,100);
}
function evLostPWPopup(){
valueString = "data_only=1|module=login_block|user_function[lost_PW_display]=1";
formCreatePost(valueString,"evPopupHolder");
evPopOpen("",400,'auto',0,0);
}
function evMessageWindowOpen(friendID,displayname){
valueString = "data_only=1|module=profile|user_function[message_send_display]=1|friendID=" + friendID +"|displayname=" + encodeURIComponent(displayname);
formCreatePost(valueString,"evPopupHolder");
evPopOpen(0,400,0,300);
}
function evMyspaceCode(directory){
valueString = "data_only=1|module=gallery|user_function[share_box_display]=1|directory=" + directory +"|photo=" + window.mainPhotoID;
formCreatePost(valueString,"evPopupHolder");
evPopOpen(0,500,'auto',250,75);
window.killRollovers = 1;
}
function sendFriendPhoto(photoID){
femail = document.getElementById("sf_email").value;
if(femail==""){
return(alert("You must enter an email address for your friend."));
}
fname = document.getElementById("sf_name").value;
yemail = document.getElementById("y_email").value;
yname = document.getElementById("y_name").value;
mess = encodeURIComponent(document.getElementById("sf_message").value);
if(mess==""){
return(alert("You must include a message."));
}
subj = encodeURIComponent(document.getElementById("sf_subject").value);
if(subj==""){
return(alert("You must enter a subject line for the email."));
}
postString = "data_only=1|module=gallery|user_function[email_pic]=1|photoID=" + photoID + "|femail=" + femail + "|fname=" + fname + "|yemail=" + yemail + "|yname=" + yname + "|mess=" + mess + "|subj=" + subj;
formCreatePost(postString,"evPopupHolder");
}
function evUsersearchWindowOpen(){
document.getElementById("evPopupHolder").innerHTML = "";
valueString = "data_only=1|module=profile|user_function[user_search_display]=1";
formCreatePost(valueString,"evPopupHolder");
evPopOpen(0,350,0,225);
}
function evAddToEventsOpen(eventID){
var postString = "data_only=1|module=event|user_function[show_add_event_popup]=1|eventID=" + eventID;
formCreatePost(postString,"evPopupHolder");
evPopOpen(0,400,0,0);
}
function evFinalizeAttendance(eventID){
var p = document.getElementById("privacy").value;
var postString = "data_only=1|module=event|user_function[finalize_attendance]=1|eventID=" + eventID + "|p=" + p;
formCreatePost(postString,"evPopupHolder");
evPopOpen(0,400,0,0);
}
function eventCancel(eventID){
if(!confirm("Are you sure you wish to cancel this event? Cancelling events with no ticketing will remove them enitrely from Eventvibe.com")){
return;
}
var postString = "data_only=1|module=event|user_function[cancel_event]=1|eventID=" + eventID;
formCreatePost(postString,"evPopupHolder");
evPopOpen(0,400,0,0);
}
function showAccounting(value)
{
var postString = "data_only=1|module=event|user_function[showAccounting]=1|eventID=" + escape(value);
formCreatePost(postString,"modalpopup");
evOpenPopModal(0);
}
function evUserpopClose(rollout){
if(null!=rollout){
if(window.killRollovers == 1){
return;
}
}
window.killRollovers = 0;
document.getElementById("evPopupHolder").style.display = "none";
document.getElementById("evPopupHolder").innerHTML = "";
closeMPopup();
}
function evFormHidden(fieldname,fieldvalue){
formAddField(fieldname,fieldvalue,'hidden','evform');
}
function evFriendRequestOpen(friendID,displayname){
evFormHidden('display_name',displayname);
evFormHidden('friendID',friendID);
evFormHidden('data_only',1);
evFormHidden('user_function[add_friend]',1);
evFormHidden('module','profile');
var contents = "
Are you sure you want to add " + displayname + " as a friend? ";
contents += "
";
contents += " ";
evPopOpen(contents);
}
function evNotLoggedPopup(){
var contents = "Sorry, you must be logged in to do that! Click here to create an account or log in at the top of the page. ";
evPopOpen(contents);
}
function evMultiFeedAdd(selected,index,selector,div){
var selectedValue = document.getElementById(selector).options[index].text;
if(selectedValue.indexOf("My artist")==0){
newArtistFieldShow();
return;
}
if(selectedValue.indexOf("Select artist")==0){
return;
}
var option1=document.createElement('OPTION');
option1.setAttribute('value',selected);
option1.setAttribute("selected","selected");
document.getElementById(div).appendChild(option1);
var txt1=document.createTextNode(selectedValue);
option1.appendChild(txt1);
eval("if(window." + div + "processStarted == 1){document.getElementById(div).size = document.getElementById(div).size + 1;}");
eval("window." + div + "processStarted = 1;");
document.getElementById(selector).remove(index);
}
if (!document.all) {
window.captureEvents(Event.MOUSEMOVE);
window.onmousemove=storeMouseMoveFF;
} else {
document.onmousemove=storeMouseMove;
}
function cityJump(cityname,type){
if(null!=type){
return(window.location.href="http://eventvibe.com/" + type + "/" + cityname);
}
window.location.href="http://eventvibe.com/cities/" + cityname;
}
function evScoutMe(photoID,scoutID,eventID){
alert("You need to be logged in before you can do that!");
}
function evMakeProfilePic(photoID){
alert("You need to be logged in before you can do that!");
}
function evAddToMyGalleries(photoID,scoutID){
alert("You need to be logged in before you can do that!");
}
function evAbusePopup(referenceID,report_type,leftEdge){
alert("You need to be logged in before you can do that!");
}
function evAddFavorite(role,indexID){
var postString = "data_only=1|module=profile|user_function[add_to_favorites]=1|indexID=" + indexID + "|role=" + role;
alert("Added to your favorites. You may organize your favorites by clicking the 'Favorites' tab on your own profile");
formCreatePost(postString,"postDiv");
}
function evRemoveFavorite(itemID){
if(!confirm("Are you sure you wish to remove from your favorites?")){
return;
}
var postString = "data_only=1|module=profile|user_function[remove_favorite]=1|itemID=" + itemID;
alert("This favorite has been removed");
formCreatePost(postString,"favoriteDiv_" + itemID);
}
function evRemoveFriend(friendID,display_name){
if(!confirm("Are you sure you wish to remove " + display_name + " as one of your friends?")){
return;
}
var postString = "data_only=1|module=profile|user_function[remove_friend]=1|friendID=" + friendID;
alert(display_name + " has been removed from your friends.");
formCreatePost(postString,"friendDiv_" + friendID);
}
function checkGallerySelector(value){
if(value==9999999){
document.getElementById("newGalField").style.display = "block";
}
}
function ev_swap_top_photos(seconds){
var evImage = new Array();
var evEventDisplay = new Array();
window.evTopPhotoCount == window.evTopPhotoCurrent ? window.evTopPhotoCurrent = 0 : window.evTopPhotoCurrent++;
evImage[0] = "";
evEventDisplay[0] = "San Diego: Typhoon Saturdays ...";
evImage[1] = "";
evEventDisplay[1] = "San Diego: Fluxx Grand Openi ...";
evImage[2] = "";
evEventDisplay[2] = "Phoenix: Starkillers @ Giant ...";
evImage[3] = "";
evEventDisplay[3] = "Dallas: Lights Out Bikini Bash";
document.getElementById("ev_primary_photo").innerHTML = evImage[window.evTopPhotoCurrent];
if(document.getElementById("evPhotoTitle")){
document.getElementById("evPhotoTitle").innerHTML = evEventDisplay[window.evTopPhotoCurrent];
}
setTimeout("ev_swap_top_photos(" + seconds + ")",(seconds * 1000));
}
function cartUpdateTimeout(eventID){
setTimeout("cartUpdate(" + eventID + ");",30);
}
function cartUpdate(ticketID){
var newQ = document.getElementById("ticket_quantity[" + ticketID + "]").value;
var postString = "data_only=1|module=store|user_function[show_cart]=1|ticketID=" + ticketID + "|newQ=" + newQ;
formCreatePost(postString,"cartContents");
}
function evPopupCart(){
evPopOpen("
|
",650,'auto',-100);
var postString = "data_only=1|module=store|user_function[show_cart]=1|popup=1";
formCreatePost(postString,"cartContents");
}
function emptyCart(){
var postString = "data_only=1|module=store|user_function[empty_cart]=1";
formCreatePost(postString,"cartContents");
}
function evPopupRegister(){
//contents,boxwidth,boxheight,left,top,fixed)
var postString = "data_only=1|module=profile|user_function[registration_display]=1";
formCreatePost(postString,"evPopupHolder");
evPopOpen(0,500,0,400,400,1);
}
function codeHint(direction,hint){
if(window.killRollovers == 1){
return;
}
if(direction==1){
document.getElementById("codeHint").innerHTML = "";
var shiftedTop = window.YmouseMove;
var shiftedLeft = window.XmouseMove + 4;
document.getElementById("codeHint").style.display = "block";
document.getElementById("codeHint").style.top = (shiftedTop + "px");
document.getElementById("codeHint").style.left = (shiftedLeft + "px");
document.getElementById("codeHint").style.zIndex = 205;
document.getElementById("codeHint").innerHTML = decodeURIComponent(hint);
document.getElementById("codeHint").style.display = "block";
}else{
document.getElementById("codeHint").innerHTML = "";
document.getElementById("codeHint").style.display = "none";
}
}
/* Calendars */
function changeCalendarRange(value){
var tag = "";
switch(value){
case(-4):
case(-1):
return;
case(-3):
tag = "?show_event=1";
break;
case(-2):
tag = "?show_event=-1";
break;
default:
tag = "?show_event=" + value;
break;
}
var splitdoc = document.location.href.split("?");
document.location.href = splitdoc[0] + tag;
}
function URLDateRange(){
var tag= "?start=" + window.startsearch + "&end=" + window.endsearch;
var splitdoc = document.location.href.split("?");
document.location.href = splitdoc[0] + tag;
}
function rangeCalendarShow(){
var postString = "data_only=1|module=calendar|user_function[display_search_calendars]=1";
formCreatePost(postString,"evPopupHolder");
evPopOpen("",300,'auto',200);
}
function swapSearchCalendar(which,month){
var postString = "data_only=1|module=calendar|user_function[display_search_calendars]=1|which=" + which + "|month=" + month;
formCreatePost(postString,"searchCal_" + which);
}
function setGallerySearchDate(which,divID,theDate){
eval("window." + which + "search = " + theDate);
eval("if(window." + which + "HolderDiv){var tmpDiv = window." + which + "HolderDiv;} else {var tmpDiv='" + divID + "';} window." + which + "HolderDiv = '" + divID + "'");
document.getElementById(tmpDiv).style.backgroundColor = "#000";
document.getElementById(tmpDiv).style.color = "#fff";
document.getElementById(divID).style.backgroundColor = "#fff";
document.getElementById(divID).style.color = "#333";
}
function changeGalleryPage(which){
document.location.href = "?gp=" + which;
}
function plfmCal(name){
this.name = name;
return(this);
}
plfmCal.prototype.rangeCalendarShow = function(calType){
this.calType = calType;
var postString = "data_only=1|module=calendar|core_app=calendar|user_function[display_search_calendars]=1|calName=" + this.calName + "|cal_type=" + calType;
formCreatePost(postString,"evPopupHolder");
evPopOpen("",300,'auto',200);
}
plfmCal.prototype.swapSearchCalendar = function(which,month){
var postString = "data_only=1|module=calendar|core_app=calendar|user_function[display_search_calendars]=1|calName=" + this.calName + "|which=" + which + "|month=" + month;
formCreatePost(postString,"searchCal_" + which);
}
plfmCal.prototype.setSearchDate = function(which,divID,theDate){
eval("this." + which + "search = " + theDate);
eval("if(this." + which + "HolderDiv){var tmpDiv = this." + which + "HolderDiv;} else {var tmpDiv='" + divID + "';} this." + which + "HolderDiv = '" + divID + "'");
document.getElementById(tmpDiv).style.backgroundColor = "#000";
document.getElementById(tmpDiv).style.color = "#fff";
document.getElementById(divID).style.backgroundColor = "#fff";
document.getElementById(divID).style.color = "#333";
}
plfmCal.prototype.doAction = function(){
var tag= "?start=" + this.startsearch + "&end=" + this.endsearch;
var postTag = "|start=" + this.startsearch + "|end=" + this.endsearch;
switch(this.calType){
case("transaction"):
var searchPhrase = document.getElementById("tran_searchphrase").value;
var searchBy = document.getElementById("tran_searchby").value;
var postString = "data_only=1|module=events|core_app=events|user_function[AJAX_transaction_search]=1|search_by=" + searchBy + "|search_phrase=" + searchPhrase + postTag;
formCreatePost(postString,"searchResults");
break;
case("user_signups"):
var postString = "data_only=1|core_app=dashboard|user_function[AJAX_user_info]=1" + postTag;
formCreatePost(postString,"user_info");
break;
}
evUserpopClose();
}
//Additions
function evOpenPopModal(content,boxW,boxH,overf,reload)
{
var contents = "";
if(content!= 0)
{
contents = content;
}
else
{
contents = document.getElementById("modalcontent").innerHTML;
}
document.getElementById("divShader").className = "on";
var screenWidth = document.getElementById("divShader").offsetWidth;
var screenHeight = document.getElementById("divShader").offsetHeight;
//document.getElementById("modalpopup").innerHTML = "";
document.getElementById("modalcontent").innerHTML = contents;
document.getElementById("modalpopup").className = "open";
if (boxW == null)
{
var popUpWidth = document.getElementById("modalpopup").offsetWidth;
}
else
{
var popUpWidth = boxW;
document.getElementById("modalcontent").style.width = boxW + "px";
}
if (boxH == null)
{
var popUpHeight = document.getElementById("modalpopup").offsetHeight;
}
else
{
//alert(boxH);
var popUpHeight = boxH-30;
document.getElementById("modalcontent").style.height = boxH+"px";
}
if(overf == null || overf == undefined)
{
document.getElementById("modalcontent").style.overflowY = "none";
}else
{
document.getElementById("modalcontent").style.overflowX = "none";
document.getElementById("modalcontent").style.overflowY = "scroll";
}
document.getElementById("modalpopup").style.marginLeft = parseInt((screenWidth - popUpWidth)/2)+"px";
var newH = parseInt((screenHeight - popUpHeight)/2);
document.getElementById("modalpopup").style.marginTop = newH+"px";
if (popUpHeight != null)
{
var chkContent = document.getElementById("modalcontent").innerHTML;
if (chkContent == "")
{
setTimeout("evOpenPopModal("+ content + ","+boxW+","+boxH+","+overf+")",100);
}
}
if(popUpHeight < 50)
{
//alert(popUpWidth + " - " + popUpHeight);
setTimeout("evOpenPopModal("+ content + ")",100);
}
else
{
document.getElementById("modalpopup").className = "open";
}
}
function closeMPopup()
{
document.getElementById("divShader").className = "";
document.getElementById("modalpopup").className = "";
document.getElementById("modalcontent").innerHTML = "";
}
function MPopupResize(old,res)
{
if(res == 1){alert("resub");}
var screenWidth = document.getElementById("divShader").offsetWidth;
var screenHeight = document.getElementById("divShader").offsetHeight;
var popUpWidth = document.getElementById("modalpopup").offsetWidth;
var popUpHeight = document.getElementById("modalpopup").offsetHeight;
if (popUpWidth > 600)
{
popUpWidth = 600;
}
document.getElementById("modalpopup").style.marginLeft = parseInt((screenWidth - popUpWidth)/2)+"px";
var newH = parseInt((screenHeight - popUpHeight)/2) - 100
document.getElementById("modalpopup").style.marginTop = newH+"px";
if (old == 0)
{
var newval = document.getElementById("modalpopup").innerHTML;
}
else
{
var newval = unescape(old);
}
var value = document.getElementById("modalpopup").innerHTML;
if (newval == value)
{
setTimeout("MPopupResize("+ escape(value) +",1)",100);
}
}
function BannerPop()
{
var shader = document.getElementById("divShader");
var bannerpop = document.getElementById("modalpopup");
shader.className = "banner";
shader.style.height = "0px";
var screenWidth = shader.offsetWidth;
shader.className = "";
var bannerHtml = "