// 8/1/2007
// EVENTS
// friendly DOM onload [use in place of window.onload]
addLoadEvent(template_init)
//window.onload=template_init;

/* Functions added from channels.js to ensure compatibility */
/* bb_makehbar is empty since it's not needed for music2.0 */
function bb_makehbar(){}
/* bb_makefbar is empty since it's not needed for music2.0 */
function bb_makefbar(){}
/* bb_makefbarnew is empty since it's not needed for music2.0 */
function bb_makefbarnew(){}
// set functions to prevent errors
function s_co() {}
// set functions to prevent errors
function s_gs() {}
function showPop() {}
function hidePop() {}
var sb_id = '';
// end compatability definitions

// For "Newsmaker" module
var maxNewsmaker=new Array(), activeNewsmaker=new Array();

function swapNewsmaker(id,direction){
	if (typeof(maxNewsmaker[id])=="undefined" && document.getElementById("newsmaker"+id+"."+1)){
		maxNewsmaker[id]=activeNewsmaker[id]=1;
		while (document.getElementById("newsmaker"+id+"."+(++maxNewsmaker[id]))){}
		maxNewsmaker[id]--;
	}
	if (maxNewsmaker[id]>1){
		toggle_display("newsmaker"+id+"."+activeNewsmaker[id],false);
		if (direction=="next"){
			if (document.getElementById("newsmaker"+id+"."+(activeNewsmaker[id]+1))){
				toggle_display("newsmaker"+id+"."+(++activeNewsmaker[id]),true);
			} else {
				toggle_display("newsmaker"+id+"."+(activeNewsmaker[id]=1),true);
			}
		} else if (direction=="previous"){
			if (document.getElementById("newsmaker"+id+"."+(activeNewsmaker[id]-1))){
				toggle_display("newsmaker"+id+"."+(--activeNewsmaker[id]),true);
			} else {
				toggle_display("newsmaker"+id+"."+(activeNewsmaker[id]=maxNewsmaker[id]),true);
			}
		}
		document.getElementById("newsmakerTally"+id).innerHTML=activeNewsmaker[id]+"/"+maxNewsmaker[id];
	}
}
function toggle_display(id,state){
	if (document.getElementById(id)){
		if (typeof(state)=="undefined"){state=document.getElementById(id).style.display=="block"?false:true;}
		document.getElementById(id).style.display=state?"block":"none";
	}
}
// End "Newsmaker Module" functions

//////////////////////////////////////////////////////////////////
/// from music2 cannae
var ieLogger = new function() {
	this.error = function(msgs){ log(type_error,msgs); };
	this.debug = function(msgs){ log(type_debug,msgs); };
}
if (typeof console == "undefined" || !console.error) { 
	var console = {}; 
	console= ieLogger;
}

//
////////
// on window load event handler
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}// end window load event handler


//addLoadEvent(findThoseImages);
////// hand written
// Begin Find Images for scaling
function findThoseImages() {

var docLoc = "http://music2.office.aol.com/home/main?debug=0";

// can only be run once
if (typeof imgScler == "undefined" && document.location == docLoc) { 
	// set an object to keep from firing again
	imgScler = {}; 

	var magicNum = 12; // font size in px
	var imgMinSze = 20; // don't do the small stuff
	var imgLst = document.getElementById("content").getElementsByTagName("img");
	
	}
}
//////////////////////////////////////////////////////////////////////////////
/* Functions for the headers tab search navigation */

function searchState(initDiv) {
		var tmpLst = document.getElementById(initDiv).getElementsByTagName('h6');	
		for (var i=0; i<tmpLst.length; i++) {
			tmpLst[i].onclick = search_tab_slctSte;
			tmpLst[i].onmouseover = searchHighLight;
			tmpLst[i].onmouseout = searchHighLightOff;			
		}	
}

