var whichIt = null;
self.onError = null;
var currentY = lastScrollY = 0;
var W3C = (document.getElementById) ? true : false;
var agt = navigator.userAgent.toLowerCase();
var IE = ((agt.indexOf('msie') != -1) && (agt.indexOf('opera') == -1) && (agt.indexOf('omniweb') == -1));
var IE5 = (W3C&&IE) ? true : false;
var NS6 = (W3C&&(navigator.appName == 'Netscape')) ? true : false;
var FF2=(W3C && (agt.indexOf('mozilla') != -1)) ? true : false;
var OP8=(W3C && (agt.indexOf('opera')!= -1)) ? true : false;
var today = new Date();
var d = new initArray('星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六');
var showExtMenu = 0;
var delayhide;

function $(o)
{
	var o = document.getElementById(o) ? document.getElementById(o) : o;
	return o;
}

document.getElementsByClassName = function(className, oBox){
	this.d=oBox || document;
	var children = this.d.getElementsByTagName('*') || document.all;
	var elements = new Array();
	for(var i = 0;i < children.length;i ++)
	{
		var child = children[i];
		var classNames = child.className.split(' ');
		for(var j = 0; j < classNames.length; j ++)
		{
			if(classNames[j] == className)
			{
				elements.push(child);
				break;
			}
		}
	}
return elements;
}

var $Cls=function(s, o)
{
	return document.getElementsByClassName(s, o);
}

function init()
{
	showtime();
	showdateToId('CS_datetime');
	var ohead = $('CS_head');
	if(typeof ohead != 'string')
	{
		window.setInterval('heartBeat()', 200);
	}
	var allSite = $Cls('listUrl');
	setHit(allSite);
	var ohead = $('idstl_text');
	if(typeof ohead != 'string')
	{
		jsp_scroLineText.call(null,'idstl_text',5000,30,22);
	}
	var ohead = $('idstl_cell');
	if(typeof ohead != 'string')
	{
		jsp_scroLineText.call(null, 'idstl_cell', 5000, 20, 24);
	}
	var ohead = $('idstl_gggs');
	if(typeof ohead!='string')
	{
		jsp_scroLineText.call(null, 'idstl_gggs', 5000, 20, 24);
	}
	var ohead = $('idsta_cell_fruit');
	if(typeof ohead != 'string')
	{
		jsp_slideLineSDivP.call(null, 'idsta_cell_fruit', 2500, 20, 40);
	}
	var ohead=$('btn_setCustomList');
	if(typeof ohead != 'string')
	{
		jsGetCustomList();
	}
}

function jsp_addFlash(ur, ww, hh)
{
	document.write('<embed src="' + ur + '" quality="high" wmode="opaque" bgcolor="#ffffff" width="' + ww + '" height="' + hh + '" align = "middle" allowScriptAccess = "sameDomain" type = "application/x-shockwave-flash" pluginspage = "http:/' + '/www.macromedia.com/go/getflashplayer" />');
	return;
}

var cnCustomStatus = 'customstatus';
var cnCustomList = 'customlist';
function jsSetCookie(sName, sValue)
{
	if(CookieEnable())
	{
		var expdate = new Date();
		expdate.setTime(expdate.getTime() + (24*60*60*1000*30));
		SetCookie(sName, sValue,expdate, '/', null, false);
	}
}

function jsCloseCustomStatus(){
jsSetCookie(cnCustomStatus,'');
return;
}
function jsOpenCustomStatus()
{
	jsSetCookie(cnCustomStatus, '1');
	return;
}

function jsSetCustomList()
{
	var psValue = '';
	var psSplit = ',';
	var pset = document.getElementsByName(cnCustomList);
	for(var i = 0; i < pset.length; i ++)
	{
		if(pset[i].checked)
		{
			if(psValue != '')
			{
				psValue += psSplit;
			}
			psValue += pset[i].value;
		}	
	}
	jsSetCookie(cnCustomList, psValue);
	jsOpenCustomStatus();
	window.open('/', '_top');
	return;
}

function jsGetCustomList()
{
	var psSplit = ',';
	var psValue = GetCookie(cnCustomList);
	var pset = document.getElementsByName(cnCustomList);
	for(var i=0; i < pset.length; i ++)
	{
		if(psValue.indexOf(pset[i].value) >= 0)
		{
			pset[i].checked = true;
		}
		else
		{
			pset[i].checked = false;
		}
	}
return;
}

