// JavaScript Document

function $(_sId){
	return document.getElementById(_sId);
}
function exist(_sId){
	var oObj = $(_sId);
	return oObj != null ? oObj : false;
}
function dw(_sTxt){
	document.write(_sTxt);
}
function hide(_sId){
	$(_sId).style.display = $(_sId).style.display == "none" ? "" : "none";
}
function onlyShow(_sId, _iNum, _sPic, _sTxt1, _sTxt2){
	var i = 0;
	var oCurr = exist(_sId + i);
	while(oCurr){
		oCurr.style.display = "none";
		$(_sPic + i).src = _sTxt2;
		i++;
		oCurr = exist(_sId + i)
	}
	$(_sId + _iNum).style.display = "";
	$(_sPic + _iNum).src = _sTxt1;
}
function swapShow(_sId){
	var i = 0;
	var oCurr = exist(_sId + i);
	while(oCurr){
		hide(_sId + i);
		i++;
		oCurr = exist(_sId + i)
	}
}
function seekKey(_sKey){
	var i = 0;
	while(exist(_sKey + i)){
		i++;
	}
	return i;
}
function swapPic(_sId,_sAttr,_sTxt1, _sTxt2) {
	$(_sId)[_sAttr] = $(_sId)[_sAttr].indexOf(_sTxt1) > -1 ? _sTxt2 : _sTxt1;
}
function swap(_sId,_sAttr,_sTxt1, _sTxt2) {
	$(_sId)[_sAttr] = $(_sId)[_sAttr] == _sTxt1 ? _sTxt2 : _sTxt1;
}
function moveGif(_sId){
	swap(_sId,'className','marginLeft2','');
}
function moveStart(_sId){
	__tmp__time = setInterval("moveGif('" + _sId + "')",200);
}
function moveStop(_sId){
	clearInterval(__tmp__time);
	$(_sId).className = "marginLeft2";
}
function switchShow(){
	hide('left');
	swapPic('arrow','src','http://image2.sina.com.cn/blog/tmpl/v3/control/images/control_switch_up.gif','http://image2.sina.com.cn/blog/tmpl/v3/control/images/control_switch_down.gif');
	swapShow('hideLeft');
	swapShow('hideBody');
}
function scroll_to_top()
{
	document.body.scrollTop=0;
}
function mainFrameRedirect(url)
{
	oo = document.getElementById("mainFrame");
	oo.url = url;
}


function iframeResize()
{
	var dyniframe   = null;
	var indexwin    = null;

	if (document.getElementById)
	{
		dyniframe       = document.getElementById("mainFrame");
		indexwin        = window;

		if (dyniframe)
		{
			if (dyniframe.contentDocument)
			{
				dyniframe.height = dyniframe.contentDocument.body.scrollHeight+20;
			}
			else if (dyniframe.document && dyniframe.document.body.scrollHeight)
			{
				iframeheight	= mainFrame.document.body.scrollHeight;
//				windowheight = indexwin.document.body.scrollHeight - 128;
//				dyniframe.height = (iframeheight < windowheight) ? windowheight : iframeheight;
				dyniframe.height = iframeheight;
			}
		}
	}
}

if (window.addEventListener)
window.addEventListener("load", iframeResize, false)
else if (window.attachEvent)
window.attachEvent("onload", iframeResize)
else
window.onload=iframeResize
function winopen(url)
{
	 window.open("" + url, "control", "width=680,height=450,scrollbars=yes,left=" + (window.screen.width-680)/2 + ",top=" + (window.screen.height-450)/2);
	
}
document.write

   
