﻿// JScript File
// Designed by Kingcean Tuan for Visino

// Properties Part
var mkt = "zh-Chs";
var baindetopflamplaytn = baindetopflamplaynn = 0, baindetopflamplaycn = 0;
var baindetopflamplaylist = new Array();
var baindetoplistpapilist = new Array();

// Functions Part
function pageInit()
{
	mkt = "zh-Chs";
}
function pageUnload()
{
	
}
function converturl(itmpurl, itmprooturl) {
    mtmplnkstring = itmpurl.toString();
    if (itmprooturl.length < 1) {
        itmprooturl = "../";
    }
    if (mtmplnkstring.length > 3) {
        mtmplnkstring = mtmplnkstring.replace("~/", "{ldlocal}").replace("{ldlocal}/", "{ldlocal}");
        mtmplnkstring = mtmplnkstring.replace("{ldlocal}", itmprooturl).replace("//", "/");
        mtmplnkstring = mtmplnkstring.replace("p:/", "p://").replace("s:/", "s://");
    }
    return mtmplnkstring;
}
function turntourl(itmpurl, itmprooturl)
{
    mtmplnkstring = converturl(itmpurl, itmprooturl);
	if (mtmplnkstring.length > 3)
	{
		window.location.href = mtmplnkstring;
	}
}
function turntolocation(itmpurl, itmprooturl, itmptarget) {
    mtmplnkstring = converturl(itmpurl, itmprooturl);
    if (mtmplnkstring.length > 3) {
        var temp = document.createElement("a");
        temp.href = mtmplnkstring;
        if (glotarget !== undefined && glotarget !== null && glotarget.toString().length > 0) {
            temp.target = itmptarget;
        }
        if (target.toString().length > 0) {
            temp.target = itmptarget;
        }
        temp.click();
        temp = null;
    }
}
function searusual(itmpkeyword,itmpurl,itmpopt)
{
	mtmptxt1=itmpkeyword.toString();
	mtmptxt1=encodeURIComponent(mtmptxt1);
	mtmptxt2=itmpurl.toString();
	mtmptxt3=itmpopt.toString();
	if (mtmptxt1.length>1)
	{
		window.location.href="" + mtmptxt2 + ".aspx?q=" + mtmptxt1 + "&set=" + mtmptxt3 + "";
	}
	else
	{
		alert("您输入的关键字太少，请增加内容以便获得更精确的结果。");
		return false;
	}
	return true;
}
function searquery(itmpkeyword,itmpurl)
{
	mtmptxt1=itmpkeyword.toString();
	mtmptxt1=encodeURIComponent(mtmptxt1);
	mtmptxt2=itmpurl.toString();
	if (mtmptxt1.length > 1 && mtmptxt2.length > 1)
	{
		window.location.href = "" + mtmptxt2.replace("{0}", mtmptxt1) + "";
	}
	else
	{
		alert("您输入的关键字太少，请增加内容以便获得更精确的结果。");
		return false;
	}
	return true;
}
function searkeywd(itmpkeyword,itmpurl,itmpopt)
{
	mtmptxt1=itmpkeyword.toString();
	mtmptxt1=encodeURIComponent(mtmptxt1);
	mtmptxt2=itmpurl.toString();
	mtmptxt3=itmpopt.toString();
	window.location.href="" + mtmptxt2 + ".aspx?q=" + mtmptxt1 + "&set=" + mtmptxt3 + "";
}
function searvideo(itmpkeyword,itmpurl,itmpcodetype)
{
	mtmptxt1=itmpkeyword.toString();
	mtmptxt1=encodeURIComponent(mtmptxt1);
	mtmptxt2=itmpurl.toString();
	if (mtmptxt1.length>1)
	{
		window.location.href="" + mtmptxt2 + ".aspx?id=" + itmpcodetype + "&q=" + mtmptxt1 + "&set=t&pn=1";
	}
	else
	{
		alert("您输入的关键字太少，请增加内容以便获得更精确的结果。");
	}
}
function AddFavorite(sURL, sTitle)
{
	try
	{
		window.external.addFavorite(sURL, sTitle);
	}
	catch (e)
	{
		try
		{
			window.sidebar.addPanel(sTitle, sURL, "");
		}
		catch (e)
		{
			alert("加入收藏失败，请使用 Ctrl+D 进行添加");
		}
	}
}
function SetHome(obj,vrl){
	try{
		obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
	}
	catch(e){
		if(window.netscape) {
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
			}  
			catch (e)  { 
				alert("网站无法为您自动设置主页，请手动操作。谢谢！'");  
			}
			var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
			prefs.setCharPref('browser.startup.homepage',vrl);
		 }
	}
}
function ChoseTab(itmptxt,itmpn)
{
	mtmpn1=itmpn;
	mtmptxt1=itmptxt;
	if (document.getElementById("" + mtmptxt1 + mtmpn1 + "t") && document.getElementById("" + mtmptxt1 + mtmpn1 + "l"))
	{
		for (mtmpn2=0; mtmpn2<9; mtmpn2++)
		{
			if (document.getElementById("" + itmptxt + mtmpn2 + "t") && document.getElementById("" + itmptxt + mtmpn2 + "l"))
			{
				document.getElementById("" + itmptxt + mtmpn2 + "t").style.display = "none";
				if (document.getElementById("" + itmptxt + mtmpn2 + "l").getAttribute("className"))
				{
					document.getElementById("" + itmptxt + mtmpn2 + "l").className = document.getElementById("" + itmptxt + mtmpn2 + "l").className.replace("_choosen","");
				}
			}
		}
		document.getElementById("" + itmptxt + mtmpn1 + "t").style.display = "block";
		if (document.getElementById("" + itmptxt + mtmpn1 + "l").getAttribute("className"))
		{
			document.getElementById("" + itmptxt + mtmpn1 + "l").className += "_choosen";
		}
	}
}
function onSilverlightError(sender, args)
{
	var appSource = "";
	if (sender != null && sender != 0) {
		appSource = sender.getHost().Source;
	} 
	var errorType = args.ErrorType;
	var iErrorCode = args.ErrorCode;
	
	var errMsg = "Unhandled Error in Silverlight 2 Application " +  appSource + "\n" ;

	errMsg += "Code: "+ iErrorCode + "    \n";
	errMsg += "Category: " + errorType + "       \n";
	errMsg += "Message: " + args.ErrorMessage + "     \n";

	if (errorType == "ParserError")
	{
		errMsg += "File: " + args.xamlFile + "     \n";
		errMsg += "Line: " + args.lineNumber + "     \n";
		errMsg += "Position: " + args.charPosition + "     \n";
	}
	else if (errorType == "RuntimeError")
	{           
		if (args.lineNumber != 0)
		{
			errMsg += "Line: " + args.lineNumber + "     \n";
			errMsg += "Position: " +  args.charPosition + "     \n";
		}
		errMsg += "MethodName: " + args.methodName + "     \n";
	}

	throw new Error(errMsg);
}
function shwtopSlGateOff()
{
	//gvheadsubdiv.style.display="block";
	//gvheadsilitodiv.style.display="none";
	document.getElementById("gvheadsubdiv").className="dncyqdeffsd3";
	document.getElementById("gvheadsilitodiv").className="dncyqdeffsd2";
}
function shwtopSlGateOn()
{
	//gvheadsubdiv.style.display="none";
	//gvheadsilitodiv.style.display="block";
	document.getElementById("gvheadsubdiv").className="dncyqdeffsd1";
	document.getElementById("gvheadsilitodiv").className="dncyqdeffsd0";
}
function getCookie(name)
{
   var start = document.cookie.indexOf(name+"=");
   var len = start+name.length+1;
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
   if (start == -1) return null;
   var end = document.cookie.indexOf(";",len);
   if (end == -1) end = document.cookie.length;
   return decodeURIComponent(document.cookie.substring(len,end));
}
function setCookie(name,value,expires,path,domain,secure)
{
	var today = new Date();
	today.setTime(today.getTime());
	if(expires)
	{
		expires = expires * 1000 * 60 * 60 *24;
	}
	var expires_date = new Date(today.getTime() + (expires));
	value = encodeURIComponent(unescape(value));
	document.cookie = name+'='+value+
		( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) +
		( ( path ) ? ';path=' + path : '' ) +
		( ( domain ) ? ';domain=' + domain : '' ) +
		( ( secure ) ? ';secure' : '' );
}
function delAllCookie()
{
	tmpArr = document.cookie.split(";");
	delKey = new Array();
	for(i in tmpArr)
	{
		if(tmpArr[i].indexOf("mykeywords") != -1)
		{
			delKey.push(decodeURIComponent(tmpArr[i].split("=")[0]));
		}
	}
	today = new Date();
	today.setTime(today.getTime() - 10000);
	for(i in delKey)
	{
		name = delKey[i];
		document.cookie = name+"='';expires="+today.toGMTString();
	}
	tmpArr = delKey = today = "";
}
function delCookie(value)
{
	len = keywords.length;
	for(i in keywords)
	{
		if(keywords[i] == value)
		{
			keywords.splice(i,1);
		}
	}
	if(keywords.length == 0)
	{
	   delAllCookie();
	}
}
function sysitestpreviewdemo()
{
	if (parent.document.getElementById("appAdminHmpgbCodeHereD"))
	{
		document.body.innerHTML=parent.document.getElementById("appAdminHmpgbCodeHereD").innerHTML;
	}
}
function transhtmlencode(itmpstr) 
{ 
	var mtmpstr = ""; 
	if (itmpstr.length == 0) return ""; 
	mtmpstr = itmpstr.replace(/&/g, "&amp;"); 
	mtmpstr = mtmpstr.replace(/</g, "&lt;"); 
	mtmpstr = mtmpstr.replace(/>/g, "&gt;"); 
	mtmpstr = mtmpstr.replace(/ /g, "&nbsp;"); 
	mtmpstr = mtmpstr.replace(/\'/g, "&#39;"); 
	mtmpstr = mtmpstr.replace(/\"/g, "&quot;"); 
	mtmpstr = mtmpstr.replace(/\n/g, "<br />"); 
	return mtmpstr; 
} 
function transhtmldecode(itmpstr) 
{ 
	var mtmpstr = ""; 
	if (itmpstr.length == 0) return ""; 
	mtmpstr = itmpstr.replace(/&amp;/g, "&"); 
	mtmpstr = mtmpstr.replace(/&lt;/g, "<"); 
	mtmpstr = mtmpstr.replace(/&gt;/g, ">"); 
	mtmpstr = mtmpstr.replace(/&nbsp;/g, " "); 
	mtmpstr = mtmpstr.replace(/&#39;/g, "\'"); 
	mtmpstr = mtmpstr.replace(/&quot;/g, "\""); 
	mtmpstr = mtmpstr.replace(/<BR>/g, "\n"); 
	mtmpstr = mtmpstr.replace(/<br>/g, "\n"); 
	mtmpstr = mtmpstr.replace(/<br \/>/g, "\n"); 
	return mtmpstr; 
} 
function starhtmlencode(itmpstr) 
{ 
	return (HTMLEncode(itmpstr)); 
} 
function starhtmldecode(itmpstr) 
{ 
	return (HTMLDecode(itmpstr)); 
} 
function HTMLEncode(html)
{
	var temp = document.createElement ("div");
	(temp.textContent != null) ? (temp.textContent = html) : (temp.innerText = html);
	var output = temp.innerHTML;
	output = output.replace(/<DIV/g, "<div"); 
	output = output.replace(/<DIV\/>/g, "</div>"); 
	output = output.replace(/<P/g, "<p"); 
	output = output.replace(/<P\/>/g, "</p>"); 
	output = output.replace(/<BR>/g, "<br />"); 
	output = output.replace(/<br>/g, "<br />"); 
	temp = null;
	return output;
}
function HTMLDecode(text)
{
	var temp = document.createElement("div");
	temp.innerHTML = text;
	var output = temp.innerText || temp.textContent;
	temp = null;
	return output;
}
function baindetopflamplayinf()
{
	if (baindetopflamplaylist.length > 2)
	{
		baindetopflamplaypnhtml = "";
		baindetopflamplayimhtml = "";
		for (i = 0; i < (baindetopflamplaylist.length / 4 - 1); i++)
		{
			if (baindetopflamplaylist[(i * 4 + 1)].toString().length > 2)
			{
				if (baindetopflamplaylist[(i * 4 + 3)].toString().length < 1)
				{
					baindetopflamplaylist[(i * 4 + 3)] = "" + (i + 1).toString() + "";
				}
				if (baindetopflamplaylist[(i * 4 + 2)].toString().length < 1)
				{
					baindetopflamplaylist[(i * 4 + 2)] = "#";
				}
				baindetopflamplaypnhtml += "<a>" + baindetopflamplaylist[(i * 4 + 3)] + "</a>";
				baindetopflamplayimhtml += "<a href=\"" + baindetopflamplaylist[(i * 4 + 2)] + "\" target=\"_blank\" ><img alt=\"" + baindetopflamplaylist[(i * 4)] + "\" src=\"" + baindetopflamplaylist[(i * 4 + 1)] + "\" /></a>";
			}
		}
		baindetopflamplayhtml = "<div id=\"baindetopflamplayend\" ><img alt=\"\" src=\"http://www.in-kungfu.cn/images/blank.gif\" /></div>";
		baindetopflamplayhtml += "<div id=\"baindetopflamplayshd\" >" + baindetopflamplayimhtml + "</div>";
		baindetopflamplayhtml += "<div id=\"baindetopflamplaybgd\" ></div>";
		baindetopflamplayhtml += "<div id=\"baindetopflamplaytxd\" ><span></span></div>";
		baindetopflamplayhtml += "<div id=\"baindetopflamplaypnd\" >" + baindetopflamplaypnhtml + "</div>";
		document.getElementById("baindetopflamplayd").innerHTML = baindetopflamplayhtml;
		baindetopflamplayldf("baindetopflamplayd");
	}
}
function baindetopflamplayief()
{
	baindetopflamplayinf();
	mtmptxtwidth = document.getElementById("baindetopflamplayd").style.width;
	mtmptxtheight = document.getElementById("baindetopflamplayd").style.height;
	$("#baindetopflamplayshd").css({"width":mtmptxtwidth,"height":mtmptxtheight});
	$("#baindetopflamplayend").css({"width":mtmptxtwidth,"height":mtmptxtheight});
	$("#baindetopflamplayshd img").css({"width":mtmptxtwidth,"height":mtmptxtheight});
	$("#baindetopflamplayend img").css({"width":mtmptxtwidth,"height":mtmptxtheight});
}
function baindetopflamplayldf(theobjname)
{
	baindetopflamplaycn = $("#baindetopflamplayshd a").size();
	$(function() {
		$("#baindetopflamplayshd a:not(:first-child)").hide();
		$("#baindetopflamplaytxd span").html($("#baindetopflamplayshd a:first-child").find("img").attr('alt'));
		$("#baindetopflamplaypnd a:first").css({"background":"#001020",'color':'#FFFF00'});
		$("#baindetopflamplaytxd span").click(function() {
			window.open($("#baindetopflamplayshd a:first-child").attr('href'), "_blank")
		});
		$("#baindetopflamplaypnd a").click(function() {
			var i = $(this).text() - 1;
			baindetopflamplaynn = i;
			if (i >= baindetopflamplaycn) return;
			$("#baindetopflamplaytxd span").html($("#baindetopflamplayshd a").eq(i).find("img").attr('alt'));
			$("#baindetopflamplaytxd span").unbind().click(function(){window.open($("#baindetopflamplayshd a").eq(i).attr('href'), "_blank")})
			$("#baindetopflamplayend img").attr('src', $("#baindetopflamplayshd a").filter(":visible").find("img").attr('src'));
			$("#baindetopflamplayshd a").filter(":visible").hide().parent().children().eq(i).fadeIn(1200);
			$(this).css({"background":"#001020","color":"#FFFF00"}).siblings().css({"background":"#333333","color":'#AAAAAA'});
		});
		baindetopflamplaytn = setInterval("baindetopflamplaysaf()", 5000);
		$("#" + theobjname + "").hover(function(){clearInterval(baindetopflamplaytn)}, function(){baindetopflamplaytn = setInterval("baindetopflamplaysaf(\"" + theobjname + "\")", 5000);});
	});
}
function baindetopflamplaysaf(theobjname)
{
	baindetopflamplaycn = $("#baindetopflamplayshd a").size();
	baindetopflamplaynn = baindetopflamplaynn >= (baindetopflamplaycn - 1) ? 0 : ++baindetopflamplaynn;
	$("#baindetopflamplaypnd a").eq(baindetopflamplaynn).trigger('click');
}
function baindetopflamplayref(itmpn1, itmpn2)
{
	mtmptxt = "";
	if (baindetopflamplaylist.length > (itmpn1 * 4 + itmpn2))
	{
		mtmptxt = baindetopflamplaylist[(itmpn1 * 4 + itmpn2)].toString();
	}
	return(mtmptxt);
}
function baindetopflamplaylkf(itmpn1, itmpn2, itmprooturl)
{
	mtmplnkstring = baindetopflamplayref(itmpn1, itmpn2);
	if (itmprooturl.length < 1)
	{
		itmprooturl = "../";
	}
	if (mtmplnkstring.length > 3)
	{
		mtmplnkstring = mtmplnkstring.replace("~/", "{ldlocal}").replace("{ldlocal}/", "{ldlocal}");
		mtmplnkstring = mtmplnkstring.replace("{ldlocal}" , itmprooturl);
		window.location.href = mtmplnkstring;
	}
}
function baindetoplistpandimf(theobjname)
{
	if (baindetoplistpapilist.length > 2)
	{
		for (i = 0; i < (baindetoplistpapilist.length / 4 - 1); i++)
		{
			$("#" + theobjname + "").children().eq(i).children().eq(0).html("<span class=\"baindenormpanetns\" >" + baindetoplistpapilist[i * 4] + " <span class=\"baindenormpanetes\" >" + baindetoplistpapilist[i * 4 + 1] + "</span></span><span class=\"baindenormpanetms\" ><a href=\"" + baindetoplistpapilist[i * 4 + 3] + "\" >更多</a></span>");
			$("#" + theobjname + "").children().eq(i).children().eq(1).html("<a href=\"" + baindetoplistpapilist[i * 4 + 3] + "\" class=\"styblue\" ><img alt=\"Show\" src=\"" + baindetoplistpapilist[i * 4 + 2] + "\" style=\"border-width: 0px; border-style: none; \" ></a>");
		}
	}
}
function pageprintnow()
{
	window.print();
}
function baindetopflamplayadf(theobj1name, theobj2name)
{
	document.getElementById(theobj2name).style.display = "block";
	document.getElementById(theobj2name).style.height = document.getElementById(theobj1name).style.height;
	document.getElementById(theobj2name).style.width = document.getElementById(theobj1name).style.width;
	document.getElementById(theobj1name).style.height = "0px";
	document.getElementById(theobj1name).style.display = "none";
}
function baindetopflamplaynof(theobj1name, theobj2name)
{
	document.getElementById(theobj1name).style.display = "block";
	document.getElementById(theobj1name).style.height = document.getElementById(theobj2name).style.height;
	document.getElementById(theobj2name).style.height = "0px";
	document.getElementById(theobj2name).style.display = "none";
}
function baindetopflamplayasf(sender)
{
	baindetopflamplayadf("baindetopflamplayd", "baindetopflamplayadvanced");
	$("#baindetopflamplayadvanced span object").css({"width":(baindetopflamplayssf("width")+"px").toString(),"height":(baindetopflamplayssf("height")+"px").toString()});
	slCtl = sender.get_element();
	slCtl.Content.slideNewsPlay.ReadySetSize(baindetopflamplayssf("width"), baindetopflamplayssf("height"));
	baindetopflamplayaaf(slCtl, 6000);
}
function baindetopflamplayaaf(theslctl, thesecond)
{
	setInterval(
		function()
		{
			baindetopflamplayanf(theslctl);
		}, thesecond);
}
function baindetopflamplayanf(theslctl)
{
	theslctl.Content.slideNewsPlay.ShowImgTurnNext();
}
function baindetoplistpandabf(sender)
{
	slCtl = sender.get_element();
	baindetopflamplayaaf(slCtl, 6000);
}
function baindetopflamplaytif(itmpindex)
{
	mtmprefvalue = baindetopflamplayref(itmpindex, 0);
	mtmprefvalue = starhtmldecode(mtmprefvalue);
	return (mtmprefvalue);
}
function baindetopflamplayssf(itmptxtkey)
{
	mtmptxtkey = itmptxtkey;
	mtmptxtreturn = "0";
	if (document.getElementById("baindetopflamplayadvanced"))
	{
		if (itmptxtkey == "width")
		{
			mtmptxtreturn = document.getElementById("baindetopflamplayadvanced").style.width.toString();
		}
		else if (itmptxtkey == "height")
		{
			mtmptxtreturn = document.getElementById("baindetopflamplayadvanced").style.height.toString();
		}
		mtmptxtreturn = mtmptxtreturn.replace("px", "").replace("%", "").replace(" ", "").replace(" ", "").replace("cm", "");
	}
	return (mtmptxtreturn);
}
function pagecopyurl() 
{ 
	window.clipboardData.setData('text', location.href.toString());
	alert("当前网址已被复制，您可使用 Ctrl+V 将地址复制到他处用以分享.");
}
function pagetransurl(url)
{
	return ("http://www.in-kungfu.cn/go/analink.aspx?action=count&to=" + encodeURIComponent(url));
}
function tcinittimdecf(iobjname, iobjhtml, iopenbsep, itimems, itimeno) {
	if (iopenbsep) {
		tcinittimdivf(iobjname, iobjhtml, 0, 0, itimems, itimeno);
	}
	else {
		tcinittimdivf(iobjname, iobjhtml, 1, 24, itimems, itimeno);
	}
}
function tcinittimdivf(iobjname, iobjhtml, itimesn, itimecn, itimems, itimeno) {
	mtmpobj = document.getElementById(iobjname);
	mtmpobjthtm = iobjhtml.toString();
	if (mtmpobjthtm.length < 1) {
		mtmpobjthtm = "{0}{1}{2}";
	}
	else {
		mtmpobjthtm = mtmpobjthtm.replace("{0}", "{sel:noon}");
		mtmpobjthtm = mtmpobjthtm.replace("{1}", "{sel:hours}");
		mtmpobjthtm = mtmpobjthtm.replace("{2}", "{sel:minutes}");
	}
	mtmpobjhtml = mtmpobjthtm;
	mtmpobjphtm = "";
	mtmposmname = tcinittimgidf(iobjname);
	mtmpostname = mtmposmname + "nselect";
	mtemptimecn = itimecn;
	if (mtemptimecn == 0) {
		mtmpobjphtm += "<select id=\"" + mtmpostname + "\" name=\"" + mtmpostname + "\" onchange=\"tcinittimdivf('" + iobjname + "', '" + iobjhtml + "', parseInt(this.value), 0, " + itimems + ", '" + itimeno + "');\" >";
		if (itimesn == 0) {
			mtmpobjphtm += "<option value=\"1\" >" + tcinittimnoof(itimeno, true) + "</option><option value=\"13\" >" + tcinittimnoof(itimeno, false) + "</option>";
		}
		else {
			mtmpobjphtm += "<option value=\"13\" >" + tcinittimnoof(itimeno, false) + "</option><option value=\"0\" >" + tcinittimnoof(itimeno, true) + "</option>";
		}
		mtmpobjphtm += "</select>";
	}
	mtmpobjhtml = mtmpobjhtml.replace("{sel:noon}", mtmpobjphtm);
	mtmpobjphtm = ""
	mtmpostname = mtmposmname + "hselect";
	mtmpobjphtm += "<select id=\"" + mtmpostname + "\" name=\"" + mtmpostname + "\" >";
	if (mtemptimecn == 0) {
		mtemptimecn = 12;
		if (itimesn < 2) {
			mtmpobjphtm += tcinittimoptf(0, itimeno);
			itimesn = 1;
		}
	}
	mtimecn = itimesn + mtemptimecn;
	if (mtimecn > 25) {
		mtimecn = 25;
	}
	for (mtmpnstep = itimesn; mtmpnstep < mtimecn; mtmpnstep++) {
		mtmpobjphtm += tcinittimoptf(mtmpnstep, itimeno);
	}
	mtmpobjphtm += "</select>";
	mtmpobjhtml = mtmpobjhtml.replace("{sel:hours}", mtmpobjphtm);
	mtmpobjphtm = ""
	if (itimems > 1) {
		mtmpostname = mtmposmname + "mselect";
		mtmpobjphtm += "<select id=\"" + mtmpostname + "\" name=\"" + mtmpostname + "\" >";
		mtmpnminsep = itimems;
		if (mtmpnminsep > 30) {
			mtmpnminsep = 60;
		}
		for (mtmpnstep = 0; mtmpnstep < mtmpnminsep; mtmpnstep++) {
			mtmpnminste = mtmpnstep * 60 / mtmpnminsep;
			mtmpobjphtm += "<option value=\"" + (mtmpnminste / 60).toString() + "\" >" + tcinittimforf(parseInt(mtmpnminste).toString()) + "</option>";
		}
		mtmpobjphtm += "</select>";
	}
	mtmpobjhtml = mtmpobjhtml.replace("{sel:minutes}", mtmpobjphtm);
	mtmpobjphtm = ""
	mtmpobj.innerHTML = mtmpobjhtml;
}
function tcinittimoptf(iobjnh, itimeno) {
	mtmpnh = parseInt(iobjnh.toString());
	mtmpstrn = "";
	if ((mtmpnh >= 0 && mtmpnh < 12) || mtmpnh == 24) {
		mtmpstrn = "" + tcinittimnoof(itimeno, true) + "";
	}
	else if (mtmpnh >= 12 && mtmpnh < 24) {
		mtmpstrn = "" + tcinittimnoof(itimeno, false) + "";
	}
	mtmpnm = 0;
	if (iobjnh - mtmpnh >= 0.5) {
		mtmpnm = 30;
	}
	mtmpstrr = "<option value=\"" + iobjnh + "\" >" + tcinittimforf(mtmpnh) + ":" + tcinittimforf(mtmpnm) + " / " + mtmpstrn + " " + tcinittimforf(tcinittimtwef(mtmpnh)) + ":" + tcinittimforf(mtmpnm) + "</option>";
	return (mtmpstrr);
}
function tcinittimforf(iobjnd) {
	mtmpstrs = iobjnd.toString();
	if (iobjnd < 10) {
		mtmpstrs = "0" + mtmpstrs;
	}
	return (mtmpstrs);
}
function tcinittimtwef(iobjnmh) {
	mtmpnmh = iobjnmh;
	if (mtmpnmh > 12) {
		mtmpnmh = mtmpnmh - 12;
	}
	return (mtmpnmh);
}
function tcinittimgidf(iobjname) {
	return (iobjname.replace("div", "").replace("div", "").replace("div", ""));
}
function tcinittimnoof(itmptnoonwords, itmpbismorning) {
	if (itmptnoonwords == "") {
		itmptnoonwords = "AM|PM";
	}
	mtmpstrnoon = itmptnoonwords.substring(itmptnoonwords.indexOf("|")).replace("|", "");
	if (itmpbismorning) {
		mtmpstrnoon = itmptnoonwords.replace(mtmpstrnoon, "").replace("|", "");
	}
	return (mtmpstrnoon);
}
function tcinittimghof(iobjname) {
	mtmpnhour = 0;
	mtmposmname = tcinittimgidf(iobjname) + "hselect";
	mtmpnhour = parseInt(document.getElementById(mtmposmname).value);
	mtmposmname = tcinittimgidf(iobjname) + "mselect";
	if (document.getElementById(mtmposmname)) {
		mtmpnhour += parseFloat(document.getElementById(mtmposmname).value);
	}
	return (mtmpnhour);
}
function tcinittimstif(iobjname) {
	mtmpshour = 0;
	mtmposmname = tcinittimgidf(iobjname) + "hselect";
	mtmpshour = tcinittimforf(parseInt(document.getElementById(mtmposmname).value)).toString() + ":";
	mtmposmname = tcinittimgidf(iobjname) + "mselect";
	if (document.getElementById(mtmposmname)) {
		mtmpshour += tcinittimforf(parseInt(parseFloat(document.getElementById(mtmposmname).value) * 60));
	}
	else {
		mtmpshour += "00";
	}
	return (mtmpshour);
}
function tcinittiminuf(iobj1name, iobj2name) {
	return (tcinittimghof(iobj1name) - tcinittimghof(iobj2name));
}

// -------------------------------------
// Designed by others below

/* 页面打印  */
function doPrint(pmore) {
	//打开一个新的窗体   
	var newWin = window.open('about:blank', "", "");
	//将取得的打印内容放入新窗体   
	newWin.document.write(pmore);
	//刷新新窗体   
	newWin.document.location.reload();
	//调用打印功能     
	newWin.print();
	//打印完毕自动关闭新窗体   
	newWin.close();   
}
/* 页面打印  */
function doPrintImg(pmore) {    
	//打开一个新的窗体   
	var newWin = window.open('about:blank',"","");   
	//将取得的打印内容放入新窗体   
	newWin.document.write("<img alt=\"\" src=\"" + pmore + "\" />");
	//刷新新窗体   
	newWin.document.location.reload();   
	//调用打印功能     
	newWin.print();   
	//打印完毕自动关闭新窗体   
	newWin.close();   
} 
