onerror=function (){return true;}
function drawImage(ImgD,maxWidth,maxHeight){
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= maxWidth/maxHeight){
     if(image.width>maxWidth){  
     ImgD.width=maxWidth;
     ImgD.height=(image.height*maxWidth)/image.width;
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     //ImgD.alt=ImgD.width+"�"+ImgD.height;
     }
    else{
     if(image.height>maxHeight){  
     ImgD.height=maxHeight;
     ImgD.width=(image.width*maxHeight)/image.height;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     //ImgD.alt=ImgD.width+"�"+ImgD.height;
     }
    }
}

function format(s)
{
	if($("#"+s)==null||$("#"+s).html()==null)
		return false;
	var result=$("#"+s).html();
	if(result!=null)
	{
		result=result.replace(/(^\s*)|(\s*$)/g, "");
		result=result.replace(/(([！|。|？|!|.|?])\s+)/g, "$1<br>&nbsp;&nbsp;&nbsp;&nbsp;");
		result="&nbsp;&nbsp;"+result;
	}
	$("#"+s).html(result)			
}


//onError = function(){
	//return true;
//}

function copy(s,t)
{
	
	$("#"+t).html($("#"+s).html())
}

function cE(tag,s,trC,tdC)
{
	var o=document.createElement("tr");
	if(trC!=null)
		o.className=trC;
	for(c in s)
	{
		if(s[c]!=null)
		{
			t= document.createElement(tag);
			t.innerHTML=s[c];
			if(tdC!=null&&tdC[c]!=null)
				t.className=tdC[c];
			o.appendChild(t);
		}	 
	}
	return o;			
}

function $S(n)
{
	return document.getElementById(n);
}
function nF(n)
{
	if(n==null||n.toString().indexOf('null')>=0)
		return '&nbsp;';
	else 
		return n;
}
function sF(s)
{
	if(s==null||s.toString().indexOf('null')>=0||s.length<=0)
		return "";
	else 
		return s;
}
function writeGoogleMap(){
	var array=new Array();
	array[0]=['http://192.168.1.2','ABQIAAAAgUwc1LVyuMwWAwYapwy8chTrReK3P99mKBTfLTiMIdvPR6kVWRRAgPiteNKbslef2RHDm0Gb2c3JLQ'];
	array[1]=['http://www.sodasoccer.com','ABQIAAAAgUwc1LVyuMwWAwYapwy8chRCszm7TE9lBM8XYepjUdorpQ1A8xRyIecKJSoynnu8joMfqkJ2Mgnzbw'];
	array[2]=['http://localhost','ABQIAAAAgUwc1LVyuMwWAwYapwy8chT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTBAm3bRr6Eis2IUo6gPAtOohlPHw'];
	for(i=0;i<array.length;i++){
		var url=window.location+"";
		if(url.indexOf(array[i][0])!=-1)
		{
			document.write("<script src=\"http://maps.google.com/maps?file=api&oe=utf-8&amp;v=2.x&key="+array[i][1]+"\"  type=\"text\/javascript\"><\/script>");
			break;
		}
	}
}
function over(tId)
{
	if(tId==null)
		setTimeout('ovetable(".paitable")',1000);
	else
		setTimeout('ovetable(\'#'+tId+'\')',1000);
}
function showMap()
{
	
	mapV=$('#map_d').css('visibility')
	
	if(mapV!=null&&mapV=='visible')
		$('#map_d').css('visibility','hidden')
	else
		$('#map_d').css('visibility','visible')
}


