//** AnyLink CSS Menu v2.0- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Script Download/ instructions page: http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm
//** January 19', 2009: Script Creation date


var anylinkcssmenu={

menusmap: {},
effects: {delayhide: 200, shadow:{enabled:true, opacity:0.3, depth: [5, 5]}, fade:{enabled:true, duration:500}}, //customize menu effects

dimensions: {},

getoffset:function(what, offsettype){
	return (what.offsetParent)? what[offsettype]+this.getoffset(what.offsetParent, offsettype) : what[offsettype]
},

getoffsetof:function(el){
	el._offsets={left:this.getoffset(el, "offsetLeft"), top:this.getoffset(el, "offsetTop"), h: el.offsetHeight}
},

getdimensions:function(menu){
	this.dimensions={anchorw:menu.anchorobj.offsetWidth, anchorh:menu.anchorobj.offsetHeight,
		docwidth:(window.innerWidth ||this.standardbody.clientWidth)-20,
		docheight:(window.innerHeight ||this.standardbody.clientHeight)-15,
		docscrollx:window.pageXOffset || this.standardbody.scrollLeft,
		docscrolly:window.pageYOffset || this.standardbody.scrollTop
	}
	if (!this.dimensions.dropmenuw){
		this.dimensions.dropmenuw=menu.dropmenu.offsetWidth
		this.dimensions.dropmenuh=menu.dropmenu.offsetHeight
	}
},

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
},

setopacity:function(el, value){
	el.style.opacity=value
	if (typeof el.style.opacity!="string"){ //if it's not a string (ie: number instead), it means property not supported
		el.style.MozOpacity=value
		if (el.filters){
			el.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity="+ value*100 +")"
		}
	}
},

showmenu:function(menuid){
	var menu=anylinkcssmenu.menusmap[menuid]
	clearTimeout(menu.hidetimer)
	this.getoffsetof(menu.anchorobj)
	this.getdimensions(menu)
	var posx=menu.anchorobj._offsets.left + (menu.orientation=="lr"? this.dimensions.anchorw : 0) //base x pos
	var posy=menu.anchorobj._offsets.top+this.dimensions.anchorh - (menu.orientation=="lr"? this.dimensions.anchorh : 0)//base y pos
	if (posx+this.dimensions.dropmenuw+this.effects.shadow.depth[0]>this.dimensions.docscrollx+this.dimensions.docwidth){ //drop left instead?
		posx=posx-this.dimensions.dropmenuw + (menu.orientation=="lr"? -this.dimensions.anchorw : this.dimensions.anchorw)
	}
	if (posy+this.dimensions.dropmenuh>this.dimensions.docscrolly+this.dimensions.docheight){  //drop up instead?
		posy=Math.max(posy-this.dimensions.dropmenuh - (menu.orientation=="lr"? -this.dimensions.anchorh : this.dimensions.anchorh), this.dimensions.docscrolly) //position above anchor or window's top edge
	}
	if (this.effects.fade.enabled){
		this.setopacity(menu.dropmenu, 0) //set opacity to 0 so menu appears hidden initially
		if (this.effects.shadow.enabled)
			this.setopacity(menu.shadow, 0) //set opacity to 0 so shadow appears hidden initially
	}
	menu.dropmenu.setcss({left:posx+'px', top:posy+'px', visibility:'visible'})
	if (this.effects.shadow.enabled)
		menu.shadow.setcss({left:posx+anylinkcssmenu.effects.shadow.depth[0]+'px', top:posy+anylinkcssmenu.effects.shadow.depth[1]+'px', visibility:'visible'})
	if (this.effects.fade.enabled){
		clearInterval(menu.animatetimer)
		menu.curanimatedegree=0
		menu.starttime=new Date().getTime() //get time just before animation is run
		menu.animatetimer=setInterval(function(){anylinkcssmenu.revealmenu(menuid)}, 20)
	}
	//alert(menuid);
	if(document.getElementById(menuid + "tab")){
		document.getElementById(menuid + "tab").style.backgroundColor = "#f5f5f5";
		document.getElementById(menuid + "tab").style.borderTop = "1px solid #cccccc";
		document.getElementById(menuid + "tab").style.borderLeft = "1px solid #cccccc";
		document.getElementById(menuid + "tab").style.borderRight = "1px solid #cccccc";
	}
},

