/**
 * @version $Id basic.js
 * @version $Revision 1.0$ 2005-09-08
 * @version Basic Ajax Functionality Page
 * @author selvaraj_47AG04
 *
 * @copyright Copyright (c) 2005 Agriya Infoway (http://www.agriya.com)
 */

//Common Ajax functions

var data;
var div_id;
var replace_word = "check||||||||||valid||||||||login";
var find_word = "heck||||||||||valid||||||||login";
function AG_xml(url, cmd)
	{
		if(url.length<=0 || cmd.length<=0)
			{
				alert("Error: Unable to Found the URL");return false;
			}
		this.url = url;
		this.cmd = cmd;
		this.result = "";
		this.req = null;
		if (window.XMLHttpRequest)
			{
				var req = new XMLHttpRequest();
				if (req.overrideMimeType)
					{
						req.overrideMimeType('text/html');
				 	}
			}
			else if (window.ActiveXObject)
				{
					req = new ActiveXObject("Microsoft.XMLHTTP");
				}
		this.req = req;
		return true;
	}

function AG_post_xml(url,cmd, fieldValues)
	{
		this.output = "NoRecords";
		var x = new AG_xml(url,cmd);
		x.popen();
		try
			{
				x.req.onreadystatechange = function()
					{
						if (x.req.readyState==4)
							{
								if(x.req.status==200)
									{
										if(x.req.responseText)
											{
												x.result = escape(x.req.responseText);
												x.getOp();
											}
									}
							}
					}
			}
		catch(e){}
		x.psend(AG_getURI(fieldValues));
		return true;
	}

function AG_ajax(url,cmd)
	{
		this.output = "NoRecords";
		var x = new AG_xml(url,cmd);
		x.opens();
		try
			{
				x.req.onreadystatechange = function()
					{
						if (x.req.readyState==4)
							{
								if(x.req.status==200)
									{
										if(x.req.responseText)
											{
												x.result = escape(x.req.responseText);
												x.getOp();
											}
									}
							}
					}
			}
		catch(e){}
		x.sends();
	}

AG_xml.prototype.opens = function()
	{
		this.req.open("GET", this.url, true);
	}

AG_xml.prototype.sends = function()
	{
		this.req.send(null);
	}

AG_xml.prototype.popen = function()
	{
		this.req.open("POST", this.url, true);
	}

AG_xml.prototype.psend = function(p)
	{
		this.req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		this.req.setRequestHeader("Content-length",p.length);
		this.req.send(unescape(p));
	}

AG_xml.prototype.getOp=function()
	{
		if(arguments.length>1)
			{
				this.cmd = arguments[0];
				alert(this.cmd+"(\""+this.result+"\")");
			}
		eval(this.cmd+"(\""+this.result+"\")");
	}

window.onerror=showError

function showError(msg, url, linenumber)
	{
		//alert('Error(s) Found....!\n Error message= '+msg+'\nURL= '+url+'\nLine Number= '+linenumber);
		return false;
	}

//Added function for application Index page
function call_ajax(div_id,path)
	{
		this.div_id = div_id;
		var show = show_hide(div_id);
		if(show)
			{
				AG_ajax(path,'show_table');
			}
	}

function show_hide()
	{
		var obj = document.getElementById(this.div_id);
		if(obj.style.display == 'none')
			{
				obj.style.display = 'block';
				return true;
			}
		else
			{
				obj.style.display = 'none';
				return false;
			}
	}

function show_table(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var obj = document.getElementById(this.div_id);
		obj.innerHTML = data;
	}

/****************** Function for members/forum.php and members/myForum.php ****************/
//this function used to show and hide all forum threads
function call_ajax_hide_expand_threads(hide_show_option)
	{

			if(!hide_show_option)
				hide_show_option = 'all';
			//Cahange td link
			var	obj_td = document.getElementById(option_arr['td_id']);
			var attach_url = this.option_arr['url']+"?forumid="+option_arr['forumid']+"&tag="+option_arr['tag']+"&catagory="+option_arr['catagory']+"&numpg="+option_arr['numpg']+"&start="+option_arr['start']+"&orderby="+option_arr['orderby']+"&order="+option_arr['order'];
			if(hide_show_option=='all')
				{
					if(this.option_arr['hide_show'] == 'hide')
						{
							attach_url += "&"+this.option_arr['show']+"="+hide_show_option;
							obj_td.innerHTML = "<a href='javascript: var dummy=call_ajax_hide_expand_threads()'>"+this.option_arr['show_lang']+'</a>';
							this.option_arr['hide_show'] = 'show';
						}
					else
						{
							attach_url += "&"+this.option_arr['hide']+"="+hide_show_option;
							obj_td.innerHTML = "<a href='javascript: var dummy=call_ajax_hide_expand_threads()'>"+this.option_arr['hide_lang']+'</a>';
							this.option_arr['hide_show'] = 'hide';
						}
				}
			else
				{
					if(this.option_arr['hide_show1'] == 'hide')
						{
							attach_url += "&"+this.option_arr['show']+"="+hide_show_option;
						}
					else
						{
							attach_url += "&"+this.option_arr['hide']+"="+hide_show_option;
						}
				}
			var divsel_obj = document.getElementById(this.option_arr['selShowForum']);
			this.timer_option = 1;
			AG_ajax(attach_url,'show_expand_hide_threads_table');
			this.option_arr['function_call'] = 'call_ajax_hide_expand_threads_timer';
	}