function searchHighLight() { this.className = "srchOvrStte"; }
function searchHighLightOff() { this.className = ""; }
function search_tab_slctSte() {

		var elemToKill = document.getElementById('hdrTab');
		var newNode = document.getElementById('hdrTab').cloneNode(true);
		var oldNodeTxt = newNode.getElementsByTagName('h5')[0].innerHTML;

		newH6 = document.createElement('h6');
		newH6.innerHTML = oldNodeTxt;
		
		this.parentNode.insertBefore(newH6, elemToKill);
		elemToKill.parentNode.removeChild(elemToKill)
		this.parentNode.insertBefore(newNode, this);
		this.parentNode.removeChild(this);
		newNode.getElementsByTagName('h5')[0].innerHTML = this.innerHTML;
		searchState('srchSlctr');
		searchb = this.innerHTML;
		bb_dosrchby('bb_topform',links);
		
}
function doSrchOmni(term,type){
    var s_account="aolsvc,aolmus"
   s_265.prop20=term;
    s_265.prop21=type+": clicked";
   s_265.t();
}
var searchb = 'music';
function bb_dosrchby(sFo, links) {
  eval('var sFormObj = document.'+ sFo);
  var searchQuery = sFormObj.query.value.toLowerCase();
  if(searchQuery == "" || searchQuery == defaultSrchTxtVal.toLowerCase()) return;
  // do srch
  doSrchOmni(searchQuery,searchb);
  var url = links[searchb.toLowerCase().replace(" ","")];
  url = url + escape(searchQuery).replace(/\+/g,'%2b');
  location.href = url;
}




/* Functions for Commerce Drawers */
/// init commerce drawer
function template_init(){
	assignRowIndex("music");
	cmmrceUtil.initCmmerce();
}
// universal object
// define tracking info, button text, commerce teaser text, commerce link text
var cmmrceUtil = { "btnTxt":"Buy | Download", "btnClssType":"button", "btnTxtOpn":"Close", 
					"napTrckImg":' on Napster <img class="trackerImg" src="http://pr.atwola.com/promoimp/100005695xx1077107445/aol" width="1" height="1">',
					"linkTxt": ["CD","iTunes","Ringtones","Sheet Music","Napster"],
					"teaserTxt":["Buy this album directly from AOL. It's quick, easy and safe.",
						"Put it on your iPod. Download this album from iTunes.",
						"Put it on your cell phone. Get ringtones by this artist.",
						"Learn to play it. Get digital sheet music and lyrics for songs by this artist.",
						"Napster: Unlimited access to 3,000,000+ songs without paying per track. <a href='http://pr.atwola.com/promoclk/100005695x1111297169x1077203488/aol?redir=http:%2F%2Fwww.napster.com%2Faol%2Findex.html%3Faffiliate%5Fid%3D68%26referral%5Fid%3DNAPSTER%26promo%5Fid%3DAOL%5FCOMMERCE%5FDRAWER' target='new' class='freetrial' style='top:2px; position:relative; left:60px;' title='Free Trial!'>FREE TRIAL!</a>"
					]
				}

// Step Thru The Links
cmmrceUtil.initCmmerce = function() {
	btn = document.getElementsByTagName("a");
	btnIndex = 0;
	for(i=0;i<btn.length;i++) {
 		if (btn[i].className == cmmrceUtil.btnClssType &&
 			btn[i].innerHTML == cmmrceUtil.btnTxt &&
 			btn[i].parentNode.tagName == "TD") {
				btn[i].onclick = appendNewRow; 
		} else if (btn[i].className == cmmrceUtil.btnClssType &&
					btn[i].innerHTML == cmmrceUtil.btnTxt) {
				// give it numerical id
				btn[i].xindex = btnIndex;
				btnIndex++;
				btn[i].onclick = appendNewDiv;
		}
	}
}

function assignRowIndex(nClassName) {
	mTable = document.getElementsByTagName("table");
	for(i=0;i<mTable.length;i++) {
		if(mTable[i].className == nClassName) {
			for(k=0;k<mTable[i].rows.length;k++) { mTable[i].rows[k].xindex = k; }
		}
	}
}

function resetButtonText() {
	btn = document.getElementsByTagName("a");
	for(i=0;i<btn.length;i++) {
		if(btn[i].className == "button" && btn[i].innerHTML == "Close") {
			btn[i].innerHTML = cmmrceUtil.btnTxt;
			break;
		}
	}
}

