//<!--
function openVchatWindow(url, name, width, height, wincfg) {
	if(!wincfg) wincfg = 'resizable=yes, toolbar=no, scrollbars=no, personalbar=no, menubar=no, width='+width+', height='+height;
	var w = window.open(url,name,wincfg);
	w.focus();
}

function openPreviewVchat (path, performerName, performerID) {
  openVchatWindow(path+'/flash/preview_vchat.html?performerId=' + performerID + '&performerName=' + performerName, 'preview', 680, 383); 
}

function openViewerVchat (path,performerName,performerID,mode) {
  openVchatWindow(path+'/flash/vc_frameset.jsp?name='+performerName+'&id=' + performerID+'&mode='+mode, performerName+'Chat', 760, 460); 
  //window.open(path+'/flash/vc_frameset.jsp?name='+performerName+'&id=' + performerID+'&mode='+mode, performerName+'Chat', ''); 
}

function openPerformerVchat (path) {
  openVchatWindow(path+'/flash/performer_vchat.jsp', '', 760, 460); 
}

function setBan(pname) {
   var t = new Date();
   var d = new Date();
   t.setTime(d.getTime() + 1000*60*60);
   var strCookie = "";
   strCookie = escape(pname+"_ban") + "=on;"
   strCookie += "expires=" + t.toGMTString();
   document.cookie = strCookie;
}

function xmlhttpGet(strURL, elementId) {
	var xmlhttp = false;
  if (window.XMLHttpRequest) {
    xmlhttp = new XMLHttpRequest(); //Mozilla/Safari
  } else if (window.ActiveXObject) { //IE
		try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
	}
	if(!xmlhttp) return;
  xmlhttp.open('GET', strURL, true);
  xmlhttp.onreadystatechange = function() {
  	if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			var obj = getElementFromName(elementId);
			if(obj) obj.innerHTML= xmlhttp.responseText;
    }
  }
  xmlhttp.send(null);
}

function getElementFromName(nm){
  // IE5+, Mozilla, Opera
  if(document.getElementById) return document.getElementById(nm); 
  if(document.all) return eval('document.all.' + nm); // IE4
  if(document.layers){ // NN4
    var s='';
    for(var i=1; i<arguments.length; i++)
      s+='document.layers.'+arguments[i]+'.';
    return eval(s+'document.layers.'+nm);
  }
  return null;
}

//-->
