﻿



var uniquepageid=window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, "") //get current page path and name, used to uniquely identify this page for persistence feature

function animatedcollapse(divId, animatetime, persistexpand, initstate){
	this.divId=divId
	this.divObj=document.getElementById(divId)
	this.divObj.style.overflow="hidden"
	this.timelength=animatetime
	this.initstate=(typeof initstate!="undefined" && initstate=="block")? "block" : "contract"
	this.isExpanded=animatedcollapse.getCookie(uniquepageid+"-"+divId) //"yes" or "no", based on cookie value
	this.contentheight=parseInt(this.divObj.style.height)
	var thisobj=this
	if (isNaN(this.contentheight)){ //if no CSS "height" attribute explicitly defined, get DIV's height on window.load
		animatedcollapse.dotask(window, function(){thisobj._getheight(persistexpand)}, "load")
		if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
			this.divObj.style.visibility="hidden" //hide content (versus collapse) until we can get its height
	}
	else if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
		this.divObj.style.height=0 //just collapse content if CSS "height" attribute available
	if (persistexpand)
		animatedcollapse.dotask(window, function(){animatedcollapse.setCookie(uniquepageid+"-"+thisobj.divId, thisobj.isExpanded)}, "unload")
}

animatedcollapse.prototype._getheight=function(persistexpand){
	this.contentheight=this.divObj.offsetHeight
	if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes"){ //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
		this.divObj.style.height=0 //collapse content
		this.divObj.style.visibility="visible"
	}
	else //else if persistence is enabled AND this content should be expanded, define its CSS height value so slideup() has something to work with
		this.divObj.style.height=this.contentheight+"px"
}


animatedcollapse.prototype._slideengine=function(direction){
	var elapsed=new Date().getTime()-this.startTime //get time animation has run
	var thisobj=this
	if (elapsed<this.timelength){ //if time run is less than specified length
		var distancepercent=(direction=="down")? animatedcollapse.curveincrement(elapsed/this.timelength) : 1-animatedcollapse.curveincrement(elapsed/this.timelength)
	this.divObj.style.height=distancepercent * this.contentheight +"px"
	this.runtimer=setTimeout(function(){thisobj._slideengine(direction)}, 10)
	}
	else{ //if animation finished
		this.divObj.style.height=(direction=="down")? this.contentheight+"px" : 0
		this.isExpanded=(direction=="down")? "yes" : "no" //remember whether content is expanded or not
		this.runtimer=null
	}
}


animatedcollapse.prototype.slidedown=function(){
	if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
		if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
			alert("Please wait until document has fully loaded then click again")
		else if (parseInt(this.divObj.style.height)==0){ //if content is collapsed
			this.startTime=new Date().getTime() //Set animation start time
			this._slideengine("down")
		}
	}
}

animatedcollapse.prototype.slideup=function(){
	if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
		if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
			alert("Please wait until document has fully loaded then click again")
		else if (parseInt(this.divObj.style.height)==this.contentheight){ //if content is expanded
			this.startTime=new Date().getTime()
			this._slideengine("up")
		}
	}
}

animatedcollapse.prototype.slideit=function(){
	if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
		alert("Please wait until document has fully loaded then click again")
	else if (parseInt(this.divObj.style.height)==0)
		this.slidedown()
	else if (parseInt(this.divObj.style.height)==this.contentheight)
		this.slideup()
}

// -------------------------------------------------------------------
// A few utility functions below:
// -------------------------------------------------------------------

animatedcollapse.curveincrement=function(percent){
	return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
}


animatedcollapse.dotask=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)
}

animatedcollapse.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}

animatedcollapse.setCookie=function(name, value){
		document.cookie = name+"="+value
}












/////////////////////////////for flash//////////////////////////////////

var write1Flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="231" height="245"> <param name="movie" value="images/banner1s.swf" /> <PARAM NAME="menu" VALUE="false"> <PARAM NAME="quality" VALUE="high"> <PARAM NAME="wmode" VALUE="transparent"> <embed src="images/banner1s.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="231" height="245"></embed></OBJECT>'
  