function jsp_fontzoom(ps_name, ps_size)
{
	var otext = $(ps_name);
	if(typeof otext != 'string')
	{
		otext.style.fontSize = ps_size;
	}
}

function jsp_pagechange(po_main)
{
    var itab = 0;
    var btab = false;
    var po_objs = document.getElementsByName(po_main.id);
    for(var i = 0; i < po_objs.length; i ++)
	{
        var sclassbefore = po_objs[i].className.substring(0, po_objs[i].className.indexOf('_')); 
        var ps_temp = po_objs[i].className.toString().substr(po_objs[i].className.indexOf('_'));
        if(!btab)
		{
			itab ++;
		}
        if(po_main==po_objs[i])
		{
            po_objs[i].className = sclassbefore + '_sel';
            btab = true;
        }
        else
		{
            po_objs[i].className = sclassbefore + '_nor';
        }
    }
    var itemp = 0;
    var po_objs = document.getElementsByName(po_main.id + '_content');
    for(var i = 0; i < po_objs.length; i ++){
        if(po_objs[i].id == (po_main.id + '_content'))
		{
            itemp ++;
            if(itemp==itab)
			{
                po_objs[i].className = po_main.id + '_content_sel';
                window.setTimeout("jsp_pageclear('" + po_main.id + "'," + itemp + ")", 6000)
            }
            else
			{
                po_objs[i].className = po_main.id + '_content_nor';
            }
        }
    }
}

function jsp_pageclear(po_main, itemp)
{
    var po_objs = document.getElementsByName(po_main + '_content');
    for(var i = 0;i < po_objs.length;i ++)
	{
        if(po_objs[i].id == po_main + '_content' && i == itemp - 1)
		{
            po_objs[i].className = po_main + '_content_nor';
        }
    }
}

var disappeardelay = 500 //menu disappear speed onMouseout (in miliseconds)
function showDiv(obj_tab){
    clearTimer();
    var obj_tab_content=$(obj_tab.id + 'D');
    clearDiv(obj_tab);
    obj_tab.className='selected';//选中当前的tab
    obj_tab_content.style.display='block';//显示弹出子菜单
}

function hideDiv(obj_tab,def_tab){
    if (IE||NS6)
        if ( typeof obj_tab!="object"){
        delayhide=setTimeout("hideExtMenu('"+obj_tab+"','"+def_tab+"')",disappeardelay)
        }
        else{
        delayhide=setTimeout("hideExtMenu('"+obj_tab.id+"','"+def_tab+"')",disappeardelay)
        }
}
function clearDiv(tab){
    var obj_tab=tab;
    var obj_tab_content=$(obj_tab.id + 'D');
    if (IE){
        var obj_tabs=obj_tab.parentElement.children;
        var obj_tab_contents=obj_tab_content.parentElement.children;
    }
    else{
        var obj_tabs=document.getElementsByName(obj_tab.id.substring(0,obj_tab.id.indexOf('_'))+'_tab');
        var obj_tab_contents=document.getElementsByName(obj_tab.id.substring(0,obj_tab.id.indexOf('_'))+'_content');
    }
    for(var i=0;i<obj_tab_contents.length;i++){
        obj_tabs[i].className='';
        obj_tab_contents[i].style.display='none';
    }
}

function hideExtMenu(tab,def_tab){
    var obj_tab=$(tab);
    clearDiv(obj_tab);
    $(obj_tab.id.substring(0,obj_tab.id.indexOf('_'))+'_'+def_tab).className='selected';//选中原来的tab
	$(obj_tab.id.substring(0,obj_tab.id.indexOf('_'))+'_'+def_tab).style.display='block';
	var obj_tab_content=$(obj_tab.id + 'D');
	obj_tab_content.style.display='block';//显示弹出子菜单
}

function clearTimer(){
    if (typeof delayhide!="undefined")
    clearTimeout(delayhide)
}

function jsp_selecttab(pdiv)
{
    var sclassbefore = pdiv.className.substring(0, pdiv.className.indexOf('_')); //样式与id同名
    var itab = 0;
    var btab = false;
    var i = 0;
    var pset = document.getElementsByName(pdiv.id);
    for(var i = 0; i < pset.length; i ++){
        if(pset[i].id == pdiv.id)
		{
            if(!btab)
			{
				itab ++;
			}
            if(pset[i] == pdiv)
			{
                pset[i].className = sclassbefore + '_sel';
                btab = true;
            }
            else
			{
                pset[i].className = sclassbefore + '_nor';
            }
        }
    }
    var itemp = 0;
    var pset = document.getElementsByName(pdiv.id + '_content');
    for(var i = 0; i < pset.length; i ++)
	{
        if(pset[i].id == (pdiv.id + '_content'))
		{
            itemp ++;
            if(itemp == itab)
			{
                pset[i].className = sclassbefore + '_content_sel';
            }
            else{
                pset[i].className = sclassbefore + '_content_nor';
            }
        }
    }
}

