function virtualpaginate(className, chunksize, elementType){
    var elementType=(typeof elementType=="undefined")? "div" : elementType //The type of element used to divide up content into pieces. Defaults to "div"
    this.pieces=virtualpaginate.collectElementbyClass(className, elementType) //get total number of divs matching class name
    this.chunksize=(typeof chunksize=="undefined")? 1 : (chunksize>0 && chunksize <this.pieces.length)? chunksize : this.pieces.length
    this.pagecount=Math.ceil(this.pieces.length/this.chunksize) //calculate number of "pages" needed to show the divs
    this.showpage(-1) //show no pages (aka hide all)
    this.currentpage=0 //Having hidden all pages, set currently visible page to 1st page
    this.showpage(this.currentpage) //Show first page
}

virtualpaginate.collectElementbyClass=function(classname, element){ 
    //Returns an array containing DIVs with specified classname
    var classnameRE=new RegExp("(^|\\s+)"+classname+"($|\\s+)", "i") //regular expression to screen for classname within element
    var pieces=[]
    var alltags=document.getElementsByTagName(element)
    for (var i=0; i<alltags.length; i++){
        if (typeof alltags[i].className=="string" && alltags[i].className.search(classnameRE)!=-1)
        pieces[pieces.length]=alltags[i]
    }
    return pieces
}


virtualpaginate.prototype.showpage=function(pagenumber){
    var totalitems=this.pieces.length //total number of broken up divs
    var showstartindex=pagenumber*this.chunksize //array index of div to start showing per pagenumber setting
    var showendindex=showstartindex+this.chunksize-1 //array index of div to stop showing after per pagenumber setting
    for (var i=0; i<totalitems; i++){
        if (i>=showstartindex && i<=showendindex)
        this.pieces[i].style.display="block"
        else
        this.pieces[i].style.display="none"
    }
    this.currentpage=parseInt(pagenumber)
    if (this.cpspan) //if <span class="paginateinfo> element is present, update it with the most current info (ie: Page 3/4)
    this.cpspan.innerHTML=''+(this.currentpage+1)+'/'+this.pagecount
}

virtualpaginate.prototype.paginate_build_selectmenu=function(paginatedropdown, anchortext){
    var instanceOfBox=this
    var anchortext=anchortext || new Array()
    this.selectmenupresent=1
    for (var i=0; i<this.pagecount; i++){
        if (typeof anchortext[i]!="undefined") //if custom anchor text for this link exists, use anchor text as each OPTION's text
        paginatedropdown.options[i]=new Option(anchortext[i], i)
        else //else, use auto incremented, sequential numbers
        paginatedropdown.options[i]=new Option("Page "+(i+1)+" of "+this.pagecount, i)
    }
    paginatedropdown.selectedIndex=this.currentpage
    paginatedropdown.onchange=function(){
        instanceOfBox.showpage(this.selectedIndex)
    }
}

virtualpaginate.prototype.paginate_build_regularlinks=function(paginatelinks){
    var instanceOfBox=this
    for (var i=0; i<paginatelinks.length; i++){
        var currentpagerel=paginatelinks[i].getAttribute("rel")
        if (currentpagerel=="previous" || currentpagerel=="next" || currentpagerel=="first" || currentpagerel=="last") //screen for these "rel" values
        paginatelinks[i].onclick=function(){
            instanceOfBox.navigate(this.getAttribute("rel"))
            return false
        }
    }
}


