iFrame=false;miniPanel=false;miniPanelBg=false;featuredMiniPanel=false;selectedMiniPanel=false;selectedMiniPlayer=false;miniIdHolder=false;commentText=false;htmlCommentText=false;signInPanel=false;function selectMini(invId){loggedOut='parent.requestLogin();';loggedIn='parent.openSettings('+invId+');';loadSignInFrame('/signinverify.aspx'+'?loggedOut='+loggedOut+'&loggedIn='+loggedIn+'&registered='+loggedIn+'&showsignin=True'+'&rand='+Math.random()*9999999);}function galleryLogin(){loggedOut='parent.requestLogin();';loggedIn='parent.openGallery()';loadSignInFrame('/signinverify.aspx'+'?loggedOut='+loggedOut+'&loggedIn='+loggedIn+'&registered='+loggedIn+'&showsignin=True'+'&rand='+Math.random()*9999999);}function requestLogin(){closeMiniPanel();openHovPanel('x-hovpanel-signinjoin');document.getElementById('x-signinframe').focus();}function verifyCredits(invId){if(!signInPanel){signInPanel=document.getElementById('x-hovpanel-signinjoin');}if(signInPanel.style.display=='block'){closeHovPanel('x-hovpanel-signinjoin');}editMiniPanel('/CreditsVerifyPage.aspx?inventoryId='+invId+'&random='+Math.random());}function openGallery(){if(!signInPanel){signInPanel=document.getElementById('x-hovpanel-signinjoin');}if(signInPanel.style.display=='block'){closeHovPanel('x-hovpanel-signinjoin');}openMiniPanel('/MinisGalleryPage.aspx?mode=gallery&rand='+Math.random()*9999999,320);}function openSettings(invId){if(!signInPanel){signInPanel=document.getElementById('x-hovpanel-signinjoin');}if(signInPanel.style.display=='block'){closeHovPanel('x-hovpanel-signinjoin');}openMiniPanel('/MinisGalleryPage.aspx?miniId='+invId+'&mode=settings&rand='+Math.random()*9999999,320);}function openExpansion(activeMiniId){openMiniPanel('/MinisExpansionPage.aspx?activeMiniId='+activeMiniId+'&rand='+Math.random()*9999999,320);}function requestPurchase(purchasePage,returnUrl,invId){open(purchasePage);}miniId=-1;miniCredits=0;function confirmSelection(name,invId,previewUrl,expression,credits){chooseMini(name,previewUrl,expression,credits);tagId='selected-mini-id';if(!miniIdHolder){miniIdHolder=document.getElementById(tagId);}miniIdHolder.value=invId;miniId=invId;miniCredits=credits}function cancelSelection(){resetMini();tagId='selected-mini-id';if(!miniIdHolder){miniIdHolder=document.getElementById(tagId);}miniIdHolder.value=-1}function editMiniPanel(url,height){if(!iFrame){iFrame=document.getElementById('x-miniframe');}iFrame.src=url;loadHovPanel();}function openMiniPanel(url,height){editMiniPanel(url,height);openHovPanel('x-hovpanel-chooseminis');}function closeMiniPanel(){closeHovPanel('x-hovpanel-chooseminis');}function editCommentMini(url){assignFlash('x-commentmini',url,120,120);loadHovPanel();}function openCommentMini(url){editCommentMini(url);openHovPanel('x-hovpanel-commentmini');}function getCurrentYPos(){if(document.body&&document.body.scrollTop){return document.body.scrollTop}if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}if(window.pageYOffset){return window.pageYOffset}return 0}function assignMini(tagId,invId){assignFlash(tagId,'http://s.xanga.com/minis/flash/'+invId+'.swf',40,40,'middle');}function appendFlash(tagId,src){var swf='&nbsp;';if(src!=''){swf='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" '+'id="flashObject">'+'<param name="allowScriptAccess" value="always" />'+'<param name="movie" value="'+src+'" '+'<param name="quality" value="high" />'+'<param name="wmode" value="transparent"/>	'+'<embed src="'+src+'" '+'wmode="transparent" '+'quality="high" '+'name="minigift" '+'allowScriptAccess="always"'+'type="application/x-shockwave-flash" '+'pluginspage="http://www.macromedia.com/go/getflashplayer" />'+'</object>'}var siblings=document.getElementById(tagId).innerHTML;document.getElementById(tagId).innerHTML=swf+siblings}function assignFlash(tagId,src,height,width){assignFlash(tagId,src,height,width,'middle');}function assignFlash(tagId,src,height,width,align){var swf='&nbsp;';if(src!=''){if(isMacXFF()){swf='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" '+'height="'+height+'" width="'+width+'" '+'id="flashObject" '+'align="'+align+'">'+'<param name="allowScriptAccess" value="always" />'+'<param name="allowFullScreen" value="false" />'+'<param name="movie" value="'+src+'" '+'<param name="quality" value="high" />'+'<param name="bgcolor" value="#ffffff" />'+'<embed src="'+src+'" '+'quality="high" '+'bgcolor="#ffffff" '+'height="'+height+'" '+'width="'+width+'" '+'name="minigift" '+'align="'+align+'" '+'allowScriptAccess="always"'+'allowFullScreen="false" '+'type="application/x-shockwave-flash" '+'pluginspage="http://www.macromedia.com/go/getflashplayer" />'+'</object>'}else{swf='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" '+'height="'+height+'" width="'+width+'" '+'id="flashObject" '+'align="'+align+'">'+'<param name="allowScriptAccess" value="always" />'+'<param name="allowFullScreen" value="false" />'+'<param name="movie" value="'+src+'" '+'<param name="quality" value="high" />'+'<param name="bgcolor" value="#000000" />'+'<param name="wmode" value="transparent"/>'+'<embed src="'+src+'" '+'wmode="transparent" '+'quality="high" '+'bgcolor="#000000" '+'height="'+height+'" '+'width="'+width+'" '+'name="minigift" '+'align="'+align+'" '+'allowScriptAccess="always"'+'allowFullScreen="false" '+'type="application/x-shockwave-flash" '+'pluginspage="http://www.macromedia.com/go/getflashplayer" />'+'</object>'}}document.getElementById(tagId).innerHTML=swf}function assignCredits(tagId,cost){var selectedPrice=document.getElementById(tagId);selectedPrice.firstChild.nodeValue=cost+" credits"}function assignDescription(nameTagId,name,costTagId,cost){var selectedName=document.getElementById(nameTagId);selectedName.firstChild.nodeValue=name;var selectedCost=document.getElementById(costTagId);selectedCost.firstChild.nodeValue=cost}function verifyComment(){if(!commentText){commentText=document.getElementById('bdescr');}if(!htmlCommentText){htmlCommentText=document.getElementById('htmleditor');}if(!miniIdHolder){miniIdHolder=document.getElementById('x_mini_id_holder');}if(miniIdHolder.value!=-1){var text;if(htmlCommentText!=null){text=htmlCommentText.contentWindow.document.body.innerHTML;text=text.replace('<P>','');text=text.replace('&nbsp;','');text=text.replace('</P>','');if(text==''){alert('You must post a comment to leave a mini. :)');}}else if(commentText!=null&&commentText.value==''){alert('You must post a comment to leave a mini. ^_^');}}}function isMacXFF(){var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf('mac')!=-1&&userAgent.indexOf('firefox')!=-1){return true}else{return false}}function repairFlash(){var mini_spans=document.getElementById('maincontent')!=null?document.getElementById('maincontent').getElementsByTagName('SPAN'):document.getElementsByTagName('SPAN');mini_bgs=new Array();for(i=0;i<mini_spans.length;i++){if(mini_spans[i].className.search('mini-bg')!=-1){mini_bgs.push(mini_spans[i]);}}for(j=0;j<mini_bgs.length;j++){mini_bgs[j].style.backgroundColor='#ddd';mini_bgs[j].style.border='2px solid #ddd';mini_bgs[j].style.MozOpacity=1}if(!hovPanelBg){hovPanelBg=document.getElementById('x-hovpanel-bg');}hovPanelBg.style.backgroundColor='#000';hovPanelBg.style.border='2px solid #000';hovPanelBg.style.MozOpacity=1}