

/*
-- ------ Gsnavigation ------ --
*/
function Gsnavigation(){}
//-- ------ #Parameters ------ --

Gsnavigation.prototype.sAjax_0=new netsSingleAjax();

//-- ------ #Methods ------ --
//#Navigation
Gsnavigation.prototype.sNavigationCount=7;
Gsnavigation.prototype.OnNavigation=function(pIndex){
	var Coun0=0;
	while(Coun0<this.sNavigationCount){
		document.getElementById("MainNavigation_"+Coun0).className="Gsnav_Navigation_1_2";
		Coun0++;
	}
	
	document.getElementById("MainNavigation_"+pIndex).className="Gsnav_Navigation_1_1";
	return 0;
}


Gsnavigation.prototype.sSearchKeywordDefault="请在这里输入您要查询的内容...";
Gsnavigation.prototype.sSearchURL="../../../Plus/m_default/Gsnavigation/gsnavigationactiveList.php";

//#Search
Gsnavigation.prototype.OnSearchFocus=function(pControl,pType){
	if(pType==0){
		if(pControl.value==this.sSearchKeywordDefault){
			pControl.value="";
		}
		pControl.className="Gsnav_Navigation_2_5";
	}else{
		if(pControl.value==this.sSearchKeywordDefault || pControl.value==""){
			pControl.value=this.sSearchKeywordDefault;
			pControl.className="Gsnav_Navigation_2_5";
		}else{
			pControl.className="Gsnav_Navigation_2_5";
		}
	}

	return 0;
}
Gsnavigation.prototype.OnSearch=function(){
	tmpKeyword=document.getElementById("keywordTxt").value;
	if(tmpKeyword==this.sSearchKeywordDefault){
		tmpKeyword="";
	}
	tmpKeyword=tmpCommon.encodeURL(tmpKeyword);

	window.location=this.sSearchURL+"?DKeyword="+tmpKeyword;
	return 0;
}

//#Setcode
Gsnavigation.prototype.sSetcodeURL="Plus/m_default/Gsnavigation/gsnavigationactiveDetail.php";
Gsnavigation.prototype.OnSetcode=function(pID,pType){

	tmpURL=tmpCommon.sysRoot+this.sSetcodeURL+"?ActionType=D"+pType+"&D"+pType+"="+pID;
	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="mainCode_"+pID+"_"+pType;
	this.sAjax_0.sURL=tmpURL;
	this.sAjax_0.sendRequestSp(tmpURL,"gsnavigation_Setcode_Callback();");
	//window.open(tmpURL,"_blank");
	tmpFrames.showMessage('','正在为您保存数据...','',0);
	
	return 0;
}
function gsnavigation_Setcode_Callback(){
	var tmpFlag=tmpGsnavigation.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpGsnavigation.sAjax_0.sPanel);
	var tmpURL=tmpGsnavigation.sAjax_0.sURL;
	var tmpHttpRequests=tmpGsnavigation.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequests.responseText);
	if(tmpHttpRequests.readyState==4){
		//alert(tmpHttpRequests.responseText);
		var tmpData=getDataByFlag(tmpHttpRequests.responseText,tmpFlag);
		//alert(tmpData);
		if(tmpData.indexOf("sendRequest")>=0 && tmpData!="<!--sendRequest-->"){
			var tmpAR0=tmpData.split(tmpCommon.sysSPLIT1);
			if(tmpAR0.length==2){
				if(parseInt(tmpAR0[1])>=0){
					tmpPanel.innerHTML=tmpAR0[1];
				}
				tmpFrames.showMessage('',tmpAR0[0],'',0);
			}else{
				tmpFrames.showMessage('',tmpData,'',0);
			}
			
	    	tmpFrames.showLoading(1);
		}else{
			tmpFrames.showMessage("",tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL),"",0);
			tmpFrames.showLoading(1);
	    }
	}else{
		tmpFrames.showMessage("",tmpCommon.sysLoading_Ajax,"",0);
		tmpFrames.showLoading(0);
	}
}

