
function sndUserCheckforcolor(theOpt)
{ http.open("get", "http://www.giftstoindia24x7.com/Ajax.aspx?proid=" + theOpt.value + "&ajmode=color"); http.onreadystatechange = handleResponse; http.send(null); }
function sndUserCheckforsize(theOpt)
{ http.open("get", "http://www.giftstoindia24x7.com/Ajax.aspx?proid=" + theOpt.value + "&ajmode=size"); http.onreadystatechange = handleResponse; http.send(null); }
function SelectedItem(theOpt,theTxt)
{ window.location.href = "http://www.giftstoindia24x7.com/category.aspx?cat=" + theOpt.value + "&searchterm=" + theTxt.value; }
function SetDivIndexPrice(theDiv,theOpt,theFlag)
{if(theDiv!=null&&theOpt!=null)
{var i;var CurrencyUnit=new Array();var collDivs=document.getElementsByTagName('DIV');if(collDivs!=null)
{theFlag.innerHTML="<img src='http://img2.giftstoindia24x7.com/Pictures/"+theOpt.options[theOpt.selectedIndex].text+".jpg' width='29' height='15'>";for(i=0;i<collDivs.length;i++)
{if(theDiv.id==collDivs[i].id)
{CurrencyUnit=theOpt.value.split(",");alert(CurrencyUnit[2]);collDivs[i].innerHTML="Rs. "+collDivs[i].title+" / "+CurrencyUnit[1]+" "+(collDivs[i].title/CurrencyUnit[2]).toFixed(2);}}}}
else
{alert("No price found to change.");}}
function setDivPrice(theDiv,theOpt,theFlag)
{
    var bFlag=false;
    if(theOpt!=null)
    {
        var xmlHttpReq=false;
        var self=this;
        if(window.XMLHttpRequest)
        {
            self.xmlHttpReq=new XMLHttpRequest();
        }
        else if(window.ActiveXObject)
        {
            self.xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");
        }
        self.xmlHttpReq.open('POST', "http://www.giftstoindia24x7.com/ajaxCommonFunction_ppnl.aspx", true);
        self.xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
        self.xmlHttpReq.onreadystatechange=function()
        {
            if(self.xmlHttpReq.readyState==4)
            {
                theOpt.disabled=false;
                var GetValue=new Array();
                if(self.xmlHttpReq.responseText.indexOf('~'!=-1))
                {
                    GetValue=self.xmlHttpReq.responseText.split("~");
                }
                if(GetValue[0].toString()!="")
                {
                    if(GetValue[0].toString()=="0")
                    {
                        alert("Error : "+GetValue[1].toString());
                    }
                    else
                    {
                        var collDivs=document.getElementsByTagName('SPAN');
                        if(collDivs!=null)
                        {
                            theFlag.innerHTML="<img src=\"http://img2.giftstoindia24x7.com/Pictures/"+theOpt.options[theOpt.selectedIndex].text+".jpg\" width=\"29\" height=\"15\">";
                            for(var i=0;i<collDivs.length;i++)
                            {
                                var att=collDivs[i].getAttribute("name");
                                if(att=="ProductPrice")
                                {
                                    bFlag=true;
                                    collDivs[i].innerHTML="Rs. "+collDivs[i].title+" / "+GetValue[1].toString()+" "+(collDivs[i].title/GetValue[2]).toFixed(2);
                                }
                            }
                        }
                        if(bFlag==false)
                        {
                            var collDivs=document.getElementsByTagName('DIV');
                            theDiv=document.getElementById('ProductPrice');
                            if (collDivs != null) 
                            {
                                theFlag.innerHTML="<img src=\"http://img2.giftstoindia24x7.com/Pictures/" + theOpt.options[theOpt.selectedIndex].text +".jpg\" width=\"29\" height=\"15\">" ;
                                for(i=0;i<collDivs.length;i++)  
                                {          
                                    if (theDiv.id == collDivs[i].id)
                                    {
                                        collDivs[i].innerHTML= "Rs. " + collDivs[i].title + " / " + GetValue[1].toString() + " " +  (collDivs[i].title/GetValue[2]).toFixed(2);                    
                                    }          
                                }
                            }
                        }
                        else
                        {
                            var collDivs=document.getElementsByTagName('DIV');
                            theDiv=document.getElementById('ProductPrice');
                            if (theDiv != null) 
                            {
                                theFlag.innerHTML="<img src=\"http://img2.giftstoindia24x7.com/Pictures/" + theOpt.options[theOpt.selectedIndex].text +".jpg\" width=\"29\" height=\"15\">" ;
                                for(i=0;i<collDivs.length;i++)  
                                {          
                                    if (theDiv.id == collDivs[i].id)
                                    {
                                        collDivs[i].innerHTML= "Rs. " + collDivs[i].title + " / " + GetValue[1].toString() + " " +  (collDivs[i].title/GetValue[2]).toFixed(2);                    
                                    }          
                                }
                            }
                        }
                    }
                }
                else
                {
                    alert("Sorry! Due to some error currency cannot be changed.");
                }
            }
            else
            {
                theOpt.disabled=true;
                theFlag.innerHTML = "<img src=\"http://www.giftstoindia24x7.com/Pictures/loading.gif\" width=\"20\" height=\"20\">";
            }
        }
        self.xmlHttpReq.send("mode=1&currId="+theOpt.value);
    }
    else
    {
        alert("Sorry! No price found to change. Cannot Change currency.");
    }
}