function jsp_selecttabTC(pdiv)
{
    var itab = 0;
    var btab = false;
    var i = 0;
    var pset = document.getElementsByName(pdiv.id);
    for(var i = 0; i < pset.length; i ++)
	{
        if(pset[i].id == pdiv.id)
		{
            if(!btab)
			{
				itab ++;
			}
            if(pset[i] == pdiv)
			{
                btab = true;
            }
            else
			{
            }
        }
    }
	var itemp = 0;
	var pset = document.getElementsByName(pdiv.id + '_content');
	for(var i = 0; i < pset.length; i ++)
	{
		if(pset[i].id == (pdiv.id + '_content')){
			itemp ++;
			if(itemp == itab){
				pset[i].style.display = 'block';
			}
			else
			{
				pset[i].style.display = 'none';
			}
		}
	}
}

function MM_findObj(n, d)
{
	var p, i, x; 
	if(!d)
	{
		d = document;
	}
	if((p = n.indexOf('?')) > 0 && parent.frames.length)
	{
		d = parent.frames[n.substring(p+1)].document;
		n = n.substring(0, p);
	}
	if(!(x = d[n]) && d.all)
	{
		x = d.all[n];
	}
	for(i = 0; !x && i < d.forms.length; i ++)
	{
		x = d.forms[i][n];
	}
	for(i = 0; !x && d.layers && i < d.layers.length; i ++)
	{
		x = MM_findObj(n,d.layers[i].document);
	}
	if(!x && d.getElementById)
	{
		x = d.getElementById(n);
	}
	return x;
}

function MM_showHideLayers()
{
	var i, p, v, obj, args = MM_showHideLayers.arguments;
	for(i = 0; i < (args.length-2); i += 3)
	{
		if((obj = MM_findObj(args[i])) != null)
		{
			v = args[i + 2];
			if(obj.style)
			{
				obj = obj.style;
				v = (v == 'show') ? 'visible' : (v == 'hide') ? 'hidden' : v;
			}
			obj.visibility = v;
		}
	}
}

function jsp_scroLineText(ul, delay, speed, lh)
{
    var slideBox = (typeof ul == 'string') ? document.getElementById(ul) : ul;
    var delay = delay || 2500, speed = speed || 20, lh = lh || 250;
    var tid = null, pause = false;
    var start = function()
	{
        tid = window.setInterval(slide, speed);
    }
    var slide = function()
	{
        if(pause)
		{
			return;
		}
        slideBox.scrollTop += 2;
        if(slideBox.scrollTop % lh == 0)
		{
            window.clearInterval(tid);
            try
			{
                var slideBoxUl = slideBox.getElementsByTagName('ul')[0];
                slideBoxUl.appendChild(slideBoxUl.getElementsByTagName('li')[0]);
                slideBox.scrollTop = 0;
                window.setTimeout(start, delay);
            }
            catch(e){}
        }
    }
    slideBox.onmouseover = function()
		{
			pause = true;
		}
    slideBox.onmouseout = function()
		{ 
			pause = false;
		}
    window.setTimeout(start, delay);
}

function jsp_slideLineSDivP(ul, delay, speed,lh)
{
	var slideBox = (typeof ul == 'string') ? document.getElementById( ul ) : ul;
	var delay = delay || 2500, speed = speed || 20, lh = lh || 200;
	var tid = null, pause = false;
	var start = function()
		{
			tid = window.setInterval(slide, speed);
		}
	var slide = function()
		{
			if(pause)
			{
				return;
			}
			slideBox.scrollTop += 2;
			if(slideBox.scrollTop % lh == 0)
			{
				window.clearInterval(tid);
				try
				{
					var slideBoxUl = slideBox.getElementsByTagName('div')[0];
					slideBoxUl.appendChild(slideBoxUl.getElementsByTagName('p')[0]);
					slideBox.scrollTop = 0;
					window.setTimeout(start, delay);
				}
				catch(e){}
			}
		}
	slideBox.onmouseover = function()
		{
			pause = true;
		}
	slideBox.onmouseout=function()
		{
			pause = false;
		}
	window.setTimeout(start, delay);
}