revealmenu:function(menuid){
	var menu=anylinkcssmenu.menusmap[menuid]
	var elapsed=new Date().getTime()-menu.starttime //get time animation has run
	if (elapsed<this.effects.fade.duration){
		this.setopacity(menu.dropmenu, menu.curanimatedegree)
		if (this.effects.shadow.enabled)
			this.setopacity(menu.shadow, menu.curanimatedegree*this.effects.shadow.opacity)
	}
	else{
		clearInterval(menu.animatetimer)
		this.setopacity(menu.dropmenu, 1)
		menu.dropmenu.style.filter=""
	}
	menu.curanimatedegree=(1-Math.cos((elapsed/this.effects.fade.duration)*Math.PI)) / 2
},

setcss:function(param){
	for (prop in param){
		this.style[prop]=param[prop]
	}
},

hidemenu:function(menuid){
	var menu=anylinkcssmenu.menusmap[menuid]
	clearInterval(menu.animatetimer)
	menu.dropmenu.setcss({visibility:'hidden', left:0, top:0})
	menu.shadow.setcss({visibility:'hidden', left:0, top:0})
	if(document.getElementById(menuid + "tab")){
		document.getElementById(menuid + "tab").style.backgroundColor = "";
		document.getElementById(menuid + "tab").style.border = "";
	}
},

getElementsByClass:function(targetclass){
	if (document.querySelectorAll)
		return document.querySelectorAll("."+targetclass)
	else{
		var classnameRE=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "i") //regular expression to screen for classname
		var pieces=[]
		var alltags=document.all? document.all : document.getElementsByTagName("*")
		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
	}
},

addEvent:function(targetarr, functionref, tasktype){
	if (targetarr.length>0){
		var target=targetarr.shift()
		if (target.addEventListener)
			target.addEventListener(tasktype, functionref, false)
		else if (target.attachEvent)
			target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)})
		this.addEvent(targetarr, functionref, tasktype)
	}
},

setupmenu:function(targetclass, anchorobj, pos){
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	var relattr=anchorobj.getAttribute("rel")
	var dropmenuid=relattr.replace(/\[(\w+)\]/, '')
	var menu=this.menusmap[targetclass+pos]={
		id: targetclass+pos,
		anchorobj: anchorobj,	
		dropmenu: document.getElementById(dropmenuid),
		revealtype: (relattr.length!=dropmenuid.length && RegExp.$1=="click")? "click" : "mouseover",
		orientation: anchorobj.getAttribute("rev")=="lr"? "lr" : "ud",
		shadow: document.createElement("div")
	}
	menu.anchorobj._internalID=targetclass+pos
	menu.anchorobj._isanchor=true
	menu.dropmenu._internalID=targetclass+pos
	menu.shadow._internalID=targetclass+pos
	menu.shadow.className="anylinkshadow"
	document.body.appendChild(menu.dropmenu) //move drop down div to end of page
	document.body.appendChild(menu.shadow)
	menu.dropmenu.setcss=this.setcss
	menu.shadow.setcss=this.setcss
	menu.shadow.setcss({width: menu.dropmenu.offsetWidth+"px", height:menu.dropmenu.offsetHeight+"px"})
	this.setopacity(menu.shadow, this.effects.shadow.opacity)
	this.addEvent([menu.anchorobj, menu.dropmenu, menu.shadow], function(e){ //MOUSEOVER event for anchor, dropmenu, shadow
		var menu=anylinkcssmenu.menusmap[this._internalID]
		if (this._isanchor && menu.revealtype=="mouseover" && !anylinkcssmenu.isContained(this, e)){ //event for anchor
			anylinkcssmenu.showmenu(menu.id)
		}
		else if (typeof this._isanchor=="undefined"){ //event for drop down menu and shadow
			clearTimeout(menu.hidetimer)
		}
	}, "mouseover")
	this.addEvent([menu.anchorobj, menu.dropmenu, menu.shadow], function(e){ //MOUSEOUT event for anchor, dropmenu, shadow
		if (!anylinkcssmenu.isContained(this, e)){
			var menu=anylinkcssmenu.menusmap[this._internalID]
			menu.hidetimer=setTimeout(function(){anylinkcssmenu.hidemenu(menu.id)}, anylinkcssmenu.effects.delayhide)
		}
	}, "mouseout")
	this.addEvent([menu.anchorobj, menu.dropmenu], function(e){ //CLICK event for anchor, dropmenu
		var menu=anylinkcssmenu.menusmap[this._internalID]
		if ( this._isanchor && menu.revealtype=="click"){
			if (menu.dropmenu.style.visibility=="visible")
				anylinkcssmenu.hidemenu(menu.id)
			else
				anylinkcssmenu.showmenu(menu.id)
			if (e.preventDefault)
				e.preventDefault()
			return false
		}
		else
			menu.hidetimer=setTimeout(function(){anylinkcssmenu.hidemenu(menu.id)}, anylinkcssmenu.effects.delayhide)
	}, "click")
},