//#Zones
Gsnavigation.prototype.sZonesButton="zonesButton";
Gsnavigation.prototype.sZonesBox="zonesBox";
Gsnavigation.prototype.sZonesLink="zonesLink";
Gsnavigation.prototype.sZonesURL="Plus/Common/Nets/Data_Gsnavigation_Zone.php";
Gsnavigation.prototype.sZonesLoaded=0;
Gsnavigation.prototype.OnZonesboxShow=function(pType){
	if(pType==0){
		document.getElementById(this.sZonesButton).className="Groupsale_Head_3_4";
		document.getElementById(this.sZonesBox).className="Groupsale_Head_3_5";
		document.getElementById(this.sZonesLink).className="Link2 FWhite1";
		if(this.sZonesLoaded==0){
			tmpURL=tmpCommon.sysRoot+this.sZonesURL;
			this.sAjax_0.sFlag="Data";
			this.sAjax_0.sPanel=this.sZonesBox+"_Content";
			this.sAjax_0.sURL=tmpURL;
			this.sAjax_0.sendRequestSp(tmpURL,"groupsalenavigation_ZonesboxShow_Callback();");
			//window.open(tmpURL,"_blank");
		}
		
	}else{
		document.getElementById(this.sZonesButton).className="Gsnav_Head_2_4";
		document.getElementById(this.sZonesBox).className=tmpCommon.sysHidden;
		document.getElementById(this.sZonesLink).className="Link2 FBlack3";
	}
	
	return 0;
}
function groupsalenavigation_ZonesboxShow_Callback(){
	var tmpFlag=tmpGsnavigation.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpGsnavigation.sAjax_0.sPanel);
	var tmpURL=tmpGsnavigation.sAjax_0.sURL;
	var tmpHttpRequests=tmpGsnavigation.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequests.responseText);
	if(tmpHttpRequests.readyState==4){
		//alert(tmpHttpRequests.responseText);
		var tmpData=getDataByFlag(tmpHttpRequests.responseText,tmpFlag);
		//alert(tmpData);
		if(tmpData.indexOf("sendRequest")>=0 && tmpData!="<!--sendRequest-->"){
			tmpPanel.innerHTML=tmpData;
			tmpGsnavigation.sZonesLoaded=1;
	    	tmpFrames.showLoading(1);
	    }else{
	    	tmpPanel.innerHTML=tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL);
	    	tmpFrames.showLoading(1);
	    }
	}else{
		tmpFrames.showLoading(0);
		tmpPanel.innerHTML=tmpCommon.sysLoading_Ajax;
	}
}

//#MessageCopy
Gsnavigation.prototype.sMessageCopyName="messageCopy";
Gsnavigation.prototype.OnMessageCopy=function(pID,pType){
	if(pType==0){
		document.getElementById(this.sMessageCopyName+"Box_"+pID).className="GroupsaleDetail_51";
	}else{
		document.getElementById(this.sMessageCopyName+"Box_"+pID).className=tmpCommon.sysHidden;
	}

	return 0;
}
Gsnavigation.prototype.OnMessageCopyClick=function(pControl){
	pControl.select();
	
	return 0;
}
Gsnavigation.prototype.OnMessageCopyCopy=function(pID){
	tmpSTR=document.getElementById(this.sMessageCopyName+"Input_"+pID).value;
	tmpCommon.OnClipboard(tmpSTR);
	
	return 0;
}


//#Tabbox
Gsnavigation.prototype.OnTabInfobox_Count=3;
Gsnavigation.prototype.OnTabInfobox=function(pIndex){
	var Coun0=0;
	while(Coun0<this.OnTabInfobox_Count){
		document.getElementById("tabinfobox_Button_"+Coun0).className="Gsnav_Title_7";
		document.getElementById("tabinfobox_Box_"+Coun0).className=tmpCommon.sysHidden;
		Coun0++;
	}
	
	document.getElementById("tabinfobox_Button_"+pIndex).className="Gsnav_Title_6";
	document.getElementById("tabinfobox_Box_"+pIndex).className="Gsnav_Box_2 Gsnav_Home_2_1";
	return 0;
}