function inputClear(obj, defValue)
{
  if(obj.value == defValue)
  	obj.value = '';
}
function inputDefault(obj, defValue)
{
  if(obj.value == '')
    obj.value = defValue;
}

function heartBeat()
{
	if(IE)
	{
		diffY = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
	}
	else
	{
		diffY = self.pageYOffset;
	}
	floatdiv = $('CS_head');
	floatdiv.style.zIndex = 9999999;
	if(IE)
	{
		if(showExtMenu)
		{
			showhideTwoObj($('CS_head'), $('CS_extMenu'));
		}
		else
		{
			showhideOneObj($('CS_head'));
		}
	}
}

function showhideOneObj(menuid)
{
	var oy = parseInt(menuid.style.top);
	if(String(oy) == 'NaN')
	{
		oy = 0;
	}
	var oh = menuid.offsetHeight;
	showhideElement('IFRAME',	oy,	oh);
	showhideElement('SELECT', oy, oh);
}

function showhideTwoObj(menuid, extmenuid)
{
	var oy = parseInt(menuid.style.top);
	if(String(oy) == 'NaN')
	{
		oy = 0;
	}
	var oh = menuid.offsetHeight + extmenuid.offsetHeight;
	showhideElement('IFRAME', oy, oh);
	showhideElement('SELECT', oy, oh);
}

function showhideElement(elmID, oy, oh)
{
	oy = parseInt(oy);
	oh = parseInt(oh);
	for(i = 0;i < document.all.tags(elmID).length; i ++)
	{
		obj = document.all.tags(elmID)[i];
		if(elmID == 'IFRAME')
		{
			if(obj.id != 'IDsearchbox')
			{
				continue;
			}
		}
		if(!obj || !obj.offsetParent)
		{
			continue;
		}
		objTop = obj.offsetTop;
		objParent = obj.offsetParent;
		while(objParent.tagName.toUpperCase()!= 'BODY')
		{
			if(objParent.offsetParent)
			{}
			else
			{
				break;
			}
			objTop += objParent.offsetTop;
			objParent = objParent.offsetParent;
		}
		if((objTop > (oy + oh)) || (oy > (objTop + obj.offsetHeight)))
		{
			obj.style.visibility = '';
		}
		else
		{
			obj.style.visibility = 'hidden';
		}
	}
}

function togglemenu(ps_name, pi_pos)
{
	var obj = $('CS_extMenu');
	if(obj.style.visibility == 'visible')
	{
		obj.style.visibility = 'hidden';
		showExtMenu = 0;
	}
	else
	{
		obj.style.visibility = 'visible';
		showExtMenu = 1;
		var itab = pi_pos;
		var itemp = 0;
		var pset = document.getElementsByName(ps_name);
		for(var i=0;i<pset.length;i++)
		{
			if(pset[i].id == (ps_name))
			{
				itemp ++;
				if(itemp == itab)
				{
					pset[i].style.display = 'block';
				}
				else
				{
					pset[i].style.display	=	'none';
				}
			}
		}
	}

	if(showExtMenu == 1)
	{}
}

function initArray()
{
	this.lengt = initArray.arguments.length;
	for(var i = 0; i < this.length; i ++)
	{
		this[i + 1] = initArray.arguments[i];
	}
}

function showtime()
{
	if(!W3C && (!document.layers))
	{
		return;
	}
	var today = new Date();
	var hours = today.getHours();
	var minutes = today.getMinutes();
	var seconds = today.getSeconds();
	var dn = 'AM';
	if(hours > 12)
	{
		dn = 'PM';
		hours = hours - 12;
	}
	if(hours == 0)
	{
		hours = 12;
	}
	if(hours <= 9)
	{
		hours = '0' + hours;
	}
	if(minutes <= 9)
	{
		minutes = '0' + minutes;
	}
	if(seconds <= 9)
	{
		seconds = '0' + seconds;
	}
	(myclock = hours + ':' + minutes + ':' + seconds);
	$('liveclock').innerHTML = myclock;
	window.setTimeout('showtime()', 1200000);
}

function showdate()
{
	document.write(today.getFullYear(), '年', today.getMonth() + 1, '月', today.getDate(), '日 ', d[today.getDay() + 1]);
}

function showdateToId(ps_id)
{
	var odt = $(ps_id);
	if(odt)
	{
		odt.innerHTML = today.getFullYear() + '年' + (today.getMonth() + 1) + '月' + today.getDate() + '日 ' + (d[today.getDay() + 1]);
	}
}