init:function(targetclass){
	var anchors=this.getElementsByClass(targetclass)
	for (var i=0; i<anchors.length; i++){
		this.setupmenu(targetclass, anchors[i], i)
	}
}

}

	function getElementLeft(Elem) {
		var elem;
		if(document.getElementById) {
			var elem = document.getElementById(Elem);
		} else if (document.all){
			var elem = document.all[Elem];
		}
		xPos = elem.offsetLeft;
		tempEl = elem.offsetParent;
	  	while (tempEl != null) {
	  		xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
	  	}
		return xPos;
	}


	function getElementTop(Elem) {
		if(document.getElementById) {	
			var elem = document.getElementById(Elem);
		} else if (document.all) {
			var elem = document.all[Elem];
		}
		yPos = elem.offsetTop;
		tempEl = elem.offsetParent;
		while (tempEl != null) {
	  		yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
	  	}
		return yPos;
	}
	
	function opacity(id, opacStart, opacEnd, millisec) {
	    //speed for each frame
	    var speed = Math.round(millisec / 100);
	    var timer = 0;

	    //determine the direction for the blending, if start and end are the same nothing happens
	    if(opacStart > opacEnd) {
	        for(i = opacStart; i >= opacEnd; i--) {
	            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
	            timer++;
	        }
	    } else if(opacStart < opacEnd) {
	        for(i = opacStart; i <= opacEnd; i++)
	            {
	            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
	            timer++;
	        }
	    }
	}

	//change the opacity for different browsers
	function changeOpac(opacity, id) {
	    var object = document.getElementById(id).style;
	    object.opacity = (opacity / 100);
	    object.MozOpacity = (opacity / 100);
	    object.KhtmlOpacity = (opacity / 100);
	    object.filter = "alpha(opacity=" + opacity + ") FILTER: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);";
	    if(opacity == 0){
			//document.getElementById(id).style.visibility = "hidden";
	    }else{
			//document.getElementById(id).style.visibility = "visible";
	    }
	} 

	function shiftOpacity(id, millisec) {
	    //if an element is invisible, make it visible, else make it ivisible
	    if(document.getElementById(id).style.opacity == 0) {
	        opacity(id, 0, 100, millisec);
	    } else {
	        opacity(id, 100, 0, millisec);
	    }
	}
	var vCurrPID = "";
	var iTimeout = 0;
	
	function showPreview(vPID){
		vCurrPID = vPID;
		iTimeout = setTimeout(executePreview,1000);
		var oFly = document.getElementById("flyovernote");
		var iLeft = getElementLeft(vCurrPID);
		var iTop = getElementTop(vCurrPID);
		var oTD = document.getElementById(vCurrPID);
		var iWidth = oTD.offsetWidth;
		var oImg = document.getElementById("previewimage");
		var sImg = oTD.getAttribute("FEATIMG");
		
		changeOpac(0,"flyover");
		
		oImg.src = sImageURL + "/products/" + sImg + "_CS.jpg";
		
		oTD.className = "productcell productcellsel";
		
		oFly.style.display = "block";
		oFly.style.width = iWidth + "px";
		var iHeight = oFly.clientHeight;
		//alert("cell width = " + iWidth + ", flyover width = " + oFly.clientWidth);
		oFly.style.top = (iTop - iHeight) + 1;
		oFly.style.left = iLeft;
		
	}
	
	function executePreview(){
		if(vCurrPID != ""){
			var oFly = document.getElementById("flyover");
			var iLeft = getElementLeft(vCurrPID);
			var iTop = getElementTop(vCurrPID);
			var oTD = document.getElementById(vCurrPID);
			var iWidth = oTD.offsetWidth;
			var iPos = oTD.getAttribute("POSITION");
			
			oFly.style.display = "block";
			var iFlyWidth = oFly.clientWidth;
			
			if(iPos < 3){
				//align it to the right edge
				oFly.style.left = (iLeft + iWidth) - 15;
				document.getElementById("flyoverleftarrow").style.display = "block";
				document.getElementById("flyoverrightarrow").style.display = "none";
			}else{
				//align it to the left edge
				//alert("left edge = " + iLeft + ", Flyover width = " + iFlyWidth + ", final left position = " + (iLeft - iFlyWidth));
				oFly.style.left = (iLeft - iFlyWidth) + 15;
				document.getElementById("flyoverleftarrow").style.display = "none";
				document.getElementById("flyoverrightarrow").style.display = "block";
			}
			oFly.style.top = iTop - 50;
			shiftOpacity("flyover",500);
			//document.getElementById("flyovernote").style.display = "none";
		}
	}
	
	function hidePreview(){
		var oFly = document.getElementById("flyover");
		if(iTimeout > 0){
			clearTimeout(iTimeout);
		}
		changeOpac(0,"flyover");
		if(oFly.style.display == "block"){
			oFly.style.display = "none";
		}
		document.getElementById(vCurrPID).className = "productcell";
		document.getElementById("flyovernote").style.display = "none";
	}
	
	function showFilterTip(){
		shiftOpacity("filtertip",2000);
		setTimeout(hideFilterTip,5000);
	}
	
	function hideFilterTip(){
		shiftOpacity("filtertip",1000);
		setTimeout(destroyFilterTip,1100);
	}
	
	function destroyFilterTip(){
		document.getElementById("filtertip").style.display = "none";
	}

	function toggleTab(vIndex){
		var i;
		if(document.getElementById("tabcontent" + vIndex).style.display == "none"){
			document.getElementById("tabcontent" + vIndex).style.display = "block";
			document.getElementById("tab" + vIndex).className = "lnheadersel";
		}else{
			document.getElementById("tabcontent" + vIndex).style.display = "none";
			document.getElementById("tab" + vIndex).className = "lnheader";
		}
	}
	function toggleFilter(vIndex){
		var i;
		if(document.getElementById("tabcontent" + vIndex).style.display == "none"){
			document.getElementById("tabcontent" + vIndex).style.display = "block";
			document.getElementById("tab" + vIndex).className = "lnsubheaderext";
			if(document.getElementById("tabsummary" + vIndex)){
				document.getElementById("tabsummary" + vIndex).style.display = "none";
			}
		}else{
			document.getElementById("tabcontent" + vIndex).style.display = "none";
			document.getElementById("tab" + vIndex).className = "lnsubheader";
			if(document.getElementById("tabsummary" + vIndex)){
				document.getElementById("tabsummary" + vIndex).style.display = "block";
			}
		}
	}

		function loadCart(){
			queueAjaxRequest(sRootURL + "/ajax_loadcart.asp", "", processRefreshCart, "txt");
		}
		
		function processRefreshCart(){
			var myajax=ajaxpack.ajaxobj
			var myfiletype=ajaxpack.filetype
			var ares;
		    
			if (myajax.readyState == 4){ //if request of file completed
				if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally
					if (myfiletype=="txt"){
						if(!oncartrefresh ==''){
							eval(oncartrefresh);
						}
						ares=myajax.responseText.split("|");
						
						document.getElementById("cartcell").innerHTML = "(" + ares[0] + " items)";
					    
					    if(document.getElementById("freeship")){
    					    if(ares[1] > 0){
        					    if(ares[1] >= 100){
        					       document.getElementById("freeshipnote").style.color = "#28951e";
        					       document.getElementById("freeshipnote").innerHTML = "<B>Your order qualifies for FREE UPS GROUND SHIPPING!</B>";
        					       document.getElementById("freeshipgauge").style.backgroundColor = "#28951e";
        					       document.getElementById("freeshipgauge").style.width = "225px";
        					    }else{
            					    
        					       document.getElementById("freeshipnote").innerHTML = "Your order is only $" + (Math.round((100 - ares[1]) * 100) / 100) + " from FREE UPS GROUND SHIPPING!";
        					       if(ares[1] < 30){
        					            document.getElementById("freeshipgauge").style.backgroundColor = "#f59f19";
        					            document.getElementById("freeshipnote").style.color = "#444444";
        					       }else{
            					       if(ares[1] < 60){
            					            document.getElementById("freeshipgauge").style.backgroundColor = "#f59f19";
            					            document.getElementById("freeshipnote").style.color = "#444444";
            					       }else{
            					            document.getElementById("freeshipgauge").style.backgroundColor = "#d50007";
                                            document.getElementById("freeshipnote").style.color = "#d50007";
            					       }
        					       }
        
        					       document.getElementById("freeshipgauge").style.width = Math.round((ares[1] / 100) * 225) + "px";
        					       
        					    }
        					    document.getElementById("freeship").style.display = "block";
    					    }else{
    					        document.getElementById("freeship").style.display = "none";
    					    }
    					}
					}else{
					//	alert(myajax.responseXML)
					}
				}
				vAjaxIsBusy=false;
			}
		}
	var vAjaxIsBusy=false;
	var ajaxQueue = new Array;
	var vQueueTimeout = 0;

	
	function queueAjaxRequest(var0,var1,var2,var3){
		//alert("queueAjaxRequest is called");
		var vLatency=10;
		ajaxQueue[ajaxQueue.length] = new Array(var0,var1,var2,var3,0);
		if(vQueueTimeout > 0){
			clearTimeout(vQueueTimeout);
			vLatency=100;
		}
		vQueueTimeout = setTimeout("checkAjaxQueue()",vLatency);
	}
	
	function checkAjaxQueue(){
		//alert("checkAjaxQueue fired");
		var vNextRequestIndex=getNextAjaxRequest();
		if(vNextRequestIndex > -1){
			if(!vAjaxIsBusy){
				//alert("calling ajax request ID " + vAjaxIsBusy);
				vAjaxIsBusy=true;
				ajaxpack.addrandomnumber = 1;
				ajaxpack.getAjaxRequest(ajaxQueue[vNextRequestIndex][0],ajaxQueue[vNextRequestIndex][1],ajaxQueue[vNextRequestIndex][2],ajaxQueue[vNextRequestIndex][3]);
				ajaxQueue[vNextRequestIndex][4] = 1;
				if(getNextAjaxRequest() > -1){
					vQueueTimeout = setTimeout("checkAjaxQueue()",100);
				}
			}else{
				vQueueTimeout = setTimeout("checkAjaxQueue()",100);
			}
		}else{
			vQueueTimeout = 0;
		}
	}
	
	function getNextAjaxRequest(){
		var bfound=false;
		var i;

		for(i=0;i<ajaxQueue.length;i++){
			if(ajaxQueue[i][4] == 0){
				bfound=true;
				return i;
				break
			}
		}
		if(!bfound){
			return -1;
		}
	}