//this function used to show and hide single forum threads
function call_ajax_hide_expand_threads_single(forum_id,show_hide)
	{
			this.option_arr['forumid']=forum_id;
			this.option_arr['hide_show1']=show_hide;
			call_ajax_hide_expand_threads(forum_id);
			this.option_arr['function_call'] = 'call_ajax_hide_expand_threads_single_timer';
	}

//this function used to show and hide single and all forum threads
function show_expand_hide_threads_table(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var obj_div = document.getElementById(this.option_arr['div_id']);
		obj_div.innerHTML = data;
	}

//this function used to show forum and reply
function call_ajax_show_forum(url)
	{
		this.option_arr['next_msg'] = true;
		AG_ajax(url,'call_ajax_show_forum_show');
	}

//this function used to show forum and reply
function call_ajax_show_forum_show(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var divsel_obj = document.getElementById('selShowForum');
		divsel_obj.innerHTML = data;
	}

//Function for pause or play the forum list
function call_ajax_hide_expand_threads_timer(hide_show_option)
	{

			if(!hide_show_option)
				hide_show_option = 'all';

			var attach_url = this.option_arr['url']+"?forumid="+option_arr['forumid']+"&tag="+option_arr['tag']+"&catagory="+option_arr['catagory']+"&numpg="+option_arr['numpg']+"&start="+option_arr['start']+"&orderby="+option_arr['orderby']+"&order="+option_arr['order'];
			if(hide_show_option=='all')
				{
					if(this.option_arr['hide_show'] == 'hide')
						{
							attach_url += "&"+this.option_arr['hide']+"="+hide_show_option;
						}
					else
						{
							if(this.timer_option==1 && this.option_arr['hide_show'] == 'show')
								attach_url += "&"+this.option_arr['show']+"="+hide_show_option;
							else
								attach_url += "&"+this.option_arr['show']+"="+hide_show_option;
								//attach_url += "&"+this.option_arr['hide']+"="+hide_show_option;
						}
				}
			else
				{

					if(this.option_arr['hide_show1'] == 'hide')
						{
							attach_url += "&"+this.option_arr['show']+"="+hide_show_option;
						}
					else if(this.option_arr['hide_show1']=='show')
						{
							attach_url += "&"+this.option_arr['hide']+"="+hide_show_option;
						}
				}

			var divsel_obj = document.getElementById(this.option_arr['selShowForum']);
			if(this.option_arr['select'] == 'capping')
					attach_url += "&option=list"
			AG_ajax(attach_url,'show_expand_hide_threads_table');
			this.option_arr['function_call'] = 'call_ajax_hide_expand_threads_timer';
			if(this.option_arr['pause_play'] == 'pause')
				{
					timer_start()
				}
	}
function call_ajax_hide_expand_threads_single_timer(forum_id,show_hide)
	{
			this.option_arr['forumid']=forum_id;
			this.option_arr['hide_show1']=show_hide;
			call_ajax_hide_expand_threads_timer(forum_id);
			this.option_arr['function_call'] = 'call_ajax_hide_expand_threads_single_timer';
	}

function sub_timer()
	{
			if(this.timer_option)
				{
					if(this.option_arr['function_call'] == 'call_ajax_hide_expand_threads_single_timer')
							{
								call_ajax_hide_expand_threads_single_timer(this.option_arr['forumid'],this.option_arr['hide_show1']);
							}
						else if(this.option_arr['function_call'] == 'call_ajax_hide_expand_threads_timer')
							{
								if(this.option_arr['hide_show'] == 'show')
									{
										call_ajax_hide_expand_threads_timer('all');
									}
								else
									{
										call_ajax_hide_expand_threads_timer('all');
									}
							}
				}
			else
				{
					call_ajax_hide_expand_threads_timer('all');
				}
	}