function findParentTableNode(node) {
	pNodeTagName = "";
	while(pNodeTagName != "TABLE") {
		pNode = node.parentNode;
		pNodeTagName = node.parentNode.tagName;
		node = pNode;
	}
	return pNode;
}



function makecmmreDrwer(arrayType) {
	// create the links from the buy array
	nHTML = "<div class=\"row1\"><ul>";
	var lkt = cmmrceUtil.linkTxt;
	// start loop
	for(i=0;i<arrayType.length;i++) {
		// srchMusicType = commerce URL
		var srchMusicType = arrayType[i].toString();	
		if ( srchMusicType != '' ) {
			if (lkt[i] == "iTunes") {
				nHTML+="<li><a href=\"#\" onmouseover=\"changeLink("+i+");\" onclick=\" setBuyForOmni('"+lkt[i]+"');openItunes('"+srchMusicType+"');return false;\">"+lkt[i]+"</a></li>";				
			}
			else if (lkt[i] == "Napster") {
				// napster link type
				nHTML+= '<li><a target="_blank" href="'+ srchMusicType +'" onmouseover="changeLink('+i+');"> Get this ';
				if (srchMusicType.indexOf('track') !=-1) {
					nHTML+= " Track ";
				} else if (srchMusicType.indexOf('album') !=-1) {
					nHTML+= " Album ";
				} else if (srchMusicType.indexOf('artist') !=-1) {
					nHTML+= " Artist ";
				} 
				// end the napster deviations
				nHTML+= cmmrceUtil.napTrckImg + ' </a></li>';
			} 
			else {
				nHTML+="<li><a href='"+ srchMusicType +"' onmouseover='changeLink("+i+");' target='_blank' onclick=\"setBuyForOmni('"+lkt[i]+"');\">"+lkt[i]+"</a></li>";
			}			
		}  // if url not empty
	}  // end for loop
	return nHTML + "</ul><div id='avlinks' class='row2'></div></div>";
}


function appendNewDiv() {

	albumName=this.album;
	artistName=this.artist;

	// button object
	btnObj = this;
	
		if (document.getElementById("tmpDiv")){
			killPrev("div");
			btnObj.innerHTML = cmmrceUtil.btnTxt;
			if (prevID == btnObj.xindex) return false;
		}

	resetButtonText();
	btnObj.innerHTML = cmmrceUtil.btnTxtOpn;
	index = prevID = btnObj.xindex;
	nObject = btnObj.parentNode.appendChild(document.createElement("div")); 
	// assign id & class
	nObject.id = "tmpDiv"; nObject.className = "hiddenlayer"	
	nObject.innerHTML = makecmmreDrwer(buy[index]);

	return false;
}


function appendNewRow() {
	node = this; 
	nodeIndex = node.parentNode.parentNode.xindex	

	albumName=this.album;
	artistName=this.artist;

	if(document.getElementById("tmpRow")) {
		prevID = document.getElementById("tmpRow").tmpIndex;
		if(prevID<nodeIndex) {
			rParentNode = findParentTableNode(document.getElementById("tmpRow"));
			if(rParentNode == nParentNode) nodeIndex--;
		}
		killPrev("row");
		if(prevID == nodeIndex) {
			node.innerHTML = cmmrceUtil.btnTxt;
			assignRowIndex("music");
			return false;
		}
	}

	resetButtonText();
	node.innerHTML = "Close";

	nParentNode = findParentTableNode(node);
	// must make R exist first!!
	var r = nParentNode.insertRow(nodeIndex+1);
	r.id = "tmpRow";
	r.tmpIndex = nodeIndex;
	var td = r.appendChild(document.createElement("td"));
	// the "s" in colspan MUST be capitalized or MSIE fails
	td.setAttribute("colSpan",7);
	td.className = "hiddenlayer"

    cmmrceUtil.teaserTxt[1] = "Put it on your iPod. Download this song from iTunes.";

	td.innerHTML += makecmmreDrwer(buy[nParentNode.id][nodeIndex-1])	
	assignRowIndex("music");
	// keep page from jumpping
	return false;
} // end append row