virtualpaginate.prototype.paginate_build_flatview=function(flatviewcontainer, anchortext){
    var instanceOfBox=this
    var flatviewhtml=""
    var anchortext=anchortext || new Array()
    for (var i=0; i<this.pagecount; i++){
        if (typeof anchortext[i]!="undefined") //if custom anchor text for this link exists
        flatviewhtml+='<a href="#flatview" rel="'+i+'">'+anchortext[i]+'</a> ' //build pagination link using custom anchor text
        else
        flatviewhtml+='<a href="#flatview" rel="'+i+'">'+(i+1)+'</a> ' //build  pagination link using auto incremented sequential number instead
    }
    flatviewcontainer.innerHTML=flatviewhtml
    this.flatviewlinks=flatviewcontainer.getElementsByTagName("a")
    for (var i=0; i<this.flatviewlinks.length; i++){
        this.flatviewlinks[i].onclick=function(){
            instanceOfBox.flatviewlinks[instanceOfBox.currentpage].className="" //"Unhighlight" last flatview link clicked on...
            this.className="selected" //while "highlighting" currently clicked on flatview link (setting its class name to "selected"
            instanceOfBox.showpage(this.getAttribute("rel"))
            return false
        }
    }
    this.flatviewlinks[this.currentpage].className="selected" //"Highlight" current page
    this.flatviewpresent=true //indicate flat view links are present
}



virtualpaginate.prototype.paginate_build_cpinfo=function(cpspan){
    this.cpspan=cpspan
    cpspan.innerHTML=''+(this.currentpage+1)+'/'+this.pagecount
}

virtualpaginate.prototype.buildpagination=function(divid, optnavtext){
    var instanceOfBox=this
    var paginatediv=document.getElementById(divid)
    if (this.chunksize==this.pieces.length){ //if user has set to display all pieces at once, no point in creating pagination div
        paginatediv.style.display="none"
        return
    }
    var paginationcode=paginatediv.innerHTML //Get user defined, "unprocessed" HTML within paginate div
    if (paginatediv.getElementsByTagName("select").length>0) //if there's a select menu in div
    this.paginate_build_selectmenu(paginatediv.getElementsByTagName("select")[0], optnavtext)
    if (paginatediv.getElementsByTagName("a").length>0) //if there are links defined in div
    this.paginate_build_regularlinks(paginatediv.getElementsByTagName("a"))
    var allspans=paginatediv.getElementsByTagName("span") //Look for span tags within passed div
    for (var i=0; i<allspans.length; i++){
    if (allspans[i].className=="flatview")
        this.paginate_build_flatview(allspans[i], optnavtext)
        else if (allspans[i].className=="paginateinfo")
        this.paginate_build_cpinfo(allspans[i])
    }
    this.paginatediv=paginatediv
}


virtualpaginate.prototype.navigate=function(keyword){
    if (this.flatviewpresent)
    this.flatviewlinks[this.currentpage].className="" //"Unhighlight" previous page (before this.currentpage increments)
    if (keyword=="previous")
    this.currentpage=(this.currentpage>0)? this.currentpage-1 : (this.currentpage==0)? this.pagecount-1 : 0
    else if (keyword=="next")
    this.currentpage=(this.currentpage<this.pagecount-1)? this.currentpage+1 : 0
    else if (keyword=="first")
    this.currentpage=0
    else if (keyword=="last")
    this.currentpage=this.pieces.length-1
    this.showpage(this.currentpage)
    if (this.selectmenupresent)
    this.paginatediv.getElementsByTagName("select")[0].selectedIndex=this.currentpage
    if (this.flatviewpresent)
    this.flatviewlinks[this.currentpage].className="selected" //"Highlight" current page
}


function ajaxRequestDiv(url, parameters, div) {
	var ajaxRequest=null;
	try {
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Browser not suppported
				alert("Your browser not supported!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById(div);
			var tempresponse = ajaxRequest.responseText;
			ajaxDisplay.innerHTML = tempresponse;
		}
	}
	ajaxRequest.open('GET', url + "?" + parameters, true);
	ajaxRequest.send(null);
}


function hideshow(div, operation) {
	if(operation=='hide') {
		if (document.getElementById) { // DOM3 = IE5, NS6
			document.getElementById(div).style.visibility = 'hidden';
		} else {
			if (document.layers) { // Netscape 4
				document.div.visibility = 'hidden';
			} else { // IE 4
				document.all.div.style.visibility = 'hidden';
			}
		}
	} else {
		if (document.getElementById) { // DOM3 = IE5, NS6
			document.getElementById(div).style.visibility = 'visible';
		} else {
			if (document.layers) { // Netscape 4
				document.div.visibility = 'visible';
			} else { // IE 4
				document.all.div.style.visibility = 'visible';
			}
		}
	}
}


