
function SendMessage(fUser,tUser,sId,offS)
{ 
  var s=10+offS;
  var no = Math.round(10000 * Math.random());
  window.open('/scripts/sendonline_new.asp?from='+fUser+'&to='+tUser+'&session='+sId,
              'sendmsg'+no,
              'status=yes,scrollbars=no,resizable=yes,width=420,height=480,screenX=10,screenY=10,top=10,left='+s);
}

function ReportAbuse(fUser,mId,sId)
{
  window.open('/scripts/reportabuse.asp?id='+mId+'&user='+fUser+'&session='+sId,'abuse'+mId,
              'status=yes,scrollbars=yes,resizable=yes,width=380,height=380,screenX=10,screenY=10,top=10,left=415');
}

function ReportSpam(fUser,mId,sId)
{
  window.open('/scripts/reportspam.asp?id='+mId+'&user='+fUser+'&session='+sId,'spam'+mId,
              'status=yes,scrollbars=yes,resizable=yes,width=380,height=380,screenX=10,screenY=10,top=10,left=415');
}


function SaveMessage1(mId,fUser,iSent)
{
  window.open('/scripts/savemessage.asp?id='+mId+'&user='+fUser+'&iSent='+iSent,
              'savemsg'+mId,
              'status=yes,scrollbars=no,resizable=no,width=250,height=180,screenX=10,screenY=10,top=10,left=10');
}

function SaveMessage(mId,fUser)
{
  SaveMessage1(mId,fUser,'N');
}

function NoThanks(fUser,tUser,sId,offS)
{
  var s=10+offS;
  var no = Math.round(10000 * Math.random());
  window.open('/scripts/nothanks.asp?msgfrom='+fUser+'&msgto='+tUser+'&session='+sId,'nt'+no,
	      'status=yes,scrollbars=yes,resizable=yes,width=400,height=300,screenX=10,screenY=10,top=10,left='+s);
}

function DeleteMsg(fUser,mId)
{
  window.open('/scripts/deletemessage.asp?id='+mId+'&user='+fUser,'deletemsg'+mId,
              'status=yes,scrollbars=no,resizable=no,width=10,height=10,screenX=10,screenY=10,top=10,left=10');
}

function StartInsta(id1,id2,st,sId)
{
  window.open('/scripts/startinsta.asp?id1='+id1+'&id2='+id2+'&session='+sId+'&st='+st,'instachat',
	      'status=yes,scrollbars=no,resizable=yes,width=400,height=300,screenX=10,screenY=10,top=10,left=425');
}


function UpdateNotes(fUser,tUser,sId)
{
  window.open('/scripts/notes.asp?from='+fUser+'&to='+tUser+'&session='+sId,
              'updateNotes',
              'status=yes,scrollbars=yes,resizable=yes,width=400,height=220,screenX=10,screenY=10,top=10,left=10');}

function SendMail(fUser,tUser,sId)
{
  window.open('/scripts/respond1.asp?from='+fUser+'&to='+tUser+'&session='+sId,
              'sendMail',
              'status=yes,scrollbars=yes,resizable=yes,width=600,height=480,screenX=10,screenY=10,top=10,left=10');
}

function InviteChat(fUser,tUser,sId)
{
  window.open('/scripts/invchat.asp?un='+fUser+'&ito='+tUser+'&session='+sId,'invitechat','status=yes,scrollbars=no,resizable=no,width=300,height=230,screenX=10,screenY=10,top=10,left=10');
}  

function ViewProfile(fUser,tUser,sId)
{
  document.cookie = "ref=" + window.self.location.href;
  var no = Math.round(10000 * Math.random());
  window.open('/scripts/ndisplay.asp?userid='+tUser,
              'profile'+no,
	      'status=no,scrollbars=yes,resizable=yes');
}


function ViewProfileTopX(fUser,tUser,sId)
{ 
  var no = Math.round(10000 * Math.random());
  window.open('/scripts/ndisplay.asp?userid='+tUser+'&topx=Y',
              'profile'+no,
	      'status=no,scrollbars=yes,resizable=yes');
}

function MailAFriend(fUser, tUser, sId)
{
  window.open('/scripts/friend.asp?user='+fUser+'&session='+sId+'&FUser='+tUser,
	      'mailfriend',
	      'status=yes,scrollbars=no,resizable=no,width=480,height=220,screenX=10,screenY=10,top=10,left=10');
}


function AddFriend(fUser,tUser,sId,s,cnf)
{
  window.open('/scripts/frndlist.asp?user='+fUser+'&session='+sId+'&Friend='+tUser+'&trns='+s+'&cnf='+cnf,
              'frnd',
              'status=yes,scrollbars=no,resizable=no,width=250,height=100,screenX=10,screenY=10,top=10,left=10');
}

function AddToFavourites(fUser,tUser,sId,s,cnf)
{
  window.open('/scripts/favs.asp?addfav='+tUser+'&session='+sId+'&User='+fUser+'&trns='+s+'&cnf='+cnf,
              'addfav',
              'status=yes,scrollbars=no,resizable=no,width=250,height=100,screenX=10,screenY=10,top=10,left=10');
}

function ViewTips()
{
  window.open('/scripts/tips.asp','tipsw','status=yes,scrollbars=yes,resizable=yes,width=500,height=450,screenX=0,screenY=0,top=0,left=0');
}

