/*
(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


function get_gallery(id_prof)
{
	var win = "width=700,height=700,left=50,top=50,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
	window.open("http://www.insearchoftheworldsmostbeautifulwoman.com/photos_gallery.php?ID="+id_prof,'gallery',win);
}

function get_gallery2(id_prof)
{
	var win = "width=700,height=700,left=50,top=50,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
	window.open("http://www.insearchoftheworldsmostbeautifulwoman.com/id_img/id_img14/gal_833/photos_gallery2.php?ID="+id_prof,'gallery',win);
}


function get_photo(id_prof, DBtable)
{
	var win = "width=600,height=600,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
//   var text = "profile_photo.php?ID=" + id_prof+"&DBtable="+Dbtable;
   if (DBtable)
	var text = 'profile_photo.php?ID=' + id_prof + '&DBtable=' + DBtable;
   else
	var text = 'profile_photo.php?ID=' + id_prof;

   window.open(text,'photo',win);
}

function get_video(id_prof)
{
	var win = "width=600,height=650,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
	window.open("video_pop.php?ID="+id_prof,'video',win);
}

function get_login()
{
   var win = "width=600,height=300,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
   var text = "sponsors_login.php";
   window.open(text,'Login',win);
    return false;
}

function launchTellFriend ()
{
    var win = "width=300,height=300,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=300,height=300,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;
}

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=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 MM_preloadImages() 
{ //v3.0
 
	img1 = new Image();
	img1.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/wmbw_bg.jpg";
	img2 = new Image(); 
	img2.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/spacer.gif";
	img3 = new Image(); 
	img3.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/join.gif";
	img4 = new Image(); 
	img4.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/c.gif";
	img5 = new Image(); 
	img5.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/h.gif";
	img6 = new Image(); 
	img6.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/0.gif";
	img7 = new Image(); 
	img7.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/2.gif";
	img8 = new Image(); 
	img8.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/8.gif";
	img9 = new Image(); 
	img9.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/9.gif";
	img10 = new Image(); 
	img10.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/11.gif";
	img11 = new Image(); 
	img11.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/12.gif";
	img12 = new Image(); 
	img12.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/13.gif";
	img13 = new Image(); 
	img13.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/14.gif";
	img14 = new Image(); 
	img14.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/15.gif";
	img15 = new Image(); 
	img15.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/17.gif";
	img16 = new Image(); 
	img16.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/18.gif";
	img17 = new Image(); 
	img17.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/19.gif";
	img18 = new Image(); 
	img18.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/20.gif";
	img19 = new Image(); 
	img19.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/21.gif";
	img20 = new Image(); 
	img20.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/26.gif";
	img21 = new Image(); 
	img21.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/27.gif";
	img22 = new Image(); 
	img22.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/29.gif";
	img23 = new Image(); 
	img23.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/30.gif";
	img24 = new Image(); 
	img24.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/32.gif";
	img25 = new Image(); 
	img25.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/36.gif";
	img26 = new Image(); 
	img26.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/37.gif";
	img27 = new Image(); 
	img27.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/42.gif";
	img28 = new Image(); 
	img28.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/43.gif";
	img29 = new Image(); 
	img29.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/46.gif";
	img30 = new Image(); 
	img30.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/48.gif";
	img31 = new Image(); 
	img31.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/50.gif";
	img32 = new Image(); 
	img32.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/52.gif";
	img33 = new Image(); 
	img33.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/55.gif";
	img34 = new Image(); 
	img34.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/56.gif";
	img35 = new Image(); 
	img35.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/59.gif";
	img36 = new Image(); 
	img36.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/66.gif";
	img37 = new Image(); 
	img37.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/67.gif";
	img38 = new Image(); 
	img38.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/70.gif";
	img39 = new Image(); 
	img39.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/72.gif";
	img40 = new Image(); 
	img40.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/75.gif";
	img41 = new Image(); 
	img41.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/76.gif";
	img42 = new Image(); 
	img42.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/77.gif";
	img43 = new Image(); 
	img43.src = "http://www.insearchoftheworldsmostbeautifulwoman.com/images_ae3/flags/83.gif";
}


var browserVersion;
var direction;
var scrolltimer;


function scrollStart()
{
if (document.layers) {	// netscape 4.0 and up
		browserVersion = eval(document.divASContainer.document.contentLayer);
	}
	else {
		if (document.getElementById) { // internet explorer 6.0 and netscape 6.0
			browserVersion= eval("document.getElementById('contentLayer').style");
		}
		else {	
			if (document.all) { // internet explorer 4.0 and up
				browserVersion = eval(document.all.contentLayer.style);
	      }
	   }
	}
	verScroll('right','2');
}


function verScroll(dir, spd) {
	scrolltimer = null;
	direction = dir;
	speed = parseInt(spd);
	var x_pos;
	x_pos = parseInt(browserVersion.left);
	if (direction == "right" && x_pos > -12650) browserVersion.left = (x_pos - (speed));
			else if (direction == "right") browserVersion.left = 0;	
	if (direction == "left" && x_pos < 0) browserVersion.left = (x_pos + (speed));
			else if (direction == "left") browserVersion.left = -5885;
	if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("Mac") != -1)
		{
		scrolltimer = setTimeout("verScroll(direction,speed)", 2);
		speed=5;
		}
		else
		{
		scrolltimer = setTimeout("verScroll(direction,speed)", 5);
		}
}


function stopScroll() {
	clearTimeout(scrolltimer);
}


function startAndStop(dir, spd) {
	clearTimeout(scrolltimer);
	verScroll(dir, spd);
}


// fade affect
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
        
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}


// Enable the marquee tag (disabled by default): 
/* user_pref("browser.display.enable_marquee", true);*/



//Trembling message script- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var ns6=document.getElementById&&!document.all
var ie=document.all

var customcollect=new Array()
var i=0

function jiggleit(num){
if ((!document.all&&!document.getElementById)) return;
customcollect[num].style.left=(parseInt(customcollect[num].style.left)==-1)? customcollect[num].style.left=1 : customcollect[num].style.left=-1
}

function initJig(){
if (ie){
while (eval("document.all.jiggle"+i)!=null){
customcollect[i]= eval("document.all.jiggle"+i)
i++
} 
}
else if (ns6){
while (document.getElementById("jiggle"+i)!=null){
customcollect[i]= document.getElementById("jiggle"+i)
i++
}
}

if (customcollect.length==1)
setInterval("jiggleit(0)",80)
else if (customcollect.length>1)
for (y=0;y<customcollect.length;y++){
var tempvariable='setInterval("jiggleit('+y+')",'+'100)'
eval(tempvariable)
}
}

///window.onload=initJig
