// To combat pop-up blockers, we need to have some sort of timer that gets
// initiated when a link is clicked. This will allow us to see if the window 
// was blocked or not
var objPopupTimer = null
var blPoppingUp = false

function startPopupTimer(){
	blPoppingUp = true
	objPopupTimer = window.setTimeout("checkPopupStatus()", 15000)
}

function cancelPopupTimer(){
	blPoppingUp = false
	window.clearTimeout(objPopupTimer)
}

function checkPopupStatus(){
	if(blPoppingUp){
		// Make one last attempt to see if the window is open.
		if(!userProfileWin.window.blLoaded){
			alert("It appears that you have a pop-up blocker installed keeping a window from opening. Please disable it by holding down the ctrl key while clicking on the link, or disable it for the entire site.\n\nWe only pop up windows that are neccessary for the site to function and do not pop-up ads. If you feel this is an error, please post in our Site Support forum.")
		}
		else{
			cancelPopupTimer()
		}
	}
}


function showLinkStatus(strMyText){
	window.defaultStatus = strMyText
	//return true
}

function clearLinkStatus(){
	window.defaultStatus = ""
	//return false
}



// Call our pop-up that will allow users to rate profiles
function rateProfile(intUID){
	var rateWin = window.open("/members/popups/rate_users.asp?UID=" + intUID, "rateWin", "width=300,height=300")
}

// Call pop-up that will allow users to browse by state
function browseState() {
	var browseState = window.open("/members/popups/browseState.asp", "browseState", "width=550,height=500");
}

// Call pop-up that will allow users to insert clubs
function insertClubs(){
	var insertClub = window.open("/members/popups/insertClub.asp", "browseState", "width=550,height=500,scrollbars=1");
}

// Call pop-up that will allow users to view full-sized images in gallery
function viewFullSize(intUID, intFileID){
	if(intFileID == 0 || intFileID == -1){
		window.opener.location.href = "/messages/must_be_a_member.asp?reason=3"
		window.close();
		//location.href = "/join/vip_join.asp"
	}
	else{
		var imageGallery = window.open("/members/popups/showFullSize.asp?intUID=" + intUID + "&intPicID=" + intFileID, "viewGallery", "width=650,height=700,scrollbars=yes");
	}
}


function viewFullSizeGallery(intUID, intFileID){
	if(intFileID == 0){
		window.opener.location.href = "/messages/must_be_a_member.asp?reason=4"
		window.close()
	}
	else{
		location.href = "/members/popups/fullGallery.asp?intUID=" + intUID + "&intPicID=" + intFileID
		//var imageGallery = window.open("/members/popups/fullGallery.asp?intUID=" + intUID + "&intPicID=" + intFileID, "viewGallery", "width=650,height=700,scrollbars=yes,resizable=yes");
	}
}


// Call pop-up that will allow users to view full-sized images in gallery
function viewFullSizeTemp(intUID, intFileID){
	var imageGallery = window.open("/members/popups/showFullSizeTemp.asp?intUID=" + intUID + "&intPicID=" + intFileID, "viewGallery", "width=650,height=700,scrollbars=yes,resizable=yes");

}


// Call pop-up that will allow users to view full-sized images in gallery
function editImage(intFileID){
	var imageGallery = window.open("/members/popups/image_viewer.asp?reload=0&intPicID=" + intFileID, "viewGallery", "width=650,height=700,scrollbars=yes,resizable=yes");

}



// Call pop-up that will allow users to view full-sized images in gallery
function editAudio(intFileID){
	var imageGallery = window.open("/members/popups/audio_viewer.asp?reload=0&intFileID=" + intFileID, "viewGallery", "width=650,height=700,scrollbars=yes,resizable=yes");

}



// Call pop-up that will allow users to view full-sized images in gallery
function editVideo(intFileID){
	var imageGallery = window.open("/members/popups/video_viewer.asp?reload=0&intFileID=" + intFileID, "viewGallery", "width=650,height=700,scrollbars=yes,resizable=yes");

}



// Call chat pop-up
function openChatWin(){
	var chatWin = window.open("/members/chat/chat_entry.asp", "browseState", "width=670,height=490,scrollbars=0,resizable=1");
}


// Call pop-up that shows complete list of buddies
function popupBuddyList(){
	var buddyWin = window.open("/members/popups/buddy_list.asp", "buddyWin", "width=350,height=420,scrollbars=1");
}

// Call pop-up that shows complete list of buddies
function popupRecipientList(){
	var buddyWin = window.open("/members/popups/recipient_list.asp", "buddyWin", "width=350,height=420,scrollbars=1");
}


function popuHelp(strURL){
	var helpWin = window.open(strURL, "helpWin", "width=350,height=420,scrollbars=1")
}



function notificationAdd(intUID){
	var notifyWin = window.open("/members/popups/notification_add.asp?uid=" + intUID, "notifyWin", "width=350,height=420,scrollbars=1")
}

function notificationOpen(){
	var notifyWin = window.open("/members/popups/notification_list.asp", "notifyWin", "width=350,height=420,scrollbars=1")
}

function weeklyPollPopup(){
	var pollWin = window.open("/members/popups/weeklyPoll.asp", "browseState", "width=550,height=500");
}

function requestRetouch(intUploadID){
	var winRetouch = window.open("/members/popups/profile_uploads_retouch.asp?upload_id=" + intUploadID, "winRetouch", "width=550,height=460,scrollbars=1")
}

function requestScan(){
	var winScan = window.open("/members/popups/scan_your_images.asp", "winScan", "width=550,height=500");
}

