<!--

// Copyright 2007 Notion Age Pte. Ltd. All rights reserved.


//AJAX START - Featured Case Study
var response_text;
/***********************************
*/
var interval=12000;
/*
************************************/

function xmlhttpPost(strURL) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
			response_text=self.xmlHttpReq.responseText;
            updatepage(response_text);
            //setHeight();
        }
		else if (self.xmlHttpReq.readyState == 1 || self.xmlHttpReq.readyState == 3 || self.xmlHttpReq.readyState == 0) {
            loading();
        }		
    }
    self.xmlHttpReq.send(getquerystring());
}

function getquerystring() {
/*
	var form = document.forms['f1'];
    var word = form.word.value;
    qstr = 'w=' + escape(word);  // NOTE: no '?' before querystring
    return qstr;
*/
	return "";
}

function updatepage(str){
	
    if(str.substr(0,1)=="0")
	{
		interval=9999999;	
	}
	
	strlens=str.length-1;
	str=str.substr(1,strlens);
	document.getElementById("random_feature").innerHTML = str;	
	//alert(document.getElementById("highlight-box").offsetHeight);
}

function loading()
{
    document.getElementById("random_feature").innerHTML = "<div align='/center'/ style='/width:220px; height:160px;'/><img style='/margin:60px auto 70px auto;'/ src='/images/loading.gif'/ alt='/Loading'/ width='/24'/ height='/24'/ /></div>";	
}


//AJAX END


function updatePage()
{
	xmlhttpPost("/includes/random_feature.php");
	setTimeout("updatePage()",interval);	
}

// Get and Set DIV height


function setHeight()
{
	var left_body=document.getElementById("body-left");
	var right_body=document.getElementById("highlight-box");
	right_body.style.height="auto";
	right_body.style.height=Math.max(left_body.offsetHeight,right_body.offsetHeight)+"px";
	//alert(right_body.style.height);
}

/*
window.onload = function() 
{
		//setHeight();
		updatePage();
}
*/
updatePage();


-->