﻿// JScript 文件
//跳转到日历详情页
function openTLMsg(oldPhookId,newPhookId,nextYearPhookId,price)
{
	var url='/PhookProduct/CalendarDetail.aspx?price={0}&phookProductId={1}&newTl={2}&nextYearTl={3}';
    url=format(url,price,oldPhookId,newPhookId,nextYearPhookId);
	urlEncode(url);
}

format=function(strFormat)
{
    var re=/[{]\d+[}]/g;
    var indexList=strFormat.match(re);
    for(var i=0;i<indexList.length;i++){
        var index=parseInt(indexList[i].replace(/[\D]+/ig,''));
        if(index+2>arguments.length){
            throw new Error('索引出界!');
        }
        strFormat=strFormat.replace(indexList[i],arguments[index+1]);
    }
    return strFormat;
}

