//document.getElementById("main").innerHTML=val1;
var xmlHttpConfig;

function getAddNewsVars(page,action,news_id,val1,val2,val3,val4,val5)
{
var val1, val2, val3, val4, val5;

if((action=="do_editnews")||(action=="do_addnews")){
//document.write(action);
val1 = document.getElementById("title").value;
val2 = document.getElementById("news").value;
}
if(action=="do_add_image"){
//document.write(val2);
val1 = document.getElementById("uploadfile").value;
val2 = document.getElementById("select").value;
}
if((action=="confirm_delete_news")||(action=="confirm_archive_news")||(action=="delete_image")){
val1 = document.getElementById("select").value;
}
if(action=="confirm_delete_image"){
val1 = document.getElementById("selectImg").value;
}
getEditBlog(page,action,news_id,val1,val2,val3,val4,val5);
}

function getEditBlog(page,action,news_id,val1,val2,val3,val4,val5)
{ 

xmlHttpConfig=GetXmlHttpObjectConfig()

if (xmlHttpConfig==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
 
var url="_pages/_config/config.php"
url=url+"?page="+page
url=url+"&action="+action
url=url+"&news_id="+news_id
url=url+"&val1="+val1
url=url+"&val2="+val2
url=url+"&val3="+val3
url=url+"&val4="+val4
url=url+"&val5="+val5
url=url+"&sid="+Math.random()

xmlHttpConfig.onreadystatechange=stateConfigChanged 
xmlHttpConfig.open("GET",url,true)
xmlHttpConfig.send(null)
} 


function stateConfigChanged() 
{ 
 if (xmlHttpConfig.readyState==4 || xmlHttpConfig.readyState=="complete")
 { 
 document.getElementById("mainbox").
 innerHTML=xmlHttpConfig.responseText;
 } 
} 

function GetXmlHttpObjectConfig()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
 {
 objXMLHttp=new XMLHttpRequest()
 }
else if (window.ActiveXObject)
 {
 objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
 }
return objXMLHttp

}
//------------------------------------------------------------------------------------------------