function createAjaxObj(){
var httprequest=false
if (window.XMLHttpRequest){ // if Mozilla, Safari etc
httprequest=new XMLHttpRequest()
if (httprequest.overrideMimeType)
httprequest.overrideMimeType('text/xml')
}
else if (window.ActiveXObject){ // if IE
try {
httprequest=new ActiveXObject("Msxml2.XMLHTTP");
} 
catch (e){
try{
httprequest=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){}
}
}
return httprequest
}

var ajaxpack=new Object()
ajaxpack.basedomain="http://"+window.location.hostname
ajaxpack.ajaxobj=createAjaxObj()
ajaxpack.filetype="txt"
ajaxpack.addrandomnumber=0 //Set to 1 or 0. See documentation.

ajaxpack.getAjaxRequest=function(url, parameters, callbackfunc, filetype){
ajaxpack.ajaxobj=createAjaxObj() //recreate ajax object to defeat cache problem in IE
if (ajaxpack.addrandomnumber==1) //Further defeat caching problem in IE?
var parameters=parameters+"&ajaxcachebust="+new Date().getTime()
if (this.ajaxobj){
this.filetype=filetype
this.ajaxobj.onreadystatechange=callbackfunc
this.ajaxobj.open('GET', url+"?"+parameters, true)
this.ajaxobj.send(null)
}
}

