// W2LIB.JS

// GLOBALS:
var Sess = "";
var Dip = "";
var GUser = "";
var GCurthrd = 0;
var GCurFirst = 0;
var PrevArticle = "";
var HOMEPAGE = "http://www.web2coders.com/";

// WTVRSSREADERHEAD.JS

	rbselon = new Image();
	rbselon.src = "pics/rbselon.jpg";
	rbseloff = new Image();
	rbseloff.src = "pics/rbseloff.jpg";
	
	rbcaton = new Image();
	rbcaton.src = "pics/rbcaton.jpg";
	rbcatoff = new Image();
	rbcatoff.src = "pics/rbcatoff.jpg";
	
	rbrefon = new Image();
	rbrefon.src = "pics/rbrefon.jpg";
	rbrefoff = new Image();
	rbrefoff.src = "pics/rbrefoff.jpg";
	
	rbaddon = new Image();
	rbaddon.src = "pics/rbaddon.jpg";
	rbaddoff = new Image();
	rbaddoff.src = "pics/rbaddoff.jpg";

	rballon = new Image();
	rballon.src = "pics/rballon.jpg";
	rballoff = new Image();
	rballoff.src = "pics/rballoff.jpg";
	
// GLOBAL
var RSSno = "";

function showform(theForm,a,b)
{
	var txt = "Form name: " + theForm.name + "\r\n";
	txt += "theForm.elements.length = "+theForm.elements.length+"\r\n";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + " = " + theForm.elements[i].value + "\r\n";
	txt += "a: "+a+"\r\n";
	txt += "b: "+b+"\r\n";
	alert(txt);
}
// === EMAIL VALIDATION =================================================================================================================================
function echeck(str) 
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1)
	   return(true);
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
		return(true);
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
		return(true);
	if (str.indexOf(at,(lat+1))!=-1)
		return(true);
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
		return(true);
	if (str.indexOf(dot,(lat+2))==-1)
		return(true);
	if (str.indexOf(" ")!=-1)
		return(true);
	return (false);					
}
// ===================================================================================================================
// === COOKIES
// ===================================================================================================================
function checkCookies()
{
	//alert("checkCookies to remove");
}
function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1)
		{ 
			c_start=c_start + c_name.length+1; 
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}
function setCookie(c_name,value,expiredays)
{
	var exdate = new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+";expires="+exdate.toGMTString();
}
function DelSessCookie()
{
	setCookie("w2sess","",-1);
}
function SessCookie()
{
	var rts = getCookie('w2sess');
	if (rts != null && rts != "")	// cookie exists: we use that session instead (but Php does NOT know)
		Sess = rts;
	else
		Sess = "";
}
// === END OF EMAIL VALIDATION =======================================================================================
// === LESSONS =============
function js_lesson1()
{
//	alert ("js_lesson1");
	window.location = "w2lessons.php";
}
function js_lesson(lno,ip)
{
//	alert ("js_lesson("+lno+") "+Sess+" "+ip);
	Dip = ip;
	sajax_target_id = 'main';
	if (Sess != "")
		x_p_lesson(Sess,lno,Dip); 
	else
		x_p_lesson("",lno,Dip);
	sajax_target_id = '';
}
function js_buy_lesson(lno)
{
	window.location = HOMEPAGE + "w2accounts.php?c=bles&l="+lno;
}
function js_buy_lesson2(theForm)
{
	theForm.submit();
}
function js_less_return()
{
	window.location = HOMEPAGE + "w2lessons.php";
}
// ==========================
function js_donate()
{
	window.location = HOMEPAGE + "w2accounts.php?c=don";
}
function js_donate2(theForm)
{
	theForm.submit();
}
function js_buy_module(prod)
{
//	alert ("Prod: "+prod);
	window.location = HOMEPAGE + "w2accounts.php?c=mod&p="+prod;
}
function js_home()
{
	window.location = "http://www.web2coders.com/";
}
function js_nav()
{
//	alert ("js_nav");
	sajax_target_id = 'navbar'; 
	x_p_navbar(Sess); 
	sajax_target_id = '';
}
function js_what_why()
{
	sajax_target_id = 'main'; 
	x_p_what_why(); 
	sajax_target_id = '';
}
function js_artists()
{
//	alert ("js_artists.  In progress");
	sajax_target_id = 'main'; 
	x_p_artists(); 
	sajax_target_id = '';
}
function js_coders()
{
//	alert ("in progress");
	sajax_target_id = 'main'; 
	x_p_coders(); 
	sajax_target_id = '';
}
function js_contactus()
{
//	alert("js_contactus");
	sajax_target_id = 'main'; 
	x_p_contactus(); 
	sajax_target_id = '';
}
function js_send_contact(theForm)
{
	showform(theForm,"js_send_contact",0);
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	alert("Form: "+txt);
	sajax_target_id = 'main'; 
	x_p_send_contact(txt); 
	sajax_target_id = '';
}
function js_coder_how()
{
	sajax_target_id = 'main'; 
	x_p_coder_how(); 
	sajax_target_id = '';
}
function js_apply(type)
{
	GetW();
	var txt = "sess="+Sess+"&type="+type+"&cmd=new&";
	var l = (Scrw - 500) / 2;
	pop_enable(150, l, 500, 400);
	sajax_target_id = 'pop'; 
	x_p_register(txt); 
	sajax_target_id = '';
}
function js_clients_how()
{
	sajax_target_id = 'main'; 
	x_p_clients_how(); 
	sajax_target_id = '';
}
function js_more(seq)
{
	sajax_target_id = 'main'; 
	x_p_more(seq); 
	sajax_target_id = '';
}
function pop_enable(t, l, w, h)
{
	var p = document.getElementById("pop");
	p.style.height = h;
	p.style.width = w;
	p.style.left = l;
	p.style.top = t;
	p.style.border = "medium groove #d0d0d0";
	p.style.visibility = "visible";	// Hidden
}
function js_pop_hide()
{
	sajax_target_id = 'pop'; 
	x_p_pop_clear(); 
	sajax_target_id = '';
	var p = document.getElementById("pop");
	p.style.visibility = "hidden";
}
function js_profile()
{
//	alert ("In progress");
	sajax_target_id = 'main'; 
	x_p_profile(Sess); 
	sajax_target_id = '';
}
function js_show_profile(username)
{
//	alert ("js_show_profile: "+username);
	sajax_target_id = 'main'; 
	x_p_show_profile(username); 
	sajax_target_id = '';
}
function js_update_btext(theForm)
{
//	showform(theForm,"js_update_btext",0);
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	txt += "s="+Sess+"&";
	sajax_target_id = 'bannerprev'; 
	x_p_update_btext(txt); 
	sajax_target_id = '';
}
function js_upload_file(theForm)
{
//	showform(theForm,"submitting",0);
	theForm.submit();
}
function js_projects()
{
//	alert ("js_projects");
	sajax_target_id = 'main'; 
	x_p_projects(); 
	sajax_target_id = '';
}
function js_new_project()
{
	sajax_target_id = 'main'; 
	x_p_new_project(Sess); 
	sajax_target_id = '';
}
function js_request()
{
//	alert ("In-progress");
	sajax_target_id = 'main'; 
	x_p_request(Sess); 
	sajax_target_id = '';
}
function js_preview(pjref)
{
	sajax_target_id = 'main'; 
	x_p_show_request(Sess,pjref); 
	sajax_target_id = '';
}
function js_update_project(theForm)
{
//	showform(theForm,"js_update_project",0);
	theForm.submit();
}
function js_project_form(pjref)
{
	sajax_target_id = 'main'; 
	x_p_edit_project(Sess,pjref); 
	sajax_target_id = '';
}
function js_save_request(theForm)
{
//	showform(theForm,"js_save_request",0);
	if (theForm.elements['opendate'].checked)
		theForm.elements['opendatebox'].value = "checked";
	else
		theForm.elements['opendatebox'].value = "unchecked";
	theForm.submit();
}
function js_make_offer(pjref)
{
//	alert ("Making offer for pjref:"+pjref);
	sajax_target_id = 'offerform'; 
	x_p_offer_form(Sess,pjref,false); 
	sajax_target_id = '';
}
function js_submit_offer(theForm)
{
//	showform(theForm,"js_submit_offer",0);
	theForm.submit();
}
function js_accept_offer(pjref,acuser)
{
	sajax_target_id = 'main'; 
	x_p_accept_offer(Sess,pjref,acuser); 
	sajax_target_id = '';
}
function js_call(artno)
{
	sajax_target_id = 'main'; 
	x_p_call(artno); 
	sajax_target_id = '';
}
function js_admin_users()
{
//	showform(theForm, 0,0);
	sajax_target_id = 'main'; 
	x_p_admin_users(); 
	sajax_target_id = '';
}
function js_admin_user_edit(user)
{
	alert ("js_admin_user_edit("+user+")");
	sajax_target_id = 'main'; 
	x_p_admin_user_edit(Sess,user); 
	sajax_target_id = '';
}
function js_admin_articles(theForm)
{
//	showform(theForm, 0,0);
	sajax_target_id = 'main'; 
	x_p_admin_articles(); 
	sajax_target_id = '';
}

