if ( top.location != location && !document.location.href.match (/preview=true/) ) top.location.replace(document.location);

addthis_pub  = 'Meo';
addthis_brand = 'Live Sex Cams';
addthis_options = 'favorites, google, email, delicious, technorati, myweb, myspace, facebook, live, more';

function gallery_status () {
var F=document.links;

for (i = 0; i < F.length; i++) {
  urlString="";
  urlLen=F[i].href.length;
  urlStart=F[i].href.lastIndexOf("http://");
  if ( urlStart > 0 ) { 
	urlString=F[i].href.substring(urlStart,urlLen);
	if ( urlString.indexOf("?") > -1) {
		urlString = urlString.substring(0,urlString.indexOf("?")); } 
	if ( urlString.indexOf("&") > -1) {
		urlString = urlString.substring(0,urlString.indexOf("&")); } 
  }
  urlStart=F[i].href.indexOf("imlive.com");
  if ( urlStart > -1 ) { 
	urlString=F[i].href.substring(0,urlStart+11);
	urlStart=F[i].href.indexOf("waitingroom1.asp");
	if ( urlStart > -1 ) {
		urlString = urlString + F[i].href.substring(urlStart, urlLen); }
  }
  if ( urlString.length > 0 ) { 
	F[i].realurl = F[i].href;
	F[i].href=urlString;
	F[i].affurl=urlString;
 	F[i].onclick = s1; 
 	F[i].onmouseup = s0; 
 	F[i].onmouseout = s0; 
 	F[i].onblur = s0; 
  }
}
}

function s1 () { 
  this.href=this.realurl;
} 

function s0 () { 
  this.href=this.affurl;
} 

function addBookmark() {
	var url=location.href;
	var title=document.title;
        if (window.sidebar) { // firefox
              window.sidebar.addPanel(title, url,"");
        } else if( document.all ) { //MSIE
                window.external.AddFavorite( url, title);
        } else if(window.opera && window.print) { // Opera Hotlist
		var dcE = document.createElement('a');
		dcE.setAttribute('rel','sidebar');
		dcE.setAttribute('href',url);
		dcE.setAttribute('title',title);
		dcE.click();
	}

}
 
function addDel() {
	location.href='http://del.icio.us/post?v=4;url='+encodeURIComponent(location.href)+';title='+encodeURIComponent(document.title);
}

var contentItemWidth = 157;
var inactiveWidth = 30;
var curLeftOffset = 0;
var expertiseTimer = null;
var scrolltextTimer = null;
var scrollertext;
var expertisetext;
var scroller;

function initScroller()
{
	scroller = document.getElementById("scroller");
	if (!scroller) return;
	scrollertext	= document.getElementById("scrollertext");
	expertisetext	= document.getElementById("expertisetext");

	imliveGreeting = scrollertext.innerHTML;
	scroller.onmousemove	= ScrollDiv;
	window.onresize = findPos;

	scrollerWidth		= scroller.offsetWidth;
	activeWidth		= scrollerWidth - 2 * inactiveWidth;
	contentItems		= scroller.childNodes.length - 1;
	contentWidth		= contentItems * contentItemWidth;
	contentScrollQuotient	= ( contentWidth - scrollerWidth ) / activeWidth;

	findPos();

}

function findPos() {
	obj = scroller;
	if (obj.offsetParent) {
		curLeftOffset = obj.offsetLeft;
		while (obj = obj.offsetParent) {
			curLeftOffset += obj.offsetLeft;
		}
	}
}

function ScrollDiv(event)
{
	var e = event || window.event;
	var PointerPosition = e.clientX - curLeftOffset;
	popupPosX = e.clientX;
	popupPosY = e.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
;

	if ( PointerPosition < inactiveWidth )
	{
		PointerPosition = inactiveWidth;
	};
	if ( PointerPosition > scrollerWidth - inactiveWidth )
	{
		PointerPosition = scrollerWidth - inactiveWidth;
	};

	PointerPosition -= inactiveWidth;
	scroller.scrollLeft = PointerPosition * contentScrollQuotient;
}

function dTitle(nick,url,expertise) {

	if (expertiseTimer != null) {
		clearTimeout(expertiseTimer);
		clearTimeout(scrolltextTimer);
		expertiseTimer = null;
	}
	scrollertext.innerHTML = 'Chat With <a href="' + url + '" target="_blank">' + nick + '</a> Right NOW!';
	expertisetext.innerHTML = expertise;
	expertisetext.style.visibility='visible';
	expertisetext.style.left=popupPosX + 5 + "px";
	expertisetext.style.top=popupPosY + 15 + "px";
}

function dTitleOut() {
	expertiseTimer = setTimeout("expertisetext.style.visibility='hidden';",250);
	scrolltextTimer = setTimeout("scrollertext.innerHTML = imliveGreeting;",4000);
}