function AddFav(sUrl, sTitle)
{
	if(!sUrl)
	{
		sUrl = 'http:/'+'/www.foshan.gov.cn';
	}
	if(!sTitle)
	{
		sTitle = '佛山市政府网';
	}
	if((window.sidebar) && ('object' == typeof(window.sidebar)) && ('function' == typeof(window.sidebar.addPanel)))
	{
		window.sidebar.addPanel(sTitle, sUrl, '');
	}
	else
	{
		if(window.opera && window.print)
		{
			var elem = document.createElement('a');
			elem.setAttribute('href', sUrl);
			elem.setAttribute('title', sTitle);
			elem.setAttribute('rel', 'sidebar');
			elem.click();
			return true;
		}
		else
		{
			if(document.all)
			{
				window.external.AddFavorite(sUrl, sTitle);
			}
		}
	}
}

function SetHome(sUrl)
{
	if(!sUrl)
	{
		sUrl = 'http:/' + '/www.foshan.gov.cn';
	}
	if(IE)
	{
		homepage.style.behavior = 'url(#default#homepage)';
		homepage.setHomePage(sUrl);
	}
	else
	{
		if(NS6)
		{
			netscape.security.PrivilegeManager.enablePrivilege('UniversalPreferencesWrite');
			navigator.preference('browser.startup.homepage', sUrl);
		}
	}
}

function CookieEnable()
{
	var result = false;
	if(navigator.cookiesEnabled)
	{
		return true;
	}
	document.cookie = 'testcookie=yes;';
	var cookieSet = document.cookie;
	if(cookieSet.indexOf('testcookie=yes') >- 1)
	{
		result = true;
	}
	document.cookie = '';
	return result;
}

function setHit(allSite)
{
	var arrSites = '';
	for(var i = 0; i < allSite.length; i ++)
	{
		arrSites = allSite[i].getElementsByTagName('a');
		for(var j = 0; j < arrSites.length; j ++)
		{
			arrSites[j].onclick = function()
			{
				SavMyHit(this);
			}
		}
	}
}

function SavMyHit(o)
{
	var MyHitStatus = GetCookie('MyHitsStatus');
	if(MyHitStatus == 'close')
	{
		return;
	}
	var sNewSite = o.innerHTML + '||' + o.href + '!!';
	var sOldSite = GetCookie('MyHits');
	((sOldSite.length > 2048) ? sOldSite = sOldSite.substring(0, 2048) : '');
	if(sOldSite.indexOf(sNewSite) != -1)
	{
		sOldSite = sOldSite.replace(sNewSite, '');
	}
	sNewSite += sOldSite;
	var expdate = new Date();
	expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 30));
	SetCookie('MyHits', sNewSite, expdate, '/', null, false);
	GetList('MyHits');
}

function SavMyFav(title)
{
	var MyFavStatus = GetCookie('MyFavsStatus');
	if(MyFavStatus == 'close')
	{
		return;
	}
	var sNewSite = title + '||' + location.href + '!!';
	var sOldSite = GetCookie('MyFavs');
	sOldSite.length > 2048 ? sOldSite = sOldSite.substring(0, 2048) : '';
	if(sOldSite.indexOf(sNewSite) != -1)
	{
		sOldSite=sOldSite.replace(sNewSite, '');
	}
	sNewSite += sOldSite;
	var expdate = new Date();
	expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 30));
	SetCookie('MyFavs', sNewSite, expdate, '/', null, false);
	GetList('MyFavs');
}