function js_admin_art_edit(artno,cmd)
{
	var txt = "artno="+artno+"&cmd="+cmd+"&";
	sajax_target_id = 'main'; 
	x_p_admin_art_edit(txt); 
	sajax_target_id = '';
}
function js_del_user(user)
{
	var res = confirm ("Delete "+user+ " profile?");
	if (res == false)
		return;
	sajax_target_id = 'main'; 
	x_p_del_user(user); 
	sajax_target_id = '';
}
function js_admin_upload_img()
{
	sajax_target_id = 'main'; 
	x_p_del_user(user); 
	sajax_target_id = '';
}
// ====================================
// FORUM FUNCTIONS
function js_forum()	// ENTRY POINT
{
	sajax_target_id = 'main'; 
	x_p_forum(Sess); 
	sajax_target_id = '';
}

function js_forum_list(first)
{
	GCurFirst = first;
	sajax_target_id = 'main'; 
	x_p_forum2(Sess,first); 
	sajax_target_id = '';
}
// === BLOG ====
function js_blog_thrd(bref)
{
//	alert("js_blog: "+bref);
	var tid = "blog"+bref;
	sajax_target_id = tid; 
	x_p_blog_thrd(Sess,bref); 
	sajax_target_id = '';
	tid = "blog"+bref+"mnu";
	sajax_target_id = tid; 
	x_p_blog_btn_reply(Sess,bref); 
	sajax_target_id = '';
}
function js_blog_reply(bref)
{
	var tid = "blog"+bref+"mnu";
	sajax_target_id = tid; 
	x_p_blog_reply_form(Sess,bref); 
	sajax_target_id = '';
}
function js_blog_post_comt(theForm)
{
//	showform(theForm,"js_blog_post_comt",0);
	var bref = theForm.elements['bref'].value;
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	txt += "s="+Sess+"&";
	var tid = "blog"+bref+"mnu";
//	alert("txt: "+txt+"\r\n"+"tid: "+tid);
	sajax_target_id = tid; 
	x_p_blog_show_new_comt(txt); 
	sajax_target_id = '';
}
function js_thrd(ref)
{
//	alert ("js_thrd, "+ref);
	sajax_target_id = 'main'; 
	x_p_thrd(Sess,ref); 
	sajax_target_id = '';
	window.scrollTo(0,0);
}
function js_thrd_del(ref,frst)
{
//	alert ("Deleting "+ref+", first: "+frst);
	sajax_target_id = 'main'; 
	x_p_thrd_del(Sess,ref,frst); 
	sajax_target_id = '';
	window.scrollTo(0,0);
}
function js_select_q(select)
{
	sajax_target_id = 'main'; 
	x_p_forum(Sess,"0"); // status = all or open
	sajax_target_id = '';
}
function js_forum_mid(select,first)
{
	GCurFirst = first;
//	alert ("js_forum_mid, GCurfirst: "+first);
	sajax_target_id = 'main'; 
	x_p_forum(Sess,select,first); // status = all or open
	sajax_target_id = '';
}
function js_forum_back()
{
//	alert ("js_forum_back. GCurFirst: "+GCurFirst);
	sajax_target_id = 'main'; 
	x_p_forum2(Sess,GCurFirst); 
	sajax_target_id = '';
}
function js_add_reply(theForm)
{
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	txt += "s="+Sess+"&";
	sajax_target_id = 'main'; 
	x_p_add_reply(txt); 
	sajax_target_id = '';
}
function js_ask_q(u)
{
	if (!document.getElementById("loggeduser"))	// NOT logged in
	{
		alert("You must be logged in to ask a question");
		return;
	}
//	else
//		alert("Ask a question");
	sajax_target_id = 'main'; 
	x_p_ask_q(Sess); 
	sajax_target_id = '';
}
function js_add_q(theForm)
{
//	showform(theForm,"js_add_q",0);
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	sajax_target_id = 'main'; 
	x_p_add_q(Sess,txt); 
	sajax_target_id = '';
//	alert ("Done");
}
function js_edit_comt(ref)
{
//	alert ("js_edit_comt");
	sajax_target_id = 'editcomt'; 
	x_p_edit_comt(Sess,ref); 
	sajax_target_id = '';
}
function js_edit_reply(theForm)
{
//	showform(theForm,"js_edit_reply",0);
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	sajax_target_id = 'editcomt'; 
	x_p_update_comt(Sess,txt); 
	sajax_target_id = '';
	txt = theForm.elements['ltext'].value;
//	alert("Refreshing with: "+txt);
	sajax_target_id = 'commt'; 
	x_p_refresh_comt(txt); 
	sajax_target_id = '';
}
function js_del_comt(ref)
{
//	alert ("js_del_comt");
	sajax_target_id = 'editcomt'; 
	x_p_del_comt(Sess,ref); 
	sajax_target_id = '';
}
function js_add_forum()	// Add forum entries from YA
{
	sajax_target_id = 'main'; 
	x_p_add_forum();
	sajax_target_id = '';
}
function js_add_ya(theForm)
{
//	showform(theForm,"js_add_ya",0);
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
//	sajax_request_type = 'POST';
	sajax_target_id = 'main'; 
	x_p_add_ya(txt);
	sajax_target_id = '';
	wait_reply();
//	window.scrollTo(0,0);
	setTimeout("js_add_forum()",1000);
//	sajax_request_type = 'POST';
}
// ==========================================================================================================
// === LOGIN
// ==========================================================================================================
function js_login(theForm)
{
	if (theForm.elements['user'] == "")
		return;
	if (theForm.elements['pwd'] == "")
		return;
	Sess = theForm.elements['s'].value;
	setCookie("w2sess",Sess,1)
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
//	alert(txt);
	sajax_target_id = 'login'; 
	x_p_login(txt); 
	sajax_target_id = '';
	setTimeout("js_check_logged()",2000);
	setTimeout("js_nav()",2000);
}
function js_check_logged()	// RETURNS LOGIN OR LOGOFF FORM
{
/*	if (!document.getElementById('loggeduser'))
	{
		sajax_target_id = 'login'; 
		x_p_check_logged(Sess,Dip); 
		sajax_target_id = '';	
	}
*/
	window.location = HOMEPAGE;
}
function js_logoff()
{
//	alert("Log-off");
	sajax_target_id = 'login'; 
	x_p_logoff(Sess); 
	sajax_target_id = '';
	DelSessCookie();
	Sess = "";
	window.location = HOMEPAGE;
}
function js_register(theForm)
{
	showform(theForm,"js_register",0)
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	txt += "sess="+Sess+"&cmd=new&";
	var left = Scrw - 310;
	pop_enable (20, left, 300,200);
	sajax_target_id = 'pop'; 
	x_p_register(txt); 
	sajax_target_id = '';
}
function js_auto_log(s,user,pwd)	// just registered, Sess has been written in w2cusers
{
	Sess = s;
	setCookie("w2sess",Sess,1);
//	alert ("js_auto_log: S="+Sess);
	sajax_target_id = 'login'; 
	x_p_auto_log(Sess,user); 
	sajax_target_id = '';
	setTimeout("js_nav()",1000);
}
function js_my_details()
{
//	alert ("js_my_details");
	sajax_target_id = 'main'; 
	x_p_my_details(Sess); 
	sajax_target_id = '';
}
function js_update_details(theForm)
{
//	showform(theForm,"js_update_details",0);
	if (theForm.elements['npwd'].value != theForm.elements['rnpwd'].value)
	{
		pop_err("Unequal Passwords! Try again","pwd");
		return;
	}
	var email = theForm.elements['email'].value;
	if (echeck(email))
	{
		pop_err("Please, enter a valid Email!","email");
		return;
	}
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	txt += "s="+Sess+"&";
	sajax_target_id = 'mydetails'; 
	x_p_update_user_details(txt); 
	sajax_target_id = '';
}
function js_check_passwords(theForm)
{
	var p = theForm.elements["pwd"];
	var pwd = p.value;
	pwd = pwd.toLowerCase();	// LOWERCASE ONLY
	p.value = pwd;
	if (p.value == "")
	{
		pop_err("Please, enter a Password.","pwd");
		return true;
	}
	if (p.value != "")
	{
		var patt1 = /\W/g;
		var uu = "";
		uu = pwd.match(patt1);
		if (uu != null)
		{
			pop_err("Pwd must be 6+ Lowercase Alphanumeric only.","pwd");
			return true;
		}
		if (pwd.length < 6)
		{
			pop_err("Pwd must be 6 character long or more.","pwd");
			return true;
		}
		var rp = theForm.elements["rpwd"];
		var rpw = rp.value;
		rpw = rpw.toLowerCase();
		rp.value = rpw;
		if (rpw == "")
		{
			pop_err("Please, repeat your password","rpwd");
			return true;
		}
		if (p.value != rpw && rpw != "")
		{
			pop_err("ERROR: your two passwords are not indentical","rpwd");
			return true;
		}
	}
	return false;
}
function js_check_avail(theForm)
{
	var name = theForm.elements['nuser'].value;
	if (js_check_username(name))
		return true;
//	alert ("checkavail "+name);
	sajax_target_id = 'poperr'; 
	x_p_check_avail(name); 
	sajax_target_id = '';
	setTimeout("check_error()",1500);
}
function check_error()
{
	var x = document.getElementById('poperr');
//	alert (x.innerHTML);
	if (x.innerHTML != "&nbsp;")
	{
		var y = document.getElementById('nuser');
		y.value = "";
		y.focus();
	}
}
function js_check_username(name)
{
	if (name == "")
	{
		pop_err("Please, enter a username, min 6 char lowercase alphanumeric only.","user");	
		return true;
	}
	var User_N = name;
	User_N = User_N.toLowerCase();	// LOWERCASE ONLY
	var x = document.getElementById('nuser');
	x.value = User_N;
	var patt1 = /\W/g;
	var uu = "";
	uu = User_N.match(patt1);
	if (uu != null)
	{
		
		pop_err("Username in Lowercase Alphanumeric only!","nuser");	
		return true;
	}
	if (User_N.length < 6)
	{
		pop_err("Username: Six characters or more!","nuser");
		return true;
	}
	return false;
}
function js_check_email(theForm)
{
	var email = theForm.elements["email"].value;
	if (echeck(email))
	{
		pop_err("Please, enter a valid email address.","email");
		return true;
	}
	return false;
}
function js_check_user_form(theForm)
{
	if (js_check_username(theForm.elements['nuser'].value)) return true;
	if (js_check_passwords(theForm)) return true;
	if (js_check_email(theForm)) return true;
//	if (js_check_county(theForm)) return true;
	return false;
}
function js_new_user(theForm) 
{
//	showform(theForm,"js_new_user",0);
	if (js_check_user_form(theForm)) return true;
	Sess = theForm.elements['s'].value;
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	txt += "&ip="+Dip+"&";
//	alert (txt + "-> to p_new_user");
	sajax_target_id = 'main'; 
	x_p_new_user(txt); 
	sajax_target_id = '';
	setTimeout("js_nav()",1700);
}
function pop_err(txt,field)
{
	sajax_target_id = 'poperr'; 
	x_p_pop_err(txt); 
	sajax_target_id = '';
	document.getElementById(field).focus();
}
function js_user_exists(user)
{
//	alert ("user "+user+" exists?");
	sajax_target_id = 'poperr'; 
	x_p_user_exists(user); 
	sajax_target_id = '';
}
function js_make_payment(theForm)
{
//	showform(theForm,0,0);
	var tot = theForm.elements['total'].value;
	theForm.elements['amount'].value = tot;
	theForm.submit();
}
function js_download(product)
{
	sajax_target_id = 'hide'; 
	x_p_download(product); 
	sajax_target_id = '';
}
// ==========================================================================================================
// === ACCOUNTS
// ==========================================================================================================
function js_acc_w2c()
{
//	alert("js_acc_w2c");
	sajax_target_id = 'main'; 
	x_p_acc_w2c(Sess); 
	sajax_target_id = '';
}
function js_acc_by_pjt()
{
	sajax_target_id = 'main'; 
	x_p_acc_by_pjt(Sess); 
	sajax_target_id = '';
}
function js_acc_by_name()
{
	alert("by name");
	sajax_target_id = 'main'; 
	x_p_acc_by_name(Sess); 
	sajax_target_id = '';
}
function js_acc_ac_inv()
{
	alert("js_acc_ac_inv");
	sajax_target_id = 'main'; 
	x_p_acc_ac_inv(Sess); 
	sajax_target_id = '';
}
function js_acc_ac_inv2(theForm)
{
	showform(theForm,"js_acc_ac_inv2",0);
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	txt += "s="+Sess+"&ip="+Dip+"&";
	sajax_target_id = 'main'; 
	x_p_acc_ac_inv2(txt); 
	sajax_target_id = '';
}
function js_acc_eoj()
{
	alert("js_acc_eoj");
	sajax_target_id = 'main'; 
	x_p_acc_eoj(Sess); 
	sajax_target_id = '';
}
function js_acc_eoj2(theForm)
{
	showform(theForm,"js_acc_eoj2",0);
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	txt += "s="+Sess+"&ip="+Dip+"&";
	sajax_target_id = 'main'; 
	x_p_acc_eoj2(txt); 
	sajax_target_id = '';
}
function js_acc_buy_pays()
{
	alert("js_acc_buy_pays");
	sajax_target_id = 'main'; 
	x_p_acc_buy_pays(Sess); 
	sajax_target_id = '';
}
function js_acc_buy_pays2(theForm)
{
	showform(theForm,"js_acc_buy_pays2",0);
	var txt = "";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + "=" + theForm.elements[i].value + "&";
	txt += "s="+Sess+"&ip="+Dip+"&";
	sajax_target_id = 'main'; 
	x_p_acc_buy_pays2(txt); 
	sajax_target_id = '';
}
function js_acc_w2c_pays()
{
	alert("js_acc_w2c_pays");
	sajax_target_id = 'main'; 
	x_p_acc_w2c_pays(Sess); 
	sajax_target_id = '';
}
// ==========================================================================================================
// === RSS
// ==========================================================================================================
function js_sel_feed()
{
//	alert ("js_sel_feed");
	sajax_target_id = 'rssfeed'; 
	x_p_sel_feed(); 
	sajax_target_id = '';
	ToRss = setTimeout("js_refresh_feed()",30000);
}
function js_sel_rssno(rssn)
{
//	alert ("js_sel_rssno: "+rssn);
	RSSno = rssn;
	sajax_target_id = 'rssfeed'; 
	x_p_sel_rssno(rssn); 
	sajax_target_id = '';
	setCookie("rssno",RSSno,365);
}
function js_refresh_feed()
{
//	alert("js_refresh_feed. Feed="+Feed);
	if (RSSno == 0)
		RSSno = 13;
	sajax_target_id = 'rssfeed'; 
	x_p_refresh_feed(RSSno); 
	sajax_target_id = '';
	clearTimeout(ToRss);
	ToRss = setTimeout("js_refresh_feed()",300000);
}
function js_make_all_feeds()
{
	alert ("js_make_all_feeds");
	sajax_target_id = 'rssfeed'; 
	x_get_all_feeds(0); 
	sajax_target_id = '';
}
function js_rs_highlight(highlightcolor)
{ 
	var source = event.srcElement; 
	if (source.tagName=="TR"||source.tagName=="TABLE") 
		return 
	while (source.tagName!="TD") 
		source=source.parentElement; 
	if (source.style.backgroundColor != highlightcolor) 
		source.style.backgroundColor = highlightcolor; 
} 
function js_rs_restore(originalcolor)
{ 
	var source = event.srcElement;
	if (event.toElement!=source) 
		source.style.backgroundColor = originalcolor;
}

function js_show_article(artno)
{
//	alert("js_show_article: "+artno);
	if (PrevArticle != "")
	{
		sajax_target_id = PrevArticle; 
		x_p_close_article(); 
		sajax_target_id = '';
	}
	var id = "art"+artno;
	sajax_target_id = id; 
	x_p_show_article(Sess,artno); 
	sajax_target_id = '';
	PrevArticle = id;
}
/*
function js_show_article(artno)
{
	sajax_target_id = 'main'; 
	x_p_show_article(artno); 
	sajax_target_id = '';
}
*/
function js_counter(prod)
{
	alert ("Incrementing counter for "+prod);
	sajax_target_id = "hide"; 
	x_p_counter(prod); 
	sajax_target_id = '';
}
