
function DoAuthentication(email,password)
{if(isDownTimePeriod())
{alert(GetDownTimeMessage());return;}
xmlAuth=CreateAJAXRequest();if(xmlAuth==null)
return;var parameters;parameters="email="+email;parameters=parameters+"&password="+password;parameters=parameters+"&op=authenticate";if(batangaLoginDebug==1)
alert("UrlRegistrationHelper = "+UrlRegistrationHelper+", parameters = "+parameters);xmlAuth.open("POST",UrlRegistrationHelper,false);xmlAuth.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlAuth.setRequestHeader("Content-length",parameters.length);xmlAuth.send(parameters);if(xmlAuth.readyState==4&&xmlAuth.status==200)
{outputText=xmlAuth.responseText;outputText=decode(outputText);var status=getTagValue(outputText,"status");if(status=="1")
return"success";else
return getTagValue(outputText,"errormessage");}
return"XMLHttp is not in right state";}
function IsEmailAvailable(email)
{xmlAuth=CreateAJAXRequest();if(xmlAuth==null)
return;var parameters;parameters="email="+email;parameters=parameters+"&op=checkemail";if(batangaLoginDebug==1)
alert("UrlRegistrationHelper = "+UrlRegistrationHelper+", parameters = "+parameters);xmlAuth.open("POST",UrlRegistrationHelper,false);xmlAuth.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlAuth.setRequestHeader("Content-length",parameters.length);xmlAuth.send(parameters);if(xmlAuth.readyState==4&&xmlAuth.status==200)
{outputText=xmlAuth.responseText;outputText=decode(outputText);var status=getTagValue(outputText,"status");if(status=="1")
return true;else
return false;}
return false;}
function RemoveFavorite(id,opCode)
{UrlFavoritesHelper=siteRootFolder+"/FavoritesHelper.aspx";xmlObj=CreateAJAXRequest();if(xmlObj==null)
return;var userId=GetLoggedInUserID();var parameters;parameters="?userid="+userId;parameters=parameters+"&id="+id;parameters=parameters+"&op="+opCode;xmlObj.open("GET",UrlFavoritesHelper+parameters,false);xmlObj.send(parameters);if(xmlObj.readyState==4&&xmlObj.status==200)
{outputText=xmlObj.responseText;outputText=decode(outputText);var status=getTagValue(outputText,"status");if(status=="0")
return true;else
return false;}
return false;}
function UpdateSongsRatedCaptions()
{var language=getLanguage();var elHiddenCount=document.getElementById('HiddenUserSongRatingCount');if(elHiddenCount==null)return;var ratingCount=elHiddenCount.innerHTML;var el=document.getElementById('ctl00_theContent_MusicControl_LabelSongsRated');if(ratingCount==1)
{if(language=="ES")
{el.innerHTML=ratingCount+' Cancion Calificada';}
else
{el.innerHTML=ratingCount+' Song Rated';}}
else
{if(language=="ES")
{el.innerHTML=ratingCount+' Canciones Calificadas';}
else
{el.innerHTML=ratingCount+' Songs Rated';}}
document.getElementById('ctl00_theContent_HyperLinkCountSongsRated').innerHTML=el.innerHTML;}
function RemoveSongRated(id,tagId)
{var status=RemoveFavorite(id,'removeusersongsrating');if(status)
{parentDiv=document.getElementById('div-songsplay');favToRemove=document.getElementById(tagId);parentDiv.removeChild(favToRemove);var elHiddenCount=document.getElementById('HiddenUserSongRatingCount');var ratingCount=elHiddenCount.innerHTML;ratingCount=ratingCount-1;elHiddenCount.innerHTML=ratingCount;var el=document.getElementById('ctl00_theContent_MusicControl_LabelSongsRated');if(ratingCount==1)
{if(language=="ES")
{el.innerHTML=ratingCount+' Cancion Calificada';}
else
{el.innerHTML=ratingCount+' Song Rated';}}
else
{if(language=="ES")
{el.innerHTML=ratingCount+' Canciones Calificadas';}
else
{el.innerHTML=ratingCount+' Songs Rated';}}
document.getElementById('ctl00_theContent_HyperLinkCountSongsRated').innerHTML=el.innerHTML;if(document.getElementById('HyperLinkShowLessSongRatings')!=null&&document.getElementById('HyperLinkShowLessSongRatings').style.display=='none')
ShowLessSongRatings(20);if(ratingCount<21)
{closeTag('HyperLinkShowLessSongRatings');closeTag('HyperLinkShowAllSongRatings');}
if(ratingCount==0)
{document.getElementById('div-SongsRated').style.display='none';document.getElementById('ctl00_theContent_MusicControl_LabelEmptySongsRated').style.display='';}}}
function RemoveFavoriteStation(id,tagId)
{var status=RemoveFavorite(id,'removefavstation');if(status)
{parentDiv=document.getElementById('ctl00_theContent_MusicControl_ul-FavoriteStations');favToRemove=document.getElementById(tagId);parentDiv.removeChild(favToRemove);var elHiddenCount=document.getElementById('ctl00_theContent_MusicControl_FavoriteStationsCount');var stationCount=elHiddenCount.innerHTML;stationCount=stationCount-1;elHiddenCount.innerHTML=stationCount;var language=getLanguage();var el=document.getElementById('ctl00_theContent_MusicControl_LabelStationFan');if(stationCount==1)
{if(language=="ES")
el.innerHTML='Fan de '+stationCount+' Estación';else
el.innerHTML='Fan of '+stationCount+' Station';}
else
{if(language=="ES")
el.innerHTML='Fan de '+stationCount+' Estaciones';else
el.innerHTML='Fan of '+stationCount+' Stations';}
if(document.getElementById('ctl00_theContent_MusicControl_HyperLinkShowLessFavStation')!=null&&document.getElementById('ctl00_theContent_MusicControl_HyperLinkShowLessFavStation').style.display=='none')
ShowLessFavStations(5);if(stationCount<6)
{closeTag('ctl00_theContent_MusicControl_HyperLinkShowLessFavStation');closeTag('ctl00_theContent_MusicControl_HyperLinkShowAllFavStation');}
if(stationCount==0)
{document.getElementById('div-FavoriteStations').style.display='none';document.getElementById('ctl00_theContent_MusicControl_LabelEmptyFavoriteStation').style.display='';}}}
function RemoveFavoriteArtist(id,tagId)
{var status=RemoveFavorite(id,'removefavartist');if(status)
{parentDiv=document.getElementById('ctl00_theContent_MusicControl_ul-FavoriteArtists');favToRemove=document.getElementById(tagId);parentDiv.removeChild(favToRemove);var elHiddenCount=document.getElementById('ctl00_theContent_MusicControl_FavoriteArtistCount');var artistCount=elHiddenCount.innerHTML;artistCount=artistCount-1;elHiddenCount.innerHTML=artistCount;var language=getLanguage();var el=document.getElementById('ctl00_theContent_MusicControl_LabelArtistFan');if(artistCount==1)
{if(language=="ES")
el.innerHTML='Fan de '+artistCount+' Artista';else
el.innerHTML='Fan of '+artistCount+' Artist';}
else
{if(language=="ES")
el.innerHTML='Fan de '+artistCount+' Artistas';else
el.innerHTML='Fan of '+artistCount+' Artists';}
if(document.getElementById('ctl00_theContent_MusicControl_HyperLinkShowLessFavArtist')!=null&&document.getElementById('ctl00_theContent_MusicControl_HyperLinkShowLessFavArtist').style.display=='none')
ShowLessFavArtists(5);if(artistCount<6)
{closeTag('ctl00_theContent_MusicControl_HyperLinkShowLessFavArtist');closeTag('ctl00_theContent_MusicControl_HyperLinkShowAllFavArtist');}
if(artistCount==0)
{document.getElementById('div-FavoriteArtists').style.display='none';document.getElementById('ctl00_theContent_MusicControl_LabelEmptyFavoriteArtits').style.display='';}}}
function RemoveFavoriteVideo(id,tagId)
{var status=RemoveFavorite(id,'removefavvideo');if(status)
{parentDiv=document.getElementById('ctl00_theContent_MusicControl_ul-FavoriteVideos');favToRemove=document.getElementById(tagId);parentDiv.removeChild(favToRemove);var elHiddenCount=document.getElementById('ctl00_theContent_MusicControl_FavoriteVideoCount');var videoCount=elHiddenCount.innerHTML;videoCount=videoCount-1;elHiddenCount.innerHTML=videoCount;var language=getLanguage();var el=document.getElementById('ctl00_theContent_MusicControl_LabelVideoFan');if(videoCount==1)
{if(language=="ES")
el.innerHTML='Fan de '+videoCount+' Video';else
el.innerHTML='Fan of '+videoCount+' Video';}
else
{if(language=="ES")
el.innerHTML='Fan de '+videoCount+' Videos';else
el.innerHTML='Fan of '+videoCount+' Videos';}
if(document.getElementById('ctl00_theContent_MusicControl_HyperLinkShowLessFavVideo')!=null&&document.getElementById('ctl00_theContent_MusicControl_HyperLinkShowLessFavVideo').style.display=='none')
ShowLessFavVideos(5);if(videoCount<6)
{closeTag('ctl00_theContent_MusicControl_HyperLinkShowLessFavVideo');closeTag('ctl00_theContent_MusicControl_HyperLinkShowAllFavVideo');}
if(videoCount==0)
{document.getElementById('div-FavoriteVideos').style.display='none';document.getElementById('ctl00_theContent_MusicControl_LabelEmptyFavoriteVideo').style.display='';}}}
function BatangaReportAbuse()
{var requestBatch=new RequestBatch();var userId=gSiteLife.GetParameter("userid");var userKey=new UserKey(userId);var reason=document.getElementById('ReportAbuse_Reason').value;var description=document.getElementById('ReportAbuse_CommentText').value;var abuseReport=new ReportAbuseAction(userKey,reason,description);requestBatch.AddToRequest(abuseReport);requestBatch.BeginRequest(serverUrl,abuseResported);closeTag('Batanga_ReportAbuse_Menu');}
function abuseResported(responseBatch)
{if(responseBatch.Messages[0].Message=='ok')
{SetupAbuseLinks('True');}
else
alert(responseBatch.Messages[0].Message);}
function GetAbuseReasons()
{var language=getLanguage();var optionHtml="<select id='ReportAbuse_Reason'>";if(language=="EN")
{optionHtml=optionHtml+"<option value='Obscenity or vulgarity'>Obscenity/vulgarity</option>"+"<option value='Hate speech'>Hate speech</option>"+"<option value='Personal attack'>Personal attack</option>"+"<option value='Advertising or Spam'>Advertising/Spam</option>"+"<option value='Copyright or Plagiarism'>Copyright/Plagiarism</option>"+"<option value='Other'>Other</option>"}
else
{optionHtml=optionHtml+"<option value='Obscenity or vulgarity'>Obscenity/vulgarity(ES)</option>"+"<option value='Hate speech'>Hate speech(ES)</option>"+"<option value='Personal attack'>Personal attack(ES)</option>"+"<option value='Advertising or Spam'>Advertising/Spam(ES)</option>"+"<option value='Copyright or Plagiarism'>Copyright/Plagiarism(ES)</option>"+"<option value='Other'>Other(ES)</option>"}
optionHtml=optionHtml+'</select>';return optionHtml;}
function ShowBatangaReportAbuse()
{var loggedIn=IsUserLoggedIn();if(!loggedIn)
{showLoginDialog();return;}
posx=batangaMouseX-100;posy=batangaMouseY+6;if(posx>0&&posy>0)
{document.getElementById('Batanga_ReportAbuse_Menu').style.left=posx+"px";document.getElementById('Batanga_ReportAbuse_Menu').style.top=posy+"px";}
document.getElementById('DivReportAbuse_Reason').innerHTML=GetAbuseReasons();document.getElementById('Batanga_ReportAbuse_Menu').style.display="block";document.getElementById('ReportAbuse_CommentText').focus();}
function toggleDisplay(id)
{var elem=document.getElementById(id);elem.style.display=(elem.style.display!='none'?'none':'inline');}
function toggleAboutMe()
{toggleDisplay('ctl00_theContent_LabelAboutMeTrunData');toggleDisplay('ctl00_theContent_LabelAboutMeFullData');toggleDisplay('ctl00_theContent_LinkButtonAboutMeMore');toggleDisplay('ctl00_theContent_LinkButtonAboutMeLess');return false;}
function Recommend()
{var loggedIn=IsUserLoggedIn();if(!loggedIn)
{showLoginDialog();return;}
var userId=gSiteLife.GetParameter("userid");var userKey=new UserKey(userId);var recommendAction=new RecommendAction(userKey);var requestBatch=new RequestBatch();requestBatch.AddToRequest(recommendAction);requestBatch.BeginRequest(serverUrl,recommendationComplete);}
function recommendationComplete(responseBatch)
{var message=responseBatch.Messages[0];if(message.Message=='ok')
{UpdateRecommendation();}
else
{var errorBlock=document.getElementById('errors');var errorHtml="";errorHtml+="("+message.MessageTime+")<br/>";errorHtml+=message.Message;errorBlock.innerHTML=errorHtml;}}
function UpdateRecommendation()
{log("persona.js:in UpdateRecommendation");var userId=gSiteLife.GetParameter("userid");var userKey=new UserKey(userId);var requestBatch=new RequestBatch();requestBatch.AddToRequest(userKey);requestBatch.BeginRequest(serverUrl,getRecommendationData);}
function getRecommendationData(responseBatch)
{log("persona.js:in getRecommendationData");logobj(responseBatch);var language=getLanguage();var message=responseBatch.Messages[0];if(message.Message=='ok')
{var response=responseBatch.Responses[0];if(response.User!=null)
{if(language=="EN")
document.getElementById('LinkRecommend').innerHTML='Recommend ('+response.User.NumberOfRecommendations+')';else
document.getElementById('LinkRecommend').innerHTML='Recomendar ('+response.User.NumberOfRecommendations+')';if(language=="EN")
document.getElementById('LabelRecommend').innerHTML='Recommended ('+response.User.NumberOfRecommendations+')';else
document.getElementById('LabelRecommend').innerHTML='Recomendado ('+response.User.NumberOfRecommendations+')';}
if(response.User.CurrentUserRecommendedProfile=='True')
{document.getElementById('DivLinkRecommend').style.display='none';document.getElementById('DivLabelRecommend').style.display='';}
else
{document.getElementById('DivLinkRecommend').style.display='';document.getElementById('DivLabelRecommend').style.display='none';}}
else
{var errorBlock=document.getElementById('errors');var errorHtml="";errorHtml+="("+message.MessageTime+")<br/>";errorHtml+=message.Message;errorBlock.innerHTML=errorHtml;}}
function PopulateCount()
{var userId=gSiteLife.GetParameter("userid");var userKey=new UserKey(userId);var requestBatchCounter=new RequestBatch();var requestBatchPhotos=new RequestBatch();requestBatchCounter.AddToRequest(new UserCommentPage(userKey,1,1,"TimeStampDescending"));requestBatchCounter.AddToRequest(userKey);if(typeof(myOwnProfile)!="undefined"&&myOwnProfile)
requestBatchCounter.AddToRequest(new PrivateMessageFolderList());requestBatchPhotos.AddToRequest(new RecentUserPhotoPage(userKey,1,1));requestBatchCounter.BeginRequest(serverUrl,getUserCountData);requestBatchPhotos.BeginRequest(serverUrl,getUserCountData);}
function getUserCountData(responseBatch)
{log('persona.js:getUserCountData');logobj(responseBatch);var language=getLanguage();if(responseBatch.Messages[0].Message=='ok')
{for(i=0;i<responseBatch.Responses.length;i++)
{var response=responseBatch.Responses[i];if(response.UserCommentPage!=null)
{if(response.UserCommentPage.NumberOfUserActivities==1)
{if(language=="EN")
document.getElementById('ctl00_theContent_HyperLinkCountComments').innerHTML=' '+response.UserCommentPage.NumberOfUserActivities+' Comment/Review ';else
document.getElementById('ctl00_theContent_HyperLinkCountComments').innerHTML=' '+response.UserCommentPage.NumberOfUserActivities+' Comentario/Crítica ';}
else
{if(language=="EN")
document.getElementById('ctl00_theContent_HyperLinkCountComments').innerHTML=' '+response.UserCommentPage.NumberOfUserActivities+' Comments/Reviews ';else
document.getElementById('ctl00_theContent_HyperLinkCountComments').innerHTML=' '+response.UserCommentPage.NumberOfUserActivities+' Comentarios/Críticas ';}}
else if(response.RecentUserPhotoPage!=null)
{if(response.RecentUserPhotoPage.NumberOfPhotos==1)
{if(language=="EN")
document.getElementById('ctl00_theContent_HyperLinkCountPhotos').innerHTML=' '+response.RecentUserPhotoPage.NumberOfPhotos+' Photo ';else
document.getElementById('ctl00_theContent_HyperLinkCountPhotos').innerHTML=' '+response.RecentUserPhotoPage.NumberOfPhotos+' Foto ';}
else
{if(language=="EN")
document.getElementById('ctl00_theContent_HyperLinkCountPhotos').innerHTML=' '+response.RecentUserPhotoPage.NumberOfPhotos+' Photos ';else
document.getElementById('ctl00_theContent_HyperLinkCountPhotos').innerHTML=' '+response.RecentUserPhotoPage.NumberOfPhotos+' Fotos ';}}
else if(response.User!=null)
{if(response.User.NumberOfFriends==1)
{if(language=="EN")
document.getElementById('ctl00_theContent_HyperLinkCountFriends').innerHTML=' '+response.User.NumberOfFriends+' Friend ';else
document.getElementById('ctl00_theContent_HyperLinkCountFriends').innerHTML=' '+response.User.NumberOfFriends+' Amigo ';}
else
{if(language=="EN")
document.getElementById('ctl00_theContent_HyperLinkCountFriends').innerHTML=' '+response.User.NumberOfFriends+' Friends ';else
document.getElementById('ctl00_theContent_HyperLinkCountFriends').innerHTML=' '+response.User.NumberOfFriends+' Amigos ';}
SetupAbuseLinks(response.User.CurrentUserHasReportedAbuse);}
else if(response.PrivateMessageFolderList!=null)
{var numMessages;var folders=response.PrivateMessageFolderList.FolderList;for(var folderListIndex=0;folderListIndex<folders.length;folderListIndex++){if(folders[folderListIndex].FolderID==="Inbox"){numMessages=folders[folderListIndex].UnreadMessageCount;}}
if(numMessages==0){}else if(numMessages==1)
{if(language!="EN")
document.getElementById('ctl00_theContent_HyperLinkCountPrivateMessages').innerHTML=numMessages+' Mensaje Privado Nuevo';else
document.getElementById('ctl00_theContent_HyperLinkCountPrivateMessages').innerHTML=numMessages+' New Private Message';}
else
{if(language!="EN")
document.getElementById('ctl00_theContent_HyperLinkCountPrivateMessages').innerHTML=numMessages+' Mensajes Privados Nuevos';else
document.getElementById('ctl00_theContent_HyperLinkCountPrivateMessages').innerHTML=numMessages+' New Private Messages';}}}}}
function SetupAbuseLinks(value)
{if(value=='True')
{document.getElementById('ctl00_theContent_LabelAbuseReported').style.display='';document.getElementById('ctl00_theContent_LinkButtonAbuse').style.display='none';}
else
{document.getElementById('ctl00_theContent_LabelAbuseReported').style.display='none';document.getElementById('ctl00_theContent_LinkButtonAbuse').style.display='';}}
function AddToFriend()
{var loggedIn=IsUserLoggedIn();if(!loggedIn)
{showLoginDialog();return false;}
var friendUserId=gSiteLife.GetParameter("userid");var requestBatch=new RequestBatch();var addFriendAction=new AddFriendAction(new UserKey(friendUserId));requestBatch.AddToRequest(addFriendAction);requestBatch.BeginRequest(serverUrl,friendResponse);return false;}
function friendResponse(response)
{log('persona.js:friendResponse');logobj(response);switch(response.Messages[0].Message){case'Added':document.getElementById('ctl00_theContent_LinkButtonAddToFriends').style.display='none';break;case'Pending':document.getElementById('ctl00_theContent_LinkButtonAddToFriends').style.display='none';break;case'AlreadyExists':document.getElementById('ctl00_theContent_LinkButtonAddToFriends').style.display='none';break;default:alert(response.Messages[0].Message);break;}}
function checkIfAlreadyFriends()
{log('in checkIfAlreadyFreinds');var loggedIn=IsUserLoggedIn();if(!loggedIn)
{document.getElementById('ctl00_theContent_LinkButtonAddToFriends').style.display='';return;}
if(document.getElementById('ctl00_theContent_LinkButtonAddToFriends')==null)return;var currentUserId=getCookie("batangausername");var friendUserId=gSiteLife.GetParameter("userid");var requestBatch=new RequestBatch();var isFriendRequest=new IsFriend(new UserKey(friendUserId),new UserKey(currentUserId));requestBatch.AddToRequest(isFriendRequest);requestBatch.BeginRequest(serverUrl,checkFriendResponse);}
function checkFriendResponse(response)
{log('in checkFriendResponse');logobj(response);if(response.Messages[0].Message=='NotFriend')
document.getElementById('ctl00_theContent_LinkButtonAddToFriends').style.display='';else
document.getElementById('ctl00_theContent_LinkButtonAddToFriends').style.display='none';}
var pluckLoginOverrideCompleted=false;var pluckLoginOverrideAttempts=0;var pluckLoginOverrideMaxAttempts=30;var pluckLoginOverrideTimer=null;var enableConsoleLog=false;if(enableConsoleLog)
window.document.title=window.document.title+" - WARNING!!! console log is enabled.";function ExtractPluckContent(content)
{var tagDelimiter='/script>';var index=content.lastIndexOf(tagDelimiter);content=content.substr(index+tagDelimiter.length);return content;}
function Batanga_ShowReportAbuse(e,docUrl,sitelifePostUrl)
{if(!IsUserLoggedIn())
{showLoginDialog();return false;}
return ShowReportAbuse(e,docUrl,sitelifePostUrl);}
function GetElementsByClassName(classname,node){if(!node)
{log('node is null. using body');node=document.getElementsByTagName("body")[0];}
var a=[];var re=new RegExp('\\b'+classname+'\\b');var els=node.getElementsByTagName("*");for(var i=0,j=els.length;i<j;i++)
if(re.test(els[i].className))a.push(els[i]);log('a.length = '+a.length);return a;}
function getIframe(frameId)
{var myTop;if(window.frameElement){myTop=window.frameElement;}else if(window.top){myTop=window.top;}
var iFs=myTop.document.getElementsByTagName('iframe');var x,i=iFs.length;while(i--){x=iFs[i];if(x.id==frameId)
return x;}
return null;}
function log(str)
{if(enableConsoleLog)
console.log(str);}
function logobj(obj)
{if(enableConsoleLog)
console.dir(obj);}
function PluckLoginOverride(frameId,classIdToLookFor)
{log('In PluckLoginOverride');if(IsUserLoggedIn())
{log('user already logged in..returning...');return;}
if(pluckLoginOverrideCompleted||pluckLoginOverrideAttempts++>pluckLoginOverrideMaxAttempts)
{if(pluckLoginOverrideTimer!=null)
clearTimeout(pluckLoginOverrideTimer);log('PluckLoginOverride:done with no changes');return;}
var ele=null;log('calling GetElementsByClassName without iframe first');var eleLogin=GetElementsByClassName('SiteLife_Login',null);try{if(eleLogin!=null&&eleLogin.length>0)
{log('ele FOUND! without iframe');ele=eleLogin[0];}
else
{frameId=frameId||'commentsiframe';log('frameId = '+frameId);classIdToLookFor=classIdToLookFor||'SiteLife_Login';log('classIdToLookFor = '+classIdToLookFor);var iframeElem=parent.document.getElementById(frameId);if(iframeElem!=null){var doc;if(iframeElem.contentDocument&&iframeElem.contentDocument!='undefined')
{log('using contentDocument = '+iframeElem.contentDocument);doc=iframeElem.contentDocument;}
else
{log('using contentWindow = '+iframeElem.contentWindow);doc=iframeElem.contentWindow.document;}
logobj(doc);eleLogin=GetElementsByClassName(classIdToLookFor,doc);log('eleLogin.length  = '+eleLogin.length);if(eleLogin.length>0)
{ele=eleLogin[0];log('ele found USING iframe');}}}}catch(eleExcept){}
if(ele==null){log('PluckLoginOverride:setting timer again...');if(pluckLoginOverrideTimer!=null)
clearTimeout(pluckLoginOverrideTimer);pluckLoginOverrideTimer=setTimeout("PluckLoginOverride('"+frameId+"', '"+classIdToLookFor+"')",2000);return;}
log('login div tag is '+ele);logobj(ele);pluckLoginOverrideCompleted=true;var loginHtml;var language=getLanguage();if(language=="ES")
loginHtml="Debes entrar para poder hacer un comentario. ";else
loginHtml="You must be logged in to leave a comment. ";loginHtml+="<a onclick=\" parent.showLoginDialog(); return false;\" href=\"#\">";if(language=="ES")
loginHtml+="Entrar";else
loginHtml+="Log In";loginHtml+="</a>";loginHtml+=" | ";loginHtml+="<a onclick=\" parent.signupUser(470, 470); return false;\" href=\"#\">";if(language=="ES")
loginHtml+="Regístrate GRATIS >";else
loginHtml+="Join for FREE >";loginHtml+="</a>";ele.innerHTML=loginHtml;if(pluckLoginOverrideTimer!=null)
clearTimeout(pluckLoginOverrideTimer);}
function GetLanguageStrippedUrl()
{var pageUrl=window.location.href;pageUrl=pageUrl.toLowerCase();pageUrl=pageUrl.replace('/es/','/');pageUrl=pageUrl.replace('/en/','/');log('GetLanguageStrippedUrl :'+pageUrl);return pageUrl;}
function Review(parentKeyType,parentKey,reviewedTitle,reviewCategory,pageSize,sort,currentPage){log("Review");var divId="Reviews_Container";gSiteLife.WriteDiv(divId);return GetReviews(parentKeyType,parentKey,reviewedTitle,reviewCategory,pageSize,sort,currentPage);}
function GetReviews(parentKeyType,parentKey,reviewedTitle,reviewCategory,pageSize,sort,currentPage){parentKeyType=parentKeyType||"ExternalResource";parentKey=gSiteLife.EscapeValue(parentKey)||gSiteLife.EscapeValue(gSiteLife.__StripAnchorFromUrl(window.location.href));reviewedTitle=gSiteLife.EscapeValue(reviewedTitle)||gSiteLife.EscapeValue(document.title);reviewCategory=reviewCategory||"Uncategorized";pageSize=pageSize||10;sort=sort||"TimeStampAscending";currentPage=currentPage||0;var url=gSiteLife.__baseUrl+'/Review/Reviews?plckElementId=Reviews_Container'+'&plckTargetKey='+parentKey+'&plckTargetKeyType='+parentKeyType+'&plckReviewedTitle='+reviewedTitle+'&plckReviewCategory='+reviewCategory+'&plckSort='+sort+'&plckParentUrl='+gSiteLife.EscapeValue(gSiteLife.__StripAnchorFromUrl(GetLanguageStrippedUrl()))+'&plckParentTitle='+gSiteLife.EscapeValue(document.title)+'&plckCurrentPage='+currentPage+'&plckPageSize='+pageSize;log(url);gSiteLife.__Send(url);return false;}
var pluckSLServer="http://sitelife.en.batanga.com";SiteLifeProxy.prototype.PersonaAddPendingFriend=function(UserId,PendingFriend,Div){$.getJSON(pluckSLServer+"/ver1.0/meebo/v1/notify?action=add&uid="+UserId+"&frienduid="+PendingFriend+"&jsoncallback=?",function(data){});return this.PersonaSend('PersonaAddPendingFriend',Div,'personaScript',UserId,'plckPendingFriend='+PendingFriend);}
SiteLifeProxy.prototype.PersonaRemoveFriend=function(UserId,Friend,Div,View,Expanded,confirmMsg){if(!Expanded)Expanded="false";if(confirm(confirmMsg)==true){$.getJSON(pluckSLServer+"/ver1.0/meebo/v1/notify?action=remove&uid="+UserId+"&frienduid="+Friend+"&jsoncallback=?",function(data){});return this.PersonaSend('PersonaRemoveFriend',Div,'personaScript',UserId,'plckFriendView='+View+'&plckFriend='+Friend+'&plckExpanded='+Expanded);}
return false;}
var saved_text;$(document).ready(function(){$(".editable").mouseover(function(){$(this).css("border","solid 1px #ccc");}).mouseout(function(){$(this).css("border","none");});$(".editable").click(function(){$("#editMode").val($(this).html());saved_text=$(this).html();$("#editMode").show();$("#editMode").focus().select();});$("#editMode").blur(function(){$("#editMode").hide();});$(document).keydown(function(e){var key=e.charCode||e.keyCode||0;if(key==27){$(".editable").html(saved_text);$("#editMode").hide();}
if(key==13){$(".editable").html($("#editMode").val());$("#editMode").hide();$.ajax({type:"POST",url:UrlRegistrationHelper+"?op=sm&statusmsg="+$("#editMode").val(),data:"op=sm&statusmsg="+$("#editMode").val(),success:function(msg){}});return false;}});});function structureSongRating(thisName,divName,toolTips,fnOnClick,songID,uvote,current,objPath,allowNotLoggedVotes)
{var myName='SongRating';var s_voted='You have voted: ';var slength=14;var sheight=14;var maxrating=5;var ttarray=new Array();var myHelper=DF_Helper;var tto=0;if(typeof allowNotLoggedVotes=="undefined")
allowNotLoggedVotes=false;this.getsongid=function()
{return songID;}
this.getuvote=function()
{return uvote;}
this.getrating=function()
{return current;}
this.soc=function(m)
{if(IsUserLoggedIn()||allowNotLoggedVotes)
{current=m+1;uvote=1;this.printSongRating();if(fnOnClick)fnOnClick(songID,current);}else
{if(fnOnClick)fnOnClick(songID,m+1);}}
this.smo=function(m)
{clearTimeout(tto);var obj;for(var i=0;i<maxrating;i++)
{obj=document.getElementById(thisName+'s'+i);if(obj)
{if(i<=m){obj.src=objPath+'sr_1.gif';}else{if((i<current)&&(uvote==2)){obj.src=objPath+'sr_2.gif';}else{obj.src=objPath+'sr_0.gif';}}}}}
this.smu=function(m)
{tto=setTimeout(thisName+'.stt('+m+')',100);}
this.stt=function(m)
{var obj;var c;for(var i=0;i<maxrating;i++)
{obj=document.getElementById(thisName+'s'+i);if(obj)
{if(i<current){obj.src=objPath+'sr_'+uvote+'.gif';}else{obj.src=objPath+'sr_0.gif';}}}}
this.buildDIVs=function()
{var strHTML='<div style="margin:0px;border:0px;padding:0px;width:'+(slength*maxrating)+'px;height:'+sheight+';" >';var c=0;var s='';for(var i=0;i<maxrating;i++)
{if(i<current){c=uvote}else{c=0};if(i+1==current){s=s_voted}else{s=''};if(sp_disableRatings==0)
strHTML+='<img style="float:left;margin:0px;border:0px;padding:0px;cursor:pointer;cursor:hand;" title="'+s+ttarray[i]+'" id="'+thisName+'s'+i+'" onclick="'+thisName+'.soc('+i+');"  onmouseover="'+thisName+'.smo('+i+');" onmouseout="'+thisName+'.smu('+i+');" src="'+objPath+'sr_'+c+'.gif">';else
strHTML+='<img style="float:left;margin:0px;border:0px;padding:0px;" title="'+s+ttarray[i]+'" id="'+thisName+'s'+i+'" src="'+objPath+'sr_'+c+'.gif">';}
strHTML+='</div>';return strHTML;}
this.setValues=function(i1,i2,i3,i4,i5)
{divName=i1;songID=i2;current=i3;uvote=i4;fnOnClick=i5;}
this.setRating=function(i3,i4)
{uvote=i3;current=i4;}
this.printSongRating=function()
{var obj=document.getElementById(divName);if(obj)
{obj.innerHTML=this.buildDIVs();}}
if(toolTips)
{var st=toolTips.split(',');var s='';for(var i=0;i<maxrating;i++)
{if(i<st.length){s=st[i]}else(s='');ttarray[i]=s;}}else
{for(var i=0;i<maxrating;i++)
{ttarray[i]='';}}
var obj=document.getElementById(divName);if(obj)
{var h='style="visibility:hidden;"'
obj.innerHTML='<img '+h+' src="'+objPath+'sr_0.gif"><img '+h+' img="'+objPath+'sr_2.gif"><img '+h+' src="'+objPath+'sr_1.gif">';}}
function structureHelper(thisName)
{var localIsLogin=false;this.findMyPath=function(myName)
{var sc=document.getElementsByTagName("script");var strS,t1;for(var i=0;i<sc.length;i++)
{strS=sc[i].src.toLowerCase();t1=strS.indexOf(myName.toLowerCase()+'.js');if(t1>-1)
{return strS.substring(0,t1)}}
return'';}
this.setCookie=function(name,value,duration)
{var cookiestring;if(duration!=null)
cookiestring=name+"="+escape(value)+";EXPIRES="+getexpirydate(duration)+";path=/;domain=batanga.com;";else
cookiestring=name+"="+escape(value)+";path=/;domain=batanga.com;";document.cookie=cookiestring;}
this.getexpirydate=function(nodays)
{var UTCstring;var Today=new Date();var nomilli=Date.parse(Today);Today.setTime(nomilli+nodays*24*60*60*1000);UTCstring=Today.toUTCString();return UTCstring;}
this.isLogin=function()
{return localIsLogin;}
this.setIsLogin=function(il)
{localIsLogin=il;}
this.getCookie=function(Name)
{var search=Name+"=";document.cookie.setDomain="batanga.com";if(document.cookie.length>0)
{var offset=document.cookie.indexOf(search)
if(offset!=-1&&offset!=null)
{offset+=search.length;end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(offset,end));}}else{return null;}}}
var UFO={req:["movie","width","height","majorversion","build"],opt:["play","loop","menu","quality","scale","salign","wmode","bgcolor","base","flashvars","devicefont","allowscriptaccess","seamlesstabbing","allowfullscreen"],optAtt:["id","name","align"],optExc:["swliveconnect"],ximovie:"ufo.swf",xiwidth:"215",xiheight:"138",ua:navigator.userAgent.toLowerCase(),pluginType:"",fv:[0,0],foList:[],create:function(FO,id){if(!UFO.uaHas("w3cdom")||UFO.uaHas("ieMac"))return;UFO.getFlashVersion();UFO.foList[id]=UFO.updateFO(FO);UFO.createCSS("#"+id,"visibility:hidden;");UFO.domLoad(id);},updateFO:function(FO){if(typeof FO.xi!="undefined"&&FO.xi=="true"){if(typeof FO.ximovie=="undefined")FO.ximovie=UFO.ximovie;if(typeof FO.xiwidth=="undefined")FO.xiwidth=UFO.xiwidth;if(typeof FO.xiheight=="undefined")FO.xiheight=UFO.xiheight;}
FO.mainCalled=false;return FO;},domLoad:function(id){var _t=setInterval(function(){if((document.getElementsByTagName("body")[0]!=null||document.body!=null)&&document.getElementById(id)!=null){UFO.main(id);clearInterval(_t);}},250);if(typeof document.addEventListener!="undefined"){document.addEventListener("DOMContentLoaded",function(){UFO.main(id);clearInterval(_t);},null);}},main:function(id){var _fo=UFO.foList[id];if(_fo.mainCalled)return;UFO.foList[id].mainCalled=true;document.getElementById(id).style.visibility="hidden";if(UFO.hasRequired(id)){if(UFO.hasFlashVersion(parseInt(_fo.majorversion,10),parseInt(_fo.build,10))){if(typeof _fo.setcontainercss!="undefined"&&_fo.setcontainercss=="true")UFO.setContainerCSS(id);UFO.writeSWF(id);}
else if(_fo.xi=="true"&&UFO.hasFlashVersion(6,65)){UFO.createDialog(id);}}
document.getElementById(id).style.visibility="hidden";},createCSS:function(selector,declaration){var _h=document.getElementsByTagName("head")[0];var _s=UFO.createElement("style");if(!UFO.uaHas("ieWin"))_s.appendChild(document.createTextNode(selector+" {"+declaration+"}"));_s.setAttribute("type","text/css");_s.setAttribute("media","screen");_h.appendChild(_s);if(UFO.uaHas("ieWin")&&document.styleSheets&&document.styleSheets.length>0){var _ls=document.styleSheets[document.styleSheets.length-1];if(typeof _ls.addRule=="object")_ls.addRule(selector,declaration);}},setContainerCSS:function(id){var _fo=UFO.foList[id];var _w=/%/.test(_fo.width)?"":"px";var _h=/%/.test(_fo.height)?"":"px";UFO.createCSS("#"+id,"width:"+_fo.width+_w+"; height:"+_fo.height+_h+";");if(_fo.width=="100%"){UFO.createCSS("body","margin-left:0; margin-right:0; padding-left:0; padding-right:0;");}
if(_fo.height=="100%"){UFO.createCSS("html","height:100%; overflow:hidden;");UFO.createCSS("body","margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;");}},createElement:function(el){return(UFO.uaHas("xml")&&typeof document.createElementNS!="undefined")?document.createElementNS("http://www.w3.org/1999/xhtml",el):document.createElement(el);},createObjParam:function(el,aName,aValue){var _p=UFO.createElement("param");_p.setAttribute("name",aName);_p.setAttribute("value",aValue);el.appendChild(_p);},uaHas:function(ft){var _u=UFO.ua;switch(ft){case"w3cdom":return(typeof document.getElementById!="undefined"&&typeof document.getElementsByTagName!="undefined"&&(typeof document.createElement!="undefined"||typeof document.createElementNS!="undefined"));case"xml":var _m=document.getElementsByTagName("meta");var _l=_m.length;for(var i=0;i<_l;i++){if(/content-type/i.test(_m[i].getAttribute("http-equiv"))&&/xml/i.test(_m[i].getAttribute("content")))return true;}
return false;case"ieMac":return/msie/.test(_u)&&!/opera/.test(_u)&&/mac/.test(_u);case"ieWin":return/msie/.test(_u)&&!/opera/.test(_u)&&/win/.test(_u);case"gecko":return/gecko/.test(_u)&&!/applewebkit/.test(_u);case"opera":return/opera/.test(_u);case"safari":return/applewebkit/.test(_u);default:return false;}},getFlashVersion:function(){if(UFO.fv[0]!=0)return;if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){UFO.pluginType="npapi";var _d=navigator.plugins["Shockwave Flash"].description;if(typeof _d!="undefined"){_d=_d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var _m=parseInt(_d.replace(/^(.*)\..*$/,"$1"),10);var _r=/r/.test(_d)?parseInt(_d.replace(/^.*r(.*)$/,"$1"),10):0;UFO.fv=[_m,_r];}}
else if(window.ActiveXObject){UFO.pluginType="ax";try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");UFO.fv=[6,0];_a.AllowScriptAccess="always";}
catch(e){if(UFO.fv[0]==6)return;}
try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}
if(typeof _a=="object"){var _d=_a.GetVariable("$version");if(typeof _d!="undefined"){_d=_d.replace(/^\S+\s+(.*)$/,"$1").split(",");UFO.fv=[parseInt(_d[0],10),parseInt(_d[2],10)];}}}},hasRequired:function(id){var _l=UFO.req.length;for(var i=0;i<_l;i++){if(typeof UFO.foList[id][UFO.req[i]]=="undefined")return false;}
return true;},hasFlashVersion:function(major,release){return(UFO.fv[0]>major||(UFO.fv[0]==major&&UFO.fv[1]>=release))?true:false;},writeSWF:function(id){var _fo=UFO.foList[id];var _e=document.getElementById(id);if(UFO.pluginType=="npapi"){if(UFO.uaHas("gecko")||UFO.uaHas("xml")){while(_e.hasChildNodes()){_e.removeChild(_e.firstChild);}
var _obj=UFO.createElement("object");_obj.setAttribute("type","application/x-shockwave-flash");_obj.setAttribute("data",_fo.movie);_obj.setAttribute("width",_fo.width);_obj.setAttribute("height",_fo.height);var _l=UFO.optAtt.length;for(var i=0;i<_l;i++){if(typeof _fo[UFO.optAtt[i]]!="undefined")_obj.setAttribute(UFO.optAtt[i],_fo[UFO.optAtt[i]]);}
var _o=UFO.opt.concat(UFO.optExc);var _l=_o.length;for(var i=0;i<_l;i++){if(typeof _fo[_o[i]]!="undefined")UFO.createObjParam(_obj,_o[i],_fo[_o[i]]);}
_e.appendChild(_obj);}
else{var _emb="";var _o=UFO.opt.concat(UFO.optAtt).concat(UFO.optExc);var _l=_o.length;for(var i=0;i<_l;i++){if(typeof _fo[_o[i]]!="undefined")_emb+=' '+_o[i]+'="'+_fo[_o[i]]+'"';}
_e.innerHTML='<embed type="application/x-shockwave-flash" src="'+_fo.movie+'" width="'+_fo.width+'" height="'+_fo.height+'" pluginspage="http://www.macromedia.com/go/getflashplayer"'+_emb+'></embed>';}}
else if(UFO.pluginType=="ax"){var _objAtt="";var _l=UFO.optAtt.length;for(var i=0;i<_l;i++){if(typeof _fo[UFO.optAtt[i]]!="undefined")_objAtt+=' '+UFO.optAtt[i]+'="'+_fo[UFO.optAtt[i]]+'"';}
var _objPar="";var _l=UFO.opt.length;for(var i=0;i<_l;i++){if(typeof _fo[UFO.opt[i]]!="undefined")_objPar+='<param name="'+UFO.opt[i]+'" value="'+_fo[UFO.opt[i]]+'" />';}
var _p=window.location.protocol=="https:"?"https:":"http:";_e.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+_objAtt+' width="'+_fo.width+'" height="'+_fo.height+'" codebase="'+_p+'//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+_fo.majorversion+',0,'+_fo.build+',0"><param name="movie" value="'+_fo.movie+'" />'+_objPar+'</object>';}},createDialog:function(id){var _fo=UFO.foList[id];UFO.createCSS("html","height:100%; overflow:hidden;");UFO.createCSS("body","height:100%; overflow:hidden;");UFO.createCSS("#xi-con","position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;");UFO.createCSS("#xi-dia","position:absolute; left:50%; top:50%; margin-left: -"+Math.round(parseInt(_fo.xiwidth,10)/2)+"px; margin-top: -"+Math.round(parseInt(_fo.xiheight,10)/2)+"px; width:"+_fo.xiwidth+"px; height:"+_fo.xiheight+"px;");var _b=document.getElementsByTagName("body")[0];var _c=UFO.createElement("div");_c.setAttribute("id","xi-con");var _d=UFO.createElement("div");_d.setAttribute("id","xi-dia");_c.appendChild(_d);_b.appendChild(_c);var _mmu=window.location;if(UFO.uaHas("xml")&&UFO.uaHas("safari")){var _mmd=document.getElementsByTagName("title")[0].firstChild.nodeValue=document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0,47)+" - Flash Player Installation";}
else{var _mmd=document.title=document.title.slice(0,47)+" - Flash Player Installation";}
var _mmp=UFO.pluginType=="ax"?"ActiveX":"PlugIn";var _uc=typeof _fo.xiurlcancel!="undefined"?"&xiUrlCancel="+_fo.xiurlcancel:"";var _uf=typeof _fo.xiurlfailed!="undefined"?"&xiUrlFailed="+_fo.xiurlfailed:"";UFO.foList["xi-dia"]={movie:_fo.ximovie,width:_fo.xiwidth,height:_fo.xiheight,majorversion:"6",build:"65",flashvars:"MMredirectURL="+_mmu+"&MMplayerType="+_mmp+"&MMdoctitle="+_mmd+_uc+_uf};UFO.writeSWF("xi-dia");},expressInstallCallback:function(){var _b=document.getElementsByTagName("body")[0];var _c=document.getElementById("xi-con");_b.removeChild(_c);UFO.createCSS("body","height:auto; overflow:auto;");UFO.createCSS("html","height:auto; overflow:auto;");},cleanupIELeaks:function(){var _o=document.getElementsByTagName("object");var _l=_o.length
for(var i=0;i<_l;i++){_o[i].style.display="none";for(var x in _o[i]){if(typeof _o[i][x]=="function"){_o[i][x]=null;}}}}};if(typeof window.attachEvent!="undefined"&&UFO.uaHas("ieWin")){window.attachEvent("onunload",UFO.cleanupIELeaks);}
function structureClipsPreviewWMP(thisName,divName,realStartOn,stopAfter)
{var browser=0;var tto=0;var fnUpdate=null;var normalVolume=70;var controlNumber=-1;var controlPosition=-1;var startOn=realStartOn;this.clipEnded=function(reset)
{var cd=1;if(reset)cd=0;if(fnUpdate)fnUpdate(controlNumber,controlPosition,cd,0);fnUpdate=null;controlNumber=-1;controlPosition=-1;}
this.PlayStateChange=function(s)
{switch(s)
{case 8:this.clipEnded(false);break;}}
this.getPlayer=function()
{return document.getElementById(this.thisName+'_player');}
this.play=function(strURL,fnU,cc,ps,so)
{var p=this.getPlayer();if((controlNumber==cc)&&(controlPosition==ps))
{p.controls.stop();this.clipEnded(false);return;}
this.clipEnded(true);if((strURL.length>0)&&(p))
{if(so){startOn=so;}else{startOn=realStartOn;}
controlNumber=cc;controlPosition=ps;p.controls.stop();p.URL=strURL;p.controls.play();p.settings.volume=normalVolume;if(fnU)fnUpdate=fnU;this.startClip();this.startGetUpdate();}}
this.startClip=function()
{this.getPlayer().controls.currentPosition=startOn;}
this.startGetUpdate=function()
{clearTimeout(tto);this.getUpdate();}
this.getUpdate=function()
{var p=this.getPlayer();if(fnUpdate)
{var m=(p.controls.currentPosition-startOn);var t=m/stopAfter;if(t>1)t=1;if(t<0)t=0;var n=stopAfter-m;if(n<0)n=0;fnUpdate(controlNumber,controlPosition,t,n);}
if(p.controls.currentPosition>startOn+stopAfter)
{p.controls.stop();this.clipEnded(false);}else
{tto=setTimeout(thisName+'.getUpdate()',1000)}}
this.initiatePlayer=function()
{var obj=document.getElementById(divName);if(obj)
{var strHTML='';strHTML+='<OBJECT classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" ';strHTML+='codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ';strHTML+='height="0" width="0" ';strHTML+='id="'+this.thisName+'_player" name="'+this.thisName+'_player">';strHTML+='<PARAM NAME="URL" VALUE="">';strHTML+='<PARAM NAME="rate" VALUE="1">';strHTML+='<PARAM NAME="balance" VALUE="0">';strHTML+='<PARAM NAME="currentPosition" VALUE="0">';strHTML+='<PARAM NAME="playCount" VALUE="1">';strHTML+='<PARAM NAME="autoStart" VALUE="0">';strHTML+='<PARAM NAME="currentMarker" VALUE="0">';strHTML+='<PARAM NAME="invokeURLs" VALUE="false">';strHTML+='<PARAM NAME="volume" VALUE="50">';strHTML+='<PARAM NAME="mute" VALUE="false">';strHTML+='<PARAM NAME="uiMode" VALUE="full">';strHTML+='<PARAM NAME="stretchToFit" VALUE="false">';strHTML+='<PARAM NAME="windowlessVideo" VALUE="false">';strHTML+='<PARAM NAME="enabled" VALUE="true">';strHTML+='<PARAM NAME="enableContextMenu" VALUE="true">';strHTML+='<PARAM NAME="fullScreen" VALUE="false">';strHTML+='<PARAM NAME="SAMIStyle" VALUE="">';strHTML+='<PARAM NAME="SAMILang" VALUE="">';strHTML+='<PARAM NAME="SAMIFilename" VALUE="">';strHTML+='<PARAM NAME="enableErrorDialogs" VALUE="0">';strHTML+='<PARAM NAME="_cx" VALUE="0">';strHTML+='<PARAM NAME="_cy" VALUE="0">';strHTML+='</OBJECT>';strHTML+='<SCRIPT event="PlayStateChange(s2)" for="'+this.thisName+'_player" language=JavaScript>'+thisName+'.PlayStateChange(s2);</SCRIPT>';obj.innerHTML=strHTML;}}}
function structureClipsPreviewFLASH(thisName,divName,realStartOn,stopAfter)
{var browser=1;var tto=0;var cpos=0;var cvol=0;var fnUpdate=null;var normalVolume=70;var controlNumber=-1;var controlPosition=-1;var startOn=realStartOn;this.clipEnded=function(reset)
{var cd=1;if(reset)cd=0;if(fnUpdate)fnUpdate(controlNumber,controlPosition,cd,0);this.getPlayer().sendEvent("stop");fnUpdate=null;controlNumber=-1;controlPosition=-1;}
this.getUpdate=function(typ,pr1,pr2,swf)
{if(typ=="time")
{cpos=pr1;if(cpos>startOn+stopAfter)
{tto=setTimeout(thisName+'.clipEnded(false);',10);}else
{if(fnUpdate)
{var t=(cpos-startOn)/stopAfter;if(t>1)t=1;if(t<0)t=0;var n=stopAfter-(cpos-startOn);if(n<0)n=0;fnUpdate(controlNumber,controlPosition,t,n);}}}
if(typ=="state"){if(pr1==3)tto=setTimeout(thisName+'.clipEnded(false);',10);};}
this.getPlayer=function()
{return document[thisName];}
this.changeVolume=function(v)
{this.getPlayer().sendEvent('volume',v);cvol=v;}
this.fwFlash=function()
{if(cpos<startOn)
{this.getPlayer().sendEvent('scrub',startOn);setTimeout(thisName+".fwFlash()",100);}else
{if(cvol<normalVolume)
{this.changeVolume(normalVolume);}}}
this.play=function(strURL,fnU,cc,ps,so)
{cpos=0;if((controlNumber==cc)&&(controlPosition==ps))
{this.clipEnded(false);return;}else if((controlNumber>=0)&&(controlPosition>=0))
{this.clipEnded(false);}
this.clipEnded(true);this.getPlayer().sendEvent('stop');if(fnU)fnUpdate=fnU;if(so){startOn=so;}else{startOn=realStartOn;}
controlNumber=cc;controlPosition=ps;this.getPlayer().loadFile(strURL,'',null,null,123);this.changeVolume(0);this.getPlayer().sendEvent('next');this.fwFlash();}
this.initiatePlayer=function()
{var obj=document.getElementById(divName);if(obj)
{var WstrPath=strPath="/include/webcontrols/jsobjects/clipspreview/";var s=""+document.location;if(s.indexOf('localhost')>-1)WstrPath='/www'+WstrPath;else if(s.indexOf('www.batanga.com')==-1)WstrPath='http://www.batanga.com'+WstrPath;var FO={movie:WstrPath+"flvplayer.swf",id:thisName,name:thisName,width:"0",height:"0",majorversion:"8",build:"0",bgcolor:"#FFFFFF",allowscriptaccess:"always",allowfullscreen:"false",flashvars:"file="+strPath+"mediaplayer.xml&enablejs=true&bufferlength=20"};UFO.create(FO,divName);getUpdate=this.getUpdate;}}}
function structureAjaxCaller()
{this.wsService="/Batanga_WebServices/myRadio.asmx";this.wsNamespace="http://webservices.batanga.com/MyRadio";this.strEnvelope="xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'";this.maxCon=50;this.tailCon=1;this.HTTPCon=new Array;this.lt=function(a,b)
{if(a<b){return true;}else{return false;}}
this.lte=function(a,b)
{if(a<=b){return true;}else{return false;}}
this.gt=function(a,b)
{if(a>b){return true;}else{return false;}}
this.gt=function(a,b)
{if(a>=b){return true;}else{return false;}}
this.fine1Con=function()
{var i;for(i=1;i<this.tailCon;i++)
{if(this.HTTPCon[i]){if(this.HTTPCon[i].readyState==0||this.HTTPCon[i].readyState==4)
return i;}}
if(this.tailCon<=this.maxCon)
{if(window.ActiveXObject){this.HTTPCon[this.tailCon]=new ActiveXObject("Microsoft.XMLHTTP");}else if(window.XMLHttpRequest){this.HTTPCon[this.tailCon]=new XMLHttpRequest();this.HTTPCon[this.tailCon].overrideMimeType('text/xml');}
if(this.HTTPCon[this.tailCon])
{i=this.tailCon;this.tailCon=this.tailCon+1;return i;}else{return false;}}else{return false;}}
this.AjaxSend=function(strFName,strVars,willExecute,fnOnResult)
{var gotOne=this.fine1Con();if(gotOne)
{if(this.HTTPCon[gotOne]){this.HTTPCon[gotOne].abort();this.HTTPCon[gotOne].open("POST",this.wsService,true);this.HTTPCon[gotOne].setRequestHeader("SOAPAction",this.wsNamespace+"/"+strFName);this.HTTPCon[gotOne].setRequestHeader("Content-Type","text/xml; charset=utf-8");var soapText="<?xml version='1.0' encoding='utf-8'?>"
+"<soap:Envelope "+this.strEnvelope+">"
+"<soap:Body>"
+"<"+strFName+" xmlns='"+this.wsNamespace+"'>";var mySplitVar=strVars.split("#");var i;if(mySplitVar.length>1)
{for(i=0;i<mySplitVar.length;i+=2){if(mySplitVar[i+1]){soapText=soapText+"<"+mySplitVar[i]+">"+mySplitVar[i+1]+"</"+mySplitVar[i]+">";}}}
soapText=soapText
+"</"+strFName+">"
+"</soap:Body>"
+"</soap:Envelope>";var savedObject=this;this.HTTPCon[gotOne].onreadystatechange=function(){if(savedObject.HTTPCon[gotOne].readyState==4&&savedObject.HTTPCon[gotOne].status==200){savedObject.AjaxOnReturn(gotOne,strFName);var strJS=savedObject.getTheResult(strFName,savedObject.HTTPCon[gotOne].responseText);if(willExecute)savedObject.executeJS(strJS);if(fnOnResult)fnOnResult(strJS);}}
this.HTTPCon[gotOne].send(soapText);}}}
this.executeJS=function(strJS)
{var script=document.createElement('script');script.type='text/javascript';script.text=strJS;script.id='JSOnTheFly';document.body.appendChild(script);var sc=document.getElementById('JSOnTheFly');document.body.removeChild(sc);}
this.getTheResult=function(strFName,responseText)
{var t1=responseText.indexOf("<"+strFName+"Result>");var t2=responseText.indexOf("</"+strFName+"Result>");if((t1>-1)&&(t2>-1)&&(t2>t1))
{return responseText.substring(t1+8+strFName.length,t2);}else
{return"";}}
this.AjaxOnReturn=function(gotOne,strName)
{}
var i;for(i=1;i<=this.maxCon;i++)
{this.HTTPCon[i]=false;}}
var sp_songWidth=0;var sp_ARating=new Array();var sp_APictures=new Array();var sp_ACurrentPic=new Array();var sp_APlaylist=new Array();var sp_tto=0;var sp_ttop=0;var sp_startOn=90;var sp_stopAfter=30;var sp_isLoaded=false;var sp_totalControl;var DF_PopMenu;var DF_Helper;var DF_ClipPlayer;var DF_AjaxCaller;var sp_ratingTotal;var sp_imagePath;var sp_ratingPath;var sp_thisPage="";var sp_ratingOTP=false;var sp_lang="ES";var sp_barHeight=0;var allowNotLoggedVotes=false;function sp_initajax()
{DF_AjaxCaller=new structureAjaxCaller();var ac=DF_AjaxCaller;var wsLocation=""+document.location;if(wsLocation.indexOf('localhost')>-1)
{ac.wsService="http://localhost.batanga.com/Batanga_WebServices/myRadio.asmx";}else if(wsLocation.indexOf('staging')>-1)
{ac.wsService="/Batanga_WebServices/myRadio.asmx";}else
{ac.wsService="/Batanga_WebServices/myRadio.asmx";}}
function sp_init()
{var songIDs="";var albumIDs="";sp_lang=getCookie('idioma');if(sp_lang==null)sp_lang="ES";if((sp_ratingTotal)||(sp_totalControl))
{if(sp_ratingOTP)
{sp_initajax();}
DF_Helper=new structureHelper('DF_Helper');DF_PopMenu=new structurePopMenu('DF_PopMenu','sp_divpopmenu');for(var i=0;i<sp_totalControl;i++)
{sp_ARating[i]=new Array();for(var j=0;j<sp_totalSongs[i];j++)
{var d='sp_rtg'+i+'_'+j;var obj=document.getElementById(d);if(obj)
{var r1=Math.floor(Math.random()*2)+1;var r2=Math.floor(Math.random()*5);r1=2;r2=0;sp_ARating[i][j]=new structureSongRating('sp_ARating['+i+']['+j+']',d,'hate,ok,like,love,excellent',onRateClick,sp_songID[i][j],r1,r2,sp_ratingPath,allowNotLoggedVotes);sp_ARating[i][j].printSongRating();songIDs=songIDs+sp_songID[i][j]+","}}}
if(navigator.appName.indexOf("Microsoft")!=-1){DF_ClipPlayer=new structureClipsPreviewWMP('DF_ClipPlayer',"sp_divplayer",sp_startOn,sp_stopAfter);}else{DF_ClipPlayer=new structureClipsPreviewFLASH('DF_ClipPlayer',"sp_divplayer",sp_startOn,sp_stopAfter);}
DF_ClipPlayer.initiatePlayer();for(var i=0;i<sp_totalControl;i++)
{sp_APictures[i]=new Array();albumIDs=albumIDs+sp_albumID[i][0]+",";for(var j=0;j<sp_totalSongs[i];j++)
{var obj=document.getElementById('sp_pic'+i+'_'+j);if(obj)
{if(obj.className.indexOf('_hide')==-1){sp_ACurrentPic[i]=j;}
sp_APictures[i][j]=obj;}}}}
sp_isLoaded=true;var url=""+document.location;if(sp_ratingOTP&&(url.indexOf('radio.')>-1||url.indexOf('localhost.')>-1||url.indexOf('www.')>-1))
{var DJID=getCookie('batangauserid');if(DJID==null)DJID="-"+getCookie('UserNumber');if(DJID==null)DJID=0;if(!IsUserLoggedIn()&&!allowNotLoggedVotes)DJID=0;var ac=DF_AjaxCaller;ac.AjaxSend("GetSongsRating","ListenerDJID#"+DJID+"#SongIDs#"+songIDs,false,sp_getRatingData);}
if(albumIDs.length>0&&(url.indexOf('radio.')>-1||url.indexOf('localhost.')>-1||url.indexOf('www.')>-1))
{sp_initajax();var ac=DF_AjaxCaller;ac.AjaxSend("GetAlbumReviewCounts","AlbumIDs#"+albumIDs,false,sp_getReviewCounts);}}
function sp_getReviewCounts(s)
{var strRS1,strRS2,strRS3,strRS4,strRS;if(sp_lang=="EN")
{strRS1="Review"
strRS2="Reviews"
strRS3="Post a Review"
strRS4="Be the first to review"}else
{strRS1="Cr&iacute;tica"
strRS2="Cr&iacute;ticas"
strRS3="Agrega una cr&iacute;tica"
strRS4="Agrega la primera cr&iacute;tica"}
if(s.length>0)
{var a1=s.split(';');for(var i=0;i<a1.length;i++)
{if(a1[i].length>0)
{var a2=a1[i].split(',');if(a2.length==2)
{var obj=document.getElementById('arev_'+a2[0]);if(obj)
{var strHTML="";var strLink="/"+sp_getAlbumURL(a2[0]);if(a2[1]>0)
{if(a2[1]==1){strRS=strRS1;}else{strRS=strRS2;}
strHTML='<a href=\"'+strLink+'\">'+a2[1]+' '+strRS+' </a> | <a href=\"'+strLink+'\">'+strRS3+'&nbsp;&gt;</a>';}else
{strHTML='<a href=\"'+strLink+'\">'+strRS4+'&nbsp;&gt;</a>';}
obj.innerHTML=strHTML;}}}}}}
function sp_getAlbumURL(sd)
{for(var i=0;i<sp_totalControl;i++)
{if(sp_albumID[i][0]==sd)return sp_albumURL[i][0];}
return'';}
function sp_getRatingData(s)
{var p=0;for(var i=0;i<sp_totalControl;i++)
{for(var j=0;j<sp_totalSongs[i];j++)
{var q=s.indexOf(';',p);if(q>0)
{var a1=s.substring(p,q).split(',');if(a1.length==3)
{if(a1[0]==sp_songID[i][j])
{if(a1[2]>0)
{sp_ARating[i][j].setRating(1,Math.round(a1[2]));}else
{sp_ARating[i][j].setRating(2,Math.round(a1[1]));}
sp_ARating[i][j].printSongRating();}}}
p=q+1;}}}
function onRateClick(songID,rate)
{var loggedIn=IsUserLoggedIn();if(loggedIn||allowNotLoggedVotes)
{var DJID
if(loggedIn)
DJID=getCookie('batangauserid');else
DJID="-"+getCookie('UserNumber');if(DJID!=null)
{var ac=DF_AjaxCaller;ac.AjaxSend("AddUserSongRating","ListenerDJID#"+DJID+"#PlaylistID#0#SongID#"+songID+"#Rating#"+rate);}}
else
{showLoginDialog();}}
function sp_setMenuMore(pm,cc,ps)
{pm.width=200;pm.height=20;pm.itemColor="#F3F3F3";pm.itemSelect="#E5E5E5";pm.color="#336699";pm.font="12px Arial, Helvetica, sans-serif";pm.paddingLeft=10;pm.paddingTop=5;pm.clearMenu();var strW=""+window.location;if(strW.indexOf('staging')>-1){strW='staging';}else{strW='';}
var strRS1,strRS2,strRS3;if(sp_lang=="EN")
{strRS1="More About The Album";strRS2="More About The Artist";strRS3="More About The Song";}else
{strRS1="Más acerca de este álbum";strRS2="Más acerca de este artista";strRS3="Más acerca de esta canción";}
if(sp_songURL[cc][ps]!="")
pm.pushMenu(strRS3,"http://"+strW+"www.batanga.com/"+sp_songURL[cc][ps],false,"");if(sp_albumURL[cc][ps]!="")
pm.pushMenu(strRS1,"http://"+strW+"www.batanga.com/"+sp_albumURL[cc][ps],false,"");if(sp_artistURL[cc][ps]!="")
pm.pushMenu(strRS2,"http://"+strW+"www.batanga.com/"+sp_artistURL[cc][ps],false,"");}
function sp_setMenuBuy(pm,cc,ps,iTunesUrl)
{pm.width=250;pm.height=35;pm.itemColor="#F3F3F3";pm.itemSelect="#E5E5E5";pm.color="#336699";pm.font="12px Arial, Helvetica, sans-serif";pm.paddingLeft=10;pm.paddingTop=2;pm.clearMenu();var strTarget="";var strArtistName=""+sp_artistName[cc][ps];var strAlbumName=""+sp_albumName[cc][ps];strArtistName=strArtistName.replace("%26","").replace("%2b%2b","%2b");strArtistName=strArtistName.replace("%2b","-");strArtistName=strArtistName.replace(" ","-");var songID=sp_songID[cc][ps];strTarget=getTargetString("CD");if(sp_thisPage.length>0)strTarget=strTarget+"-"+sp_thisPage;var strRS1,strRS2;if(sp_lang=="EN")
{strRS1="Get Ringtone";strRS2="Download on iTunes";}else
{strRS1="Comprar Tono";strRS2="Descárgalo de iTunes";}
var iTunesIcon;if(sp_lang=="EN")
{iTunesIcon="Download_on_iTunes_En.gif"}
else
{iTunesIcon="Download_on_iTunes_Sp.gif"}
if(iTunesUrl==""){iTunesUrl="http://www.apple.com/search/ipoditunes/?q="+strArtistName;}
pm.pushMenu(strRS2,iTunesUrl,true,"<img src='"+sp_imagePath+iTunesIcon+"'>");strTarget=getTargetString("ringtone");var strW=""+window.location;if(strW.indexOf('staging')>-1){strW='staging';}else{strW='';}
if(sp_artistURL[cc][ps]!="")
pm.pushMenu(strRS1,"http://"+strW+"www.batanga.com/"+sp_artistURL[cc][ps]+"/ringtones?songtitle="+sp_songName[cc][ps].substring(0,10).replace(/\s/g,"-"),false,"<img src='"+sp_imagePath+"thumbplay.gif' style='margin-top:10px'>");else
pm.pushMenu(strRS1,"http://radio.batanga.com/player/clicktobuy.aspx?playlistid=0&listenerDJID=0&target="+strTarget+"&ArtistName="+strArtistName+"&songid="+songID,false,"<img src='"+sp_imagePath+"thumbplay.gif' style='margin-top:10px'>");}
function getTargetString(s)
{if(sp_thisPage.length>0)s=s+"-"+sp_thisPage;return s;}
function sp_setMenuAlbum(pm,cc,ps)
{pm.width=220;pm.height=23;pm.itemColor="#F3F3F3";pm.itemSelect="#E5E5E5";pm.borderColor="#C0C0C0";pm.color="#336699";pm.font="12px Arial, Helvetica, sans-serif";pm.paddingLeft=10;pm.paddingTop=5;pm.clearMenu();var strTarget="";var strArtistName=""+sp_artistName[cc][ps];var strAlbumName=""+sp_albumName[cc][ps];strArtistName=strArtistName.replace("%26","").replace("%2b%2b","%2b");strArtistName=strArtistName.replace("%2b","+");strArtistName=strArtistName.replace(" ","+");var songID=sp_songID[cc][ps];strTarget=getTargetString("ringtone");var strRS1,strRS2;if(sp_lang=="EN")
{strRS1="Get Ringtone";strRS2="Buy Song from Amazon";}else
{strRS1="Comprar Tono"
strRS2="Comprar canción en Amazon";}
pm.pushMenu(strRS1,"http://radio.batanga.com/player/clicktobuy.aspx?playlistid=0&listenerDJID=0&target="+strTarget+"&ArtistName="+strArtistName+"&songid="+songID,true,"<img src='"+sp_imagePath+"thumbplay.gif'>");strTarget=getTargetString("CD");pm.pushMenu(strRS2,"http://radio.batanga.com/player/clicktobuy.aspx?playlistid=0&listenerDJID=0&target="+strTarget+"&ArtistName="+strArtistName+"&songid="+songID,true,"<img src='"+sp_imagePath+"amazon.png'>");}
function sp_realJsPicOut(x,y)
{if(sp_ACurrentPic[x]!=0)
{y=0;var cs=sp_APictures[x][sp_ACurrentPic[x]].className;sp_APictures[x][sp_ACurrentPic[x]].className=sp_APictures[x][y].className;sp_APictures[x][y].className=cs;sp_ACurrentPic[x]=y;}}
function sp_jsPicOut(x,y)
{if(!sp_isLoaded)return;sp_tto=setTimeout("sp_realJsPicOut("+x+","+y+");",200);}
function sp_jsPicIn(x,y)
{if(!sp_isLoaded)return;clearTimeout(sp_tto);if(y!=sp_ACurrentPic[x])
{if(sp_APictures[x][sp_ACurrentPic[x]])
{var cs=sp_APictures[x][sp_ACurrentPic[x]].className;sp_APictures[x][sp_ACurrentPic[x]].className=sp_APictures[x][y].className;sp_APictures[x][y].className=cs;sp_ACurrentPic[x]=y;}}}
function sp_jsOut(hidePop,img,i)
{if(!sp_isLoaded)return;var myImages=new Array('albumOFF.gif','albumON.gif','moreOFF.gif','moreON.gif','addOFF.gif','addON.gif','buyOFF.gif','buyON.gif');if(hidePop>0)DF_PopMenu.hidePopMenu();if((img)&&(i>=0)&&(i<myImages.length))
{img.src=sp_imagePath+myImages[i];}}
function sp_jsASong(m,cc,ps)
{if(!sp_isLoaded)return;if(CreateListBySongID)CreateListBySongID(sp_songID[cc][ps],sp_songName[cc][ps],sp_artistName[cc][ps],m);}
function sp_jsACD(m,cc)
{if(!sp_isLoaded)return;if(CreateListByAlbumID)CreateListByAlbumID(sp_albumID[cc][0],sp_albumName[cc][0],sp_artistName[cc][0],m);}
function sp_jsBuy(m,cc,ps,iTunesUrl)
{if(!sp_isLoaded)return;sp_setMenuBuy(DF_PopMenu,cc,ps,iTunesUrl);DF_PopMenu.showPopMenu((m.offsetLeft-(DF_PopMenu.width+22)+m.width),(m.offsetTop+m.height));}
function sp_jsMore(m,cc,ps)
{if(!sp_isLoaded)return;sp_setMenuMore(DF_PopMenu,cc,ps);DF_PopMenu.showPopMenu((m.offsetLeft-(DF_PopMenu.width+22)+m.width),(m.offsetTop+m.height));}
function sp_jsAlbum(m,cc,ps)
{if(!sp_isLoaded)return;sp_setMenuAlbum(DF_PopMenu,cc,ps);DF_PopMenu.showPopMenu((m.offsetLeft-(DF_PopMenu.width+22)+m.width),(m.offsetTop+m.height));}
function sp_jsPlayAll(cc)
{if(!sp_isLoaded)return;sp_ClearPlayAll();for(var i=0;i<sp_totalSongs[cc];i++)
{sp_APlaylist[i]="sp_jsPlay("+cc+","+i+",false);";}
sp_nowPlayAll();}
function sp_nowPlayAll()
{if(sp_APlaylist.length>0)
{var s=sp_APlaylist[0];sp_APlaylist.splice(0,1);setTimeout(s,10);}}
function sp_ClearPlayAll()
{while(sp_APlaylist.length>0)
{sp_APlaylist.splice(0,1);}}
function sp_jsPlay(cc,ps,clear)
{if(!sp_isLoaded)return;if((clear==null)||(clear==true)){sp_ClearPlayAll();}
var p=DF_ClipPlayer;var songLink="";var l=sp_songLength[cc][ps]
var so=0;if(l>=((2*60)+15)*1000)
{so=sp_startOn;}else if(l>=((1*60)+30)*1000)
{so=sp_startOn-30;if(so<=0)so=1;}else if(l>=((0*60)+45)*1000)
{so=sp_startOn-85;if(so<=0)so=1;}else
{so=1;}
if(DF_ClipPlayer.browser==0)
{songLink="http://wmod.batanga.com/radio/"+sp_songLink[cc][ps]+".wma";}else
{songLink="http://mp3od.batanga.com/mp3/"+sp_songLink[cc][ps]+".mp3";}
p.play(songLink,sp_jsUpdateBar,cc,ps,so);sp_changeBar(cc,ps,0,sp_stopAfter);if(sp_admentorID[cc]!=0)
{try{admentorPixelCounter(sp_admentorID[cc]);}catch(eAdmentor){};}}
var sp_ttoPA=0;function sp_reallyStop()
{sp_nowPlayAll();}
function sp_changeBar(cc,ps,pr,sc)
{if(pr==-1)
{clearTimeout(sp_ttoPA);sp_ttoPA=setTimeout("sp_reallyStop()",2500);}
var obj=document.getElementById('sp_dsh'+cc+'_'+ps);if(obj)
{var opacity=30;obj.style.position='absolute';var bwd=Math.round(sp_songWidth[cc]*pr);if(pr==-1){bwd=0;}else if(bwd<5)bwd=0;obj.style.width=bwd+"px";obj.style.height=sp_barHeight+"px";obj.style.opacity=(opacity/100);obj.style.MozOpacity=(opacity/100);obj.style.KhtmlOpacity=(opacity/100);obj.style.filter="alpha(opacity="+opacity+")";obj.style.margin="-3px";}
obj=document.getElementById('sp_bttn'+cc+'_'+ps);if(obj)
{sc=Math.round(sc);if(sc>=sp_stopAfter)
{sc=sp_stopAfter;obj.className='sp_btplay';}else
{if(obj.className=='sp_btplay')obj.className='sp_btpause';}
if(pr==0)obj.className='sp_btpause';if(sc==0){obj.className='sp_btplay';sc=sp_stopAfter;}
var ss='';ss=ss+sc;if(ss.length==1)ss="0"+ss;obj.innerHTML=":"+ss;}
if(pr==1){sp_ttop=setTimeout("sp_changeBar("+cc+","+ps+",-1,"+sp_stopAfter+");",1);}}
function sp_jsUpdateBar(cc,ps,pr,sc)
{sp_changeBar(cc,ps,pr,sc);}
function structurePopMenu(thisName,divName)
{var tto=0;this.width=0;this.height=0;this.itemColor='#F3F3F3';this.itemSelect='#E5E5E5';this.borderColor='#C0C0C0';this.paddingLeft=2;this.paddingTop=2;this.color='#000000';this.font='12px Arial, Helvetica, sans-serif';this.arrMenu=new Array()
this.arrLink=new Array()
this.arrNewWindow=new Array()
this.clearMenu=function()
{var aM=this.arrMenu;var aL=this.arrLink;var aN=this.arrNewWindow;aM.splice(0,aM.length);aL.splice(0,aL.length);aN.splice(0,aN.length);}
this.pushMenu=function(menu,link,nw,icon)
{var aM=this.arrMenu;var aL=this.arrLink;var aN=this.arrNewWindow;if((menu.length>0)&&(link.length))
{aM[aM.length]='<table border=0 cellpadding=0 width=100% cellspacing=0><tr><td>'+menu+'</td><td align=right>'+icon+'</td><td>&nbsp;</td></tr></table>';aL[aL.length]=link;aN[aN.length]=nw;}}
this.click=function(i)
{var aL=this.arrLink;var aN=this.arrNewWindow;if(i<aL.length)
{if(aN[i])
{window.open(aL[i]);}else
{document.location=aL[i];}}}
this.mouseOver=function(i)
{var obj=document.getElementById(thisName+'_item'+i);if(obj)
{obj.style.background=this.itemSelect;}}
this.mouseOut=function(i)
{var obj=document.getElementById(thisName+'_item'+i);if(obj)
{obj.style.background=this.itemColor;}}
this.mouseOverH=function()
{clearTimeout(tto);}
this.mouseOutH=function()
{tto=setTimeout(thisName+'.hideme()',100);}
this.hideme=function()
{var obj=document.getElementById(divName);if(obj)
{obj.innerHTML='';}}
this.buildDIVs=function()
{var strHTML='';var aM=this.arrMenu;var aL=this.arrLink;var strB='';strHTML+='<div style="font:'+this.font+'; color:'+this.color+'; border:solid 1px '+this.borderColor+'; margin:0px; width:'+(this.width+this.paddingLeft*2)+'px; height:'+((this.height+this.paddingTop)*aM.length+aM.length-1)+'px;" id="'+thisName+'_holder" onmouseover="'+thisName+'.mouseOverH();" onmouseout="'+thisName+'.hidePopMenu();" >';for(var i=0;i<aM.length;i++)
{if(i<aM.length-1)
{strB='border-bottom:dashed 1px '+this.borderColor+';';}else
{strB='';}
if((aM[i].length>0)&&(aL[i].length>0))
strHTML+='<div style="'+strB+' cursor:pointer; padding-left:'+this.paddingLeft+'px; padding-top:'+this.paddingTop+'px; background-color:'+this.itemColor+'; width:'+(this.width+this.paddingLeft)+'px; height:'+this.height+'px;" id="'+thisName+'_item'+i+'" onclick="'+thisName+'.click('+i+');" onmouseover="'+thisName+'.mouseOver('+i+');" onmouseout="'+thisName+'.mouseOut('+i+');" >'+aM[i]+'</div>';}
strHTML+='</div>';return strHTML;}
this.showPopMenu=function(x,y)
{var obj=document.getElementById(divName);if(obj)
{obj.innerHTML=this.buildDIVs();obj.style.position="absolute";obj.style.left=x+"px";obj.style.top=y+"px";obj.style.zIndex=1;}}
this.hidePopMenu=function()
{var aM=this.arrMenu;if(aM.length>0)this.mouseOutH();}
this.stayPopMenu=function()
{this.mouseOverH();}}
function admentorPixelCounter(bannerId)
{if(bannerId!=null){var img=document.createElement('img');img.id="pixelid"+bannerId;img.src="http://adserver.planetatv.com/admentor/adserve.asp?B="+bannerId+"&nocache="+Math.random();document.head.appendChild(img);}}
var songName="";var artistName="";var songID=0;var cdID=0;var albumName="";var addActive=0;var cacheData="";var resetList=false;var xmlObj2,xmlObj3,xmlObj4,xmlObj5,xmlObj6;var wsLocation=""+document.location;if(wsLocation.indexOf('localhost')>-1)
{wsLocation="http://localhost.batanga.com/Batanga_WebServices/myRadio.asmx";}else if(wsLocation.indexOf('staging')>-1)
{wsLocation="/Batanga_WebServices/myRadio.asmx";}else
{wsLocation="/Batanga_WebServices/myRadio.asmx";}
if(getCookie('batangauserid')!=null)
{DJIDlocal2=getCookie('batangauserid');}
else
{}
function findPos(obj){var curleft=curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft
curtop=obj.offsetTop
while(obj=obj.offsetParent){curleft+=obj.offsetLeft
curtop+=obj.offsetTop}}
return[curleft,curtop];}
function CreateListBySongID(SongID,SongName,Artist,objBase)
{if(IsUserLoggedIn())
{songID=SongID;songName=SongName.replace("|$|","'");artistName=Artist.replace("|$|","'");cdID=9;albumName="";if((cacheData=="")||resetList==true){GetMyPlaylists(3);}else{ShowAddSongWindow();}
var panelPos=getPosition(objBase,document.getElementById('RememberSong'));var panelLeft=panelPos[0];var panelTop=panelPos[1];OpenPanel('RememberSong',panelLeft,panelTop);}
else
{showLoginDialog();}}
function CreateListByAlbumID(CDID,AlbumName,Artist,objBase)
{if(IsUserLoggedIn())
{cdID=CDID;albumName=AlbumName.replace("|$|","'");artistName=Artist.replace("|$|","'");songID=0;songName="";if((cacheData=="")||resetList==true){GetMyPlaylists(3);}else{ShowAddSongWindow();}
var panelPos=getPosition(objBase,document.getElementById('RememberSong'));var panelLeft=panelPos[0];var panelTop=panelPos[1];OpenPanel('RememberSong',panelLeft,panelTop);}
else
{showLoginDialog();}}
function getPosition(objBase,objTarget)
{var objHeight=objBase.offsetHeight;var objWidth=objBase.offsetWidth;var objPos=findPos(objBase);var objLeft=objPos[0];var objTop=objPos[1];var targetWidth=290;var targetHeight=200;var posTop;var posLeft;posTop=objTop-targetHeight-10;posLeft=(objLeft+(objWidth/2))-(targetWidth/2);posLeft=posLeft-183;posTop=posTop+232;return[posLeft,posTop];}
function CheckPosition()
{if(thisMovieW("WMAPlayer").playState==3)
{var currentPos=thisMovieW("WMAPlayer").controls.currentPosition;if(currentPos-nOffSet>29)
{StopStreamW();}
else
{var cmd='CheckPosition();';setTimeout(cmd,1000);}}}
function GetMyPlaylists(target)
{targetPanel=target;xmlObj5=CreateAjaxObj();if(DJIDlocal2!=null&&DJIDlocal2!=0)
{xmlObj5.setRequestHeader("SOAPAction","http://webservices.batanga.com/MyRadio/GetMyPlayLists");xmlObj5.setRequestHeader("Content-Type","text/xml; charset=utf-8");xmlObj5.onreadystatechange=MyPlaylistsData;var soapText="<?xml version='1.0' encoding='utf-8'?>"
+"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
+"<soap:Body>"
+"<GetMyPlayLists xmlns='http://webservices.batanga.com/MyRadio'>"
+"<listenerDJID>"+DJIDlocal2+"</listenerDJID>"
+"<target>"+target+"</target>"
+"</GetMyPlayLists>"
+"</soap:Body>"
+"</soap:Envelope>";xmlObj5.send(soapText);}}
function CreatePlaylistBySongID(ListenerDJID,PlaylistName,SongID)
{xmlObj2=CreateAjaxObj();xmlObj2.setRequestHeader("SOAPAction","http://webservices.batanga.com/MyRadio/CreatePlaylistBySongID");xmlObj2.setRequestHeader("Content-Type","text/xml; charset=utf-8");xmlObj2.onreadystatechange=dummyFNData2;var soapText="<?xml version='1.0' encoding='utf-8'?>"
+"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
+"<soap:Body>"
+"<CreatePlaylistBySongID xmlns='http://webservices.batanga.com/MyRadio'>"
+"<ListenerDJID>"+ListenerDJID+"</ListenerDJID>"
+"<PlaylistName>"+PlaylistName+"</PlaylistName>"
+"<songID>"+SongID+"</songID>"
+"</CreatePlaylistBySongID>"
+"</soap:Body>"
+"</soap:Envelope>";xmlObj2.send(soapText);}
function CreatePlaylistByAlbumID(ListenerDJID,PlaylistName,AlbumID)
{xmlObj3=CreateAjaxObj();xmlObj3.setRequestHeader("SOAPAction","http://webservices.batanga.com/MyRadio/CreatePlaylistByAlbumID");xmlObj3.setRequestHeader("Content-Type","text/xml; charset=utf-8");xmlObj3.onreadystatechange=dummyFNData3;var soapText="<?xml version='1.0' encoding='utf-8'?>"
+"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
+"<soap:Body>"
+"<CreatePlaylistByAlbumID xmlns='http://webservices.batanga.com/MyRadio'>"
+"<ListenerDJID>"+ListenerDJID+"</ListenerDJID>"
+"<PlaylistName>"+PlaylistName+"</PlaylistName>"
+"<albumID>"+AlbumID+"</albumID>"
+"</CreatePlaylistByAlbumID>"
+"</soap:Body>"
+"</soap:Envelope>";xmlObj3.send(soapText);}
function InsertPlaylistItemBySongID(PlaylistIDs,SongID,RotationID)
{xmlObj4=CreateAjaxObj();xmlObj4.setRequestHeader("SOAPAction","http://webservices.batanga.com/MyRadio/InsertPlaylistItemBySongID");xmlObj4.setRequestHeader("Content-Type","text/xml; charset=utf-8");xmlObj4.onreadystatechange=dummyFNData4;var soapText="<?xml version='1.0' encoding='utf-8'?>"
+"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
+"<soap:Body>"
+"<InsertPlaylistItemBySongID xmlns='http://webservices.batanga.com/MyRadio'>"
+"<playlistIDs>"+PlaylistIDs+"</playlistIDs>"
+"<songID>"+SongID+"</songID>"
+"<RotationID>"+RotationID+"</RotationID>"
+"</InsertPlaylistItemBySongID>"
+"</soap:Body>"
+"</soap:Envelope>";xmlObj4.send(soapText);}
function InsertPlaylistItemByAlbumID(PlaylistIDs,AlbumID,RotationID)
{xmlObj6=CreateAjaxObj();xmlObj6.setRequestHeader("SOAPAction","http://webservices.batanga.com/MyRadio/InsertPlaylistItemByAlbumID");xmlObj6.setRequestHeader("Content-Type","text/xml; charset=utf-8");xmlObj6.onreadystatechange=dummyFNData6;var soapText="<?xml version='1.0' encoding='utf-8'?>"
+"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
+"<soap:Body>"
+"<InsertPlaylistItemByAlbumID xmlns='http://webservices.batanga.com/MyRadio'>"
+"<playlistIDs>"+PlaylistIDs+"</playlistIDs>"
+"<albumID>"+AlbumID+"</albumID>"
+"<RotationID>"+RotationID+"</RotationID>"
+"</InsertPlaylistItemByAlbumID>"
+"</soap:Body>"
+"</soap:Envelope>";xmlObj6.send(soapText);}
function dummyFNData2()
{if((xmlObj2!=null)&&(xmlObj2.readyState==4)&&(xmlObj2.status==200))
{xmlObj2=null;}}
function dummyFNData3()
{if((xmlObj3!=null)&&(xmlObj3.readyState==4)&&(xmlObj3.status==200))
{xmlObj3=null;}}
function dummyFNData4()
{if((xmlObj4!=null)&&(xmlObj4.readyState==4)&&(xmlObj4.status==200))
{xmlObj4=null;}}
function dummyFNData6()
{if((xmlObj6!=null)&&(xmlObj6.readyState==4)&&(xmlObj6.status==200))
{xmlObj6=null;}}
function OpenPanel(PanelName,PanelLeft,PanelTop)
{var PanelBox=document.getElementById(PanelName);var Pos=findPos(PanelBox);PanelBox.style.left=PanelLeft+'px';PanelBox.style.top=PanelTop+'px';var Pos=findPos(PanelBox);PanelBox.style.visibility="visible";PanelBox.style.display="";}
function ClosePanel(PanelName)
{var PanelBox=document.getElementById(PanelName);PanelBox.style.visibility="hidden";PanelBox.style.display="none";}
function MyPlaylistsData()
{var outputText;var p;if((xmlObj5!=null)&&(xmlObj5.readyState==1))
{if(targetPanel==1)
{var span_id=document.getElementById("InnerPanel");span_id.innerHTML='<label class="PrimaryLabel"> Loading Stations...</label>';}
if(targetPanel==3){var span_id=document.getElementById("AddtoMyStations");span_id.innerHTML='<label class="PrimaryLabel"> Loading Stations...</label>';}}
if((xmlObj5!=null)&&(xmlObj5.readyState==4)&&(xmlObj5.status==200))
{outputText=xmlObj5.responseText;p=outputText.indexOf('<GetMyPlayLists>');if(p>0){outputText=outputText.substr(p+14);outputText=outputText.substr(0,outputText.indexOf("</GetMyPlayLists>"));}
xmlObj5=null;if(targetPanel==1){var span_id=document.getElementById("InnerPanel");span_id.innerHTML=outputText;}
if(targetPanel==3){var span_id=document.getElementById("AddtoMyStations");span_id.innerHTML=outputText;cacheData=span_id.innerHTML;ShowAddSongWindow();resetList=false;}}}
function ShowAddSongWindow()
{addActive=0;if(cacheData!="")
{if(songID==0)
{if(getCookie("idioma")=='ES')
{document.getElementById("AddtoMyStations").innerHTML=cacheData.replace('Canción:','Álbum:').replace('canción y haz','álbum y haz');}else
{document.getElementById("AddtoMyStations").innerHTML=cacheData.replace('Song:','Album:').replace('like this song to be','like this album to be');}}else
{document.getElementById("AddtoMyStations").innerHTML=cacheData;}}
var obj;var Replace_Text=songName;if(songID==0)Replace_Text=albumName;var Replace_Text2=artistName;var btnText="";if(getCookie("idioma")=='ES'){btnText='Agregar';}else{btnText='Add Now';}
var Replace_Text3="<input type=\"button\" onclick=\"javascript:AddToMyPlaylist();\" value=\""+btnText+"\" id=\"btnAddSong\"/>";obj=document.getElementById("AddtoMyStations").getElementsByTagName("td");for(i=0;i<obj.length;i++)
{if(obj[i].innerHTML.match("#song#")){obj[i].innerHTML=obj[i].innerHTML.replace("#song#",Replace_Text);}
if(obj[i].innerHTML.match("#artist#")){obj[i].innerHTML=obj[i].innerHTML.replace("#artist#",Replace_Text2);}
if(obj[i].innerHTML.match("#okbutton#")){obj[i].innerHTML=obj[i].innerHTML.replace("#okbutton#",Replace_Text3);}}}
function AddToMyPlaylist()
{var strIDs="";var sid=0;formObj=document.getElementsByName("AddSongCB")
for(var i=0;i<formObj.length;i++)
{if(formObj[i].checked)
{sid=formObj[i].id;strIDs=strIDs+sid+",";}}
var txtNewPlaylistName=document.getElementById("txtNewMyStation").value;if(txtNewPlaylistName!=""&&txtNewPlaylistName!=null)
{if(songID>0)
{CreatePlaylistBySongID(DJIDlocal2,txtNewPlaylistName,songID);}else if(cdID>0)
{CreatePlaylistByAlbumID(DJIDlocal2,txtNewPlaylistName,cdID);}
resetList=true;ClosePanel('RememberSong');}
if(strIDs.length>0)
{if(songID>0)
{InsertPlaylistItemBySongID(strIDs,songID,1);}else if(cdID>0)
{InsertPlaylistItemByAlbumID(strIDs,cdID,1);}
ClosePanel('RememberSong');}else
{if(!resetList)alert('Error: Please select at least one station');}}
function CreateAjaxObj()
{var xmlObjLocal;if(window.ActiveXObject)
{mediaType=1;MyBrowser="IE";xmlObjLocal=new ActiveXObject("Microsoft.XMLHTTP");xmlObjLocal.open("POST",wsLocation,true);}
else if(window.XMLHttpRequest)
{mediaType=2;MyBrowser="nonIE";xmlObjLocal=new XMLHttpRequest();xmlObjLocal.overrideMimeType('text/xml');xmlObjLocal.open("POST",wsLocation,true);}
else
{alert('no idea what browser!');}
return xmlObjLocal;}