function openItunes (url) {
	window.open (url,'','height=135,width=330,resizable=no,scrollbars=no,status=no');
}

function openNewWindow(url) {
	window.open (url,'','resizable=yes,scrollbars=yes,status=no');
}

function killPrev(type) {
	if (type=="row"){
		pElement = document.getElementById("tmpRow").parentNode;
		pElement.removeChild(document.getElementById("tmpRow"));
		assignRowIndex("music");
	}else{
		pElement = document.getElementById("tmpDiv").parentNode;	
		pElement.removeChild(document.getElementById("tmpDiv"));
	}
}

function changeLink(desc) {
	document.getElementById("avlinks").innerHTML = cmmrceUtil.teaserTxt[desc];
}

function setBuyForOmni(item1) {
    s_linkType='o';
    s_linkName='mm: buy: '+item1;
    if(albumName != undefined) {
       s_prop18=albumName;
    } else {
      s_prop18=''
    }     
    if(typeof artistName != 'undefined') {
        s_prop17=artistName;
    } 
    t=s_account.split(",");
    s_account2=(t[0].indexOf("aolsvc")==-1?t[0]:t[1]);
    s_linkTrackVars="s_prop17,s_prop18,s_prop19,s_prop20,s_prop21";
    s_lnk=s_co(this);
    s_gs(s_account2);
}
/// end commerce drawer


var enableCache = true;
var jsCache = new Array();
var ajaxObjects = new Array();
var x_offset_dvddual = 5;
var y_offset_dvddual = 0;
var providerObj = false;
var providerObj_iframe = false;
var providerObj_MSIE = false;
if(navigator.userAgent.indexOf('MSIE')>=0)providerObj_MSIE=true;

function showProviders(externalFile,inputObj) {
	if(!providerObj)
	{
		providerObj = document.createElement('DIV');
		providerObj.style.position = 'absolute';
		providerObj.id = 'providerObj';		
		document.body.appendChild(providerObj);
		var contentDiv = document.createElement('DIV');
		contentDiv.className = 'dvddualpop';
		providerObj.appendChild(contentDiv);
		contentDiv.id = 'dvddualpop';
		if(providerObj_MSIE){
			providerObj_iframe = document.createElement('<IFRAME frameborder="0">');
			providerObj_iframe.style.position = 'absolute';
			providerObj_iframe.border='0';
			providerObj_iframe.frameborder='0';
			providerObj_iframe.style.backgroundColor='#FFF';
			providerObj_iframe.src = 'about:blank';
			contentDiv.appendChild(providerObj_iframe);
			providerObj_iframe.style.left = '0px';
			providerObj_iframe.style.top = '0px';
		}
	}
	providerObj.style.display='block';
	loadContent('dvddualpop',externalFile);
	if(providerObj_MSIE){
		providerObj_iframe.style.width = providerObj.clientWidth + 'px';
		providerObj_iframe.style.height = providerObj.clientHeight + 'px';
	}
	positionProviders(inputObj);
}

function hideProviders() {
	providerObj.style.display='none';
}

function showContent(divId,ajaxIndex,url) {
	document.getElementById(divId).innerHTML = ajaxObjects[ajaxIndex].response;
	if(enableCache){
		jsCache[url] = ajaxObjects[ajaxIndex].response;
	}
	ajaxObjects[ajaxIndex] = false;
}

function loadContent(divId,url) {
	if(enableCache && jsCache[url]){
		document.getElementById(divId).innerHTML = jsCache[url];
		return;
	}
	var ajaxIndex = ajaxObjects.length;
	document.getElementById(divId).innerHTML = '<div class="loadcontent"><img src="http://adpqaart-sd02.websys.aol.com/ch_movies/please_wait_indicator" /><br>Loading content - please wait a moment...</div>';
	ajaxObjects[ajaxIndex] = new sack();
	ajaxObjects[ajaxIndex].requestFile = url;
	ajaxObjects[ajaxIndex].onCompletion = function(){ showContent(divId,ajaxIndex,url); };
	ajaxObjects[ajaxIndex].runAJAX();
}