ajaxpack.postAjaxRequest=function(url, parameters, callbackfunc, filetype){
ajaxpack.ajaxobj=createAjaxObj() //recreate ajax object to defeat cache problem in IE
if (this.ajaxobj){
this.filetype=filetype
this.ajaxobj.onreadystatechange = callbackfunc;
this.ajaxobj.open('POST', url, true);
this.ajaxobj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
this.ajaxobj.setRequestHeader("Content-length", parameters.length);
this.ajaxobj.setRequestHeader("Connection", "close");
this.ajaxobj.send(parameters);
}
}

//ACCESSIBLE VARIABLES (for use within your callback functions):
//1) ajaxpack.ajaxobj //points to the current ajax object
//2) ajaxpack.filetype //The expected file type of the external file ("txt" or "xml")
//3) ajaxpack.basedomain //The root domain executing this ajax script, taking into account the possible "www" prefix.
//4) ajaxpack.addrandomnumber //Set to 0 or 1. When set to 1, a random number will be added to the end of the query string of GET requests to bust file caching of the external file in IE. See docs for more info.

//ACCESSIBLE FUNCTIONS:
//1) ajaxpack.getAjaxRequest(url, parameters, callbackfunc, filetype)
//2) ajaxpack.postAjaxRequest(url, parameters, callbackfunc, filetype)

