
var xmlHttp=false;

function createXmlHttp()
{
	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();
	}
}

var tempObj;

function runAJAX(strURL,returnObj)
{
	var _d=new Date();
	if(strURL.indexOf('?')>0)
			strURL+='&Temp='+_d.getTime();
		else
			strURL+='?Temp='+_d.getTime();
	tempObj=returnObj;
	createXmlHttp();
	xmlHttp.open("Get",strURL,true);
	xmlHttp.onreadystatechange=returnContent;
	xmlHttp.send(null);
}

function returnContent()
{
	if(tempObj&&xmlHttp.readyState==4)
	{
		tempObj.innerHTML=xmlHttp.responseText;
	}
}

//..................comment

var objComment;
var vool;
function runCommentAJAX(strURL,returnObjComment,commentModeration)
{
	var _d=new Date();
	if(strURL.indexOf('?')>0)
			strURL+='&Temp='+_d.getTime();
		else
			strURL+='?Temp='+_d.getTime();
	objComment=returnObjComment;
	vool=commentModeration;
	createXmlHttp();
	xmlHttp.open("Get",strURL,true);
	xmlHttp.onreadystatechange=returnCommentContent;
	xmlHttp.send(null);
}

function returnCommentContent()
{
	if(objComment&&xmlHttp.readyState==4)
	{
		objComment.innerHTML=xmlHttp.responseText;		
		PassValue();
		if(vool=='True')
		{
		    alert("Thanks for your comments...");
		}
	}
}

function PassValue()
{
    try
    {
        $('post_comment_count_span').innerHTML=$('comment_count_span').innerHTML; 
        $('imgVerify').onclick(); 
    }
    catch(e){}
}


//....................


//..................background

function readCookie(name)
{

  var cookieValue = "";

  var search = name + "=";

  if(document.cookie.length > 0)

  { 

    offset = document.cookie.indexOf(search);

    if (offset != -1)

    { 

      offset += search.length;

      end = document.cookie.indexOf(";", offset);

      if (end == -1) end = document.cookie.length;

      cookieValue = unescape(document.cookie.substring(offset, end))

    }

  }
  return cookieValue;
}
        
function setBackGround(a)
{  
    cookieBg.set("BackGroundImage",a,31536000000);
    //var bgImage=readCookie("BackGroundImage");
    var bgImage=a;
    
    if(bgImage!='')
    {
        $('Bodybackground').style.background="#000000 url('uploaded/BackGround/"+bgImage+"') no-repeat fixed 0 0";
    }
    else
    {
        $('Bodybackground').style.background="#000000 url('images/bg.gif') no-repeat fixed 0 0";
    }
}

function IsetBackGround()
{    
    var bgImage=readCookie("BackGroundImage");
    //alert($('background').style.background);
    if(bgImage!='')
    {
        //$('background').innerHTML='<img src=uploaded/BackGround/'+bgImage+' height=100% width=100% />';
        $('Bodybackground').style.background="#000000 url('uploaded/BackGround/"+bgImage+"') no-repeat fixed 0 0";
    }
    else
    {
        //$('background').innerHTML='<img src=images/bg.gif height=100% width=100% />';
        $('Bodybackground').style.background="#000000 url('images/bg.gif') no-repeat fixed 0 0";
    }
}

//....................