function pr_chgsrt(who,_min,_max)
{
	if(who==0)
	{
		document.getElementById('lst_srt').value=document.getElementById('srt_f').value;
	}else{
		document.getElementById('lst_srt').value=document.getElementById('srt_s').value;
	}
	searchByCondition1(1,_min,_max);
}

function searchByCondition1(page,_min,_max,category,showType,sortByCondition,smallChangePage,endPage)
{

	var callback=
	{
		success: searchSuccess, 
		failure: searchFailure,
		timeout: 8000,
		argument : [endPage]
	}
	var _sum=_min+_max;
	var link_url=document.getElementById("lst_lnk").value;
	var itemCategory=document.getElementById("itemCategorys");
	var rcpttype=document.getElementById("rcpttype");
	var hiddenSortCondition=document.getElementById("sortCondition").value;
	if(sortByCondition)
	{
		var sortCondition=sortByCondition;
		var sortConditionControl=document.getElementById(sortByCondition);
		if(sortConditionControl)sortCondition=sortConditionControl.value;
		if(sortCondition.length>0)link_url=link_url+"&sortByCondition="+sortCondition;
	}
	if(smallChangePage)link_url=link_url+"&smallChangePage="+smallChangePage;
	if(category)link_url=link_url+"&itemCategory="+category;
	else if(itemCategory)link_url=link_url+"&itemCategory="+itemCategory.value;
	if(_min)link_url=link_url+"&_min="+_min;
	if(_max)link_url=link_url+"&_max="+_max;
	if(page)link_url=link_url+"&page="+page;
	if(rcpttype)link_url=link_url+"&rcpttype="+rcpttype.value;
	if(showType)link_url=link_url+"&showType="+showType;
	var cObj=YAHOO.util.Connect.asyncRequest('post',link_url,callback);
}

function searchSuccess(o)
{
	var responseP=eval('('+ o.responseText+')');
	document.getElementById("content").innerHTML=responseP.gifts;
	document.getElementById("headImageDiv").innerHTML=responseP.headerContent;
	if(o.argument[0]=="end"){
		document.getElementById("into").scrollIntoView();
	}	
}
function searchFailure(){}

function searchRight()
{
	var itemCategory=document.getElementById("itemCategorys");
	var rcpttype=document.getElementById("rcpttype");
	var _min=document.getElementById("_min").value;
	var _max=document.getElementById("_max").value;
	searchByCondition1(1,_min,_max);
	
}
function change(whichLink) {

	 var box = document.getElementById("headImageDiv");
      var links = box.getElementsByTagName("a");
	  whichLink.className = 'clickAfter';
	  whichLink.style.opacity = '1';
}

function overBigImg(obj,name)
{

	obj.src="/images/xingzuo_shengxiao/"+name+"_year.gif";
}
function outBigImage(obj,name)
{
	obj.src="/images/xingzuo_shengxiao/shengxiao_"+name+".jpg";
}


