function send(id){
var xMax = screen.width, yMax = screen.height;
var xOffset = (xMax - 300)/2, yOffset = (yMax - 200)/2;
winRefIM = window.open('http://www.urbanjoint.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.urbanjoint.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.urbanjoint.com/include/nowplaying.asp', 'AjaxDisplayTn')
setTimeout("ShowNowPlayingTn()",10000);
}
function ShowNowPlayingVideo()
{
loadFragmentInToElement('http://www.urbanjoint.com/include/nowplayingvideo.asp', 'AjaxDisplayVideo')
setTimeout("ShowNowPlayingVideo()",5000);
}
function ShowNowPlayingAudio()
{
loadFragmentInToElement('http://www.urbanjoint.com/include/nowplayingaudio.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.urbanjoint.com/include/topnav_frame_ad.asp");
alert(GetRandUrl()+"/include/topnav_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.urbanjoint.com/include/TrackViewers.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 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.urbanjoint.com/SearchPortResult.asp'
break;
case 2:
document.SearchForm.action='http://www.urbanjoint.com/UJforum/searchResult.asp'
break;
default:
document.SearchForm.action='http://www.urbanjoint.com/ArtistCommunity.asp'
}
}
function OnDivScroll(AjaxUrl,element_id,height)
{
var el = document.getElementById(element_id);
if(el.scrollTop < el.scrollHeight - (height*2)){
return;
}
var loading = document.getElementById(element_id + 'loadingDiv');
if(loading.style.display == '')
return; //already loading
loading.style.display = '';
LoadMoreElements(AjaxUrl,element_id);
}
function loadPagingInToElement(fragment_url, element_id) {
//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 ; //+ fragment_url;
} else {
//alert (httpe.responseText)
}
}
httpe.send(null);
} catch (err) {}
}
function LoadMoreElements(AjaxUrl,element_id)
{
for(var i=1; i<=NumberOfNewEntrySets; i++) {
loadPagingInToElement(AjaxUrl + '&offset=' + AjaxPagingStartCount , element_id)
AjaxPagingStartCount = AjaxPagingStartCount + NumberOfNewEntrySets ;
setTimeout( function() { LoadCallback(element_id) },1000);
}
}
function LoadCallback(element_id)
{
var loading = document.getElementById(element_id + 'loadingDiv');
loading.style.display = 'none';
}
function iniPagingLoad(AjaxUrl,element_id,lcount)
{
for(var i=1; i<=lcount; i++) {
//alert(element_id)
loadPagingInToElement(AjaxUrl + '&offset=' + AjaxPagingStartCount , element_id)
AjaxPagingStartCount = AjaxPagingStartCount + NumberOfNewEntrySets ;
}
}
function toggleDiv(Element,LinkText) {
var ele = document.getElementById(Element);
var text = document.getElementById(LinkText);
if(ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "
";
}
else {
ele.style.display = "block";
text.innerHTML = "
";
}
}
function getWindowDem(HW) {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
if (HW=='H') {
return myHeight ;
}
if (HW=='W') {
return myWidth ;
}
}
function GetDocHeight(){
var d= document.documentElement;
var b= document.body;
var who= d.offsetHeight? d: b ;
return Math.max(who.scrollHeight,who.offsetHeight);
}
function MouseWheelAction(){
}
function ResizeScrollDiv(ediv,escroll,thissplit,buffer){
if (thissplit == 0) {
MainBodHeight = getWindowDem('H') - buffer;
} else {
MainBodHeight = GetDocHeight()- buffer ;
}
//alert (thissplit);
if (thissplit > 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;
}
}