/*
*	
*
*/
custom_action = 0;
custom_action_tmp = 0;

function changeWeboscope(act) {
	//old webpage
	if (webozone == "") webozone = 1;
	
	//new wrp
	if (WRP_SECTION == "") WRP_SECTION = 1;
	if (WRP_SUBSECTION == "") WRP_SUBSECTION = 1;
	
	if (typeof act == "undefined") {
		act = 1;
		custom_action_tmp = 0;
	} else {
		custom_action = 0;
		custom_action_tmp = 1;
	}
	act = act - 1;
	
	
	//new wrp
	wrp_array = WRP_CONTENT_ACT.split(";");
	WRP_CONTENT = (typeof wrp_array[act] != "undefined") ? wrp_array[act] : 1;
	WRP_CONTENT = (WRP_CONTENT == 1 && custom_action_tmp == 0 && typeof wrp_array[0] != "undefined" && wrp_array[0] != "") ? wrp_array[0] : WRP_CONTENT;
	
	//old webopage
	webopage_array = webopage_act.split(";");
	PAGE = (typeof webopage_array[act] != "undefined") ? webopage_array[act] : 1;
	PAGE = (PAGE == 1 && custom_action_tmp == 0 && typeof webopage_array[0] != "undefined" && webopage_array[0] != "") ? webopage_array[0] : PAGE;
	
	DEBUG = (typeof webo_debug != "undefined") ? webo_debug : false;
	if (DEBUG) alert("ACTION: " + parseInt(parseInt(act) + 1) + " cust_action: " + custom_action + " cust_action_tmp: " + custom_action_tmp + " webo_ok: " + webo_ok);
	try {
		//old webopage
		if (webo_ok == 1 && custom_action == 0) {
			if (DEBUG) {
				alert("WEBOPAGE: " + SERVER + " - " + SITE + " - " + webozone + " - " + PAGE + " - " + WEBO_TIME);
			} else {	
				weboShort(WEBO_SERVER = SERVER, WEBO_ID = SITE, WEBO_ZONE = webozone, WEBO_PAGE = PAGE, WEBO_TIME);
			}	
		}
		//new wrp
		if (wreport_ok == 1 && custom_action == 0) {
			if (DEBUG) {		
				alert("WRP:\n" + "section " +  WRP_SECTION + " \nsubsection " + WRP_SUBSECTION + "\nid " + WRP_ID + "\nacc " + WRP_ACC + "\nchannel " + WRP_CHANNEL + "\nsection_grp " + WRP_SECTION_GRP + "\nsubsection_grp " + WRP_SUBSECTION_GRP + "\ncontent " + WRP_CONTENT);
			} else {	
				var w_counter = new wreport_counter(WRP_SECTION, WRP_SUBSECTION, WRP_ID, WRP_ACC, WRP_CHANNEL, WRP_SECTION_GRP, WRP_SUBSECTION_GRP);
				w_counter.add_content(WRP_CONTENT);
				w_counter.count();
			}	
		}
		
	} catch (error) {}
	
	custom_action = custom_action_tmp;

}