function show1Flash () {

    document.write(write1Flash);

}


/////////////////////////////for flash//////////////////////////////////


////////////////////////for voucher code///////////////


function showhidevoucher(x,s,y)
{   
      
      if(document.getElementById(x).style.display == "none")
       { 
         document.getElementById(x).style.display = '';
         document.getElementById(y).style.display = "none";
       }
       
      
        if(window.clipboardData)  
        {  
         window.clipboardData.setData('text',s);  
        } 
        else  
        {  
        var clipboarddiv=document.getElementById('divclipboardswf');  
        if(clipboarddiv==null)  
        { 
        clipboarddiv=document.createElement('div');  
        clipboarddiv.setAttribute("name", "divclipboardswf");        
        clipboarddiv.setAttribute("id", "divclipboardswf");    
        document.body.appendChild(clipboarddiv);  
        }  
        clipboarddiv.innerHTML='<embed src="../retailersvoucher/clipboard.swf" FlashVars="clipboard='+  
        encodeURIComponent(s)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';  
        }  
        //alert('The text is copied to your clipboard...');  
//        var doc = eval("document.readme."+y);
//        alert(doc);
//        cp = doc.createTextRange();
//        doc.focus();
//        doc.select();
//        cp.execCommand("Copy");
        
   
     
     
//      Copied.execCommand("RemoveFormat");


   return true;
}

function validation()
{
        if(document.getElementById('ctl00_ContentPlaceHolder1_uc2_txtEmail').value=="")
        {
            alert("Email Id cannot be left blank!");
            document.getElementById('ctl00_ContentPlaceHolder1_uc2_txtEmail').focus();
            return false;
        }
        var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
        var address = document.getElementById('ctl00_ContentPlaceHolder1_uc2_txtEmail').value;
        if(reg.test(address) == false) 
        {

            alert('Invalid Email Id!');
            document.getElementById('ctl00_ContentPlaceHolder1_uc2_txtEmail').focus();
            return false;
        }
}



// 06/10/2009
//Start show hide Dive At festival page??
function showhideRptDiv(u,v)
{
 if(document.getElementById(u).style.display == "none")
 {
  document.getElementById(u).style.display = '';
  document.getElementById(v).innerHTML = " ";
 }
 else if(document.getElementById(u).style.display == '')
 {
  document.getElementById(u).style.display = "none";
  document.getElementById(v).innerHTML = " ";
  document.getElementById(v).innerHTML = "More..";
 }
return false;
  
}
//**** Show Hide filter At festival page ***//

function showhideFilter ()
{  
  if(document.getElementById("ShowhideDivr").style.display == "none")
  {
  document.getElementById("ShowhideDivr").style.display = '';
  document.getElementById("divhid").innerHTML= "Hide Filter";  
  }
 else
  {
   document.getElementById("ShowhideDivr").style.display = "none";
   document.getElementById("divhid").innerHTML= "Show Filter";  
  }
 return false;
}





//**for Festival special search ***//

function GETFestivalresponse(){           
    try{ 
        var manuid=document.getElementById("ctl00_ContentPlaceHolder1_ltrmanufature").Value;
        var OfFid=document.getElementById("ctl00_ContentPlaceHolder1_ltroffer").Value;
        var Price=document.getElementById("ctl00_ContentPlaceHolder1_ltrprice").Value;
        var CatType=document.getElementById("ctl00_ContentPlaceHolder1_cattype").value;
        var CatID=document.getElementById("ctl00_ContentPlaceHolder1_catid").value;//ctl00_ContentPlaceHolder1_catid
        var Title=document.getElementById("ctl00_ContentPlaceHolder1_title").value;
        var Fid=document.getElementById("ctl00_ContentPlaceHolder1_fid").value;

        var ajax = AjaxEnvironment();
        if(ajax != null){
            ajax.onreadystatechange = function(){
                if(ajax.readyState == 4 && ajax.status == 200){
                    var Data = ajax.responseText; 
                    //alert(Data);
                    document.getElementById("responsdata").innerHTML= Data;  
                    document.getElementById("loading").style.display = "none";                   
                }else{
                    //alert(document.getElementById("loading").style.display);
                    document.getElementById("loading").style.display = '';      
                }
            }    
            var url =  "ResponseFestival.aspx?manuid="+manuid+"&OfFid="+OfFid+"&Price="+Price+"&CatType="+CatType+"&CatID="+CatID+"&Title="+Title+"&Fid="+Fid+"&r="+Math.random();
            //alert(url);
            ajax.open("GET",url,true);
            ajax.send(null);
        }    
    }catch(err){alert(err.description );}
}  