function closebox(box) {
	var jsDisplay = document.getElementById(box);
	jsDisplay.innerHTML = "";
}


function submitComment(id, box, url) {
	var ajaxRequest;  // The variable that makes Ajax possible!
	try{
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Your browser broke!");
				return false;
			}
		}
	}
	ajaxRequest.onreadystatechange = function() {
		if(ajaxRequest.readyState == 4) {
			var ajaxDisplay = document.getElementById(box);
			var xDisplay = document.getElementById('comments');
			var check = ajaxRequest.responseText.indexOf('<font color=red>');
			if(check==-1) {
				ajaxDisplay.innerHTML = "";
			}
			xDisplay.innerHTML = ajaxRequest.responseText + xDisplay.innerHTML;
		}
	}
	var comment = document.getElementById('comment').value;
	var name = document.getElementById('name').value;
	var email = document.getElementById('email').value;
	if (comment != "" && name != "" && email != "") {
		var str = "id="+id+"&name="+name+"&email="+email+"&submit=yes&comment="+comment;
		ajaxRequest.open("POST", url, true);
		ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		ajaxRequest.send(str);
	} else {
		alert('Required fields must not be empty');
	}
}


function makePostRequest(url, parameters, div) {
	var ajaxRequest=null;
	try {
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		try {
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Your browser not supported!");
				return false;
			}
		}
	}
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById(div);
			var tempresponse = ajaxRequest.responseText;
			ajaxDisplay.innerHTML = tempresponse;
		}
	}
	ajaxRequest.open('POST', url, true);
	ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	ajaxRequest.send(parameters);
}


var ddtabmenu={
	disabletablinks: false, //Disable hyperlinks in 1st level tabs with sub contents (true or false)?
	snap2original: [false, 300], //Should tab revert back to default selected when mouse moves out of menu? ([true/false, delay_millisec]
	currentpageurl: window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, ""), //get current page url (minus hostname, ie: http://www.dynamicdrive.com/)
definemenu:function(tabid, dselected){
	this[tabid+"-menuitems"]=null
	this[tabid+"-dselected"]=-1
	this.addEvent(window, function(){ddtabmenu.init(tabid, dselected)}, "load")
},
showsubmenu:function(tabid, targetitem){
	var menuitems=this[tabid+"-menuitems"]
	this.clearrevert2default(tabid)
 for (i=0; i<menuitems.length; i++){
		menuitems[i].className=""
		if (typeof menuitems[i].hasSubContent!="undefined")
			document.getElementById(menuitems[i].getAttribute("rel")).style.display="none"
	}
	targetitem.className="current"
	if (typeof targetitem.hasSubContent!="undefined")
		document.getElementById(targetitem.getAttribute("rel")).style.display="block"
},
isSelected:function(menuurl){
	var menuurl=menuurl.replace("http://"+menuurl.hostname, "").replace(/^\//, "")
	return (ddtabmenu.currentpageurl==menuurl)
},
isContained:function(m, e){
	var e=window.event || e
	var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
	while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
	if (c==m)
		return true
	else
		return false
},
revert2default:function(outobj, tabid, e){
	if (!ddtabmenu.isContained(outobj, tabid, e)){
		window["hidetimer_"+tabid]=setTimeout(function(){
			ddtabmenu.showsubmenu(tabid, ddtabmenu[tabid+"-dselected"])
		}, ddtabmenu.snap2original[1])
	}
},
clearrevert2default:function(tabid){
 if (typeof window["hidetimer_"+tabid]!="undefined")
		clearTimeout(window["hidetimer_"+tabid])
},
addEvent:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
	var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false)
	else if (target.attachEvent)
		target.attachEvent(tasktype, functionref)
},
init:function(tabid, dselected){
	var menuitems=3
	this[tabid+"-menuitems"]=menuitems
	for (var x=0; x<menuitems.length; x++){
		if (menuitems[x].getAttribute("rel")){
			this[tabid+"-menuitems"][x].hasSubContent=true
			if (ddtabmenu.disabletablinks)
				menuitems[x].onclick=function(){return false}
			if (ddtabmenu.snap2original[0]==true){
				var submenu=document.getElementById(menuitems[x].getAttribute("rel"))
				menuitems[x].onmouseout=function(e){ddtabmenu.revert2default(submenu, tabid, e)}
				submenu.onmouseover=function(){ddtabmenu.clearrevert2default(tabid)}
				submenu.onmouseout=function(e){ddtabmenu.revert2default(this, tabid, e)}
			}
		}
		else //for items without a submenu, add onMouseout effect
			menuitems[x].onmouseout=function(e){this.className=""; if (ddtabmenu.snap2original[0]==true) ddtabmenu.revert2default(this, tabid, e)}
		menuitems[x].onmouseover=function(){ddtabmenu.showsubmenu(tabid, this)}
		if (dselected=="auto" && typeof setalready=="undefined" && this.isSelected(menuitems[x].href)){
			ddtabmenu.showsubmenu(tabid, menuitems[x])
			this[tabid+"-dselected"]=menuitems[x]
			var setalready=true
		}
		else if (parseInt(dselected)==x){
			ddtabmenu.showsubmenu(tabid, menuitems[x])
			this[tabid+"-dselected"]=menuitems[x]
		}
	}
}
}