function showIncludeContent(divId,ajaxIndex,url) {
	var targetObj = document.getElementById(divId);
	targetObj.innerHTML = ajaxObjects[ajaxIndex].response;
	if(enableCache){
		jsCache[url] = ajaxObjects[ajaxIndex].response;
	}
	ajaxObjects[ajaxIndex] = false;
}

function includeContent(divId,url) {
	if(enableCache && jsCache[url]){
		document.getElementById(divId).innerHTML = jsCache[url];
		return;
	}
	var ajaxIndex = ajaxObjects.length;
	document.getElementById(divId).innerHTML = '<img src="http://adpqaart-sd02.websys.aol.com/ch_movies/please_wait_indicator" /><br>Loading content - please wait a moment...';
	ajaxObjects[ajaxIndex] = new sack();
	ajaxObjects[ajaxIndex].requestFile = url;
	ajaxObjects[ajaxIndex].onCompletion = function(){ showIncludeContent(divId,ajaxIndex,url); };
	ajaxObjects[ajaxIndex].runAJAX();
}

function positionProviders(inputObj) {
	var leftPos = (getLeftPos(inputObj) + inputObj.offsetWidth);
	var topPos = getTopPos(inputObj);
	var dvddualWidth = document.getElementById('dvddualpop').offsetWidth; 
	providerObj.style.left = leftPos + 'px';
	providerObj.style.top = topPos + 'px';	
}

function getTopPos(inputObj) {	
	var topValue = 0;
	if (inputObj.offsetParent) {
		while (inputObj.offsetParent) {
			topValue += inputObj.offsetTop
			inputObj = inputObj.offsetParent;
		}
	} else if (inputObj.y) topValue += inputObj.y;
	return topValue;
}

function getLeftPos(inputObj) {
	var leftValue = 0;
	if (inputObj.offsetParent) {
		while (inputObj.offsetParent) {
			leftValue += inputObj.offsetLeft
			inputObj = inputObj.offsetParent;
		}
	} else if (inputObj.x) leftValue += inputObj.x;
	return leftValue;
}

/* Simple AJAX Code-Kit (SACK) v1.6.1 */
/* ©2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence, see documentation or authors website for more details */
function sack(file) {
	this.xmlhttp = null;
	this.resetData = function() {
		this.method = "GET";
  		this.queryStringSeparator = "&";
		this.argumentSeparator = "";
		this.URLString = "";
		this.encodeURIString = true;
  		this.execute = false;
  		this.element = null;
		this.elementObj = null;
		this.requestFile = file;
		this.vars = new Object();
		this.responseStatus = new Array(2);
  	};

	this.resetFunctions = function() {
  		this.onLoading = function() { };
  		this.onLoaded = function() { };
  		this.onInteractive = function() { };
  		this.onCompletion = function() { };
  		this.onError = function() { };
		this.onFail = function() { };
	};

	this.reset = function() {
		this.resetFunctions();
		this.resetData();
	};

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				this.xmlhttp = null;
			}
		}

		if (! this.xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlhttp = new XMLHttpRequest();
			} else {
				this.failed = true;
			}
		}
	};

	this.setVar = function(name, value){
		this.vars[name] = Array(value, false);
	};

	this.encVar = function(name, value, returnvars) {
		if (true == returnvars) {
			return Array(encodeURIComponent(name), encodeURIComponent(value));
		} else {
			this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
		}
	}

	this.processURLString = function(string, encode) {
		encoded = encodeURIComponent(this.argumentSeparator);
		regexp = new RegExp(this.argumentSeparator + "|" + encoded);
		varArray = string.split(regexp);
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split("=");
			if (true == encode){
				this.encVar(urlVars[0], urlVars[1]);
			} else {
				this.setVar(urlVars[0], urlVars[1]);
			}
		}
	}

	this.createURLString = function(urlstring) {
		if (this.encodeURIString && this.URLString.length) {
			this.processURLString(this.URLString, true);
		}

		if (urlstring) {
			if (this.URLString.length) {
				this.URLString += this.argumentSeparator + urlstring;
			} else {
				this.URLString = urlstring;
			}
		}

		// prevents caching of URLString
		this.setVar("rndval", new Date().getTime());

		urlstringtemp = new Array();
		for (key in this.vars) {
			if (false == this.vars[key][1] && true == this.encodeURIString) {
				encoded = this.encVar(key, this.vars[key][0], true);
				delete this.vars[key];
				this.vars[encoded[0]] = Array(encoded[1], true);
				key = encoded[0];
			}

			urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
		}
		if (urlstring){
			this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
		} else {
			this.URLString += urlstringtemp.join(this.argumentSeparator);
		}
	}

	this.runResponse = function() {
		eval(this.response);
	}

	this.runAJAX = function(urlstring) {
		if (this.failed) {
			this.onFail();
		} else {
			this.createURLString(urlstring);
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
					try {
						this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
					} catch (e) { }
				}

				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState) {
						case 1:
							self.onLoading();
							break;
						case 2:
							self.onLoaded();
							break;

						case 3:
							self.onInteractive();
							break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;

							if (self.execute) {
								self.runResponse();
							}

							if (self.elementObj) {
								elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input"
								|| elemNodeName == "select"
								|| elemNodeName == "option"
								|| elemNodeName == "textarea") {
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							if (self.responseStatus[0] == "200") {
								self.onCompletion();
							} else {
								self.onError();
							}

							self.URLString = "";
							break;
					}
				};

				this.xmlhttp.send(this.URLString);
			}
		}
	};

	this.reset();
	this.createAJAX();
}