function FestivalfilterOnPriceCatalog() // call Function Add The Hid Of Price
{   
     var Startprice=document.getElementById("ctl00_ContentPlaceHolder1_txtstartprice").value;
     var EndPrice=document. getElementById("ctl00_ContentPlaceHolder1_txtendprice").value;
     if((Startprice!="")&&(EndPrice!=""))
       {
          showhide1();
          fedstivalsetPriceCookies(_PricerangeArr,Startprice,EndPrice);
         
          return false;
      }
      else
       {
           alert("Plz Enter Value");
           return false;
       }
    
}


function fedstivalsetPriceCookies(Q,R,i) // for searchng Marchent in Arr
{  
  var valu=R+" to "+i; 
  var s=0;
  festivaladdFilter("PA",s,valu);  // add Marchent in Div
  GETFestivalresponse();
  return false;
   
   
}

function festivaladdFilter(T,U,V)  // For Add Product 
{   
    
  if(T=="OF")
     {
      _offerbyArr[U]=V;
        var m=document.getElementById("Div48");
        ShowAllfestivalofferbyData(_offerbyArr,m);  // Data Show in Div
        return false;
    }
  if(T=="MA")
     {
       _mannufatureArr[U]=V;
        var S=document.getElementById("Div47");
        ShowAllfestivalmanufatureData(_mannufatureArr,S); // Data Show In Div
        return false;
     }
   if(T=="PA")
     {
       _PricerangeArr[U]=V;
        var Si=document.getElementById("Div46");
        ShowAllfestivalPriceData(_PricerangeArr,Si); // Data Show In Div
        return false;
     }

  
} 


function FestivalfilterOnOfferByForCatalog(CID,CNam)
{     //alert('k');
      showhide1();
      setfestivalBrandCookies(_offerbyArr,CID,CNam);
      return false;
    
}

function showhide1()
{ 
      if(document.getElementById("Div44").style.display == "none")
       { 
         document.getElementById("Div44").style.display = '';
       }

   return false;
}


function setfestivalBrandCookies(b,d,e) // for searchng Brand in Arr
{
  if(isAlreadyAdded(b,e)==true)
    {alert("offer by "+e+" already selected");
    return false
    }
    else
    {
     festivaladdFilter("OF",d,e);  // for Add OfferBy in Div
     GETFestivalresponse();  // For Hit Requst 
     return false
    }
    

}

function festivalfilterOnMannufatureForCatalog(FID,Fnam) // call Function Add The Hid Of Manufature
{    
      showhide1();
      setfestivalFeatureCookies(_mannufatureArr,FID,Fnam);
      return false;
}



function setfestivalFeatureCookies(g,h,i) // for searchng Marchent in Arr
{  
  
  if(isAlreadyAdded(g,i)==true)
    {
    alert("Manufacture "+i+" already selected");
    return false
    }
   else
   {
    festivaladdFilter("MA",h,i);  // add Marchent in Div
    GETFestivalresponse();  // For Hit Requst
    return false;
   }
   
}

function removefestivalFilteroffer(EID) // For Remove Offer Data In Div And Array 
{   
    
    var X;
    for(X=0;X<_offerbyArr.length+1;X++)
     { 
        if(X==EID)
        { 
        delete _offerbyArr[X];
        ShowAllfestivalofferbyData(_offerbyArr,document.getElementById("Div48"))
       // var n=checkData();
//        alert(n);
     GETFestivalresponse();
        }
     } 

    return false;
}