///////////END OF ROUTINE HERE////////////////////////


//////EXAMPLE USAGE ////////////////////////////////////////////
/* Comment begins here

//Define call back function to process returned data
function processGetPost(){
var myajax=ajaxpack.ajaxobj
var myfiletype=ajaxpack.filetype
if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ if request was successful or running script locally
if (myfiletype=="txt")
alert(myajax.responseText)
else
alert(myajax.responseXML)
}
}
}

/////1) GET Example- alert contents of any file (regular text or xml file):

ajaxpack.getAjaxRequest("example.php", "", processGetPost, "txt")
ajaxpack.getAjaxRequest("example.php", "name=George&age=27", processGetPost, "txt")
ajaxpack.getAjaxRequest("examplexml.php", "name=George&age=27", processGetPost, "xml")
ajaxpack.getAjaxRequest(ajaxpack.basedomain+"/mydir/mylist.txt", "", processGetPost, "txt")

/////2) Post Example- Post some data to a PHP script for processing, then alert posted data:

//Define function to construct the desired parameters and their values to post via Ajax
function getPostParameters(){
var namevalue=document.getElementById("namediv").innerHTML //get name value from a DIV
var agevalue=document.getElementById("myform").agefield.value //get age value from a form field
var poststr = "name=" + encodeURI(namevalue) + "&age=" + encodeURI(agevalue)
return poststr
}

var poststr=getPostParameters()

ajaxpack.postAjaxRequest("example.php", poststr, processGetPost, "txt")
ajaxpack.postAjaxRequest("examplexml.php", poststr, processGetPost, "xml")

Comment Ends here */