function createRequestObject(){

var req;
var divID;

if(window.XMLHttpRequest){
//For Firefox, Safari, Opera
req = new XMLHttpRequest();
}
else if(window.ActiveXObject){
//For IE 5+
req = new ActiveXObject("Microsoft.XMLHTTP");
}
else{
//Error for an old browser
alert('Your browser is not IE 5 or higher, or Firefox or Safari or Opera');
}

return req;
}

//Make the XMLHttpRequest Object
var http = createRequestObject();

function sendRequest(method, url,id){

divID=id;
if(method == 'get' || method == 'GET'){
http.open(method,url);
http.onreadystatechange = handleResponse;
http.send(null);
}
}

function handleResponse(){
if(http.readyState == 4 && http.status == 200){
var response = http.responseText;
if(response){
// Put Div Id here



document.getElementById(divID).innerHTML = response;

//if(start1<4){
//document.getElementById("nextImage").style.visibility="hidden";
//document.getElementById("nextImage").style.display="none";
//}
}
}     
}



var firstPo=0;
var start1=0;
function calNext(start){
start1=start;
if(start==4){

firstPo=firstPo+start;
// alert('firstPo --IN IF- '+firstPo)
sendRequest('GET','/icc120-photos.do?sub=SubCategoryWithPhotoFeature&catID=4&subCatID=56&photoFeatureID=2944&pageNo='+firstPo+'&noOfRecords=5&forwardpath=/campaign/christmas/components/campPhoto.jsp','imageDiv');

}else{

//alert(firstPo);


sendRequest('GET','/icc120-photos.do?sub=SubCategoryWithPhotoFeature&catID=4&subCatID=56&photoFeatureID=2944&pageNo='+(firstPo+start)+'&noOfRecords=5&forwardpath=/campaign/christmas/components/campPhoto.jsp','imageDiv');


}



}


function calPre(start){


if(start==4){
firstPo=firstPo-start;
sendRequest('GET','/icc120-photos.do?sub=SubCategoryWithPhotoFeature&catID=4&subCatID=56&photoFeatureID=2944&pageNo='+firstPo+'&noOfRecords=5&forwardpath=/campaign/christmas/components/campPhoto.jsp','imageDiv');

}else{
sendRequest('GET','/icc120-photos.do?sub=SubCategoryWithPhotoFeature&catID=4&subCatID=56&photoFeatureID=2944&pageNo='+(firstPo-start)+'&noOfRecords=5&forwardpath=/campaign/christmas/components/campPhoto.jsp','imageDiv');


  }
}