function removefestivalFilterManufature(EEID)  // For Remove Manufature Data In Div And Array
{   
    
    var Y;
    for(Y=0;Y<_mannufatureArr.length+1;Y++)
     { 
        if(Y==EEID)
        { 
        delete _mannufatureArr[Y];
        ShowAllfestivalmanufatureData(_mannufatureArr,document.getElementById("Div47"))
       // var n=checkData();
//         alert(n);
//        if((manuid=="")&&(OfFid=="")&&(Price==""))
//           {
//            clearFilter();
//            StateSuggestionsShow(1);
//           }
//           else
//           {
            GETFestivalresponse();
//           }
       
        }
     } 

    return false;
}

function removefestivalFilterPrice(EEIDi)  // For Remove Manufature Data In Div And Array
{   
   
    var Yi;
    delete _PricerangeArr[0];
//    document.getElementById("ctl00_ContentPlaceHolder1_txtstartprice").value="";
//    document.getElementById("ctl00_ContentPlaceHolder1_txtendprice").value="";

    ShowAllfestivalPriceData(_PricerangeArr,document.getElementById("Div46"))
   // var n=checkData();
    GETFestivalresponse();
    return false;
}

function ShowAllfestivalofferbyData(p,q)  // Show Offer Data In Div
{  var Mid=""; 
   var offerdata="";
    var w;
    for(w=0;w<p.length+1;w++)
     { 
       if(typeof(p[w])!="undefined")
        { 
          Mid=Mid+","+w;
         offerdata=offerdata+"<a href='javascript:;' onclick='JavaScript:return removefestivalFilteroffer("+w+");'>x</a> <span>"+p[w]+"</span><br/>";
        }
       
    }
   
     q.innerHTML=offerdata;
     document.getElementById("ctl00_ContentPlaceHolder1_ltroffer").Value=Mid;
     return false;
}

function ShowAllfestivalmanufatureData(r,y) // Show Manufature Data in Div
{
   var Ofid=""; 
   var manudata="";
    var z;
    for(z=0;z<r.length+1;z++)
     { 
       if(typeof(r[z])!="undefined")
        { 
        Ofid=Ofid+","+z;
       manudata=manudata+"<a href='javascript:;' onclick='JavaScript:return removefestivalFilterManufature("+z+");'>x</a> <span>"+r[z]+"</span><br/>";

        }
     }
     y.innerHTML=manudata;
     document.getElementById("ctl00_ContentPlaceHolder1_ltrmanufature").Value=Ofid;
     return false;
}

function ShowAllfestivalPriceData(ri,yi) // Show Manufature Data in Div
{
   var Pid=""; 
   var Pricedata="";
    var zi;
    for(zi=0;zi<ri.length+1;zi++)
     { 
       if(typeof(ri[zi])!="undefined")
        { 
         pid=ri[zi];
       Pricedata=Pricedata+"<a href='javascript:;' onclick='JavaScript:return removefestivalFilterPrice("+zi+");'>x</a> <span>"+ri[zi]+"</span><br/>";

        }
     }
     yi.innerHTML=Pricedata;
     document.getElementById("ctl00_ContentPlaceHolder1_ltrprice").Value=pid;
     return false;
}




//********Start Refine Search Data js File*************/
 
/*
  Search Filter At Deal Box Page 
  For Refine Search Deal Data 
  Create By: KAPIL KHARE
   

*/



var _offerbyArr =new Array();
var _mannufatureArr =new Array();
var _PricerangeArr =new Array();

 
function AjaxEnvironment()
{
    var ajax=null;
    try
    {
        // Firefox, Opera 8.0+, Safari
        ajax = new XMLHttpRequest();
    }
    catch (e)
    {
        // Internet Explorer
        try
        {
            ajax = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            try
            {
                ajax=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
                alert("Your browser does not support AJAX!");    
            }
        }
    }
    return ajax;
}