function timer_start()
	{
		if(this.option_arr['pause_play'] == 'pause')
			{
				setTimeout('sub_timer()', 10000);
			}
	}
function call_ajax_pause_play()
	{
		var obj_elem = document.getElementById(this.option_arr['elem']);
		if(this.option_arr['pause_play'] == 'play')
			{
				obj_elem.innerHTML = "<a href='javascript: var dummy=call_ajax_pause_play()'>"+this.option_arr['pause']+"</a>";
				this.option_arr['pause_play'] = 'pause';
			}
		else
			{
				obj_elem.innerHTML = "<a href='javascript: var dummy=call_ajax_pause_play()'>"+this.option_arr['play']+"</a>";
				this.option_arr['pause_play'] = 'play';
			}
			timer_start();
	}

function call_ajax_edit_form(msgid,forumid)
	{
		if( this.option_arr['next_msg']==false)
			return false;
		url = this.option_arr['edit_url']+'?msgid='+msgid+'&forumid='+forumid;
		this.option_arr['msgid'] = msgid;
		this.option_arr['forumid'] = forumid;
		AG_ajax(url,'call_ajax_edit_form_show');
		this.option_arr['next_msg'] = false;
		return false;
	}

function call_ajax_edit_form_show(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var obj = document.getElementById('selForumMsg'+this.option_arr['msgid']);
		obj.innerHTML = data;
	}

function call_ajax_update_forum(msgid,forumid,message,add_submit)
	{
		if(Trim(message)=='' && add_submit=='add_submit')
			return false;
		url = this.option_arr['edit_url']+'?msgid='+msgid+'&forumid='+forumid+'&message='+escape(message)+'&'+add_submit+'='+add_submit;
		this.option_arr['msgid'] = msgid;
		this.option_arr['forumid'] = forumid;
		AG_ajax(url,'call_ajax_update_forum_show');
		this.option_arr['next_msg'] = true;
		return false;
	}

function call_ajax_update_forum_show(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		maindata = data.split('###date###');
		var obj = document.getElementById('selForumMsg'+this.option_arr['msgid']);
		obj.innerHTML = maindata[0];
		var obj = document.getElementById('selUpdateMsg'+this.option_arr['msgid']);
		obj.innerHTML = maindata[1];
		if(window.opener!=null)
			{
				obj = window.opener.document.getElementById('selForumMsg'+this.option_arr['msgid']);
				if(obj!=null)
					obj.innerHTML = data;
			}
	}

function call_ajax_reply_submit(forumid,newreply)
	{
		if(Trim(newreply)=='')
			return false;
		this.option_arr['next_msg'] = true;
		if(this.option_arr['url_new'])
			url = this.option_arr['url_new']+'?forumid='+forumid+'&tag='+ this.option_arr['tag']+'&catagory='+ this.option_arr['catagory']+'&reply=reply&newreply='+newreply;
		else
			url = this.option_arr['url']+'?forumid='+forumid+'&tag='+ this.option_arr['tag']+'&catagory='+ this.option_arr['catagory']+'&reply=reply&newreply='+newreply;
		this.option_arr['forumid'] = forumid;
		AG_ajax(url,'call_ajax_reply_submit_show');
		return false;
	}

function call_ajax_reply_submit_show(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var obj = document.getElementById('selShowForum');
		obj.innerHTML = data;
	}

function call_ajax_reply_detech_submit(forumid,newreply)
	{
		if(Trim(newreply)=='')
			return false;
		url = this.option_arr['detech_url']+'?forumid='+forumid+'&reply=reply&newreply='+newreply;
		this.option_arr['forumid'] = forumid;
		AG_ajax(url,'call_ajax_reply_detech_submit_show');
	}

function call_ajax_reply_detech_submit_show(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var obj = document.getElementById('selShowForum');
		obj.innerHTML = data;
	}

function call_ajax_reply_submit_pop(forumid,newreply)
	{
		if(Trim(newreply)=='')
			return false;
		this.option_arr['next_msg'] = true;
		this.option_arr['newreply'] = newreply;
		this.option_arr['next_msg'] = true;
		if(this.option_arr['url_new'])
			url = this.option_arr['url_new']+'?forumid='+forumid+'&reply=reply&newreply='+newreply;
		else
			url = this.option_arr['url']+'?forumid='+forumid+'&reply=reply&newreply='+newreply;
		AG_ajax(url,'call_ajax_reply_submit_show_pop');
		return false;
	}

