var ord=Math.floor(Math.random()*9999);var tile=1;function $(){var results=[],element;for(var i=0;i<arguments.length;i++){element=arguments[i];if(typeof element=='string')
element=document.getElementById(element);results.push(element);}
return results.length<2?results[0]:results;}
function observeEvent(element,name,observer,useCapture){var element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.attachEvent))
name='keydown';if(element.addEventListener){element.addEventListener(name,observer,useCapture);}else if(element.attachEvent){element.attachEvent('on'+name,observer);}}
function ChangeClass(elements,cssClass)
{if(elements==null)
return;if(elements.length!=0)
{for(var i=0;i<elements.length;i++)
{elements[i].className=cssClass;}}}
function GetElementsByName(tag,name){var elements=document.getElementsByTagName(tag);var elementList=new Array();var lstIndex=0;for(i=0;i<elements.length;i++)
{elementName=elements[i].getAttribute("name");if(elementName==name)
{elementList[lstIndex]=elements[i];lstIndex++;}}
return elementList;}
function toggleSettings(divId){var panel=$(divId);if(panel.style.display=="none")
{panel.style.display="block";}
else
{panel.style.display="none";}}
function sendPageViewTag(pageID,categoryID)
{cmSetProduction();cmCreatePageviewTag(pageID,categoryID,null);var http_request=false;if(window.XMLHttpRequest)
{http_request=new XMLHttpRequest();if(http_request.overrideMimeType)
{http_request.overrideMimeType('text/xml');}}
else if(window.ActiveXObject)
{try
{http_request=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{http_request=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{}}}
if(!http_request)
{alert('Giving up :( Cannot create an XMLHTTP instance');return false;}}
function openCheetahGirlsPopup(srcURL)
{var width=470;var height=420;var left=(screen.width-width)/2;var top=(screen.height-height)/2;var popURL=srcURL;window.open(popURL,'','scrollbars=no,height='+height+',width='+width+',left='+left+',top='+top+',resizable=no,status=no');}
function openHouseBunnyPopup(srcURL)
{var width=480;var height=360;var left=(screen.width-width)/2;var top=(screen.height-height)/2;var popURL="http://www.weeworld.com/"+srcURL;window.open(popURL,'','scrollbars=no,height='+height+',width='+width+',left='+left+',top='+top+',resizable=no,status=no');}
function showBeeMoviePopup(srcURL)
{var width=744;var height=354;var left=(screen.width-width)/2;var top=(screen.height-height)/2;var popURL="http://www.weeworld.com/"+srcURL;window.open(popURL,'','scrollbars=no,height='+height+',width='+width+',left='+left+',top='+top+',resizable=no,status=no');}
function openPromoPayoffPopup(srcURL){var width=400;var widthParam="popupWidth=";try{if(srcURL.indexOf(widthParam)>-1){width=srcURL.substring(srcURL.indexOf(widthParam)+widthParam.length,srcURL.indexOf(widthParam)+widthParam.length+3);}}
catch(e){}
var height=400;var heightParam="popupHeight=";try{if(srcURL.indexOf(heightParam)>-1){height=srcURL.substring(srcURL.indexOf(heightParam)+heightParam.length,srcURL.indexOf(heightParam)+heightParam.length+3);}}
catch(e){}
var left=(screen.width-width)/2;var top=(screen.height-height)/2;var rootURL="http://www.weeworld.com/";if(rootURL.length==0)rootURL="http://www.weeworld.com/"
var popURL=rootURL+srcURL;var windowArgs='scrollbars=no,height='+height+',width='+width+',left='+left+',top='+top+',resizable=no,status=no';window.open(popURL,'',windowArgs);}
function openFeedbackPopup(username,email)
{if(username==null)
username='';if(email==null)
email='';window.open("http://www.weeworld.com/popups/feedback.aspx?username="+username+"&email="+email,'','scrollbars=no,height=400,width=303,resizable=no,status=yes');}
function openReportAbusePopup(currentURL)
{if(currentURL==null)
{currentURL='';}
window.open("http://www.weeworld.com/popups/reportAbuse.aspx?currentURL="+currentURL,'','scrollbars=no,height=480,width=302,resizable=no,status=yes');}
function openSafetyAdvicePopup()
{window.open("http://www.weeworld.com/popups/safetyAdvice.aspx",'','scrollbars=yes,height=610,width=425,resizable=no,status=yes');}
var pointsWhatsThis=false;function openPointsWhatsThisPopup()
{if(pointsWhatsThis==false)
{window.open("http://www.weeworld.com/popups/pointsWhatsThis.aspx",'','scrollbars=yes,height=640,width=435,resizable=no,status=yes');pointsWhatsThis=true;}}
function openPointsWhatsThisPopup_Closed()
{window.opener.pointsWhatsThis=false;}
function openTermsAndConditions()
{window.open("http://www.weeworld.com/tsandcs/default.aspx",'','scrollbars=yes,height=600,width=800,resizable=yes,status=yes');}
function goToUrl(url)
{document.location.href=url;}
function raiseEarningEvent(eventName)
{try
{WeeWorldAjax.UserNotifications.RaiseEarningEvent(eventName);}
catch(e)
{}}
function UpdateUsersNotifications(addSurfingAction){try{if(AllowPointsUpdate)
{WeeWorldAjax.UserNotifications.GetActionNotifier(addSurfingAction,UpdateUsersNotifications_AJAXCallBack);}}
catch(e){}}
function UpdateUsersNotifications_AJAXCallBack(res){if(res.error==null&&res.value!=null){var userNotifications=res.value;if(!(typeof(flashProxy)=="undefined")){passPointsBalanceToFlash(userNotifications[0],userNotifications[1]);}
UpdateUserStatusSwf(userNotifications);if(notificationVisible)
{var lastIndex=dropDownNotifications.length-1;for(var i=0;i<=userNotifications[7].length-1;i++)
{lastIndex++;dropDownNotifications[lastIndex]=userNotifications[7][i];ShowNotification(dropDownNotifications[currentNotificationPage]);return;}}
else
{dropDownNotifications=userNotifications[7];currentNotificationPage=0;if(dropDownNotifications.length>0)
{ShowNotification(dropDownNotifications[0]);}}}}
var AllowPointsUpdate=true;var dropDownNotifications;var fireAlertConversionEvents=true;var currentNotificationPage=0;function achPrevious(){if(currentNotificationPage>0){currentNotificationPage--;ShowNotification(dropDownNotifications[currentNotificationPage]);fireAlertConversionEvents=true;}}
function achNext(){if(currentNotificationPage<dropDownNotifications.length-1){currentNotificationPage++;ShowNotification(dropDownNotifications[currentNotificationPage]);$('levelcontainer').style.height='auto';fireAlertConversionEvents=true;}}
var notificationVisible=false;function ShowNotification(notification)
{if(notificationVisible==false)
{var expand=function(){ExpandDiv('levelcontainer',0);};notificationVisible=true;fireAlertConversionEvents=true;setTimeout(expand,1000);}
if(notification[0]!="")
{LoadAlertCSS(notification[0]);}
$('achDropDynamic').innerHTML=notification[1];if($('achdropnav')!=null)
{if(dropDownNotifications.length>1)
{$('achdropnav').style.display='block';$('achdroppagenum').innerHTML=(currentNotificationPage+1)+' of '+dropDownNotifications.length;}
else
{$('achdropnav').style.display='none';}}
if($('marketingAlertDiv')!=null&&fireAlertConversionEvents)
{ParseScriptTag($('marketingAlertDiv'));try
{RaiseMarketingConversion();fireAlertConversionEvents=false;}
catch(e)
{}}}
function CloseAchievementNotifcation()
{$('levelcontainer').style.display='none';notificationVisible=false;}
function LoadAlertCSS(cssFilePath)
{var filename=cssFilePath;var fileref=document.createElement("link");fileref.setAttribute("rel","stylesheet");fileref.setAttribute("type","text/css");fileref.setAttribute("href",filename);if(typeof fileref!="undefined")
document.getElementsByTagName("head")[0].appendChild(fileref);}
function ExpandDiv(objectName,size)
{var item=document.getElementById(objectName);var expandSize=0;if(item.style.display=='none'||item.style.display=='')
{item.style.height='0px';item.style.display='block';}
expandSize=$('achDropContent').offsetHeight;var currentHeight;if(parseInt(item.style.height))
{currentHeight=parseInt(item.style.height);}
else
{currentHeight=0;}
if(currentHeight<expandSize)
{currentHeight+=10;item.style.height=currentHeight+'px';var ExpandDiv2=function(){ExpandDiv(item.id,expandSize);};window.setTimeout(ExpandDiv2,1);}
else if(currentHeight>=expandSize/2&&item.childNodes!=null)
{item.style.height=$('achDropContent').offsetHeight+'px';for(var i=0;i<item.childNodes.length;++i)
{if(item.childNodes[i].style.display=='')
{item.childNodes[i].style.display='block';}}}}
var userStatsObject;var userStatsLoaded=false;function LoadUserStatusArea(rootURL,jsonString){if(!userStatsLoaded)
{document.getElementById('user-status-area-swf').innerHTML='<p><strong>You need to upgrade your Flash Player</strong>Download the latest Flashplayer for free <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">HERE</a>!</p>';userStatsLoaded=true;userStatsObject=new SWFObject(rootURL+"flash/achievements/achievementsPanel.swf","userStats_swf","300","45","7","#FFFFFF");userStatsObject.addParam("allowScriptAccess","always");userStatsObject.addVariable("data",jsonString);userStatsObject.addVariable("vars","data");userStatsObject.write("user-status-area-swf");window.userStats_swf=document.forms[0].userStats_swf;}}
function GetUserStatusAreaSwf()
{return $('userStats_swf');}
function UpdateUserStatusSwf(statusData)
{var userStatusArea=GetUserStatusAreaSwf();userStatusArea.ext_UpdateUserStatusArea(statusData);}
function ShowGetPointsAsPopup(flag)
{var userStatusArea=GetUserStatusAreaSwf();userStatusArea.ext_UpdateInBuilderStatus(flag);}
function showPrivateTV()
{cmCreateConversionEventTag("OPEN PRIVATE TV","2","WEEROOM - MINE","0");window.open("http://www.teen.com/showcase/private/weeworld/index.vm","teenmovie","scrollbars=0,menubar=0,status=0,toolbar=0,width=749,height=445,resizable=0");raiseEarningEvent('JSPRIVATETV');}
function openPopup(popupUrl,eventName)
{if(eventName!=null)
{raiseEarningEvent(eventName);}
window.open(popupUrl,'','scrollbars=yes,height=600,width=800,resizable=yes,status=yes');}
function ParseScriptTag(divElement)
{var e=divElement.getElementsByTagName("script");var script=document.createElement("script");var head=document.getElementsByTagName("head")[0];script.type="text/javascript";script.text=e[0].text;head.insertBefore(script,head.firstChild);head.removeChild(script);}