function tabberObj(argsObj)
{
  var arg; /* name of an argument to override */
  this.div = null;
  this.classMain = "tabber";
  this.classMainLive = "tabberlive";
  this.classTab = "tabbertab";
  this.classTabDefault = "tabbertabdefault";
  this.classNav = "tabbernav";
  this.classTabHide = "tabbertabhide";
  this.classNavActive = "tabberactive";
  this.titleElements = ['h2','h3','h4','h5','h6'];
  this.titleElementsStripHTML = true;
  this.removeTitle = true;
  this.addLinkId = false;
  this.linkIdFormat = '<tabberid>nav<tabnumberone>';
  for (arg in argsObj) { this[arg] = argsObj[arg]; }
  this.REclassMain = new RegExp('\\b' + this.classMain + '\\b', 'gi');
  this.REclassMainLive = new RegExp('\\b' + this.classMainLive + '\\b', 'gi');
  this.REclassTab = new RegExp('\\b' + this.classTab + '\\b', 'gi');
  this.REclassTabDefault = new RegExp('\\b' + this.classTabDefault + '\\b', 'gi');
  this.REclassTabHide = new RegExp('\\b' + this.classTabHide + '\\b', 'gi');
  this.tabs = new Array();
  if (this.div) {
    this.init(this.div);
    this.div = null;
  }
}