function call_ajax_reply_submit_show_pop(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		if(window.opener!=null)
			{
				if(window.opener.document.getElementById('selShowForum'))
					{
						var obj = window.opener.document.getElementById('selShowForum');
						obj.innerHTML = data;
					}
			}
		call_ajax_reply_detech_submit(this.option_arr['forumid'],this.option_arr['newreply'])
	}
/************************ functions for cappingForum.php *******************///this function used to show and hide all forum threads
function call_ajax_hide_expand_threads_capping(hide_show_option)
	{
			if(!hide_show_option)
				hide_show_option = 'all';
			//Cahange td link
			var	obj_td = document.getElementById(option_arr['td_id']);
			var attach_url = this.option_arr['url']+"?forumid="+option_arr['forumid']+"&tag="+option_arr['tag']+"&catagory="+option_arr['catagory']+"&numpg="+option_arr['numpg']+"&start="+option_arr['start']+"&orderby="+option_arr['orderby']+"&order="+option_arr['order']+'&option=list';
			if(hide_show_option=='all')
				{
					if(this.option_arr['hide_show'] == 'hide')
						{
							attach_url += "&"+this.option_arr['show']+"="+hide_show_option;
							obj_td.innerHTML = "<a href='javascript: var dummy=call_ajax_hide_expand_threads_capping()'>"+this.option_arr['show_lang']+'</a>';
							this.option_arr['hide_show'] = 'show';
						}
					else
						{
							attach_url += "&"+this.option_arr['hide']+"="+hide_show_option;
							obj_td.innerHTML = "<a href='javascript: var dummy=call_ajax_hide_expand_threads_capping()'>"+this.option_arr['hide_lang']+'</a>';
							this.option_arr['hide_show'] = 'hide';
						}
				}
			else
				{
					if(this.option_arr['hide_show1'] == 'hide')
						{
							attach_url += "&"+this.option_arr['show']+"="+hide_show_option;
						}
					else
						{
							attach_url += "&"+this.option_arr['hide']+"="+hide_show_option;
						}
				}
			var divsel_obj = document.getElementById(this.option_arr['selShowForum']);
			this.timer_option = 1;
			AG_ajax(attach_url,'show_expand_hide_threads_table');
			this.option_arr['function_call'] = 'call_ajax_hide_expand_threads_timer';

	}

//this function used to show and hide single forum threads
function call_ajax_hide_expand_threads_single_capping(forum_id,show_hide)
	{
			this.option_arr['forumid']=forum_id;
			this.option_arr['hide_show1']=show_hide;
			call_ajax_hide_expand_threads_capping(forum_id);
			this.option_arr['function_call'] = 'call_ajax_hide_expand_threads_single_timer';
	}
//this function used to show forum and reply
function call_ajax_show_forum_capping(url)
	{
		this.option_arr['next_msg'] = true;
		AG_ajax(url,'call_ajax_show_forum_show');
	}
/********************** functions for target forum ***************/
function call_ajax_target_forum(url,div_tag)
	{
		this.option_arr['next_msg'] = true;
		this.div_tag = div_tag;
		AG_ajax(url,'call_ajax_target_forum_show');
	}
function call_ajax_target_forum_show(data)
	{
		this.option_arr['next_msg'] = true;
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var obj = document.getElementById(this.div_tag);
		obj.innerHTML = data;
	}

/****************** functions for messagesHistory.php ***********/
function call_ajax_messages_history(url,div_tag_his)
	{
		this.div_tag_his = div_tag_his;
		AG_ajax(url,'call_ajax_messages_history_show');
		return false;
	}
function call_ajax_messages_history_show(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		data = data.split('||||message_page_nav||||');
		var obj = document.getElementById(this.div_tag_his);
		obj.innerHTML = data[0];
		obj = document.getElementById('selMessagePageNav');
		obj.innerHTML = data[1];

	}

/***************** functions for newForum.php ****************/
function emptySelectBox(selBox)
	{
		//selBox = document.getElementById(id);
		if(selBox.options.length==0) return;

		for(var i=selBox.options.length-1; i>=0; i--)
			{
				selBox.options[i]= null;
			}
	}
function str_replace(data,change,by)
	{
		while(data.lastIndexOf(change)>0)
			{
				data = data.replace(change,by);
			}
			return data;
	}
function call_ajax_populate_city(path,country)
	{
		var obj = document.getElementById('cityid');
		emptySelectBox(obj);
		if(country=="")
			{
				obj.disabled = true;
				return;
			}
		path = path+"?country="+country;
		AG_ajax(path,'populate_city_list');
	}
function populate_city_list(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var arg;
		data = data.split(':::');
		var obj = document.getElementById('cityid');
		obj.disabled = false;
		for(i=0;i<data.length;i++)
			{
				arg = data[i].split('***');
				obj.options[obj.options.length] = new Option(arg[0], arg[1], arg[2], arg[3]);
			}
	}

