function flashGetHref() {
	if( navigator.appName == "Microsoft Internet Explorer" ) {
		return window.location.href;
	} else {
		return location.href;
	}
}

function flashPutHref(href) {
	if( navigator.appName == "Microsoft Internet Explorer" ) {
		window.location.href = href;
	} else {
		location.href = href;
	}
}

function flashGetTitle() {
	return document.title;
}

function flashPutTitle(title) {
	document.title = title;
}
	
function ab_window(url) {
	link = window.open(url,"ab"+SITE_CODE,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=250,height=300,left=0,top=0");
	link.focus();
}

function doFriend( action, friendid ) {
	if ( action == "remove" || action == "private" ) {
		window.location = "/friends.php?action="+action+"&memberid="+friendid+"&goto="+escape( window.location );
	} else {
		link = window.open("/friends.php?action="+action+"&memberid="+friendid+"&goto="+escape(window.location),"friend"+SITE_CODE,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=640,height=250,left=0,top=0");
		link.focus();
	}
}

function mail_window(url) {
	link = window.open(url,"qmail"+SITE_CODE,"scrollbars=1,resizable=1,width=800,height=600,left=0,top=0");
	link.focus();
}

function bookmarks_window( action, type, targetid, PHPSESSID ) {
	var bkmk_action = "";
	var bkmk_type = "";
	var bkmk_label = "";
	var bkmk_link = "";
	var bkmk_SID = "";
	
	if( action != ""  ) {
		bkmk_action = "&action=" + action;
	}
	
	if( type != "" ) {
		bkmk_type = "&type=" + type;
	}
	
	if( targetid != "" ) {
		bkmk_label = "&label=" + targetid + "_Profile";
		bkmk_link = "&link=" + targetid;
	}
	
	if( PHPSESSID != "" ) {
		bkmk_PHPSESSID = "&PHPSESSID=" + PHPSESSID;
	}
	
	url = "/modules/bookmarks/index.php?" + bkmk_action + bkmk_type + bkmk_label + bkmk_link + bkmk_PHPSESSID + "&";
	
//	url = "/modules/bookmarks/index.php?action="+action+"&type=" + type + "&label=" + targetid + "_Profile&link=" + targetid + "&" + SID;
	link = window.open( url, "bookmarks", "scrollbars=1,width=600,height=500,left=0,top=0" );
	link.focus();
}


function map_window( pLocation, pType, pIndex, pTitle, pDesc, pSID ) {
	if( pLocation != undefined ) {
		mapLocation = "&setLocation="+ pLocation;
	} else {
		mapLocation = "Dallas, TX";
	}
	
	if( pType != undefined ) {
		mapType = "&setType="+ pType;
	} else {
		mapType = "zip";
	}
	
	if( pIndex != undefined ) {
		mapIndex = "&setIndex="+ pIndex;
	} else {
		mapIndex = "";
	}
	
	if( pTitle != undefined ) {
		mapTitle = "&setTitle="+ pTitle;
	} else {
		mapTitle = "";
	}

	if( pDesc != undefined ) {
		mapDesc = "&setDesc="+ pDesc;
	} else {
		mapDesc = "";
	}

	if( pSID != undefined ) {
		mapSID = "&PHPSESSID="+ pSID;
	} else {
		mapSID = "";
	}

	url = "/modules/onlinemaps/index.php?setLocation=" + pLocation + mapType + mapIndex + mapTitle + mapDesc + mapSID + "&";
//	alert( "here: " + url );
	link = window.open( url, "maps", "scrollbars=0,width=600,height=560,left=0,top=0" );
	link.focus();
}

function photo_window(id) {
	url = "/photos.php?action=view&album=public&view=album&memberid="+id;
	link = window.open(url,"photos"+SITE_CODE,"scrollbars=1,width=750,height=600,left=0,top=0");
	link.focus();
}

function photos(url) {
	link = window.open(url,"photos","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=750,height=500,left=0,top=0");
	link.focus();
}

function photos_window(url) {
	link = window.open(url,"photos"+SITE_CODE,"scrollbars=1,width=750,height=600,left=0,top=0");
	link.focus();
}

function read_mail(id,folderid) {
	link = window.open("mail.php?action=read&messageid="+id+"&folderid="+folderid,"readmail"+id,"scrollbars=1,resizable=1,width=680,height=540,left=0,top=0");
	link.focus();
}

function history_window(url) {
	link = window.open(url,"history"+SITE_CODE,"scrollbars=1,resizable=1,width=750,height=500,left=0,top=0");
	link.focus();
}

function validation_window() {
	link = window.open("validation.php","validation"+SITE_CODE,"scrollbars=1,resizable=1,width=750,height=500,left=0,top=0");
	link.focus();
}

function profile_window(id) {
	url = isNaN(id) ? id : ("/profile.php?id="+id);
	link = window.open(url,"profile","scrollbars=1,resizable=1,width=750,height=600,left=0,top=0");
	link.focus();
}

function profile_window2(id) {
	url = "/profile.php?id="+id;
	link = window.open(url,"profile"+SITE_CODE,"scrollbars=1,resizable=1,width=750,height=600,left=0,top=0");
	link.focus();
}

function terms_window(url) {
	link = window.open(url,"terms"+SITE_CODE,"scrollbars=1,resizable=1,width=750,height=500,left=0,top=0");
	link.focus();
}

function setPointer(theRow, thePointerColor) {
	if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
		return false;
	}
	if (typeof(document.getElementsByTagName) != 'undefined') {
		var theCells = theRow.getElementsByTagName('td');
	} else if (typeof(theRow.cells) != 'undefined') {
		var theCells = theRow.cells;
	} else {
		return false;
	}
	
	var rowCellsCnt  = theCells.length;
	for (var c = 0; c < rowCellsCnt; c++) {
		theCells[c].style.backgroundColor = thePointerColor;
	}
	return true;
} // end of the 'setPointer()' function

function CheckAll(frm,el) {
	for (var i=0;i<frm.elements.length;i++) {
		var e = frm.elements[i];
		if ((e.name != 'allbox') && (e.name != 'allbox2') && (e.type=='checkbox')) e.checked = el.checked;
	}
}
