//sessvars.$.debug(); var ActivePortType =''; var PreLoadPageHTML = new Array(); var AjaxPagingStartCount = new Array(); var PreLoadElementContainer = new Array(); function send(id){ var xMax = screen.width, yMax = screen.height; var xOffset = (xMax - 300)/2, yOffset = (yMax - 200)/2; winRefIM = window.open('http://www.teenjoint.com/UJIM/send.asp?rid='+id+'','winRefIM','resizable=yes,height=300,width=400,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+''); } function CloseWin(){ window.open('http://www.teenjoint.com/UJIM/close.asp') } function resizeFrame(FrameName) { var the_height = document.getElementById(FrameName).contentWindow.document.body.scrollHeight; document.getElementById(FrameName).height = the_height; } function createRequestObject() { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } return xmlHttp; } var http = createRequestObject(); ; var response; // this function should be called for user input // it opens up a php page with a querystring of 'action' // this function could probably be adapted to POST function sndReq(action) { http.open("get", "ajax.php?action=" + action); http.onreadystatechange = handleResponse; http.send(null); } // the response in this case is formatted as follows: // object|text // where object is the id of the HTML element we are going to update // and text is what it will be updated to // this could obviously work a lot better with some XML // this function should be called for user input // it opens up the usercheck.asp page with a querystring of 'action' function loadFragmentInToElement(fragment_url, element_id) { try { var element = document.getElementById(element_id); var httpe = createRequestObject(); ; httpe.open("GET", fragment_url); httpe.onreadystatechange = function() { if (httpe.readyState == 4 && httpe.status == 200) { element.innerHTML = httpe.responseText; } } httpe.send(null); } catch (err) {} } function ShowNowPlayingTn() { loadFragmentInToElement('http://www.teenjoint.com/AjaxContent/AjaxNowplaying.asp', 'AjaxDisplayTn') setTimeout("ShowNowPlayingTn()",10000); } function ShowNowPlayingVideo() { loadFragmentInToElement('http://www.teenjoint.com/AjaxContent/AjaxNowplayingvideo.asp', 'AjaxDisplayVideo') setTimeout("ShowNowPlayingVideo()",5000); } function ShowNowPlayingAudio() { loadFragmentInToElement('http://www.teenjoint.com/AjaxContent/AjaxNowplayingaudio.asp', 'AjaxDisplayVideo') setTimeout("ShowNowPlayingAudio()",5000); } function ShowCyclingInfo(URL,element) { loadFragmentInToElement(URL.toString(), element.toString()) setTimeout( function() { ShowCyclingInfo(URL,element) },5000); } function GetRanNum(RandNum){ var rand_no = Math.random(); rand_no = rand_no * RandNum; rand_no = Math.ceil(rand_no); return rand_no; } function GetRandUrl() { var RandCount = GetRanNum(10); var URL; switch (RandCount) { case 1: URL = "http://www.photojointz.com" break; case 2: URL = "http://www.videojointz.com" break; case 3: URL = "http://www.clubjointz.com" break; case 4: URL = "http://www.musicjointz.com" break; case 5: URL = "http://www.filmjointz.com" break; case 6: URL = "http://www.partyjointz.com" break; case 7: URL = "http://www.teenjoint.com" break; case 8: URL = "http://www.talentjoint.com" break; case 9: URL = "http://www.blackpartycentral.com" break; case 10: URL = "http://www.teenjoint.com" break; } return URL; } function HandleResponseRefreshAdSpot(wDiv) { if(http.readyState == 4) { if (http.status == 200) { var Refreshresponse = http.responseText; document.getElementById(wDiv).innerHTML = Refreshresponse; } } } function RefreshAdSpot(wDiv) { http.open("get", "http://www.teenjoint.com/AjaxContent/AjaxTopnav_frame_ad.asp"); alert(GetRandUrl()+"/AjaxContent/AjaxTopnav_frame_ad.asp"); http.onreadystatechange = HandleResponseRefreshAdSpot(wDiv); http.send(null); setTimeout(function() { RefreshAdSpot(wDiv); } ,5000); } ////////////////////////////////////////////////////////////// function OpenThisWin(Width,Height,Url,WinName,loc){ var xMax = screen.width, yMax = screen.height; switch(loc){ case 'lt': xOffset = 0, yOffset = 0; self.resizeTo((screen.width-Width)-10,screen.height-30); self.moveTo(Width+10,0); break; case 'ct': xOffset = (xMax - Width)/2, yOffset = (yMax - Height)/2; break; case 'rt': xOffset = (xMax - Width), yOffset = 0; self.resizeTo((screen.width-Width)-10,screen.height-30); self.moveTo(0,0); break; } //var xOffset = (xMax - 300)/2, yOffset = (yMax - 200)/2; winRefIM = window.open(Url,WinName,'resizable=no,height='+Height+',width='+Width+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+''); } //////////// function handleResponseTrackViewers() { if(http.readyState == 4) { if (http.status == 200) { response = http.responseText; //document.getElementById('AjaxDisplayTn').innerHTML = response; } } } function TrackViewers(viewerid,profileid,action) { if (profileid!='' && viewerid!='' ) { http.open("get", "http://www.teenjoint.com/AjaxContent/AjaxTrackViewers.asp?action="+action+"&viewerid="+viewerid+"&profileid="+profileid); http.onreadystatechange = handleResponseTrackViewers; http.send(null); //alert(viewerid+' '+profileid+' '+action); } } var isIE = (navigator.appVersion.toLowerCase().indexOf('msie 6.0') != -1); function ShowArtistLayerOverHover(element){ if (isIE) { element.getElementsByTagName('a')[0].getElementsByTagName('span')[0].style.display = "inline"; } else { element.getElementsByTagName('a')[0].getElementsByTagName('img')[0].style.display = "inline"; } } function ShowArtistLayerOutHover(element){ if (isIE) { element.getElementsByTagName('a')[0].getElementsByTagName('span')[0].style.display = "none"; } else { element.getElementsByTagName('a')[0].getElementsByTagName('img')[0].style.display = "none"; } } function readCookie(name) { var cookieValue = ""; var search = name + "="; if(document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; cookieValue = unescape(document.cookie.substring(offset, end)) } } return cookieValue; } function writeCookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure ) { var cookie_string = name + "=" + escape ( value ); if ( exp_y ) { var expires = new Date ( exp_y, exp_m, exp_d ); cookie_string += "; expires=" + expires.toGMTString(); } if ( path ) cookie_string += "; path=" + escape ( path ); if ( domain ) cookie_string += "; domain=" + escape ( domain ); if ( secure ) cookie_string += "; secure"; document.cookie = cookie_string; } function showhidelogin(){ if ( readCookie('svAccess') != ''){ document.getElementById("shohidelogin").style.display = 'none'; } else { document.getElementById("shohidelogin").style.display = 'block'; } } function PostForm(where){ switch(where) { case 1: document.SearchForm.action='http://www.teenjoint.com/SearchPortResult.asp' break; case 2: document.SearchForm.action='http://www.teenjoint.com/UJforum/searchResult.asp' break; default: document.SearchForm.action='http://www.teenjoint.com/ArtistCommunity.asp' } } function OnDivScroll(AjaxUrl,element_id,height,SetPortType) { StoreSessionInfo (SetPortType); var el = document.getElementById(element_id); PreLoadPagingScrollHight = el.scrollHeight; if(el.scrollTop < el.scrollHeight - (height*2)){ return; } ActivePortType = SetPortType; var loading = document.getElementById(element_id + 'loadingDiv'); if(loading.style.display == '') { return; //already loading } loading.style.display = ''; LoadMoreElements(AjaxUrl,element_id,SetPortType); } function loadPagingInToElement(fragment_url, element_id,SetPortType) { //alert(fragment_url) try { var element = document.getElementById(element_id); var httpe = createRequestObject(); ; httpe.open("GET", fragment_url); httpe.onreadystatechange = function() { if (httpe.readyState == 4 && httpe.status == 200) { element.innerHTML += httpe.responseText ; PreLoadPageHTML[SetPortType] += httpe.responseText ; var x = element.getElementsByTagName("script"); for(var i=0;i 1){ MainBodHeight = Math.floor(MainBodHeight / thissplit) } if ( readCookie('svAccess') == ''){ MainBodHeight = MainBodHeight - 25; } thisHeight = MainBodHeight +'px'; document.getElementById(ediv).mouseWheelEnabled = false; document.getElementById(escroll).mouseWheelEnabled = false; setTimeout(function () { document.getElementById(ediv).style.height = thisHeight; document.getElementById(escroll).style.height = thisHeight;}, 1000); // document.getElementById(ediv).style.height = thisHeight // document.getElementById(escroll).style.height = thisHeight } function ClearEventCityButtons(buttonGroup){ var theButton = document.getElementsByName(buttonGroup); for(i=0;i< theButton.length;i++) { theButton[i].checked=false; } } function MakeShadowLinksVisible(ShadowboxLinkArray){ for (x in ShadowboxLinkArray) { if (document.getElementById(ShadowboxLinkArray[x])!= null) { document.getElementById(ShadowboxLinkArray[x]).style.visibility = "visible"; } } } var __isIE = navigator.appVersion.match(/MSIE/); var __userAgent = navigator.userAgent; var __isFireFox = __userAgent.match(/firefox/i); var __isFireFoxOld = __isFireFox && (__userAgent.match(/firefox\/2./i) || __userAgent.match(/firefox\/1./i)); var __isFireFoxNew = __isFireFox && !__isFireFoxOld; function __parseBorderWidth(width) { var res = 0; if (typeof(width) == "string" && width != null && width != "" ) { var p = width.indexOf("px"); if (p >= 0) { res = parseInt(width.substring(0, p)); } else { //do not know how to calculate other values (such as 0.5em or 0.1cm) correctly now //so just set the width to 1 pixel res = 1; } } return res; } //returns border width for some element function __getBorderWidth(element) { var res = new Object(); res.left = 0; res.top = 0; res.right = 0; res.bottom = 0; if (window.getComputedStyle) { //for Firefox var elStyle = window.getComputedStyle(element, null); res.left = parseInt(elStyle.borderLeftWidth.slice(0, -2)); res.top = parseInt(elStyle.borderTopWidth.slice(0, -2)); res.right = parseInt(elStyle.borderRightWidth.slice(0, -2)); res.bottom = parseInt(elStyle.borderBottomWidth.slice(0, -2)); } else { //for other browsers res.left = __parseBorderWidth(element.style.borderLeftWidth); res.top = __parseBorderWidth(element.style.borderTopWidth); res.right = __parseBorderWidth(element.style.borderRightWidth); res.bottom = __parseBorderWidth(element.style.borderBottomWidth); } return res; } //returns absolute position of some element within document function getAbsolutePos(element) { var res = new Object(); res.x = 0; res.y = 0; if (element !== null) { res.x = element.offsetLeft; res.y = element.offsetTop; var offsetParent = element.offsetParent; var parentNode = element.parentNode; var borderWidth = null; while (offsetParent != null) { res.x += offsetParent.offsetLeft; res.y += offsetParent.offsetTop; var parentTagName = offsetParent.tagName.toLowerCase(); if ((__isIE && parentTagName != "table") || (__isFireFoxNew && parentTagName == "td")) { borderWidth = __getBorderWidth(offsetParent); res.x += borderWidth.left; res.y += borderWidth.top; } if (offsetParent != document.body && offsetParent != document.documentElement) { res.x -= offsetParent.scrollLeft; res.y -= offsetParent.scrollTop; } //next lines are necessary to support FireFox problem with offsetParent if (!__isIE) { while (offsetParent != parentNode && parentNode !== null) { res.x -= parentNode.scrollLeft; res.y -= parentNode.scrollTop; if (__isFireFoxOld) { borderWidth = _getBorderWidth(parentNode); res.x += borderWidth.left; res.y += borderWidth.top; } parentNode = parentNode.parentNode; } } parentNode = offsetParent.parentNode; offsetParent = offsetParent.offsetParent; } } return res; } function getPosition(element){ var obj = document.getElementById(element); var pos = getAbsolutePos(obj); return [pos.x -6 , pos.y -6]; } function HtmlAlert(text) { document.getElementById('aportfolio').innerHTML = text + ' '; }