// JavaScript Document
var xmlHttp = false;
form="";
try 
{
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} 
catch (e) 
{
  try 
  {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } 
  catch (e2) 
  {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') 
{
  xmlHttp = new XMLHttpRequest();
}

function edit(id,or)
{ 
  //alert("edit");
	URL='process1.php?id='+escape(id)+'&or='+escape(or);
	//alert(URL);
	xmlHttp.open("GET", URL, true);
	xmlHttp.onreadystatechange = callbackVote;
	xmlHttp.send(null);
}

 
function callbackVote() 
{
	if (xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
	//alert(response);
		valarr=response.split('^');
		if(response!='')
		{ 
			////////////////////////// start for title
			//alert(valarr[0]);
			objstr="document.getElementById('plus"+trim(valarr[0])+"')";//alert(objstr);
			obj=eval(objstr);
			obj.style.display = "none";
			
			objstr="document.getElementById('minus"+trim(valarr[0])+"')";//alert(objstr);
			obj=eval(objstr);
			obj.style.display ="inline";			
			
			//alert(response);
			objstr="document.getElementById('adiv"+trim(valarr[0])+"')";//alert(objstr);
			obj=eval(objstr);//alert(obj);
			obj.style.display = "block";
			st=valarr[1];//alert(st);
			//alert(st);
		    obj.innerHTML=st;			
		}
	}
}

function edit1(id)
{ 


			objstr="document.getElementById('plus"+id+"')";//alert(objstr);
			obj=eval(objstr);
			obj.style.display = "block";
			
			objstr="document.getElementById('minus"+id+"')";//alert(objstr);
			obj=eval(objstr);
			obj.style.display = "none";

			objstr="document.getElementById('adiv"+id+"')";//alert(objstr);
			obj=eval(objstr);
			obj.innerHTML="";
			
			
			obj.style.display='none';
			
		  //  document.getElementById("video").style.display='none';
		   
	return true;
}

function edit3(id,or)
{ 
	//alert("edit 3");


	URL='processval.php?id='+escape(id)+'&or='+escape(or);
	xmlHttp.open("GET", URL, true);
	xmlHttp.onreadystatechange = callbackVote3;
	xmlHttp.send(null);
	
	if(document.getElementById('show'))
	{
		document.getElementById('show').style.display='none';	
	}
	
	
	if(document.getElementById('homecontent'))
	{
	document.getElementById('homecontent').style.display='none';
	}
	
/*	
	if(document.getElementById('ads'))
	{
    document.getElementById('ads').style.display='none';
	}
	
*/	
	if(document.getElementById('video'))
	{   
	document.getElementById('video').style.display='none';
	}
	
}

 
function callbackVote3() 
{
	if (xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		valarr=response.split('^');
		if(response!='')
		{ 
			
			objstr="document.getElementById('headerContentValue')";//alert(objstr);
			obj=eval(objstr);
			st=valarr[1];
			obj.innerHTML=st;
		}
	}
}

 function trim(str) 
{ 
    return str.replace(/^\s+|\s+$/g,''); 
} 


////////////////////////////////// wordwrap function
String.prototype.wordWrap = function(m, b, c){
	var i, j, s, r = this.split("\n");
	if(m > 0) for(i in r){
		for(s = r[i], r[i] = ""; s.length > m;
			j = c ? m : (j = s.substr(0, m).match(/\S*$/)).input.length - j[0].length
			|| j.input.length + (j = s.substr(m).match(/^\S*/)).input.length + j[0].length,
			r[i] += s.substr(0, j) + ((s = s.substr(j)).length ? b : "")
		);
		r[i] += s;
	}
	return r.join("\n");
};
///////////////////////////////// end function