//FUNCTION: SCREEN SIZE
//-------------------------------------------------------------------------------------------------------------
if (parseInt(navigator.appVersion)>3){
	screenw = screen.width;
	screenh = screen.height;
}else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)==3 && navigator.javaEnabled()){
	var jToolkit = java.awt.Toolkit.getDefaultToolkit();
	var jScreenSize = jToolkit.getScreenSize();
	screenw = jScreenSize.width;
	screenh = jScreenSize.height;
}

//FUNCTION: ADD FAVORITE
//-------------------------------------------------------------------------------------------------------------
function addtofav(){

	//BOOKMARK SITE
	var is_4up = parseInt(navigator.appVersion);
	var is_mac   = navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
	var is_ie   = navigator.userAgent.toLowerCase().indexOf("msie")!=-1;
	var thePage = location.href;

	if (thePage.lastIndexOf('#')!=-1){
		thePage = thePage.substring(0,thePage.lastIndexOf('#'));
	}
	if (is_ie && is_4up && !is_mac){
		window.external.AddFavorite(thePage,document.title);
	}
	else if (is_ie || document.images){
		booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60');
	}
}

//FUNCTION: ADD FRIEND
//-------------------------------------------------------------------------------------------------------------
function addfriend(){
	window.opener.document.location.href = "myfriends.php";	close();
}

//FUNCTION: COOKIE HANDLING
//-------------------------------------------------------------------------------------------------------------

function setCookie(name,value){
	document.cookie = name + "=" + escape(value) + "; expires=Tue, 19 Jan 2038 00:00:00 GMT';path=/";
}

function getCookie(name){
	var nameEQ=name+"=";
	var ca=document.cookie.split(";");
	for(var i=0;i<ca.length;i++){
		var c=ca[i];
		while (c.charAt(0)==" "){
			c=c.substring(1,c.length);
		}
		if (c.indexOf(nameEQ)==0){
			return unescape(c.substring(nameEQ.length,c.length));
		}
	}
	return "";
}

//POPUPS
//-------------------------------------------------------------------------------------------------------------
//PROFILE ITEM=MEMBER,ADDCLICK=CLICK TRACKING,GOPAGE=PAGE TO NAVIGATE TO
function popmbr(item,addclick,gopage){
	var popmbr = '';
	popmbr = window.open('mbrdtlprf.php?viewid=' + item + '&addclick=' + addclick + '&gopage=' + gopage + '&popmbr=true','popmbr','toolbar=no,menubar=no,resizable=no,scrollbars=yes,status=no,location=no,width=600,height=' + (screenh - 100) + ',left=0,top=0');
	if (window.focus) {
		popmbr.focus()
	}
	//CLEAR COOKIE FOR MBRDTL POPUP
	setCookie("ckviewid","","365");
	setCookie("ckgopage","","365");
}

//DB IS DEFINED AS PIC + 3 LETTER EXTENSION IE.. PICMBR WOULD BE DB=MBR
function poppic(typ,tid,sid,pid){
var poppic='';
poppic=window.open('poppic.php?typ='+typ+'&tid='+tid+'&sid='+sid+'&pid='+pid+'','poppic','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width=600,height=460,left=0,top=0');
if (window.focus) {poppic.focus()}
}

function popfavorite(item){
var popfavorite = '';
popfavorite = window.open('addfavorite.php?favid=' + item + '','popfavorite','toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=no,location=no,width=540,height=250,left=0,top=0');
if (window.focus) {popfavorite.focus()}
}

function popwink(item){
var popwink = '';
popwink = window.open('addwink.php?winkid=' + item + '','popwink','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width=540,height=300,left=0,top=0');
if (window.focus) {popwink.focus()}
}

function pophelp(item){
var pophelp = '';
pophelp = window.open('help.php#' + item + '','pophelp','toolbar=no,menubar=no,resizable=no,scrollbars=yes,status=no,location=no,width=620,height=' + (screenh - 100) + ',left=0,top=0');
if (window.focus) {pophelp.focus()}
}

function popinvite(){
var popinvite = '';
popinvite = window.open('invite.php','popinvite','toolbar=no,menubar=no,resizable=no,scrollbars=yes,status=no,location=no,width=540,height=450,left=0,top=0');
if (window.focus) {popinvite.focus()}
}

function popevt(item,attending){
var popevents = '';
popevents = window.open('evtdetail.php?evtid=' + item + '&attending=' + attending + '','popevents','toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=no,location=no,width=540,height=' + (screenh - 100) + ',left=0,top=0');
if (window.focus) {popevents.focus()}
}

function pophot(item){
var pophs = '';
pophs = window.open('hotdetail.php?hotid=' + item + '','pophs','toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=no,location=no,width=540,height=' + (screenh - 100) + ',left=0,top=0');
if (window.focus) {pophs.focus()}
}

function popfriends(item){
var popfriends = '';
popfriends = window.open('searchresinv.php?viewid=' + item + '','popfriends','toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=no,location=no,width=540,height=' + (screenh - 100) + ',left=0,top=0');
if (window.focus) {popfriends.focus()}
}

//SITE DOCUMENTATION
//-------------------------------------------------------------------------------------------------------------function poppolicy(){var poppolicy = '';poppolicy = window.open('sitepolicy.php','poppolicy','toolbar=no,menubar=no,resizable=no,scrollbars=yes,status=no,location=no,width=620,height=' + (screenh - 100) + ',left=0,top=0');if (window.focus) {poppolicy.focus()}}
function popterms(){var popterms = '';
popterms = window.open('siteterms.php','siteterms','toolbar=no,menubar=no,resizable=no,scrollbars=yes,status=no,location=no,width=620,height=' + (screenh - 100) + ',left=0,top=0');
if (window.focus) {popterms.focus()}
}

function popcopyright(){
var popcopyright = '';
popcopyright = window.open('sitecopyright.php','popcopyright','toolbar=no,menubar=no,resizable=no,scrollbars=yes,status=no,location=no,width=620,height=' + (screenh - 100) + ',left=0,top=0');
if (window.focus) {popcopyright.focus()}
}

function popsafety(){
var popsafety = '';
popsafety = window.open('sitesafety.php','popsafety','toolbar=no,menubar=no,resizable=no,scrollbars=yes,status=no,location=no,width=620,height=' + (screenh - 100) + ',left=0,top=0');
if (window.focus) {popsafety.focus()}
}
//-------------------------------------------------------------------------------------------------------------