function StateSuggestionsShow(p)
{           
          
           var manuid=document.getElementById("ctl00_ContentPlaceHolder1_ltrmanufature").Value;
           var OfFid=document.getElementById("ctl00_ContentPlaceHolder1_ltroffer").Value;
           var Price=document.getElementById("ctl00_ContentPlaceHolder1_ltrprice").Value;
           var CatType=document.getElementById("ctl00_ContentPlaceHolder1_cattype").Value;
           var CatID=document.getElementById("ctl00_ContentPlaceHolder1_catid").Value;
      //   alert("ManUid="+manuid+" OfFid="+OfFid+" Price="+Price+" CatType="+CatType+" CatID="+CatID);
            var ajax = AjaxEnvironment();
            if(ajax != null)
            {
                ajax.onreadystatechange = function()
                {  
                
                if(ajax.readyState == 4 && ajax.status == 200)
                    {
                    var Data = ajax.responseText; 
                    document.getElementById("responsdata").innerHTML= Data;  
                    document.getElementById("Dealloading").style.display = "none";                   
                }
                else{document.getElementById("Dealloading").style.display = '';}
                }    
                 
     ajax.open("GET","Responspage.aspx?manuid="+manuid+"&OfFid="+OfFid+"&Price="+Price+"&PageNo="+p+"&CatType="+CatType+"&CatID="+CatID+"&t="+Math.random()+"",true);
                ajax.send(null);
   
        }    
 }   


function showhide1()
{ 
      if(document.getElementById("Div44").style.display == "none")
       { 
         document.getElementById("Div44").style.display = '';
       }

   return false;
}


function filterOnOfferByForCatalog(CID,CNam)
{     //alert('k');
      showhide1();
      setBrandCookies(_offerbyArr,CID,CNam);
      return false;
    
}



function setBrandCookies(b,d,e) // for searchng Brand in Arr
{
  if(isAlreadyAdded(b,e)==true)
    {alert("offer by "+e+" already selected");
    return false
    }
    else
    {
     addFilter("OF",d,e);  // for Add OfferBy in Div
     StateSuggestionsShow(1);  // For Hit Requst 
     return false
    }
    

}

function filterOnMannufatureForCatalog(FID,Fnam) // call Function Add The Hid Of Manufature
{    
      showhide1();
      setFeatureCookies(_mannufatureArr,FID,Fnam);
      return false;
}



function setFeatureCookies(g,h,i) // for searchng Marchent in Arr
{  
  
  if(isAlreadyAdded(g,i)==true)
    {
    alert("Manufacture "+i+" already selected");
    return false
    }
   else
   {
    addFilter("MA",h,i);  // add Marchent in Div
    StateSuggestionsShow(1);  // For Hit Requst
    return false;
   }
   
}

function filterOnPriceCatalog() // call Function Add The Hid Of Price
{   
     var Startprice=document.getElementById("ctl00_ContentPlaceHolder1_txtstartprice").value;
     var EndPrice=document. getElementById("ctl00_ContentPlaceHolder1_txtendprice").value;
     if((Startprice!="")&&(EndPrice!=""))
       {
          showhide1();
          setPriceCookies(_PricerangeArr,Startprice,EndPrice);
         
          return false;
      }
      else
       {
           alert("Plz Enter Value");
           return false;
       }
    
}


function setPriceCookies(Q,R,i) // for searchng Marchent in Arr
{  
  var valu=R+" to "+i; 
  var s=0;
  addFilter("PA",s,valu);  // add Marchent in Div
  StateSuggestionsShow(1);
  return false;
   
   
}

function addFilter(T,U,V)  // For Add Product 
{   
    
  if(T=="OF")
     {
      _offerbyArr[U]=V;
        var m=document.getElementById("Div48");
        ShowAllofferbyData(_offerbyArr,m);  // Data Show in Div
        return false;
    }
  if(T=="MA")
     {
       _mannufatureArr[U]=V;
        var S=document.getElementById("Div47");
        ShowAllmanufatureData(_mannufatureArr,S); // Data Show In Div
        return false;
     }
   if(T=="PA")
     {
       _PricerangeArr[U]=V;
        var Si=document.getElementById("Div46");
        ShowAllPriceData(_PricerangeArr,Si); // Data Show In Div
        return false;
     }

  
}
function isAlreadyAdded(b,c) // For Find All Ready Availevel Data 
{  
    if(b.length>0)
    {
    for(var a=0;a<b.length;a++)
    {
    if(b[a]==c){return true}
    }
    }
    return false
}