function MessageHistory(fn,fUser,tUser,sId,jt)
{
  var no = Math.round(10000 * Math.random());
  window.open('/scripts/'+fn+'.asp?from='+fUser+'&to='+tUser+'&session='+sId+'&th='+jt,
              'mh'+no,'status=yes,scrollbars=yes,resizable=yes,width=420,height=300,screenX=10,screenY=10,top=10,left=425');
}

function DeleteStoredMsg(fUser,mId)
{
  window.open('/scripts/deletestoredmessage.asp?id='+mId+'&user='+fUser,'deletemsg'+mId,
              'status=yes,scrollbars=no,resizable=no,width=10,height=10,screenX=10,screenY=10,top=10,left=10');
}

function OpenGaydarRadio()
{
  window.open('http://www.gaydarnation.com/mediaplayer/nation_player.asp?from=player&site=GD','radiomenu','addressbar=no,status=yes,scrollbars=no,resizable=no,width=490,height=420,screenX=10,screenY=10,top=10,left=10');
}

function OpenPrivates(fName)
{
  window.open('/scripts/albumbottom.asp?pvt=Y&fn='+fName,'Private','status=yes,scrollbars=yes,resizable=yes,width=530,height=500,screenX=10,screenY=10,top=100,left=100');
}

function OpenHelp(HelpSect)
{
  window.open('/scripts/help.asp#'+HelpSect,'Help','status=yes,scrollbars=yes,resizable=yes,width=530,height=500,screenX=10,screenY=10,top=100,left=100');
}

function CallUser(fUser,tUser,sId)
{
  window.open('/scripts/phoneme.asp?from='+fUser+'&to='+tUser+'&session='+sId,'voicechat','status=yes,scrollbars=no,resizable=no,width=350,height=400,screenX=10,screenY=10,top=10,left=10');
}

function VoiceMessage(fUser,tUser,sId)
{
  window.open('/scripts/voicemessage.asp?from='+fUser+'&to='+tUser+'&session='+sId,'voicemessage','status=yes,scrollbars=no,resizable=no,width=550,height=500,screenX=10,screenY=10,top=10,left=10');
}

function EnterSexFactor(sId)
{ 
  var no = Math.round(10000 * Math.random());
  window.open('/scripts/sexfactor/enter.asp?header=False&session='+sId,
              'sexfactor'+no,
	      'status=no,scrollbars=yes,resizable=yes');
}

function SexFactorMenu(sId)
{ 
  var no = Math.round(10000 * Math.random());
  window.open('/scripts/sexfactor/sexfactormenu.asp?header=False&session='+sId,
              'sexfactor'+no,
	      'status=no,scrollbars=yes,resizable=yes');
}


function SexFactorVote(sId,NoId,MemType)
{ 
  var no = Math.round(10000 * Math.random());
  window.open('/scripts/sexfactor/vote_display.asp?header=False&session='+sId+'&noid='+NoId+'&mt='+MemType,
              'sexfactor'+no,
	      'status=no,scrollbars=yes,resizable=yes');
}

function RefreshWindow()
{
	//window.location.href = window.location.href;
	window.location.reload();
}

function ViewTravel(fUser,sId,countryC,areaC)
{ 
  var no = Math.round(10000 * Math.random());
  window.open('/scripts/travelarea.asp?userid='+fUser+'&session='+sId+'&country='+countryC+'&area='+areaC,
              'travel'+no,
	      'status=no,scrollbars=yes,resizable=yes');
}

function ReportProfile(ReprId,RepdId)
{
  window.open('/scripts/reportprofilenotes.asp?ReprId='+ReprId+'&RepdId='+RepdId,'',
              'status=no,scrollbars=no,resizable=no,width=365,height=360,screenX=10,screenY=10,top=10,left=10');
}

function ReportProfileInfo()
{
	window.open('/scripts/reportprofileinfo.asp','','status=yes,scrollbars=yes,resizable=yes,width=465,height=160,screenX=10,screenY=10,top=10,left=10');
}

var currentGalleryThumbnail;
var lastClickedGalleryThumbnail;

function mouseoverGalleryThumbnail(i, s, c)
{
    // only mouseover if nothing has been "clicked"
    if (!lastClickedGalleryThumbnail && i && i!=currentGalleryThumbnail) {
        if (currentGalleryThumbnail){
            currentGalleryThumbnail.className = 'galleryThumbnailPlain';
        }
        i.className='galleryThumbnailShown';
        showGalleryPicture(i, s, c);
        return false;
    } else {
        return true;
    }
}

function showGalleryPicture(i, s, c)
{
    var img = document.getElementById("mainPic");
    var div = document.getElementById("mainPicCaption");
    img.src = s;
    div.innerHTML = c;
    currentGalleryThumbnail = i;
}

function clickGalleryThumbnail(i, s, c){
    if (i) {
        // has something already been "clicked"
        if (lastClickedGalleryThumbnail){
            // have the previous "clicked" thumbnil been clicked again
            if (i == lastClickedGalleryThumbnail){
                lastClickedGalleryThumbnail = null;
            } else {
                lastClickedGalleryThumbnail.className='galleryThumbnailPlain';
                lastClickedGalleryThumbnail = i;
            }
        } else {
            lastClickedGalleryThumbnail = i;
        }
        if (i==lastClickedGalleryThumbnail){
           i.className='galleryThumbnailClicked';
        } else {
           i.className = 'galleryThumbnailShown'
        }
        showGalleryPicture(i, s, c);
        return false;
    } else {
        return true;
    }
}

function ViewProfileGN(tUser)
{ 
  window.open('/scripts/ndisplay.asp?userid='+tUser+'&GN=Y','','status=no,scrollbars=yes,resizable=yes');
}
