/*
  (C) Intimate Associates Swingware Software Development, 2000-2009
  IMPORTANT: This is a commercial software product and any use of it means you
  agree to the Swingware Software License agreement. It can be found
  at http://www.intimateassociates.com/swingware/license.html
  Please report License abuse to the Admin at
  http://www.intimateassociates.com/swingware/support/index.php
  This notice may not be removed from the source code.

File Test: 09.15.2006
File Validation: 09.15.2006

Change Log:

================================================================================

================================================================================
*/

/**
 * Checks/unchecks all tables
 *
 * @param   string   the form name
 * @param   boolean  whether to check or to uncheck the element
 *
 * @return  boolean  always true
 */
function setCheckboxes(the_form, do_check)
{
    var elts      = document.forms[the_form].elements;
    var elts_cnt  = elts.length;

    for (var i = 0; i < elts_cnt; i++) {
        elts[i].checked = do_check;
                if (the_form + "_submit" == elts[i].name) {
                        elts[i].disabled = !do_check;
                }
    } // end for

    return true;
} // end of the 'setCheckboxes()' function

function setCheckbox(the_form)
{
    var elts      = document.forms[the_form].elements;
    var elts_cnt  = elts.length;

    var allUnchecked = true;

    for (var i = 0; i < elts_cnt; i++)
    {
        if(elts[i].checked) allUnchecked = false;
    }

    for (var i = 0; i < elts_cnt; i++)
    {
        if(elts[i].name == (the_form + "_submit")) elts[i].disabled = allUnchecked;
    }

    return true;
}



function get_gallery(id_prof)
{
   var win = "width=625,height=625,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";
   window.open("photos_gallery.php?ID="+id_prof,'gallery',win);
}

function launchTellFriend ()
{
    var win = "width=250,height=260,left=200,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
    window.open("tellfriend.php",'tellfriend',win);
    return false;
}

 function launchHostessKit ()
{
    var win = "width=550,height=650,left=50,top=50,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
    window.open("hostess_kit.php",'hostesskit',win);
    return false;
}

function launchPopGenParties ( sID )
{
        var win = "width=550,height=750,left=50,top=50,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";
    window.open("pop_general_pleasure_parties.php?ID="+sID,'pleasurepartiespopup',win);
    return false;
}

function launchTellFriendProfile ( sID )
{
    var win = "width=300,height=300,left=0,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";
    window.open("tellfriend.php?ID="+sID,'tellfriendprofile',win);
    return false;
}

function ShowShowHide ( show_name, show_name2, hide_name )
{
    if (hide_name) hide_name.style.display = 'none';
    if (show_name) show_name.style.display = 'inline';
    if (show_name2) show_name2.style.display = 'inline';
}

function ShowHideHide ( show_name, hide_name, hide_name2 )
{
    if (hide_name) hide_name.style.display = 'none';
    if (hide_name2) hide_name2.style.display = 'none';
    if (show_name) show_name.style.display = 'inline';
}


/**
 * change images onHover mouse action
 */
function show(FileName,jpg1Name)
{
        document.images[FileName].src = jpg1Name;
}

/**
 * set status of the browser window to 's'
 */
function ss(s)
{
        window.status = s;
        return true;
}

/**
 * set status of the browser window to empty
 */
function ce()
{
        window.status='';
}


/**
 * insert emotion item
 */
function emoticon( txtarea, text ) {

        text = ' ' + text + ' ';
        if (txtarea.createTextRange && txtarea.caretPos) {
                var caretPos = txtarea.caretPos;
                caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
                txtarea.focus();
        } else {
                txtarea.value  += text;
                txtarea.focus();
        }
}

function launchAddToIM (id)
{
    var win = "width=600,height=160,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";
    window.open("explanation.php?explain=imadd&ID="+id,'add_to_im',win);
    return false;
}

function docOpen(text)
{
        newWindow=window.open('','','toolbar=no,resizable=yes,scrollbars=yes,width=400,height=300');
        newWindow.document.open("text/html");
        newWindow.document.write(unescape(text));
        newWindow.document.close();
}
/**
 * Launches the Swingware Contact Us Standard Addition
 *
 * @param   none, launch modal window
 *
 * @return  boolean  always false
 *
 * MOD Contact Us by IA 01.06.2006
 *
 * Add FROM "//--" TO  "}" to the inc/js/functions.js in aedating directory
 */