function removeFilteroffer(EID) // For Remove Offer Data In Div And Array 
{   
    
    var X;
    for(X=0;X<_offerbyArr.length+1;X++)
     { 
        if(X==EID)
        { 
        delete _offerbyArr[X];
        ShowAllofferbyData(_offerbyArr,document.getElementById("Div48"))
       // var n=checkData();
//        alert(n);
        StateSuggestionsShow(1);
        }
     } 

    return false;
}

function removeFilterManufature(EEID)  // For Remove Manufature Data In Div And Array
{   
    
    var Y;
    for(Y=0;Y<_mannufatureArr.length+1;Y++)
     { 
        if(Y==EEID)
        { 
        delete _mannufatureArr[Y];
        ShowAllmanufatureData(_mannufatureArr,document.getElementById("Div47"))
       // var n=checkData();
//         alert(n);
//        if((manuid=="")&&(OfFid=="")&&(Price==""))
//           {
//            clearFilter();
//            StateSuggestionsShow(1);
//           }
//           else
//           {
             StateSuggestionsShow(1);
//           }
       
        }
     } 

    return false;
}

function removeFilterPrice(EEIDi)  // For Remove Manufature Data In Div And Array
{   
   
    var Yi;
    delete _PricerangeArr[0];
    ShowAllPriceData(_PricerangeArr,document.getElementById("Div46"))
    // var n=checkData();
    StateSuggestionsShow(1);
    return false;
}
function clearFilter()  //Clear All  Search Filter Data Data
{
     manudata="";
     offerdata="";
    _offerbyArr =new Array();
    _mannufatureArr =new Array();
     _PricerangeArr =new Array();

    document.getElementById("Div46").innerHTML="";
    document.getElementById("Div47").innerHTML="";
    document.getElementById("Div48").innerHTML="";
    document.getElementById("ctl00_ContentPlaceHolder1_ltrmanufature").Value="";
    document.getElementById("ctl00_ContentPlaceHolder1_ltroffer").Value="";
    document.getElementById("ctl00_ContentPlaceHolder1_ltrprice").Value="";
//    if( document.getElementById("ctl00_ContentPlaceHolder1_txtstartprice").Value!="")
//     {
//        document.getElementById("ctl00_ContentPlaceHolder1_txtstartprice").Value="0.0";
//     }
//     if( document.getElementById("ctl00_ContentPlaceHolder1_txtendprice").Value!="")
//     {  alert(document.getElementById("ctl00_ContentPlaceHolder1_txtendprice").Value);
//       document.getElementById("ctl00_ContentPlaceHolder1_txtendprice").Value="0.0";
//     }
    document.getElementById("Div44").style.display = "none";
   //StateSuggestionsShow(1);
   // return false;
    
    
    
    
}


function ShowAllofferbyData(p,q)  // Show Offer Data In Div
{  var Mid=""; 
   var offerdata="";
    var w;
    for(w=0;w<p.length+1;w++)
     { 
       if(typeof(p[w])!="undefined")
        { 
          Mid=Mid+","+w;
         offerdata=offerdata+"<a href='javascript:;' onclick='JavaScript:return removeFilteroffer("+w+");'>x</a> <span>"+p[w]+"</span><br/>";
        }
       
    }
   
     q.innerHTML=offerdata;
     document.getElementById("ctl00_ContentPlaceHolder1_ltroffer").Value=Mid;
     return false;
}

function ShowAllmanufatureData(r,y) // Show Manufature Data in Div
{
   var Ofid=""; 
   var manudata="";
    var z;
    for(z=0;z<r.length+1;z++)
     { 
       if(typeof(r[z])!="undefined")
        { 
        Ofid=Ofid+","+z;
       manudata=manudata+"<a href='javascript:;' onclick='JavaScript:return removeFilterManufature("+z+");'>x</a> <span>"+r[z]+"</span><br/>";

        }
     }
     y.innerHTML=manudata;
     document.getElementById("ctl00_ContentPlaceHolder1_ltrmanufature").Value=Ofid;
     return false;
}

