<!--
// -------------------------------------------------------------------------------------------------------------------------------------------
// js vars

	var currentFloatingDivId = "";
	var TYPE_AJAX = 0;
	var TYPE_IFRAME = 1;
	var TYPE_CONTENT = 2;

	var isIE = document.all;
	var isNN = !document.all && document.getElementById;
	var isIE5 = navigator.userAgent.toLowerCase().indexOf('msie 5') != -1;
	var isIE6 = navigator.userAgent.toLowerCase().indexOf('msie 6') != -1;
	var isIE7 = navigator.userAgent.toLowerCase().indexOf('msie 7') != -1;
	var isIE8 = navigator.userAgent.toLowerCase().indexOf('msie 8') != -1;
	var ddEnabled = false;
	var whichDog;
	var ddLocked = false;


// -------------------------------------------------------------------------------------------------------------------------------------------
// little ajax functions to make pages seem dynamic

	function dom_dosound(is_grey) // autoplay on/off
	{
		// hide the floating div
		_hideelement('domlayer');
		// init the ajax for this dialogue
		ajax_loadContent('domlayer', "/ajax/sound.php?grey="+is_grey);
	}
	function dom_doadult(is_grey) // adult content on/off
	{
		// hide the floating div
		_hideelement('domlayer');
		// init the ajax for this dialogue
		ajax_loadContent('domlayer', "/ajax/adult.php?grey="+is_grey);
	}

	/*function dom_togglesection(divid) // old style section toggle
	{
		// hide the floating div
		_hideelement('domlayer');
		// init the ajax for this dialogue
		ajax_loadContent('domlayer', "/ajax/mysections.php?id="+divid);
	}*/

	function dom_slide_open(id, maxheight) {
		_setheightelement(id, 1);
		_setwidthelement(id, _getwidth(id+'h'));
		_setwidthelement(id+"i", _getwidth(id+'h')-2);
		_positionelement(id, _getleft(id+'h')+1, _gettop(id+'h')+18);
		_showelement(id);
		setTimeout("dom_slide_do('"+id+"',1,"+maxheight+",1)", 20);
		setTimeout("dom_slide_do('"+id+"',150,1,-1)", 3000);
	}

	function dom_slide_close(id) {
		var h = _getheight(id);
		setTimeout("dom_slide_do('"+id+"',"+h+",1,-1)", 20);
	}

	function dom_slide_do(id, curheight, limitheight, bias) {
		_setheightelement(id, curheight);
		if(bias == 1) {
			if((curheight += 8) < limitheight) setTimeout("dom_slide_do('"+id+"',"+curheight+","+limitheight+",1)", 20);
		}
		if(bias == -1) {
			if((curheight -= 8) > limitheight) setTimeout("dom_slide_do('"+id+"',"+curheight+","+limitheight+",-1)", 20); else _hideelement(id);
		}
	}	

	function dom_togglesection(sectionname,modifier) // new style section toggle (toggle is in dropdown menu system)
	{
		if(!modifier) {
			// hide the floating div
			_hideelement('domlayer');
			// init the ajax for this dialogue
			ajax_loadContent('domlayer', "/ajax/mysections.php?id="+sectionname);
		} else {
			// hide the floating div
			_hideelement('domlayer');
			// init the ajax for this dialogue
			ajax_loadContent('domlayer', "/ajax/mysections2.php?s="+sectionname+"&m="+modifier);
		}
	}


	function dom_use_notices_layer(title, url)
	{
		// hide the floating div
		_hideelement('noticeslayer');

		// create the title bar + content div
		var content = "";
		content += '<table cellspacing="0" cellpadding="0" border="0" width="100%" id="titleBar"><tr><td width="99%" height:18px; style="color:#ffffff;" valign="top"><b>'+title+'</b></td>';
		content += '<td align="right" nowrap="nowrap">';
		content += '<a href="#" onclick="dom_use_notices_layer_close();return false;"><img src="/images/theme-default-dialogue-modal-close.gif" border="0"></a> ';
		content += '</td></tr></table>';
		content += "<div id=\"noticeslayerinterior\" style=\"width:220px; height:185px; z-index:30; overflow:auto;\"></div>";
		document.getElementById('noticeslayer').innerHTML = content;
	
		// show the floating div
		_showelement('noticeslayer');

		// init the ajax for this dialogue
		ajax_loadContent('noticeslayerinterior', url);
	}


	function dom_use_notices_layer_close()
	{
		_hideelement('noticeslayer');
		document.getElementById('noticeslayer').innerHTML = '';
	}