tabberObj.prototype.init = function(e)
{
  var
  childNodes, /* child nodes of the tabber div */
  i, i2, /* loop indices */
  t, /* object to store info about a single tab */
  defaultTab=0, /* which tab to select by default */
  DOM_ul, /* tabbernav list */
  DOM_li, /* tabbernav list item */
  DOM_a, /* tabbernav link */
  aId, /* A unique id for DOM_a */
  headingElement; /* searching for text to use in the tab */
  if (!document.getElementsByTagName) { return false; }
  if (e.id) {
    this.id = e.id;
  }
  this.tabs.length = 0;
  childNodes = e.childNodes;
  for(i=0; i < childNodes.length; i++) {
    if(childNodes[i].className &&
       childNodes[i].className.match(this.REclassTab)) {
      t = new Object();
      t.div = childNodes[i];
      this.tabs[this.tabs.length] = t;
      if (childNodes[i].className.match(this.REclassTabDefault)) {
	defaultTab = this.tabs.length-1;
      }
    }
  }
  DOM_ul = document.createElement("ul");
  DOM_ul.className = this.classNav;
  for (i=0; i < this.tabs.length; i++) {
    t = this.tabs[i];
    t.headingText = t.div.title;
    if (this.removeTitle) { t.div.title = ''; }
    if (!t.headingText) {
      for (i2=0; i2<this.titleElements.length; i2++) {
	headingElement = t.div.getElementsByTagName(this.titleElements[i2])[0];
	if (headingElement) {
	  t.headingText = headingElement.innerHTML;
	  if (this.titleElementsStripHTML) {
	    t.headingText.replace(/<br>/gi," ");
	    t.headingText = t.headingText.replace(/<[^>]+>/g,"");
	  }
	  break;
	}
      }
    }
    if (!t.headingText) {
      t.headingText = i + 1;
    }
    DOM_li = document.createElement("li");
    t.li = DOM_li;
    DOM_a = document.createElement("a");
    DOM_a.appendChild(document.createTextNode(t.headingText));
    DOM_a.href = "javascript:void(null);";
    DOM_a.title = t.headingText;
    DOM_a.onclick = this.navClick;
    DOM_a.tabber = this;
    DOM_a.tabberIndex = i;
    if (this.addLinkId && this.linkIdFormat) {
      aId = this.linkIdFormat;
      aId = aId.replace(/<tabberid>/gi, this.id);
      aId = aId.replace(/<tabnumberzero>/gi, i);
      aId = aId.replace(/<tabnumberone>/gi, i+1);
      aId = aId.replace(/<tabtitle>/gi, t.headingText.replace(/[^a-zA-Z0-9\-]/gi, ''));
      DOM_a.id = aId;
    }
    DOM_li.appendChild(DOM_a);
    DOM_ul.appendChild(DOM_li);
  }
  e.insertBefore(DOM_ul, e.firstChild);
  e.className = e.className.replace(this.REclassMain, this.classMainLive);
  this.tabShow(defaultTab);
  if (typeof this.onLoad == 'function') {
    this.onLoad({tabber:this});
  }
  return this;
};
tabberObj.prototype.navClick = function(event)
{
  var
  rVal, /* Return value from the user onclick function */
  a, /* element that triggered the onclick event */
  self, /* the tabber object */
  tabberIndex, /* index of the tab that triggered the event */
  onClickArgs; /* args to send the onclick function */
  a = this;
  if (!a.tabber) { return false; }
  self = a.tabber;
  tabberIndex = a.tabberIndex;
  a.blur();
  if (typeof self.onClick == 'function') {
    onClickArgs = {'tabber':self, 'index':tabberIndex, 'event':event};
    if (!event) { onClickArgs.event = window.event; }
    rVal = self.onClick(onClickArgs);
    if (rVal === false) { return false; }
  }
  self.tabShow(tabberIndex);
  return false;
};
tabberObj.prototype.tabHideAll = function()
{
  var i; /* counter */
  for (i = 0; i < this.tabs.length; i++) {
    this.tabHide(i);
  }
};
tabberObj.prototype.tabHide = function(tabberIndex)
{
  var div;
  if (!this.tabs[tabberIndex]) { return false; }
  div = this.tabs[tabberIndex].div;
  if (!div.className.match(this.REclassTabHide)) {
    div.className += ' ' + this.classTabHide;
  }
  this.navClearActive(tabberIndex);
  return this;
};
tabberObj.prototype.tabShow = function(tabberIndex)
{
  var div;
  if (!this.tabs[tabberIndex]) { return false; }
  this.tabHideAll();
  div = this.tabs[tabberIndex].div;
  div.className = div.className.replace(this.REclassTabHide, '');
  this.navSetActive(tabberIndex);
  if (typeof this.onTabDisplay == 'function') {
    this.onTabDisplay({'tabber':this, 'index':tabberIndex});
  }
  return this;
};
tabberObj.prototype.navSetActive = function(tabberIndex)
{
  this.tabs[tabberIndex].li.className = this.classNavActive;
  return this;
};
tabberObj.prototype.navClearActive = function(tabberIndex)
{
  this.tabs[tabberIndex].li.className = '';
  return this;
};
function tabberAutomatic(tabberArgs)
{
  var
    tempObj, /* Temporary tabber object */
    divs, /* Array of all divs on the page */
    i; /* Loop index */
  if (!tabberArgs) { tabberArgs = {}; }
  tempObj = new tabberObj(tabberArgs);
  divs = document.getElementsByTagName("div");
  for (i=0; i < divs.length; i++) {
    if (divs[i].className &&
	divs[i].className.match(tempObj.REclassMain)) {
      tabberArgs.div = divs[i];
      divs[i].tabber = new tabberObj(tabberArgs);
    }
  }
  return this;
}
function tabberAutomaticOnLoad(tabberArgs)
{
  var oldOnLoad;
  if (!tabberArgs) { tabberArgs = {}; }
  oldOnLoad = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = function() {
      tabberAutomatic(tabberArgs);
    };
  } else {
    window.onload = function() {
      oldOnLoad();
      tabberAutomatic(tabberArgs);
    };
  }
}
if (typeof tabberOptions == 'undefined') {
    tabberAutomaticOnLoad();
} else {
  if (!tabberOptions['manualStartup']) {
    tabberAutomaticOnLoad(tabberOptions);
  }
}