//#Time
Gsnavigation.prototype.sTimeboxs="";
Gsnavigation.prototype.OnTimerun=function(){
	var tmpDate_Today=new Date();
	var tmpDate_Endday=new Date();

	var tmpAR0=this.sTimeboxs.split(tmpCommon.sysSPLIT1);
	var Coun0=0;
	while(tmpAR0.length>Coun0){
		if(document.getElementById("GroupsaleTime_"+tmpAR0[Coun0]+"_Endtime")!=undefined){
			tmpSTR=document.getElementById("GroupsaleTime_"+tmpAR0[Coun0]+"_Endtime").value;
			tmpDate_Endday=tmpCommon.formatDate(tmpSTR);
			var tmpDatetime=this.DateSub(tmpDate_Endday,tmpDate_Today);
			
			document.getElementById("GroupsaleTime_"+tmpAR0[Coun0]+"_Day").innerHTML=tmpDatetime[0];
			document.getElementById("GroupsaleTime_"+tmpAR0[Coun0]+"_Hour").innerHTML=tmpDatetime[1];
			document.getElementById("GroupsaleTime_"+tmpAR0[Coun0]+"_Min").innerHTML=tmpDatetime[2];
			document.getElementById("GroupsaleTime_"+tmpAR0[Coun0]+"_Seconds").innerHTML=tmpDatetime[3];
		}
		Coun0++;
	}

	return 0;
}
Gsnavigation.prototype.DateSub=function(pDate,pDate_DIS){
	var tmpAR0=new Array(0,0,0,0);
	var tmpDayDivisor=28;
	var tmpDayDivisorAR=new Array(0,3,0,3,2,3,2,3,3,2,3,2,3);
	
	tmpYear=pDate.getYear()-pDate_DIS.getYear();
	tmpMonth=pDate.getMonth()-(pDate_DIS.getMonth()+1);
	tmpDay=pDate.getDate()-pDate_DIS.getDate();
	tmpHour=pDate.getHours()-pDate_DIS.getHours();
	tmpMinute=pDate.getMinutes()-pDate_DIS.getMinutes();
	tmpSecond=pDate.getSeconds()-pDate_DIS.getSeconds();
	var tmpAR1=tmpCommon.TimeCheck(tmpYear,tmpMonth,tmpDay,tmpHour,tmpMinute,tmpSecond);
	
	tmpDay=tmpAR1[2];
	tmpINT=parseInt(tmpYear/4);
	tmpDay+=tmpYear*365+tmpINT;
	Coun0=0;
	while(tmpAR1[1]>Coun0){
		tmpDay+=tmpDayDivisor+tmpDayDivisorAR[Coun0];
		Coun0++;
	}

	tmpAR0[0]=tmpDay;
	tmpAR0[1]=tmpAR1[3];
	tmpAR0[2]=tmpAR1[4];
	tmpAR0[3]=tmpAR1[5];
	return tmpAR0;
}
//#Map
Gsnavigation.prototype.Map_ChangeParid=function(pURL){
	var tmpSTR="";
	var Coun0=0;
	while(document.getElementById(tmpCommon.sysForm).paridTxt.length>Coun0){
		if(document.getElementById(tmpCommon.sysForm).paridTxt[Coun0].checked){
			tmpSTR+=document.getElementById(tmpCommon.sysForm).paridTxt[Coun0].value+tmpCommon.sysSPLIT2;
		}
		Coun0++;
	}
	tmpURL=pURL.replace(/\{Nets.PARID}/g,tmpSTR);

	window.location=tmpURL;
	return 0;
}


