/*

(C) AEwebworks Software Development Ltd., 2002-2003

IMPORTANT: This is a commercial software product and any kind of using it must agree

to the AEwebworks Software Development Ltd. license agreement. It can be found at

http://www.aewebworks.com/license.htm

This notice may not be removed from the source code.

*/



/**

 * 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





var win = "width=470,height=500,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";

function get_gallery(id_prof)

{

   window.open("photos_gallery.php?ID="+id_prof,'gallery',win);

}



function launchTellFriend ()

{

    var win = "width=320,height=320,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";

    window.open("tellfriend.php",'tellfriend',win);

    return false;

}



function launchTellFriendProfile ( sID )

{

    var win = "width=320,height=320,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";

    window.open("tellfriend.php?ID="+sID,'tellfriendprofile',win);

    return false;

}



//--  MOD 200 Contact Us STD by Swingware 01.05.2006 BEGIN CODE--//

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;

}



//--  MOD 200 Contact Us STD by Swingware 01.05.2006 END CODE--//



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 ) {

//	var txtarea = document.post.message;

	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=400,height=200,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;

}

