//** Site Logo/ Watermark Script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** Available/ usage terms at http://www.dynamicdrive.com
//** v2.0 (April 19th, 09')


var ddsitelogo={
	setting: {orientation:4, visibleduration:0, fadeduration:[1000, 500]}, //orientation=1|2|3|4, duration=millisec or 0, fadedurations=millisecs
	offsets: {x:20, y:50},//offset of logo relative to window corner
	logoHTML: '<a href="http://join.baretwinks.com/track/MjAwMDAwMDY4LjMuMi4yLjAuMC4wLjAuMA" title="Bare Twinks!" target="_blank"><img src="/bans/bt-115x175.jpg" style="width:115px; height:175px; border:0" class="rounded-img" /></a>', //HTML for logo, which is auto wrapped in DIV w/ ID="mysitelogo"

	coord: {},

	keepfixed:function(){
		if (!this.cssfixedsupport){
			var $window=jQuery(window)
			var is1or3=/^[13]$/.test(this.setting.orientation)
			var is1or2=/^[12]$/.test(this.setting.orientation)
			var x=$window.scrollLeft() + (is1or3? this.offsets.x : $window.width()-this.$control.width()-this.offsets.x)
			var y=$window.scrollTop() + (is1or2? this.offsets.y : $window.height()-this.$control.height()-this.offsets.y)
			this.$control.css({left:x+'px', top:y+'px'})
		}
	},

	showlogo:function(){
		var mainobj=ddsitelogo
		this.$control.animate({opacity:1}, this.setting.fadeduration[0])
		if (this.setting.visibleduration>0){
			setTimeout(function(){
				mainobj.$control.stop().animate({opacity:0}, mainobj.setting.fadeduration[1], function(){
					jQuery(window).unbind('scroll.fixed resize.fixed')
				})
			}, this.setting.visibleduration+this.setting.fadeduration[0])
		}
	},
	
	init:function(){
		jQuery(document).ready(function($){
			var mainobj=ddsitelogo
			var iebrws=document.all
			mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
			if (mainobj.cssfixedsupport){
				mainobj.coord[(/^[13]$/.test(mainobj.setting.orientation))? 'left' : 'right']=mainobj.offsets.x
				mainobj.coord[(/^[12]$/.test(mainobj.setting.orientation))? 'top' : 'bottom']=mainobj.offsets.y
			}
			mainobj.$control=$('<div id="mysitelogo">'+mainobj.logoHTML+'</div>')
				.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', opacity:0})
				.css(mainobj.coord)
				.appendTo('body')
			if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
				mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
			mainobj.keepfixed()
			mainobj.showlogo()
			$(window).bind('scroll.fixed resize.fixed', function(){mainobj.keepfixed()})
		})
	}
}

ddsitelogo.init()
/*
// JavaScript Document

function getLoginBoxData()

{

	var ajaxRequest;  // The variable that makes Ajax possible!

	

	try{

		// Opera 8.0+, Firefox, Safari

		ajaxRequest = new XMLHttpRequest();

	} catch (e){

		// Internet Explorer Browsers

		try{

			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");

		} catch (e) {

			try{

				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");

			} catch (e){

				// Something went wrong

				alert("Your browser does not support ajax!");

				return false;

			}

		}

	}

	// Create a function that will receive data sent from the server

	ajaxRequest.onreadystatechange = function(){

		if(ajaxRequest.readyState == 4){

			setLoginBoxData(ajaxRequest.responseXML);

		}

	}

	

	ajaxRequest.open("GET", "ajax_status_bar.php" + "?au=" + new Date().getTime(), true);

	ajaxRequest.send(null); 



}



function setLoginBoxData(xml_doc)

{

	var row=xml_doc.getElementsByTagName('user')[0];

	

	if(document.getElementById('lb_friend_req'))

	{

		document.getElementById('lb_friend_req').innerHTML=row.getElementsByTagName('friend_requests')[0].firstChild.data;

	}

	if(document.getElementById('lb_messages'))

	{

		document.getElementById('lb_messages').innerHTML=row.getElementsByTagName('messages')[0].firstChild.data;

	}

	if(document.getElementById('lb_comments'))

	{

		var comments=new Number(row.getElementsByTagName('comments')[0].firstChild.data);

		if(comments==0||comments>1)

		{

			var comment_html="<b>"+comments+"</b>";

		}

		else

		{

			var comment_html="<b>"+comments+"</b>";

		}

		document.getElementById('lb_comments').innerHTML=comment_html;

	}

	return setTimeout("getLoginBoxData();",300000);



}

window.onload = function () { setTimeout("getLoginBoxData();",300000); }; 
*/