function ShowAllPriceData(ri,yi) // Show Manufature Data in Div
{
   var Pid=""; 
   var Pricedata="";
    var zi;
    for(zi=0;zi<ri.length+1;zi++)
     { 
       if(typeof(ri[zi])!="undefined")
        { 
         pid=ri[zi];
       Pricedata=Pricedata+"<a href='javascript:;' onclick='JavaScript:return removeFilterPrice("+zi+");'>x</a> <span>"+ri[zi]+"</span><br/>";

        }
     }
     yi.innerHTML=Pricedata;
     document.getElementById("ctl00_ContentPlaceHolder1_ltrprice").Value=pid;
     return false;
}


function clean(arr,to_delete) // For Clear Empty DAta in Array 
{
   var a;
   for (a = 0; a < arr.length; a++)
   {
      if (arr[a] == to_delete)
      {         
         arr.splice(a, 1);
         a--;
      }
   }
   
   return arr;
}

function checkData() // For Check data in Array 
{
     var a=0;
      var manuid=document.getElementById("ctl00_ContentPlaceHolder1_ltrmanufature").Value;
        var OfFid=document.getElementById("ctl00_ContentPlaceHolder1_ltroffer").Value;
        var Price=document.getElementById("ctl00_ContentPlaceHolder1_ltrprice").Value;

       
    
          if(manuid=="")                   
           {
            a=a+1;
           }
          if(OfFid=="")                       
           {
             a=a+1;
           }

          if(Price=="")                       
           {
            a=a+1;
           }
           
          
   return a;
}




//********End Refine Search Data js File*************/




// for Brand search

function BrandAjax(V,P)
{   
          var ajax = AjaxEnvironment();
            if(ajax != null)
            {
                ajax.onreadystatechange = function()
                {
                    if(ajax.readyState == 4 && ajax.status == 200)
                    {
                        var Data = ajax.responseText; 
                        document.getElementById("BrandDiv").innerHTML= Data;                   
                    }  
                }    
               
                ajax.open("GET","BrandResponspage.aspx?ch="+V+"&P="+P,true);
                ajax.send(null);
   
        }    
 } 
//End Brand 

//Close******//

/* For Deal-box-Details Page Tabls ShowHide */


function showhide_ds(divid)
{
	document.getElementById('divcomment').style.display = "none";
	document.getElementById('div2').style.display = "none";
	document.getElementById('div3').style.display = "none";
	document.getElementById('div4').style.display = "none";
	document.getElementById('t1').className = "";
	document.getElementById('t2').className = "";
	document.getElementById('t3').className = "";
	document.getElementById('t3').className = "";
	if(divid == 'a')
	{
		document.getElementById('divcomment').style.display = "";
		document.getElementById('t1').className = "selected";
		document.getElementById('div2').style.display = "none";
	    document.getElementById('div3').style.display = "none";
	    document.getElementById('div4').style.display = "none";
	} 
	if(divid == 'b')
	{
		document.getElementById('div2').style.display = "";
		document.getElementById('t2').className = "selected";
		document.getElementById('divcomment').style.display = "none";
		document.getElementById('div3').style.display = "none";
	    document.getElementById('div4').style.display = "none";
	}
	else if(divid == 'c')
	{
		document.getElementById('div3').style.display = "";
		document.getElementById('t3').className = "selected";
		document.getElementById('divcomment').style.display = "none";
	    document.getElementById('div2').style.display = "none";
	    document.getElementById('div4').style.display = "none";
	}
	else if(divid == 'd')
	{ 
		document.getElementById('div4').style.display = "";
		document.getElementById('t4').className = "selected";
		document.getElementById('divcomment').style.display = "none";
	   document.getElementById('div2').style.display = "none";
	   document.getElementById('div3').style.display = "none";
	}                 
}




/*   Close   Deal-box-Details Page Tabls ShowHide */