var div_tag_album;
//Functions for show image album

function openTheImage(urlStr)
	{
		window.open(urlStr);
	}

function downLoadImage(urlStr)
	{
		window.open(urlStr,"_blank");
	}

function call_ajax_show_image(path)
	{
		this.div_tag_album = 'selSlideShowPage';
		AG_ajax(path,'call_ajax_show_image_album');
		return false;
	}
function call_ajax_show_image_album(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var obj = document.getElementById(this.div_tag_album);
		obj.innerHTML = data;
	}

function call_ajax_show_image1(path)
	{
		this.div_tag_album = 'selViewSlides';
		new AG_ajax(path,'call_ajax_show_image_album1');
		return false;
	}
function call_ajax_show_image_album1(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		data = data.split('|||||||||||||||[][][]|||||||||||');
		var obj = document.getElementById(this.div_tag_album);
		obj.innerHTML = data[0];
		count_slide_show = data[1];
		dragDropInit();
		window.clearTimeout(timer_status);
		increment_photo = 2;
		slideShowPlay();
	}

function call_ajax_show_image2(path)
	{
		this.div_tag_album = 'selViewSlides';
		new AG_ajax(path,'call_ajax_show_image_album2');
		return false;
	}
function call_ajax_show_image_album2(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		data = data.split('|||||||||||||||[][][]|||||||||||');
		//alert(data[1]);
		var obj1 = document.getElementById("selAlbumLinks");
		var obj2 = document.getElementById("selAlbums");
		obj1.innerHTML = data[0];
		obj2.innerHTML = data[1];
		window.clearTimeout(timer_status);
		//alert(data[2]);
		call_ajax_show_image1(data[2]);
	}
function cityupdate(id, tab)
	{
		url = siteURL + 'populateCities_ajax.php?id='+id+'&tab='+tab;
		new AG_ajax(url,'cityupdate_show');
	}

function cityupdate_show(data)
	{
		data = unescape(data);
		var obj = opener.document.getElementById('cityTdId'); //selBlogForumMsg //selGroupNewest
		if(obj!=null)
			{
				obj.innerHTML = data;
			}
		window.close();
	}

function call_ajax_edit_form_title(forumid, msgid)
	{
		if( this.option_arr['next_msg']==false)
			return false;
		url = siteURL +'members/editForumTitle_ajax.php?title=1&forumid='+forumid;
		this.option_arr['forumid'] = forumid;
		AG_ajax(url,'call_ajax_edit_form_title_show');
		url = this.option_arr['edit_url']+'?msgid='+msgid+'&forumid='+forumid+'&action=no';
		this.option_arr['msgid'] = msgid;
		AG_ajax(url,'call_ajax_edit_form_show_title');
		this.option_arr['next_msg'] = false;
		return false;
	}

function call_ajax_edit_form_title_show(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var obj = document.getElementById('selForumTitle');
		obj.innerHTML = data;
	}

function call_ajax_edit_form_show_title(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var obj = document.getElementById('selForumMsg'+this.option_arr['msgid']);
		obj.innerHTML = data;
	}

function call_ajax_update_title_forum(forumid,msgid,message,subject,add_submit)
	{
		if(Trim(message)=='' && add_submit=='add_submit')
			return false;
		if(Trim(subject)=='' && add_submit=='add_submit')
			return false;
		url = siteURL +'members/editForumTitle_ajax.php?forumid='+forumid+'&message='+escape(subject)+'&'+add_submit+'='+add_submit+'&title=1';
		this.option_arr['forumid'] = forumid;
		AG_ajax(url,'call_ajax_update_forum_title_show');
		url = this.option_arr['edit_url']+'?msgid='+msgid+'&forumid='+forumid+'&message='+escape(message)+'&'+add_submit+'='+add_submit;
		this.option_arr['msgid'] = msgid;
		this.option_arr['forumid'] = forumid;
		AG_ajax(url,'call_ajax_update_forum_show');
		this.option_arr['next_msg'] = true;
		return false;
	}

function call_ajax_update_forum_title_show(data)
	{
		data = unescape(data);
		if(data.indexOf(find_word)<1)
			{
				location.replace(replace_url);return;
			}
		data = data.replace(replace_word,'');
		var obj = document.getElementById('selForumTitle');
		obj.innerHTML = data;
		if(window.opener!=null)
			{
				obj = window.opener.document.getElementById('selForumTitle');
				if(obj!=null)
					obj.innerHTML = data;
			}
	}