function GetList(obj, n)
{
	this.maxlength = n || 5;
	var sOldSite = GetCookie(obj);
	sOldSite = sOldSite.split('!!');
	var nMaxNum = sOldSite.length > this.maxlength ? this.maxlength + 1 : sOldSite.length;
	var sHtml = '\n<ul>';
	for (i = 0;i < nMaxNum - 1; i ++)
	{
		var sTempInfo = sOldSite[i].split('||');
		if(sTempInfo[0].substring(0,1) == '·')
		{
			//sHtml+='<a href=\"'+sTempInfo[1]+'\" target=\"_blank\">'+sTempInfo[0]+'</a><br />\n';
			sHtml += '<li><a href=\"' + sTempInfo[1] + '\" target="_blank">' + sTempInfo[0] + '</a></li>\n';
		}
		else
		{
			//sHtml+='<a href=\"'+sTempInfo[1]+'\" target=\"_blank\">·'+sTempInfo[0]+'</a><br />\n';
			sHtml += '<li><a href=\"' + sTempInfo[1] + '\" target="_blank">·' + sTempInfo[0] + '</a></li>\n';
		}
	}
	if(nMaxNum <= 1)
	{
		sHtml = '<li>暂无浏览记录！</li>\n';
	}
	sHtml += "\n</ul><div id=\"clearList\"><a href=\"javascript:;\" title=\"点此可以清除您“最近浏览网站”的所有记录。\" onclick=\"clearList('"+obj+"');\">[清除记录]</a>&nbsp;";
	var ListStatus = GetCookie(obj + 'Status');
	if(ListStatus == 'open' || ListStatus == '')
	{
		sHtml += "<a href=\"javascript:;\" title=\"点此停用“最近浏览网站”的功能，系统将不再记录您最近浏览过的网站。\" onclick=\"chgListStatus('" + obj + "','close');\">[停用]</a></div>";
	}
	else
	{
	sHtml += "<a href=\"javascript:;\" title=\"点此启用“最近浏览网站”的功能，系统将记录您最近浏览过的网站。\" onclick=\"chgListStatus('" + obj + "','open');\">[启用]</a></div>";
	}
	$(obj + 'List').innerHTML = sHtml;
}

function clearList(obj)
{
	var expdate = new Date();
	expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 30));
	SetCookie(obj, '', expdate, '/', null, false);
	GetList(obj);
}

function chgListStatus(obj,stat)
{
	var expdate = new Date();
	expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 30));
	SetCookie(obj + 'Status', stat, expdate, '/', null, false);
	GetList(obj);
}

function GetCookie(Name){
	var search = Name + '=';
	var returnvalue = '';
	if(document.cookie.length > 0)
	{
		offset = document.cookie.lastIndexOf(search);
		if(offset != -1)
		{
			offset += search.length;
			end = document.cookie.indexOf(';', offset);
			if(end == -1)
			{
				end = document.cookie.length;
			}
			returnvalue = unescape(document.cookie.substring(offset, end));
		}
	}
	return returnvalue;
}

function SetCookie(name, value)
{
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	document.cookie = name + '=' + escape(value) + ((expires == null) ? '' : ('; expires=' + expires.toGMTString())) + ((path == null) ? '' : ('; path=' + path)) + ((domain == null) ? '' : ('; domain=' + domain)) + ((secure == true) ?'; secure' : '');
}

function getCurrPage(psKeyName)
{
	var psUrl = (window.location).toString();
	if(psUrl.indexOf('?', 0) >= 0)
	{
		psUrl = psUrl.substr(psUrl.indexOf('?', 0) + 1);
	}
	if(psUrl.indexOf('#', 0) >= 0)
	{
		psUrl = psUrl.substr(0, psUrl.indexOf('#', 0));
	}
	var psValue = getDictValue(psUrl, psKeyName, '&', '=');
	if(psValue == null || psValue == '')
	{
		psValue = '';
	}
	return psValue;
}

function getDictValue(psStr, psField, psGsplit, psKVsplit)
{
	var paFields = psStr.split(psGsplit);
	psStr = '';
	for(var i = 0; i < paFields.length; i ++)
	{
		if(paFields[i].indexOf(psField + psKVsplit,0) >= 0)
		{
			psStr = paFields[i].substr((psField + psKVsplit).length);
			break;
		}
	}
	return psStr;
}

function jsp_pageresume(ps_mainid, pi_page){
	var po_objs = document.getElementsByName(ps_mainid);
	for(var i = 0; i < po_objs.length; i ++)
	{
		var ps_temp = '';
		ps_temp = po_objs[i].className.toString().substr(po_objs[i].className.toString().length - 2);
		if(pi_page == i + 1)
		{
			if(ps_temp != 'se')
			{
				po_objs[i].className += 'se';
			}
		}
		else
		{
			if(ps_temp == 'se' || ps_temp == 'so')
			{
				po_objs[i].className = po_objs[i].className.toString().substr(0, po_objs[i].className.toString().length - 2);
			}
		}
	}
}

var flag = false;
function DrawImage(ImgD)
{
	var image = new Image();
	var iwidth = 660;
	var iheight = 2000;
	image.src = ImgD.src;
	if(image.width > 0 && image.height > 0)
	{
		flag = true;
		if(image.width > iwidth)
		{
			ImgD.width = iwidth;
			ImgD.height = (image.height * iwidth) / image.width;
		}
		else
		{
			ImgD.width = image.width;
			ImgD.height = image.height;
		}
		ImgD.alt = image.width + '×' + image.height;
	}
}