//////////////////////////////////////////////////////////////////////////////////////
   //////////////////////////// AJAX DEFAULT FUNCTIONS ////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////






function ajaxRequestReturn(url, parameters, divx) {
	var ajaxRequest=null;
	
	try {
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Browser not suppported
				alert("Your browser not supported!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById(divx);
			var tempresponse = ajaxRequest.responseText;
			ajaxDisplay.innerHTML = tempresponse;
		}
	}
	ajaxRequest.open('GET', url + "?" + parameters, true);
	ajaxRequest.send(null);
}


function ajaxRequest(url, parameters) {
	var ajaxRequest=null;
	
	try {
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Browser not suppported
				alert("Your browser not supported!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('ajaxbox');
			var tempresponse = ajaxRequest.responseText;
			ajaxDisplay.innerHTML = tempresponse;
		}
	}
	ajaxRequest.open('GET', url + "?" + parameters, true);
	ajaxRequest.send(null);
}

function makePostRequest(url, parameters) {
	var ajaxRequest=null;
	
	try {
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try {
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Browser not suppported
				alert("Your browser not supported!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			// Do nothing here
		}
	}
	ajaxRequest.open('POST', url, true);
	ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	ajaxRequest.send(parameters);
}

function makeFreeRequest(url, parameters) {
	var ajaxRequest=null;
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Browser not suppported
				alert("Your browser not supported!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			//alert(ajaxRequest.responseText);	
		}
	}
	if(parameters) {
		parameters = '?'+parameters;
	}
	
	ajaxRequest.open('GET', url + parameters, true);
	ajaxRequest.send(null);
}


function bookmark_news(news_id){
	var ajaxRequest;	
	try{
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Your browser broke!");
				return false;
			}
		}
	}
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
		}
	}
	document.getElementById(''+news_id).innerHTML = "<div align=\"right\" style=\"COLOR:GRAY\"> Successfully Bookmarked</div>";
	var str = "m=news&a=addbookmark&news_id=" + news_id;
	ajaxRequest.open("GET", "http://www.samaylive.com/nofile.php?"+str, true);
	ajaxRequest.send(null);
}




function delete_bookmark(news_id){
	var ajaxRequest;	
	try{
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Your browser broke!");
				return false;
			}
		}
	}
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
		}
	}
	document.getElementById(''+news_id).innerHTML = "<div  style=\"COLOR:GRAY\"> Deleted</div>";
	var str = "m=news&a=delete_bookmark&news_id=" + news_id;
	ajaxRequest.open("GET", "http://www.samaylive.com/nofile.php?"+str, true);
	ajaxRequest.send(null);
}


function set_division_message(id, message) {
	var jsDisplay = document.getElementById(id);
	jsDisplay.innerHTML = message;
}


//////////////////////////////function to show the Big Small Text////////////////////////////////

var min=9;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('div');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('div');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}