// -------------------------------------------------------------------------------------------------------------------------------------------
// the bubble popup system

	function dom_bubble_open(title, url, size, type, content, buttons, closeurl) // close url is the url to show when close is called (SAMP uses this to clear samp session)
	{
		if(size == "small") {
			var width = 350;
			var height = 150;
		} else if(size == "medium") {
			var width = 450;
			var height = 250;
		} else if(size == "large") {
			var width = 550;
			var height = 350;
		} else {
			var width = 650;
			var height = 400;
		}

		// hide the floating div
		_hideelement('dombubble');
		_showelement('dommask');
		document.getElementById('dombubble').innerHTML = '';

		// set central position
		if(isIE5 || isIE6) {
			var yoffset = 0;
			var coords = _getwindowcenter();
			if(document.body && document.body.scrollTop) {
				var yoffset = document.body.scrollTop;
			} else if(document.documentElement && document.documentElement.scrollTop) {
				var yoffset = document.documentElement.scrollTop;
			}
			_positionelement('dombubble', Math.round(coords.cx - (width / 2)), Math.round(coords.cy - (height / 2)) + yoffset);
			_positionelement('dombubbleloading', Math.round(coords.cx - (300 / 2)), Math.round(coords.cy - (100 / 2)) + yoffset);
			_positionelement('dommask', 0, yoffset);
		} else {
			var coords = _getwindowcenter();
			_positionelement('dombubble', Math.round(coords.cx - (width / 2)), Math.round(coords.cy - (height+92) / 2));
			_setwidthelement('dombubble', width);
			_setheightelement('dombubble', height);
			_positionelement('dombubbleloading', Math.round(coords.cx - (300 / 2)), Math.round(coords.cy - (100+92) / 2));
			_setwidthelement('dombubbleloading', 300);
			_setheightelement('dombubbleloading', 100);
		}

		// sort scroll type and change height/width to suit
		if(isIE5 || isIE6) {
			scrolltype = "yes";
		} else {
			scrolltype = "auto";
		}

		// which bubble background image to use
		if(isIE5 || isIE6 || isIE7) {
			var background = "/images/theme-dialogue-bubble-"+size+"-ie.png";
		} else {
			var background = "/images/theme-dialogue-bubble-"+size+".png";
		}

		// create bubble container
		var container = "";
		container += '<table cellspacing="0" cellpadding="0" border="0" width="'+width+'">';
		container += '<tr>';
		container += '<td>';
		container += '<table width="100%" border="0" cellspacing="0" cellpadding="1">';
		container += '<tr>';
		container += '<td width="'+(width-24-78)+'" id="bubbletitle" valign="top" height="24" style="background:transparent url(\''+background+'\') top left; font-size:14pt; font-family:arial rounded MT bold,arial,helvetica; font-weight:bold; color:#ffffff; padding-top:8px; padding-left:8px;">'+title+'</td>';
		container += '<td width="24" valign="top" height="24" nowrap="nowrap" style="background:transparent url(\'/images/theme-dialogue-bubble-titlebar.png\') no-repeat top right;"><img src="/images/blank.gif" width="16" height="16"></td>';
		container += '<td width="78" align="right" nowrap="nowrap" id="bubbletitlebuttons" valign="top" height="24" style="background:transparent url(\'/images/theme-dialogue-bubble-titlebar-right.png\') no-repeat top right;">';
		if(closeurl == "" || closeurl == null)
			container += '<a href="#" onclick="dom_bubble_close(); return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-close" /></a>';
		else
			container += '<a href="#" onclick="dom_bubble_close('+"'"+closeurl+"'"+'); return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-close" /></a>';
		container += '</td>';
		container += '</tr>';
		container += '</table>';
		container += '</td>';
		container += '<tr>';
		container += '<td valign="top" style="background:#ffffff;">';
		
		if(type == TYPE_AJAX && size == "small")
			container += "<div id=\"dialogueinterior\" style=\"width:"+(width-10)+"px; z-index:30; padding:4px;\"></div>";
		if(type == TYPE_AJAX && size != "small")
			container += "<div id=\"dialogueinterior\" style=\"width:"+(width-2)+"px; height:"+height+"px; max-height:"+height+"px; z-index:30; overflow:auto;\"></div>";
		if(type == TYPE_IFRAME)
			container += '<iframe name=\"dialogueinterior\" id=\"dialogueinterior\" style=\"width:'+(width-2)+'px; height:'+height+'px; border:0px;" frameborder="0" framespacing="0" src="'+url+'" scrolling="'+scrolltype+'"></iframe>';
		if(type == TYPE_CONTENT)
			container += "<div class=\"popupsecondary\" style=\"padding:6px;\">"+content+"</div>";

		container += '</td>';
		container += '</tr>';
		container += '<tr>';
		container += '<td style="background:transparent url(\''+background+'\') bottom right; font-size:1px;">';
		container += '<table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td id="bubblebuttons" valign="bottom" align="right" height="20">';
		if(buttons.indexOf('cancel')!=-1) container += '<a href="#" onclick="dom_bubble_close();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-cancel" vspace="0"></a>';
		if(buttons.indexOf('ok')!=-1) container += '<a href="#" onclick="dom_bubble_close();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-ok" vspace="0"></a>';
		if(buttons.indexOf('post')!=-1) container += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'submit\').click();return false;" class="bubble-button"><img src="/images/blank.gif" id="positivebutton" class="bubble-button-post" vspace="0"></a>';
		if(buttons.indexOf('update')!=-1) container += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'submit\').click();return false;" class="bubble-button"><img src="/images/blank.gif" id="positivebutton" class="bubble-button-update" vspace="0"></a>';
		if(buttons.indexOf('upload')!=-1) container += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'submit\').click();return false;" class="bubble-button"><img src="/images/blank.gif" id="positivebutton" class="bubble-button-upload" vspace="0"></a>';
		if(buttons.indexOf('close')!=-1) container += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'submit\').click();return false;" class="bubble-button"><img src="/images/blank.gif" id="positivebutton" class="bubble-button-upload" vspace="0"></a>';
		if(buttons.indexOf('prev')!=-1) container += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'prev\').click();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-prev" vspace="0"></a>';
		if(buttons.indexOf('next')!=-1) container += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'next\').click();return false;" class="bubble-button"><img src="/images/blank.gif" id="positivebutton" class="bubble-button-next" vspace="0"></a>';
		if(buttons.indexOf('deletefinal')!=-1) container += '<a href="#" onclick="document.getElementById(\'delete\').click();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-deletefinal" vspace="0"></a>';
		container += '</td></tr></table></td>';
		container += '</tr>';
		container += '</table>';

		// fill the floating div with the container content and initial loading screen if required
		document.getElementById('dombubble').innerHTML = container;
		
		// show the floating div
		_showelement('dombubble');

		// init the ajax for this dialogue
		if(type == TYPE_AJAX) {
			document.getElementById('dialogueinterior').innerHTML = "<p align=\"center\"><img src=\"/images/icon-loading.gif\"></p>";
			ajax_loadContent('dialogueinterior', url);
		}

		// have to load the iframe after wiping it first, as SAFARI requires it (for all other browsers could put the url in the <iframe> statement).
		//if(type == TYPE_IFRAME)
		//{
		//	document.getElementById('dialogueinterior').contentWindow.document.open();
		//	//document.getElementById('dialogueinterior').contentWindow.document.write("<html><head></head><body><script language=\"javscript\">document.location.href='"+url+"';</script></body></html>");
		//	document.getElementById('dialogueinterior').contentWindow.document.close();
		//	document.getElementById('dialogueinterior').src = url;
		//}
	}

	function dom_bubble_close(closeurl)
	{
		var url = '';
		if(closeurl != null && closeurl != '') url = closeurl;

		_hideelement('dombubble');
		_hideelement('dommask');
		if(url == '') {
			document.getElementById('dombubble').innerHTML = '';
		} else {
			document.getElementById('dombubble').innerHTML = '<div id="bubinterior"></div>';
			ajax_loadContent('dombubble', url);
		}
	}

	function dom_bubble_changebuttons(newbuttons)
	{
		var contents = "";
		if(newbuttons.indexOf('cancel')!=-1 && newbuttons.indexOf('cancelback')==-1 && newbuttons.indexOf('bottomcancel')==-1) contents += '<a href="#" onclick="dom_bubble_close();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-cancel" vspace="0"></a>';
		if(newbuttons.indexOf('bottomcancel')!=-1) contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.history.back();" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-bottomcancel" vspace="0"></a>';
		if(newbuttons.indexOf('cancelback')!=-1) contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.history.back();" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-cancel" vspace="0"></a>';
		if(newbuttons.indexOf('bottomclose')!=-1) contents += '<a href="#" onclick="dom_bubble_close(); return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-bottomclose" vspace="0"></a>';
		if(newbuttons.indexOf('ok')!=-1) contents += '<a href="#" onclick="dom_bubble_close();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-ok" vspace="0"></a>';
		if(newbuttons.indexOf('buy')!=-1) contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'submit\').click();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-buy" vspace="0"></a>';
		if(newbuttons.indexOf('post')!=-1) contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'submit\').click();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-post" vspace="0"></a>';
		if(newbuttons.indexOf('delete')!=-1) contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'delete\').click();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-delete" vspace="0"></a>';
		if(newbuttons.indexOf('update')!=-1) contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'submit\').click();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-update" vspace="0"></a>';
		if(newbuttons.indexOf('upload')!=-1) contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'submit\').click();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-upload" vspace="0"></a>';
		if(newbuttons.indexOf('prev')!=-1) contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'prev\').click();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-prev" vspace="0"></a>';
		if(newbuttons.indexOf('next')!=-1) contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'next\').click();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-next" vspace="0"></a>';
		if(newbuttons.indexOf('deletefinal')!=-1) contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').contentWindow.document.getElementById(\'delete\').click();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-deletefinal" vspace="0"></a>';
		document.getElementById('bubblebuttons').innerHTML = contents;
	}

	function dom_bubble_changetitlebuttons(newbuttons)
	{
		var contents = "";
		var width = 0;
		if(newbuttons.indexOf('inbox')!=-1) { width +=70; contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').src=\'/ajax/iframe-account-mail.php\';return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-inbox" vspace="0"></a>'; }
		if(newbuttons.indexOf('sentitems')!=-1) { width +=113; contents += '<a href="#" onclick="document.getElementById(\'dialogueinterior\').src=\'/ajax/iframe-account-mail-sentitems.php\';return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-sentitems" vspace="0"></a>'; }
		width += 78; contents += '<a href="#" onclick="dom_bubble_close();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-close" vspace="0"></a>';
		document.getElementById('bubbletitlebuttons').innerHTML = contents;
		_setwidthelement('bubbletitlebuttons', width);
	}

	function dom_bubble_changetitle(newtitle)
	{
		document.getElementById('bubbletitle').innerHTML = newtitle;
	}

	function dom_bubble_showloading(initialtext)
	{
		var content = "";
		content  = '<div align="center" style="padding:6px; font-family:verdana,arial,helvetica; font-size:9pt; font-weight:bold; color:#000000;" id="bubbleloadingtext">'+initialtext+'</div><br />';
		content += '<div align="center"><img src="/images/progress_bar.gif"></div>';
		document.getElementById('dombubbleloading').innerHTML = content;
		_showelement('dombubbleloading');
		document.getElementById('dombubble').style.zIndex = 0;
	}

	function dom_bubble_hideloading()
	{
		_hideelement('dombubbleloading');
		document.getElementById('dombubble').style.zIndex = 30;
	}

	function dom_bubble_alert(title, text)
	{
		var width = 350;
		var height = 150;

		// hide the floating div
		_hideelement('dombubblealert');
		_showelement('dommask2');
		document.getElementById('dombubblealert').innerHTML = '';

		// set central position
		if(isIE5 || isIE6) {
			var yoffset = 0;
			var coords = _getwindowcenter();
			if(document.body && document.body.scrollTop) {
				var yoffset = document.body.scrollTop;
			} else if(document.documentElement && document.documentElement.scrollTop) {
				var yoffset = document.documentElement.scrollTop;
			}
			_positionelement('dombubblealert', Math.round(coords.cx - (width / 2)), Math.round(coords.cy - (height / 2)) + yoffset);
			_positionelement('dommask2', 0, yoffset);
		} else {
			var coords = _getwindowcenter();
			_positionelement('dombubblealert', Math.round(coords.cx - (width / 2)), Math.round(coords.cy - (height+92) / 2));
			_setwidthelement('dombubblealert', width);
			_setheightelement('dombubblealert', height);
		}

		// sort scroll type and change height/width to suit
		if(isIE5 || isIE6) {
			scrolltype = "yes";
		} else {
			scrolltype = "auto";
		}

		// which bubble background image to use
		if(isIE5 || isIE6 || isIE7) {
			var background = "/images/theme-dialogue-bubble-small-ie.png";
		} else {
			var background = "/images/theme-dialogue-bubble-small.png";
		}

		// create bubble container
		var container = "";
		container += '<table cellspacing="0" cellpadding="0" border="0" width="'+width+'">';
		container += '<tr>';
		container += '<td>';
		container += '<table width="100%" border="0" cellspacing="0" cellpadding="1">';
		container += '<tr>';
		container += '<td width="'+(width-24-78)+'" id="bubbletitle" valign="top" height="24" style="background:transparent url(\''+background+'\') top left; font-size:14pt; font-family:arial rounded MT bold,arial,helvetica; font-weight:bold; color:#ffffff; padding-top:8px; padding-left:8px;">'+title+'</td>';
		container += '<td width="24" valign="top" height="24" nowrap="nowrap" style="background:transparent url(\'/images/theme-dialogue-bubble-titlebar.png\') no-repeat top right;"><img src="/images/blank.gif" width="16" height="16"></td>';
		container += '<td width="78" align="right" nowrap="nowrap" id="bubbletitlebuttons" valign="top" height="24" style="background:transparent url(\'/images/theme-dialogue-bubble-titlebar-right.png\') no-repeat top right;">';
		container += '<a href="#" onclick="dom_bubble_alert_close(); return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-close" /></a>';
		container += '</td>';
		container += '</tr>';
		container += '</table>';
		container += '</td>';
		container += '<tr>';
		container += '<td valign="top" style="background:#ffffff;">';
		container += "<div class=\"popupsecondary\" style=\"padding:6px;\">"+text+"</div>";
		container += '</td>';
		container += '</tr>';
		container += '<tr>';
		container += '<td style="background:transparent url(\''+background+'\') bottom right; font-size:1px;">';
		container += '<table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td id="bubblebuttons" valign="bottom" align="right" height="20">';
		container += '<a href="#" onclick="dom_bubble_alert_close();return false;" class="bubble-button"><img src="/images/blank.gif" class="bubble-button-ok" vspace="0"></a>';
		container += '</td></tr></table></td>';
		container += '</tr>';
		container += '</table>';

		// fill the floating div with the container content and initial loading screen if required
		document.getElementById('dombubblealert').innerHTML = container;
		
		// show the floating div
		_showelement('dombubblealert');
	}

	function dom_bubble_alert_close()
	{
		_hideelement('dombubblealert');
		_hideelement('dommask2');
		document.getElementById('dombubblealert').innerHTML = 'x';
	}


// -------------------------------------------------------------------------------------------------------------------------------------------
//-->