function newsPopup(){
	var pollWin = window.open("/members/popups/news.asp", "browseState", "width=550,height=500");
}

function drinksPopup(){
	var drinksWin = window.open("/members/popups/drink_recipes.asp", "browseState", "width=550,height=500,scrollbars=1");
}

function privacyPopup(){
	var pollWin = window.open("/members/popups/privacy.asp", "browseState", "width=550,height=500,scrollbars=1");
}

function termsPopup(){
	var pollWin = window.open("/members/popups/terms.asp", "browseState", "width=550,height=500,scrollbars=1");
}


function reportUser(intUID){
	var reportWin = window.open("/members/popups/report_user.asp?uid=" + intUID, "reportWin", "width=400,height=420,scrollbars=1")
}

function tellAFriend(){
	var tellWin = window.open("/members/popups/tell_a_friend.asp", "tellWin", "width=550,height=450,scrollbars=1")
}

function takeFreeTour(){
	var tourWin = window.open("/tour/tour_popup1.html", "tourWin", "width=630,height=500")
}

function nameAvailability(strUsername){
	var nameWin = window.open("/members/popups/name_available.asp?username=" + strUsername, "browseState", "width=550,height=500,scrollbars=1");
}

function tourMail(){
	var nameWin = window.open("/members/popups/mail_tour.asp", "tour", "width=350,height=500,scrollbars=1");
}

function mailSettings(){
	var nameWin = window.open("/members/popups/mail_settings.asp", "settings", "width=450,height=420,scrollbars=1");
}

function whatsNew(){
	var newWin = window.open("/members/popups/whats_new.asp", "whatsNew", "width=380,height=400,scrollbars=1");
}



// Call pop-up that will allow users to view full-sized images in gallery
function viewUsersAudio(intOwnerID, intFileID){
	var imageGallery = window.open("/members/popups/other_audio_viewer.asp?intOwnerID=" + intOwnerID + "&intFileID=" + intFileID, "viewGallery", "width=650,height=700,scrollbars=yes,resizable=yes");
}



// Call pop-up that will allow users to view full-sized images in gallery
function viewUsersVideo(intOwnerID, intFileID){
	var imageGallery = window.open("/members/popups/other_video_viewer.asp?intOwnerID=" + intOwnerID + "&intFileID=" + intFileID, "viewGallery", "width=650,height=700,scrollbars=yes,resizable=yes");
}

var userProfileWin
function viewUserInfo(intUID){
	userProfileWin = window.open("/members/viewUser.asp?uid=" + intUID, "userProfile", "width=790,height=540,scrollbars=yes,resizable=yes");
}

function viewUserInfoToParent(intUID){
	parent.top.location.href = "/members/viewUser.asp?uid=" + intUID
}

function comingSoon(){
	var soonWin = window.open("/members/popups/coming_soon.asp", "comingSoon", "width=584,height=300,scrollbars=0");
}


function horoscopes(){
	var scopesWin = window.open("/members/popups/horoscopes.asp", "horoscopes", "width=584,height=450,scrollbars=1");
}

function IM(strUsername){
	var imWin = window.open("/members/popups/im/default.asp?username=" + strUsername + "#Anchor", strUsername, "width=400,height=390,scrollbars=0");
}

function MediaCenterHelp(){
	var MediaCenterHelpWin = window.open("/members/popups/help/media_center_help.asp", "MediaCenterHelp", "width=510,height=420,scrollbars=1");
}


function getFlashWin(){
	var FlashWin = window.open("/members/popups/getFlash.asp", "FlashWin", "width=240,height=225,scrollbars=0");
}




function trapezeCoupon(){
	var trapezeWin = window.open("/members/popups/trapeze.asp", "Trapeze", "width=350,height=510,scrollbars=0");
}



function newOrleansContest(){
	var tellWin = window.open("/members/popups/contests/win_a_trip_to_no.asp", "tellWin", "width=550,height=450,scrollbars=1")
}


function openFSChat(){
	var chatWin = window.open("/members/popups/FSChat_Beta.asp", "chatWin", "width=755,height=568,scrollbars=0,resizable=yes")
}


function getSupport(){
	window.opener.location.href = '/support.asp';
	window.close()
	
}


function searchLegend(){
	var legendWin = window.open("/members/popups/search_results_legend.asp", "legendWin", "width=390,height=550,scrollbars=0,resizable=yes")
}

function fsNews(strPath){
	var fsNewsWin = window.open(strPath, "fsNewsWin", "width=450,height=400,scrollbars=1,resizable=yes")
}

function fsFreeUpgrade(){
	var fsFreeUpgradeWin = window.open("/members/popups/offers/freeupgrade.asp", "fsFreeUpgrade", "width=450,height=400,scrollbars=1,resizable=yes")
	parent.location.href = "/members/profile_essays.asp"
}


function imagePolicies(){
	var policiesWin = window.open("/members/popups/image_policies.asp", "browseState", "width=550,height=500,scrollbars=1");
}


function referredFriendsList(){
	var friendsWin = window.open("/members/popups/referred_friends.asp", "friendsWin", "width=350,height=420,scrollbars=1")
}


function eventInfo(e_id, e_dt) 
{
		window.open('/members/popups/EventInfo.asp?e_dt=' + e_dt + '&e_id=' + e_id,'EventInfo','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=449,height=400');
}

function NonRebillingDefinition(){
	var DefinitionWin = window.open("/members/popups/NonRefundingDefinition.asp", "browseState", "width=450,height=260,scrollbars=1");
	
}