
var isIE=false;
var MainPageURL = "../Pages/AjaxServerPage.aspx";
if(!window.XMLHttpRequest)
{
	isIE=true;
}
if(document.All)
{
	isIE=true;
}

		var Xmlhttp; 
		var xmlDoc;
		var CurrentpageIndex;
		var PageSize=20;
		var PreviousPage;
		var NextPage;
		var SelectedCollection;
		var IsPaging;   //for  Checking results in pages or not.
		var PageCount;
		var btncontrol;
	
		
		function createXmlHttp()
		{
			var moz = (typeof document.implementation != 'undefined') && (typeof 
			document.implementation.createDocument != 'undefined');
			if (moz)
			{
				Xmlhttp = new XMLHttpRequest();
			}
			else // for Ie
			{
				try
				{
					Xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e)
				{
					try
					{
						Xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
					} 
					catch(oc)
					{
						Xmlhttp = null;
					}
				}
			}  //end else;	
		}// end createXmlhttp;
		
	
		function getGiftcardsAll(Selectedlink)
		{
	
			btncontrol=Selectedlink;            // "0" for giftcards all and 1 and 2 for next and prev links
			document.getElementById('divGiftCards').innerHTML = '';
		//ChangLinkStyle(CollectionId);
		  		    
			url= MainPageURL + "?GiftCards="+"All";
			createXmlHttp();
			if(Xmlhttp)
			{
				
				Xmlhttp.onreadystatechange = handleresponse;
				Xmlhttp.open("GET", url,  true);
				Xmlhttp.send(null);	
			}
			
			return false;
		 }//end getText;
				
		function handleresponse()
		{
	 
		if(Xmlhttp.readyState == 4)
			{ 
		if (Xmlhttp.status == 200)
			{
				if(Xmlhttp.responseXML.documentElement)
				{
					if(window.location.href.toLowerCase().indexOf("giftcards.aspx") == -1)
					{
						display(Xmlhttp.responseXML.documentElement);
					}
				}
			}
			
			}
		} //end handle response
			
				
		function display(obj)
				{ 
				
    			var loopcnt1;
				var loopcnt2
				var firstchild = obj.firstChild;
				var loopcheck;
				var imgsrc;
				var strDescription;
				var price;
				var OldPrice;
				var amount;
				var strFabrcImg;
				var strPrice;
				var baseIndex;
				var lastIndex;
	
if(!window.XMLHttpRequest)
{
	isIE=true;
}
if (document.all)
{
    isIE=true;
}

				// code for paging //
				
			  if(btncontrol==0)
				{
					CurrentpageIndex =0;
					baseIndex = 0;
					if(isIE==true)
					{
						lastIndex = obj.childNodes.length;
						if((obj.childNodes.length)>=PageSize)
						{
							lastIndex = PageSize; //obj.childNodes.length;
						} 
					}
					else
					{
						lastIndex = parseInt((obj.childNodes.length-1)/2);
						if(lastIndex>=PageSize)
						{
							lastIndex = PageSize; //obj.childNodes.length;
						} 
					}
					
				}
				// code for paging//
				
					var table1=document.createElement('table')
				    table1.setAttribute('cellPadding',0);
					table1.setAttribute('cellSpacing',0);
					table1.border="0";
					table1.id = "tblList";		
					//table1.style.height="100%";			
					//table1.style.border="1px solid #000000";
					table1.align='center';
					table1.width='780';
					var tbody=document.createElement('tbody');
					var tr =document.createElement('tr');
				
			// code for paging //
				
				if(btncontrol==0)
				{
					if(isIE==true)
					{
						if(((obj.childNodes.length)%PageSize)!=0)
							PageCount = parseInt((obj.childNodes.length)/PageSize) + 1;
						else
							PageCount = parseInt((obj.childNodes.length)/PageSize);
					}
					else
					{
						if((((obj.childNodes.length-1)/2)%PageSize)!=0)
							PageCount = parseInt(((obj.childNodes.length-1)/2)/PageSize) + 1;
						else
							PageCount = parseInt(((obj.childNodes.length-1)/2)/PageSize);
					}
				
				} 
				
				if(btncontrol==1)            //for next button in paging
				{
				  baseIndex = CurrentpageIndex * PageSize;
				  lastIndex = baseIndex + PageSize;
				  if(isIE==true)
				  {
					if((obj.childNodes.length)< lastIndex)
					{
						lastIndex=obj.childNodes.length;
					}
				  }
				  else
				  {
				   if(parseInt((obj.childNodes.length-1)/2)< lastIndex)
					{
						lastIndex=parseInt((obj.childNodes.length-1)/2);
					}
				  }
				 }
				 
				if(btncontrol==2)               //code for previous page          
				{
				  baseIndex = CurrentpageIndex * PageSize;
				  lastIndex = baseIndex + PageSize; 
				}
				// code for paging//
				
	   	/* Check for page Links  */
		if((obj.childNodes.length)<=PageSize)
		{
			//document.getElementById('tdprev').style.display="none";
			//document.getElementById('tdnext').style.display="none";
			document.getElementById("lnkprev").onclick = function()
			{
				return false;
			}
			
			document.getElementById("lnknext").onclick = function()
			{
				return false;
			}
			
			document.getElementById("lnkprev").className = "graylinks12";
			document.getElementById("lnknext").className = "graylinks12";
		}
			
		if(obj.childNodes.length>PageSize)
		{
			if (baseIndex ==0)
			{
				//document.getElementById('tdprev').style.display="none";
				document.getElementById("lnkprev").onclick = function()
				{
					return false;
				}
				document.getElementById("lnkprev").className = "graylinks12";
			}
			else
			{
				//document.getElementById('tdprev').style.display='';
				document.getElementById("lnkprev").onclick = function()
				{
					getPreviousPage();
					return false;
				}
				document.getElementById("lnkprev").className = "graylinksbrown";
			}
			if(isIE==true)
			{
				if(lastIndex >= obj.childNodes.length)
				{
					//document.getElementById('tdnext').style.display="none";
					document.getElementById("lnknext").onclick = function()
					{
						return false;
					}
					document.getElementById("lnknext").className = "graylinks12";
				}
				else
				{
					//document.getElementById('tdnext').style.display='';
					document.getElementById("lnknext").onclick = function()
					{
						getNextPage();
						return false;
					}
					document.getElementById("lnknext").className = "graylinksbrown";
				}
				
			}
			else   //For Mozilla
			{
				
				if( (2*lastIndex+1) >= obj.childNodes.length)
				{
					//document.getElementById('tdnext').style.display="none";
					document.getElementById("lnknext").onclick = function()
					{
						return false;
					}
					document.getElementById("lnknext").className = "graylinks12";
				}
				else
				{
					//document.getElementById('tdnext').style.display='';
					document.getElementById("lnknext").onclick = function()
					{
						getNextPage();
						return false;
					}
					document.getElementById("lnknext").className = "graylinksbrown";
				}
			}  
		
		}
		
		/* End check for page Links */	
				var categ = "";
				
				for(loopcnt1=baseIndex; loopcnt1 < lastIndex;loopcnt1++)  //obj.childNodes.length
				{
					if((loopcnt1)%4==0)
        			{
        			    var tit = "";
						if(isIE==true)
		    			{
		    			    tit = document.createTextNode(obj.childNodes[loopcnt1].childNodes[5].text).nodeValue;
				    	}
				    	else
				    	{
				    	    tit = document.createTextNode(obj.childNodes[2*loopcnt1+1].childNodes[11].firstChild.nodeValue).nodeValue;
				    	}

    					if (categ != tit)
    					{
	    				    var tr1 = document.createElement('tr');
		    			    var tdtitle=document.createElement('td');
			    		    tdtitle.colSpan = 4
			    		    tdtitle.innerHTML = '<span class="style_text_regular_new3">' + tit + '</span><hr style="width: 780px;"/><br/>'
			    		    tr1.appendChild(tdtitle);
				    	    tbody.appendChild(tr1);
				    	    categ = tit;
				    	}

						var tr = document.createElement('tr');
						tr.style.height = "120px";
					}

					var tdimg=document.createElement('td');
					tdimg.id ="tdimg";
					//tdimg.setAttribute("bgcolor","Green");
					var innertable=document.createElement('table');
					//innertable.style.marginLeft = "40px";
				    innertable.setAttribute('cellPadding',0);
					innertable.setAttribute('cellSpacing',0);
					if(isIE)
					{
						innertable.style.marginLeft = "20px";
						innertable.style.marginRight = "20px";
					}
					else
					{
					    innertable.style.paddingLeft = "20px";
						innertable.style.paddingRight = "20px";
					}
					
					//innertable.style.border=" 1px solid red";
					innertable.style.width="80px";
					innertable.style.height="80px";
					innertable.align='center';
					//innertable.style.border="1";
					
					var innertbody=document.createElement('tbody');
					var innertr =document.createElement('tr');
					var innertd=document.createElement('td');
					innertd.align='center';
					var Giftcardimg = document.createElement('img');
					
					var lblId=document.createElement('LABEL');
					var lblDescription=document.createElement('LABEL');
					lblDescription.className="font1";
					lblId.style.display='none';
					price=document.createElement('LABEL');
					amount=document.createElement('LABEL');
					amount.style.display='none';
					price.className="fontwhite"; //"fontgreen";
					var descript = "";
					//price.style.color = "#FFFFFF";
					Giftcardimg.id="imgGiftCard";
					OldPrice=document.createElement('LABEL');
					OldPrice.className="Strikedline";
					OldPrice.innerHTML = "";
					 if(isIE==true)
					 {
						imgsrc = document.createTextNode(obj.childNodes[loopcnt1].childNodes[2].text).nodeValue;
						price.innerHTML ="$" + parseInt(document.createTextNode(obj.childNodes[loopcnt1].childNodes[1].text).nodeValue);
						amount.innerHTML= parseInt(document.createTextNode(obj.childNodes[loopcnt1].childNodes[1].text).nodeValue);   // gets the amount of giftcard
						lblId.innerHTML=document.createTextNode(obj.childNodes[loopcnt1].childNodes[0].text).nodeValue;
						descript = document.createTextNode(obj.childNodes[loopcnt1].childNodes[3].text).nodeValue;
						try
						{	
							if(obj.childNodes[loopcnt1].getElementsByTagName("OldPrice")[0].childNodes[0].nodeValue + "" != "0")
							{
								var tempvalue = obj.childNodes[loopcnt1].getElementsByTagName("OldPrice")[0].childNodes[0].nodeValue;
								if(parseInt(amount.innerHTML) < parseInt(tempvalue))
								{
									OldPrice.innerHTML =  "[$" + tempvalue.split(".")[0] + "]";
								}
							}
						}
						catch(ers)
						{}
					 } 
					 else
					 {						
						imgsrc = document.createTextNode(obj.childNodes[2*loopcnt1+1].childNodes[5].firstChild.nodeValue).nodeValue;
						price.innerHTML ="$" + parseInt(document.createTextNode(obj.childNodes[2*loopcnt1+1].childNodes[3].firstChild.nodeValue).nodeValue);
						amount.innerHTML= parseInt(document.createTextNode(obj.childNodes[2*loopcnt1+1].childNodes[3].firstChild.nodeValue).nodeValue);   // gets the amount of giftcard
						lblId.innerHTML=document.createTextNode(obj.childNodes[2*loopcnt1+1].childNodes[1].firstChild.nodeValue).nodeValue;
						descript = document.createTextNode(obj.childNodes[2*loopcnt1+1].childNodes[7].firstChild.nodeValue).nodeValue;
						try
						{	
							if(obj.childNodes[2*loopcnt1+1].getElementsByTagName("OldPrice")[0].childNodes[0] + "" != "0")
							{
								var tempvalue = obj.childNodes[2*loopcnt1+1].getElementsByTagName("OldPrice")[0].childNodes[0].nodeValue;
								if(parseInt(amount.innerHTML) < parseInt(tempvalue))
								{
									if(tempvalue.split(".")[0] != "0")
									{
										OldPrice.innerHTML =  "[$" + tempvalue.split(".")[0] + "]";
									}
								}
							}
						}
						catch(ers)
						{}
					 }
					OldPrice.className = "strikedline";
					Giftcardimg.src = imgsrc;
					Giftcardimg.width = "156";
					Giftcardimg.height = "98";
					Giftcardimg.alt = "Alexander West Gift Card for " + price.innerHTML;
					Giftcardimg.title = "Alexander West Gift Card for " + price.innerHTML;
					//Giftcardimg.style.width = "80px";
					//Giftcardimg.style.height = "70px";
				
					Giftcardimg.style.display='none';
					//innertable.background=imgsrc;	      
						                                 
					tdimg.onmouseover =function()
					{
						SetLeft();
						document.getElementById('Layerpopup').style.display = '';
					//	document.getElementById('imgGiftCard').src=  this.childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].src;
					//	document.getElementById('lblPrice1').innerHTML =  this.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].innerHTML;    
					}
			           		
					Giftcardimg.onclick =function()
					{
						if(isIE)
						{
							RedirecttoUserSelect(this.parentNode.getElementsByTagName("LABEL")[0].innerHTML,this.parentNode.getElementsByTagName("LABEL")[0].innerHTML);
						}
						else
						{
							RedirecttoUserSelect(this.parentNode.getElementsByTagName("LABEL")[0].innerHTML,this.parentNode.getElementsByTagName("LABEL")[0].innerHTML);
						}
				  	}				  		
				  	
				  	innertd=document.createElement('td');
				    innertd.style.width='5px';
				    innertd.valign='top';
				    innertd.align='left';
					innertd.appendChild(price);
					var outerTd = document.createElement("DIV");
					outerTd.style.zIndex = 1;
					outerTd.style.position = "relative";
					outerTd.className = "fontwhite";
					if(OldPrice.innerHTML != "")
					{
						innertd.appendChild(document.createTextNode(" "));
						innertd.appendChild(OldPrice);
						OldPrice.style.display = "none";
					}
					
					
					if(isIE)
					{
						innertr.className="fontwhite";
						innertr.appendChild(innertd);
					 	var tempTr = innertr.cloneNode(true);
					 	var ttTable = document.createElement("TABLE");
					 	var ttTbody = document.createElement("TBODY");
					 	var tempD = document.createElement("DIV");
					 	tempD.style.display = "none";
					 	ttTbody.appendChild(tempTr);
					 	ttTable.appendChild(ttTbody);
					 	tempD.appendChild(ttTable);
					 	tempD.style.position = "absolute";
				  		tempD.style.marginLeft = "47px";
				  		tempD.style.marginTop = "83px";
				  		tempD.style.zIndex = "5000";
					 						 	
					 	var tempDiv = document.createElement("Div");
					 	tempDiv.style.display = "none";
				  		var tempTbody = document.createElement("Tbody");
				  		var tempTable = document.createElement("Table");
				  		tempTbody.appendChild(innertr);
				  		tempTable.appendChild(tempTbody);
				  		tempDiv.style.position = "absolute";
				  		tempDiv.style.marginLeft = "-70px";
				  		tempDiv.style.marginTop = "5px";
				  		tempDiv.style.zIndex = "5000";				  				  				  		
				  						  					  		
					  	tempDiv.appendChild(tempTable);
					  	
					  	var tempTr12 = document.createElement("TR");
					  	var tempTd12 = document.createElement("TD");
					  	
					  	tempTd12.appendChild(tempDiv);
					  	tempTd12.appendChild(tempD);
					  	tempTr12.appendChild(tempTd12);
					  	
				  		innertbody.appendChild(tempTr12);
					 	
						innertr1 = document.createElement('tr');
						innertd1=document.createElement('Td');
						innertd1.style.width='30px';
						innertd1.style.height='60px';
						Giftcardimg.style.display = '';						
				  		innertd1.appendChild(Giftcardimg);
				  		Giftcardimg.style.cursor='pointer';
				  		innertd1.appendChild(lblId);
				  		innertr1.appendChild(innertd1);
				  		innertbody.appendChild(innertr1);				  						  		
					}
					else
					{
						innertr.className="fontwhite";
						innertd.style.overflow = "hidden";
						innertr.appendChild(innertd);
						innertr1 =document.createElement('tr');
						innertd1=document.createElement('Td');
						innertd1.style.width='30px';
						innertd1.style.height='60px';
						Giftcardimg.style.display = '';						
				  		innertd1.appendChild(Giftcardimg);
				  		Giftcardimg.style.cursor='pointer';
				  		innertd1.appendChild(lblId);
				  		innertr1.appendChild(innertd1);
				  		innertbody.appendChild(innertr1);
					  	
				  		var tempDiv = document.createElement("Div");
				  		var tempDiv1 = document.createElement("Div");
				  		var tempTbody = document.createElement("Tbody");
				  		var tempTable = document.createElement("Table");
				  		tempTable.appendChild(tempTbody);
				  		tempTbody.appendChild(innertr);
				  		tempDiv.appendChild(tempTable);
				  		
				  		tempDiv.style.position = "absolute";
				  		tempDiv1.style.position = "absolute";
				  		
				  		tempDiv.style.display = "none";
				  		tempDiv1.style.display = "none";
				  		
					  	tempDiv1.innerHTML = tempDiv.innerHTML;
				  		tempDiv.style.marginTop = "-100px";
				  		tempDiv.style.marginLeft = "4px";
				  		
				  		tempDiv1.style.marginTop = "-23px";
				  		tempDiv1.style.marginLeft = "120px";
					  	
				  		innertbody.appendChild(tempDiv);
				  		innertbody.appendChild(tempDiv1);
					}
				  	
    				var trprice = document.createElement('tr');
					var tdprice = document.createElement('td');
					descript=descript.replace(/\n/, '<br>');
					//alert(descript);
					tdprice.innerHTML = descript + " <span class='font1'>" + price.innerHTML + "</span><br/><br/>";
					trprice.appendChild(tdprice);
					innertbody.appendChild(trprice);

					innertable.appendChild(innertbody);
					tdimg.vAlign = "top";
					tdimg.style.whiteSpace = "nowrap";
					tdimg.appendChild(innertable);
					innertable.className = "";
					tr.appendChild(tdimg);
					//alert(tr.innerHTML);
					tbody.appendChild(tr);
				   } 
				   
				   if(!isIE)
				   {				   
					var intCounter = 1;
					intCounter = tr.getElementsByTagName("TD").length;
					intCounter = (intCounter % 2);
					if(intCounter != 0)
					{
							var intLoopIndex = 1;
							for(intLoopIndex = intCounter; intLoopIndex <= 4; intLoopIndex++)
							{
								var tempTDD = document.createElement("TD");
								tempTDD.appendChild(document.createTextNode("    "));
								tempTDD.style.width = "60px";
								tr.appendChild(tempTDD);
							}
					}
				   }
				   
				 table1.appendChild(tbody);
				 //table1.style.height = "120px";
				 if(baseIndex!=lastIndex)
				 {
					fnCheckPageSize(baseIndex,lastIndex,table1); // For Creating empty tables to fill the grid.
				 }
				 document.getElementById('divGiftCards').style.display='';
				 //table1.style.border = "1px solid red";
				 document.getElementById('divGiftCards').appendChild(table1);
				
							
				}//end display
	
		function fnCheckPageSize(baseIndex,lastIndex,table1)
		{
		    /*
			var intlooop;
			var intRowcnt,intinnerloop;
			var cnt=(PageSize)-(lastIndex-baseIndex);
			if((lastIndex-baseIndex)<(PageSize))
			{
				for(intloop=0;intloop< cnt;intloop++)
				{
					var tr;
					intRowcnt=table1.childNodes[0].childNodes.length;
					if(table1.childNodes[0].childNodes[intRowcnt-1].childNodes.length==5)
					{
						 tr= document.createElement('tr');
					}
					else
					{
						tr= table1.childNodes[0].childNodes[intRowcnt-1];
					}
					
					var tdimg=document.createElement('td');
					tdimg.id ="tdimg";
					
					var innertable=document.createElement('table')
				    innertable.setAttribute('cellPadding',2);
					innertable.setAttribute('cellSpacing',0);
				//	innertable.style.border=" 1px solid #cccccc";
					innertable.style.width="80";
					innertable.style.height="60";
					innertable.align="left";
					var innertbody=document.createElement('tbody');
					var innertr =document.createElement('tr');
					var innertd=document.createElement('td');
					innertd.align='center';
					innertd.style.width='80';						
				  	innertr.appendChild(innertd);
				  	innertbody.appendChild(innertr);
				  	innertable.appendChild(innertbody);
					tdimg.appendChild(innertable);
					tr.appendChild(tdimg);
					table1.childNodes[0].appendChild(tr);
				}
						
			}
		    */
		}		
				
	   function getNextPage()
		{
	
			if (CurrentpageIndex < PageCount-1)        
			{
				CurrentpageIndex++;
				getGiftcardsAll(1);    // '1' is for next link
			}
	   		 return false;
		 } //End getNextpage() function 
		function getPreviousPage()
		{         
			if(CurrentpageIndex > 0)              
			{
				CurrentpageIndex--;
				getGiftcardsAll(2);  //'2' is for next link
			}
		   return false;
		}  // End function getPreviousPage
       	
      
       function	RedirecttoUserSelect(GiftCardId,price)  // redirects to page UserSelect.aspx page
       {
			
			/*if(document.getElementById('lblFrom').innerHTML == 'Referrals')
			{
				window.location.href="ReferralAddFriend.aspx?SelectedGiftCard=" + GiftCardId+"&Price="+price;
			}
			else
			{
				window.location.href="GiftCards.aspx?SelectedGiftCard=" + GiftCardId;
			}*/
			
			document.getElementById("txtGId").value = GiftCardId;
			__doPostBack('lnkPost','');
           
       }  //End  RedirecttoUserSelect
       
  function SetLeft()
     {
     	var offset;
     	offset=parseInt(document.body.offsetWidth);
		
		if(document.getElementById('Layerpopup'))
		{
			if(offset<=780)
			{
				document.getElementById('Layerpopup').style.left='47px';
			}
			else
			{
				offset=(parseInt(document.body.clientWidth/2)-400) + 47;
				document.getElementById('Layerpopup').style.left=offset + 'px';
			}
		
		}	
		return false;
     }     
     
	function SetHeight()
	{
		document.getElementById("Layer2").style.top = (parseInt(document.getElementById("MainDiv").offsetHeight) - 70) + "px";
	}

	function formatCurrency(obj)
	{       
		var num,cents;
		num=obj;
		num = num.toString().replace(/\$|\,/g,'');
		if(isNaN(num))
				num = "0";							
				num = Math.floor(num*100+0.50000000001);				
				{cents = num%100;}				
				num = Math.floor(num/100).toString();				
		if(cents<10)
				cents = "0" + cents;
				for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
				num = num.substring(0,num.length-(4*i+3))+','+
				num.substring(num.length-(4*i+3));
				return( num + '.' + cents);
	}	
	
		function CheckPopupDisplay()
		{
			if(document.getElementById("divAlert").style.display == "")
			{
				return false;
			}
			else
			{
				if(document.getElementById("divQuickFabric").style.display == "")
				{
					return false;
				}
				else
				{
					if(document.getElementById("divconfirmation").style.display == "")
					{
						return false;
					}
					else
					{
						return true;
					}
				}
			}
		}		
	    

	   function GetNextItem(objlink,obj)
       {
			if(CheckPopupDisplay())
			{
				var Id;
				var url;
				var objSrc;
		          
				Id =  document.getElementById('hdnGiftCardId').value;   // obj.parentNode.getElementsByTagName("INPUT")[0].value;
				url= MainPageURL + "?Function=GetNextGiftCards&Id="+ Id +"&link=" + objlink + "&rand=" + Math.random();
				createXmlHttp();
				if(Xmlhttp)
					{		
						Xmlhttp.onreadystatechange = function()
						{
							if(Xmlhttp.readyState==4)
							{
								if(Xmlhttp.status==200)
								{
									if(Xmlhttp.responseXML.documentElement)
									{							     							
										objSrc = Xmlhttp.responseXML.documentElement.getElementsByTagName("tblGiftCards")[0]
										if (objSrc)
										{
											
											if (objSrc.getElementsByTagName("GiftCardId")[0].firstChild)
											{
												document.getElementById('hdnGiftCardId').value = objSrc.getElementsByTagName("GiftCardId")[0].firstChild.nodeValue;
											}  

											if (objSrc.getElementsByTagName("Details")[0].firstChild)
											{
												document.getElementById('lblDetails').innerHTML = objSrc.getElementsByTagName("Details")[0].firstChild.nodeValue;
											}  
												
											try
											{
												if (objSrc.getElementsByTagName("GiftCardAmount")[0].firstChild)
												{	
												    document.getElementById('lblDescr').innerHTML = objSrc.getElementsByTagName("Description")[0].firstChild.nodeValue;						   
													document.getElementById('lblamount').innerHTML = '$' + formatCurrency(objSrc.getElementsByTagName("GiftCardAmount")[0].firstChild.nodeValue);	
													document.getElementById('hdnUnitPrice').value = formatCurrency(objSrc.getElementsByTagName("GiftCardAmount")[0].firstChild.nodeValue);
													document.getElementById("lblPriceOnImage").innerHTML = '$' + formatCurrency(objSrc.getElementsByTagName("GiftCardAmount")[0].firstChild.nodeValue).replace(".00","");
																																									
												}
												else
												{
													document.getElementById('lblPrice').innerHTML = "N/A";	
													document.getElementById("lblPriceOnImage").innerHTML = "N/A";
												}
											}
											catch(ers){}
											
											try
											{
												if (objSrc.getElementsByTagName("GiftCardImagePath2")[0].firstChild)
												{
													document.getElementById('imgGiftcard').src =	objSrc.getElementsByTagName("GiftCardImagePath2")[0].firstChild.nodeValue;//.replace("_1_1","_2_2");														    
												}
											}
											catch(ers)
											{
											}												
										}  
									}	
								}
							}
						}	
							
						if( (!window.XMLHttpRequest)||(isIE) )   //(document.all)
						{   
							Xmlhttp.open("POST", url, true);
							Xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
						}
						else
						{
							Xmlhttp.open("GET", url, true);
						} 
						Xmlhttp.send(null);
					}
      				return false;
			}
       }
           
       function ShowLageView(obj)
       {
			if(CheckPopupDisplay())
			{
				document.getElementById('divQuickFabric').style.display = '';         
				document.getElementById('LargeImage').src =  obj.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName("IMG")[0].src.replace("_2_2","_3_3");
				setTimeout("AssignImage();",100);
			}   
       }
	
		function AssignImage()
		{
			document.getElementById('LargeImage').src = document.getElementById('LargeImage').src ;
		}
      