//--  MOD 200 Contact Us STD by Swingware 01.05.2006 --//
function launchContactUsSTD ()
{
    var win = "width=450,height=495,left=200,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
    window.open("sw_contact_us_std.php",'contactusstd',win);
    return false;
}
//--  MOD 201 Contact Us B2B by Swingware 01.05.2006 --//
function launchContactUsB2B ()
{
    var win = "width=450,height=775,left=200,top=10,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
    window.open("sw_contact_us_b2b.php",'contactusb2b',win);
    return false;
}
//--  MOD 202 Contact Us BUG by Swingware 01.05.2006 --//
function launchContactUsBUG ()
{
    var win = "width=450,height=495,left=200,top=10,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
    window.open("sw_contact_us_bug.php",'contactusbug',win);
    return false;
}
/**
 * Launches the Swingware reload for Geo ZipCodes
 *  self.location = 'geo_locations.php?CID=' + val ;
 */
function reload1( form )
{
    var val0 = form.GeoLocationActions.value;
    var val1 = form.Country.options[form.Country.options.selectedIndex].value;

    self.location = val0 + '&CID=' + val1 ;
}
function reload2( form )
{
    var val0 = form.GeoLocationActions.value;
    var val1 = form.Country.options[form.Country.options.selectedIndex].value;
    var val2 = form.State.options[form.State.options.selectedIndex].value;

    self.location = val0 +'&CID=' + val1 + '&SID=' + val2 ;
}
function reload3( form )
{
    var val0 = form.GeoLocationActions.value;
    var val1 = form.Country.options[form.Country.options.selectedIndex].value;
    var val2 = form.State.options[form.State.options.selectedIndex].value;
    var val3 = form.City.options[form.City.options.selectedIndex].value;

    self.location = val0 +'&CID=' + val1 + '&SID=' + val2 + '&TID=' + val3 ;
}
function reload4( form )
{
    var val0 = form.GeoLocationActions.value;
    var val1 = form.Country.options[form.Country.options.selectedIndex].value;
    var val2 = form.State.options[form.State.options.selectedIndex].value;
    var val3 = form.City.options[form.City.options.selectedIndex].value;
    var val4 = form.ZipCode.options[form.ZipCode.options.selectedIndex].value;

    self.location=val0 + '&CID=' + val1 + '&SID=' + val2 + '&TID=' + val3 + '&ZID=' + val4;
}
/**
 * Launches the Pop-Up Embedder Script
 *  <a href="http://www.MYSITE.com/mp3/hotwife.mp3" target="_blank" onClick="javascript:PlayerOpen('POPUP DISPLAY NAME',this.href); return false">AUDIO DISPLAY LINK NAME</a>
 */

function PlayerOpen(soundfiledesc,soundfilepath)
{
    var UniqueID = 314 // Make each link open in a new window.
    var newWinOffset = 0 // Position of first pop-up
    var winContent = "<HTML><HEAD><TITLE>" + soundfiledesc + "</TITLE></HEAD><BODY bgcolor='#FF9900'  oncontextmenu='return false;'>";
    PlayWin = window.open('',UniqueID,'width=320,height=190,top=' + newWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
    PlayWin.focus();

    winContent += "<B style='font-size:18px;font-family:Verdana,sans-serif;line-height:1.5'>" + soundfiledesc + "</B>";
    winContent += "<OBJECT width='300' height='42'>";
    winContent += "<param name='SRC' value='" +  soundfilepath + "'>";
    winContent += "<param name='AUTOPLAY' VALUE='true'>";
    winContent += "<param name='CONTROLLER' VALUE='true'>";
    winContent += "<param name='BGCOLOR' VALUE='#FF9900'>";
    winContent += "<EMBED SRC='" + soundfilepath + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#FF9900'></EMBED>";
    winContent += "</OBJECT>";
// OPTIONAL ADD DOWNLOAD LINK
    //winContent += "<p style='font-size:12px;font-family:Verdana,sans-serif;text-align:center'><a href='"+soundfilepath+"'>Download this file</a> <SPAN style='font-size:10px'>(right-click or Option-click)</SPAN></p>";

    winContent += "<FORM><DIV align='center'><INPUT type='button' value='Close this window' onClick='javascript:window.close();'></DIV></FORM>";
    winContent += "</BODY></HTML>";
    PlayWin.document.write(winContent);
    PlayWin.document.close(); // "Finalizes" new window
    UniqueID = UniqueID + 1
// OPTIONAL SUBSEQUENT POP-UPS WILL BE THIS MANY PIXELS LOWER.
    //newWinOffset = newWinOffset + 20
}