//////////
// various function from head

function rsiAdInit(segmax) {
    var segQS="";
    var segs_beg=document.cookie.indexOf('rsi_segs=');
    if(segs_beg>=0){
        segs_beg=document.cookie.indexOf('=',segs_beg)+1;
        if(segs_beg>0){
            var segs_end=document.cookie.indexOf(';',segs_beg);
            if(segs_end==-1)segs_end=document.cookie.length;
            rsi_segs=document.cookie.substring(segs_beg,segs_end).split('|');
            for (var i=0;i<Math.min(segmax,rsi_segs.length);i++){
                segQS+=rsi_segs[i].replace(/.*_(.*)/,"rsi=$1;");
            }
            adSetOthDclk(segQS);
       }
    }
}
function openWindow (url) {
	var argv = openWindow.arguments;
	var argc = argv.length;
	if (argc == 1) {var handle = window.open(url);}
	else if (argc == 2) {var handle = window.open(url,argv[1]);}
	else {var handle = window.open(url,argv[1],argv[2]);}
	handle.focus();
}
///////////////////////////////
/// CUT AND PASTE FROM ent2.js
//// SNS sign in
// Login Functions
function AsnsSignIn( obj, leftOffSet, topOffSet ) {
 	if (!leftOffSet) leftOffSet = 0;
 	if (!topOffSet) topOffSet = 0;
 	pSNS = document.getElementById("snsMiniUI");
 	// pSNS = getEl("snsMiniUI");
 	if ( document.all ) {
 		var pos = findPos(obj);
 		pSNS.innerHTML = "";
 		pSNS.innerHTML = _sns_var_;
 		pSNS.style.position = 'relative';
 		pSNS.style.left = (pos[0] + leftOffSet - 138) + 'px';
		pSNS.style.top =  (pos[1] + topOffSet + 12)  + 'px';

 	} else {
		pSNS.innerHTML = "";
		pSNS.innerHTML = _sns_var_;
		obj.appendChild(pSNS);
		pSNS.style.position = 'relative';
		pSNS.style.left = leftOffSet + 'px';
		pSNS.style.top =  topOffSet  + 'px';
	}

	pSNS.style.zIndex = 1000;
}
function findPos(obj) {
	var curleft = curtop = 0;
	curleft = getX(obj);
	curtop = getY(obj);
	return [curleft,curtop];
}

function getY( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetTop;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function getX( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetLeft;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

/*EOF*/
