All pastes #458571 Raw Edit

Unnamed

public javascript v1 · immutable
#458571 ·published 2007-04-25 23:23 UTC
rendered paste body
function getHTTPObject() {  //create an httpobject and returns it	var xmlhttp;	/*@cc_on	@if (@_jscript_version >= 5)	try {	  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");	  } catch (e) {	  try {		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");		} catch (E) {		xmlhttp = false;		}	  }	@else	xmlhttp = false;	@end @*/	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {	try {	  xmlhttp = new XMLHttpRequest();	  } catch (e) {	  xmlhttp = false;	  }	}	return xmlhttp;}function gbet_show(started,visible) {	var http_get = getHTTPObject();	function h_show() {		if (http_get.readyState == 4) {			var results = http_get.responseText;			var html = '';			var items = new Array();			//alert(results);			eval(results);			for (i=0;i<items.length;i++)					html += items[i].getHtml();			document.getElementById("imatch_" + started + "_content").innerHTML = html;			document.body.style.cursor = 'default';		}	}					if (visible) {		show_item("imatch_" + started + "_content");		document.getElementById("imatch_" + started + "_content").innerHTML = '<div class="bluecell drow">Loading...</div>';		document.getElementById("imatch_" + started + "_arrow").innerHTML = carrow[visible];		document.body.style.cursor = 'wait';		http_get.open("POST", "./inc/ajax/gosubet.php", true);		http_get.onreadystatechange = h_show;		http_get.setRequestHeader("Content-type", "application/x-www-form-urlencoded");		http_get.send("started="+started+"&gamesection="+gamesection);	}	else {		hide_item("imatch_" + started + "_content");		document.getElementById("imatch_" + started + "_arrow").innerHTML = carrow[visible];	}	window['show_'+started] = (visible)?0:1;	}function show_newsportal(visible) {	var http = getHTTPObject();	function h_show() {		if (http.readyState == 4) {			var results = http.responseText;			var html = '';			var items = new Array();			//alert(results);			eval(results);			for (i=0;i<items.length;i++)					html += items[i].getHtml();			document.getElementById("inewsportal_content").innerHTML = html;			document.body.style.cursor = 'default';		}	}		if (visible) {		show_item("inewsportal_content");		document.getElementById("inewsportal_content").innerHTML = '<div class="g300_middle rdrow">Loading...</div>';		document.getElementById("inewsportal_arrow").innerHTML = carrow[visible];		document.body.style.cursor = 'wait';		http.open("POST", "./inc/ajax/newsportal.php", true);		http.onreadystatechange = h_show;		http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");		http.send(null);	}	else {		hide_item("inewsportal_content");		document.getElementById("inewsportal_arrow").innerHTML = carrow[visible];	}	window['show_np'] = (visible)?0:1;	}function Bet(id, lbl, hint, t){ this.id = id; this.lbl = lbl; this.hint = hint; this.t = t;  this.getHtml = function(){	var html = '';	html += '<div class="bluecell drow" title="' + this.hint + '" onclick="location.replace(\'./match/' + this.id + '\');" ';	html += 'onmouseover=\'this.className = "bluecell_hover drow";\' ';	html += 'onmouseout=\'this.className = "bluecell drow";\'';	html += '>';	html += '	<div class = "container">';	html += '	<span class = "left-element">';	html += 		this.lbl;	html += '	</span>';	html += '	<span class = "right-element">';	html += 		this.t;	html += '	</span>';	html += '	</div>';	html += '</div>';		return html; }} function Match(id, p1, status, p2, live){ this.id = id; this.p1 = p1; this.status = status; this.p2 = p2; this.live = live;  this.getHtml = function(){	var html = '';	html += '<div class="bluecell drow" onclick="location.replace(\'./match/' + this.id + '\');" ';	html += 'onmouseover=\'this.className = "bluecell_hover drow";\' ';	html += 'onmouseout=\'this.className = "bluecell drow";\'';	html += '>';	html += '	<div class = "container">';	html += '		<div style="float:left;width:60">' + this.p1 + '</div>';	html += '		<div style="float:left;width:20">' + this.status + '</div>';	html += '		<div style="float:left;width:60">' + this.p2 + '</div>';	html += '	</div>';	if (this.live) {		html += '<div class = "container rowlive">';		html += this.live;		html += '</div>';	}	html += '</div>';		return html; }} function Newsportal(id, title, url, desc, author){ this.id = id; this.title = title; this.url = url; this.desc = desc; this.author = author;  this.getHtml = function(){	var html = '';	html += '<div class="g300_middle rdrow" onclick="location.replace(\'./news_portal.php?id=' + this.id + '\');" ';	html += 'onmouseover=\'this.className = "g300_middle_hover rdrow";\' ';	html += 'onmouseout=\'this.className = "g300_middle rdrow";\'';	html += '>';	html += '	<div class = "rdcell">';	html += '		<div><b><a href="' + this.url + '">' + this.title + '</a></b></div>';	html += '		<div><small>' + this.desc + '</small></div>';	html += '	</div>';	html += '</div>';		return html; }}