/**********************************
 *Version:       1.0.0(2010-02-05)
**********************************/


function NewsDisplayForID(){
	
	function doNull( param ){
		return (param == null || param == undefined)? "": param;
	}
	
	this.download = function( arr ){
		
		if( arr == null ) return;
		
		var down_mmoar = arr;
		
		var str = '';
		
		str += '<a href="' + down_mmoar[0]['gurl']  + '"><img src="http://images.mmosite.com/news/images/2009v2/download.jpg" width="311" height="50" /></a>';
		
		document.write( str );
	}
	
		//help them
	this.helpThem = function( arr ){
		
		if( arr == null || arr.list.length == 0 )return;
		
		var answers = arr.list;     
		var answerscatalog = arr.catalog;

		var str = '';
		
		str += '		<table width="100%" border="0">';
		
		for( var i = 0; i < answers.length; i++ ){
        	str +=   '<tr>';
        	str +=    	'<td><a href="' + doNull(answers[i].aurl) + '" title="' + doNull(answers[i].title) + '">' + doNull(answers[i].title) + '</a></td>';
        	str +=      '<td><span>' + doNull(answers[i].score) + '</span></td>';
        	str +=   '</tr>';
		}
		
		str +=  '		</table>';

		document.write( str );
	}
	
	//MMOsiter Soapbox
	this.mmositerSoapbox = function( arr1,arr2 ){
		
		var str = '';
		str += '	<table class="fix">';
		
		if( arr1 != null ){
			var forum = arr1;
			for( var i = 0; i < forum.length; i++ ){
				str += '  <tr>';
				str += '<td class="td1">';
				str += '<a href="' + forum[i]['url'] + '" title="' + forum[i]['title'] + '">' + forum[i]['title'] + '</a><br />';
				str += 'Posted ' + forum[i]['date'] + ' by <a href="' + forum[i]['author_url'] + '" class="c1">' + forum[i]['author_nickname'] + '</a><br /> ';
				str += '<span class="c1">' + forum[i]['reply'] + ' Comments</span></td>';
				str += '<td class="td2"><a href="' + forum[i]['author_url'] + '"><img src="' + forum[i]['author_avatar'] + '" width="64" height="64"/></a></td>';
				str += ' </tr>';
			}
		}
		
		if( arr2 != null ){
			var blog = arr2;
			for( var i = 0; i < blog.length; i++ ){
				
				str += '  <tr>';
				str += '<td class="td1">';
				str += '<a href="' + blog[i]['article_url'] + '" title="' + blog[i]['subject'] + '">' + blog[i]['subject'] + '</a><br />';
				str += 'Posted ' + blog[i]['postdate'] + ' by <a href="' + blog[i]['author_url']  + '" class="c1">' + blog[i]['author'] + '</a><br /> ';
				str += '<span class="c1">' + blog[i]['comment_num'] + ' Comments</span></td>';
				str += '<td class="td2"><a href="' + blog[i]['author_url'] + '"><img src="' + blog[i]['author_img'] + '" width="64" height="64"/></a></td>';
				str += '</tr>';
			}
		}
		
		str += '</table>';
		
		document.write( str );
	}
	
	//Video
	this.video = function( arr ){
		
		if( arr == null || arr.length == 0 ) return;
		
		var video_mmoar = arr;
		
		var str = '';

		str += '<table class="fix">';
		
		for( var i = 0; i < video_mmoar.length; i++ ){
        	str += '	<tr>';
        	str += '		<td><a href="' + video_mmoar[i]['url'] + '" title="' + video_mmoar[i]['title'] + '">' + video_mmoar[i]['title'] + '</a><br />';
        	str += '            ' + video_mmoar[i]['time'] + '</td>';
        	str += '        <td class="videophoto"><a href="' + video_mmoar[i]['url'] + '" title="Play"> <span></span><img src="' + video_mmoar[i]['picture'] + '" width="60" height="45"/></a></td>';
        	str += '    </tr>';
		}
        
		str += '      </table>';

		
		document.write( str );
	}
}

var dis_o = new NewsDisplayForID();

//Show Big Picture
function UE_Pic(){	
	function $ID( id ){ return document.getElementById( id ); }
	function showPic( pPic ){
		$ID( "ue_pic" ).innerHTML = '<img src="' + pPic + '" onclick="document.getElementById(\'ue_pic\').style.display=\'none\'" title="close" />';
		$ID( "ue_pic" ).style.display = "block";
	}
	
	function doDiv(){
		var str = '';
		
		str += '<style type="text/css">';
		str += '.ue_pic {left:50%;margin-left:-501px;max-width:1000px;position:fixed;_position:absolute;text-align:center;top:5%;width:1002px;z-index:1000;}';
		str += '.ue_pic img {background-color:#FFFFFF;border:1px solid #CCCCCC;cursor:pointer;max-width:1000px;padding:5px;}';
		str += 'a.zoom {position:relative;}';
		str += 'a.zoom span {display:none;}';
		str += 'a.zoom:hover span {display:block;}';
		str += 'a.zoom img {max-width:590px;_width:expression(this.width > 560 ? 560: true);}';
		str += '.tozoom {background:transparent url(http://images.mmosite.com/news/images/2009v2/fullsizes.png) no-repeat scroll 0 0;cursor:pointer;display:block;height:58px;position:absolute;bottom:15px;*bottom:15px; left:80%; width:57px;text-indent:-1000em;}';
		str += '</style>';
		
		str += '<div id="ue_pic" class="ue_pic"></div>';
		
		document.write( str );
	}
	
	this.doPic = function( pPic ){
		if( pPic == null ) return;
		showPic( pPic );
	}
	
	this.init = function(){
		doDiv();
	}

}
var ue_pic = new UE_Pic(); 
ue_pic.init();

