/*function updatepid()
{
	if(window.location.href.indexOf('#') != -1 && window.location.href.indexOf('categoryid') != -1)
	{
		var curl=window.location.href;
		var rdurl=window.location.href.split('?');
		var rdurl1=rdurl[1].split('#');
		window.location.href=rdurl[0]+'?'+rdurl1[1];
	}
	else if(window.location.href.indexOf('#') != -1 && window.location.href.indexOf('design-gallery.aspx') != -1)
	{
		var curl=window.location.href;
		var rdurl=window.location.href.split('#');
		churlparam=rdurl[1].split('=');
		if(getid('ctl00_hdnDGProductID').value=='')
		{
			getid('ctl00_hdnDGProductID').value=churlparam[1];
			window.location.href=rdurl[0]+'?productid='+churlparam[1];
			alert(window.location.href);
		}
	}
}*/
var currentsection='';
var firsttxt=''
var hschg=0;
var priceid;
var valus=new Array();
var texts=new Array();
var cdate=new Array();
var cmonth=new Array();
var cyear=new Array();
var sizeArray=new Array();
var vals=0;
var cdvals=0;
var cmvals=0;
var cyvals=0;
var shdiv=0;
var shdiv1=0;
var catdiv=0;
var shdiv2=0;
var shdiv3=0;
var descdiv=0;
var datecount=1;
var monthcount=1;
var yearcount=1;
var categorydiv=0;
var descimg=0;
var countryshow =0;
var postb=0;
var txtnum=0;
var ldprodfirst=0;
var ldfirst=1;
var dlmsg='';
var designurl='';	
var dreamlisturl='';
var inspirationurl='';	
var designerurl='';
var retailersearchurl='';
var userid;
var builddghome;
var builddghome1;	
var paramsnew;
var alreadyclick=0;
var catid=0;
var retailersection=0;
var countryname='';
var domain=window.location.href.split('/')[2];
var m_names = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
if(window.location.href.toLowerCase().indexOf('categoryid') != -1 && window.location.href.toLowerCase().indexOf('typeid') != -1)
{
	var builddghome=2;	
}
else if(window.location.href.toLowerCase().indexOf('showall=1') != -1)
{
	var builddghome=3;	
}
else if(window.location.href.toLowerCase().indexOf('mostviewed=1') != -1)
{
	var builddghome=7;	
}
else if(window.location.href.toLowerCase().indexOf('productid') != -1 && (window.location.href.toLowerCase().indexOf('design-gallery.aspx') != -1 || window.location.href.toLowerCase().indexOf('galerie-bijoux.aspx') != -1 || window.location.href.toLowerCase().indexOf('galleria-dei-gioielli.aspx') != -1 || window.location.href.toLowerCase().indexOf('design-galerie.aspx') != -1))
{
	var builddghome=0;	
	currentsection='Design Gallery';
	var paramsnew=window.location.href.toLowerCase().split('#');
	var paramsnew=paramsnew[1].split('=');
	ldprodfirst=paramsnew[1];
}
else if(window.location.href.toLowerCase().indexOf('pt-inspiration.aspx') != -1 || window.location.href.toLowerCase().indexOf('inspiration-platin.aspx') != -1 || window.location.href.toLowerCase().indexOf('inspiration-platine.aspx') != -1 || window.location.href.toLowerCase().indexOf('pt-ispirazioni.aspx') != -1)
{
	var builddghome=1;	
	ldfirst=0;
	currentsection='Platinum Inspiration';
	var paramsnew=window.location.href.toLowerCase().split('=');
	ldprodfirst=paramsnew[2];
}
else if(window.location.href.toLowerCase().indexOf('pt-dreamlist.aspx') != -1 || window.location.href.toLowerCase().indexOf('traumstucke.aspx') != -1)
{
	var builddghome=4;
	currentsection='Dream List';
	var userid=0;
}
else if(window.location.href.toLowerCase().indexOf('budget.aspx') != -1)
{
	var builddghome=6;
}
var tdate= new Date();
window.onload=check_page;
function check_page()
{
	if(window.location.href.toLowerCase().indexOf('index.aspx') != -1 || window.location.href.toLowerCase().indexOf('company.aspx') != -1 || window.location.href.toLowerCase().indexOf('cosmo.aspx') != -1 || window.location.href.toLowerCase().indexOf('confetti.aspx') != -1 || window.location.href.toLowerCase().indexOf('marie-claire.aspx') != -1)
	{
		if(window.location.href.toLowerCase().indexOf('en-gb/') != -1)
		{
			 ukchngimg();	
		}
		else if(window.location.href.toLowerCase().indexOf('en-us/') != -1 || window.location.href.toLowerCase().indexOf('ko/') != -1)
		{
			chngimg();	
		}
		else if(window.location.href.toLowerCase().indexOf('en/') != -1)
		{
			inchngimg();	
		}
		else if(window.location.href.toLowerCase().indexOf('it/') != -1)
		{
			 itchngimg();	
		}
		else if(window.location.href.toLowerCase().indexOf('de/') != -1)
		{
			dechngimg();	
		}
		else if(window.location.href.toLowerCase().indexOf('fr/') != -1)
		{
			 frchngimg();	
		}
		else if(window.location.href.toLowerCase().indexOf('zh-cn/') != -1)
		{
			cnchngimg();	
		}
		else if(window.location.href.toLowerCase().indexOf('ja/') != -1)
		{
			jachngimg();
		}
	}
	
    
    document.onclick=hide_divs;
    if (typeof window.innerWidth != 'undefined')
	{
		viewportwidth = window.innerWidth;
		viewportheight = window.innerHeight;
	}
	// IE
	else if (typeof document.documentElement != 'undefined'	 && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0)
	{
		viewportwidth = document.documentElement.clientWidth;
		viewportheight = document.documentElement.clientHeight;
	}
	// older versions of IE
	else
	{
		viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
		viewportheight = document.getElementsByTagName('body')[0].clientHeight;
	}
	if(!getid('cover'))
    {
		var coverdiv=document.createElement('div');
		coverdiv.setAttribute('id','cover');
		document.body.appendChild(coverdiv);
	}
	var animElements = document.getElementsByTagName("a");
  	for(var i=0; i<animElements.length; i++)
	{
		if(animElements[i].className=='viewthickbox')
		{
			var links=animElements[i].href;
			animElements[i].setAttribute('href','javascript:void(0)');
			animElements[i].setAttribute('id',links);
			animElements[i].onclick = openlightbox;
		}		
   	}
	function openlightbox()
	{
		ajaxlink=this.id;
		positioncover();
	}
	function positioncover()
	{
		if(getid("Wrapper").offsetHeight > viewportheight)
		{
			pageheight=getid("Wrapper").offsetHeight;
		}
		else
		{
			pageheight=viewportheight;
		}
		getid("cover").style.display='block';
		getid("cover").style.position='absolute';
		getid("cover").style.left='0px';
		getid("cover").style.top='0px';
		getid("cover").style.height=pageheight+"px";
		getid("cover").style.width='100%';
		getid("cover").style.background='#ffffff';
		getid("cover").style.opacity=.5;
		getid("cover").style.MozOpacity=.5;
		getid("cover").style.KhtmlOpacity=.5;
		getid("cover").style.filter="alpha(opacity="+50+ ")";
		
		if(!getid('layer'))
		{
			var poplayer=document.createElement('div');
			poplayer.setAttribute('id','layer');
			
			var popimage=document.createElement('div');
			popimage.setAttribute('id','imgid');
			
			poplayer.appendChild(popimage);
			document.body.appendChild(poplayer);
		}
		getid('layer').style.position='absolute';
		getid('layer').style.height="500px";
		getid('layer').style.width="800px";
		getid('layer').style.zIndex="10";
		layertop=(viewportheight-500)/2;
		layerleft=(viewportwidth-800)/2;
		getid('layer').style.left=layerleft+"px";
		getid('layer').style.top=layertop+"px";
		getid('layer').style.visibility="visible";
		makeajaxcall();
	}
    
    var divs = document.getElementsByTagName("a");
	var len = divs.length;
	var thisDiv;
	for (var i = 0; i < len; i++)
	{
		thisDiv = divs[i];
		if (thisDiv.className == 'lst_coun')
		{
			thisDiv.setAttribute('id','country_selected');
			thisDiv.setAttribute('href','javascript:show_country()');
		}
	}	
    var divs = document.getElementsByTagName("div");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
	    thisDiv = divs[i];
	    if (thisDiv.className == 'divFileDes')
	    {
	        thisDiv.setAttribute('id','imgdesc'+descdiv);
		    thisDiv.style.position='absolute';
		    thisDiv.style.top='-90px';
		    thisDiv.style.left='0px';
		    /*thisDiv.style.background='#000000';*/
		    thisDiv.style.color='#ffffff';
		    thisDiv.style.width='81px';
		    thisDiv.style.display='none';
		    thisDiv.style.padding='5px 5px 15px 5px';
		    descdiv++;
	    }
    }
    var divs = document.getElementsByTagName("img");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
	    thisDiv = divs[i];
	    if (thisDiv.className == 'resimg')
	    {
	        thisDiv.setAttribute('name','imgs'+descimg);
		    thisDiv.onmouseover=show_img_desc;
		    thisDiv.onmouseout=hide_img_desc;
		    descimg++;
	    }
    }
	var divs = document.getElementsByTagName("div");
	var len = divs.length;
	var thisDiv;
	for (var i = 0; i < len; i++)
	{
		thisDiv = divs[i];
		if (thisDiv.className == 'country')
		{
			thisDiv.onmouseover=show_country;
		}
	}
	var divs = document.getElementsByTagName("select");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
        thisDiv = divs[i];
        if (thisDiv.className == 'nice')
        {
            postb=1;
            thisDiv.style.visibility="hidden";
             for(var j=0;j<thisDiv.childNodes.length;j++)
            {
                if(thisDiv.childNodes[j].value)
                {
                    valus[vals]=thisDiv.childNodes[j].value;
                    texts[vals]=thisDiv.childNodes[j].innerHTML;
                    vals++;
                }
            }
            var odiv=document.createElement('div');
            odiv.setAttribute('id','drop_down1');
            //odiv.style.top=thisDiv.offsetTop+"px";
            var idiv1=document.createElement('div');
            idiv1.setAttribute('id','drop_downtxt');
            
            var initval=texts[0];
            for(var k=0;k<1;k++)
            {
                var idivtxt=document.createTextNode(texts[k]);
            }
            idiv1.onclick=show_div;
            idiv1.appendChild(idivtxt);

            var idiv2=document.createElement('div');
            idiv2.setAttribute('id','drop_downbtn');
            idiv2.onclick=show_div;

            var idiv3=document.createElement('div');
            idiv3.setAttribute('id','drop_downlay');
                
            var idiv4=document.createElement('ul');

            //var idiv5=document.createElement('li');
            //idiv5.setAttribute('tabindex','0');

            //idiv4.appendChild(idiv5);
            for(var k=0;k<valus.length;k++)
            {
                var idiv5=document.createElement('li');
                if(navigator.userAgent.indexOf('safari') != -1 || navigator.userAgent.indexOf('Safari') != -1 || navigator.userAgent.indexOf('MSIE 8') != -1)
                {
                    
                    if(valus[k] == '' || valus[k] == '0')
                    {
                        //alert(valus[k]);
                        idiv5.setAttribute('value','0');
                    }
                    else
                    {
                        idiv5.setAttribute('value',valus[k]);
                    }
                }
                else
                {
                    if(valus[k] == '' || valus[k] == '0')
                    {
                        idiv5.setAttribute('tabindex','');
                    }
                    else
                    {
                        idiv5.setAttribute('tabindex',valus[k]);
                    }
                }
                var textadd=texts[k].replace(/&amp;/g,'&');
                var idiv5txt=document.createTextNode(textadd);
                idiv5.onclick=sel_text;
                idiv5.appendChild(idiv5txt);
                idiv4.appendChild(idiv5);
            }
            odiv.appendChild(idiv1);
            odiv.appendChild(idiv2);
            idiv3.appendChild(idiv4);
            odiv.appendChild(idiv3);
            if(getid('drop_down_fill'))
            {
                getid('drop_down_fill').appendChild(odiv);
            }
            var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
	            thisDiv = divs[i];
	            if (thisDiv.className == 'hiddentxt')
	            {
	                if(thisDiv.id.indexOf('txtNewsCategory1') != -1)
	                {
	                    getid("drop_downtxt").innerHTML=getid(thisDiv.id).value;
	                    if(getid(thisDiv.id).value == '' || getid(thisDiv.id).value == '0')
                        {
                            getid("drop_downtxt").innerHTML=initval;
                        }
	                }
	                if(thisDiv.id.indexOf('txtPressCategory1') != -1)
	                {
	                    getid("drop_downtxt").innerHTML=getid(thisDiv.id).value;
	                    if(getid(thisDiv.id).value == '' || getid(thisDiv.id).value == '0')
                        {
                            getid("drop_downtxt").innerHTML=initval;
                        }
	                }	                
	            }
            }  
            
            
             
            /*if(getid("ctl00_IntroTextPlaceHolder1_ctl00_txtNewsCategory"))
            {
                getid("drop_downtxt").innerHTML=getid("ctl00_IntroTextPlaceHolder1_ctl00_txtNewsCategory").value; 
            }
            else if(getid("ctl00_ContentPlaceHolder1_ctl00_txtNewsCategory"))
            {
                 getid("drop_downtxt").innerHTML=getid("ctl00_ContentPlaceHolder1_ctl00_txtNewsCategory").value;
            }
            if(getid("ctl00_IntroTextPlaceHolder1_ctl00_txtNewsCategory"))
            {
                if(getid("ctl00_IntroTextPlaceHolder1_ctl00_txtNewsCategory").value == '')
                {
                    getid("drop_downtxt").innerHTML='Select Category';
                }
            }
            else if(getid("ctl00_ContentPlaceHolder1_ctl00_txtNewsCategory"))
            {
                if(getid("ctl00_ContentPlaceHolder1_ctl00_txtNewsCategory").value == '')
                {
                    getid("drop_downtxt").innerHTML='Select Category';
                }
            }*/
            
            
        }
        if (thisDiv.className == 'nice1')
        {
            postb=1;
            vals=0;
            thisDiv.style.visibility="hidden";
             for(var j=0;j<thisDiv.childNodes.length;j++)
            {
                if(thisDiv.childNodes[j].value)
                {
                    valus[vals]=thisDiv.childNodes[j].value;
                    texts[vals]=thisDiv.childNodes[j].innerHTML;
                    vals++;
                }
            }
            var odiv=document.createElement('div');
            odiv.setAttribute('id','drop_down'+i);
            //odiv.style.top=thisDiv.offsetTop+"px";
            var idiv1=document.createElement('div');
            idiv1.setAttribute('id','drop_downtxt'+i);
            
            var initval=texts[0];
            for(var k=0;k<1;k++)
            {
                var idivtxt=document.createTextNode(texts[k]);
            }
            idiv1.onclick=show_div1;
            idiv1.appendChild(idivtxt);
            var idiv2=document.createElement('div');
            idiv2.setAttribute('id','drop_downbtn'+i);
            idiv2.onclick=show_div1;

            var idiv3=document.createElement('div');
            idiv3.setAttribute('id','drop_downlay'+i);
                
            var idiv4=document.createElement('ul');

            //var idiv5=document.createElement('li');
            //idiv5.setAttribute('tabindex','0');

            //idiv4.appendChild(idiv5);
            for(var k=0;k<valus.length;k++)
            {
                var idiv5=document.createElement('li');
                if(navigator.userAgent.indexOf('safari') != -1 || navigator.userAgent.indexOf('Safari') != -1 || navigator.userAgent.indexOf('MSIE 8') != -1)
                {
                    
                    if(valus[k] == '' || valus[k] == '0')
                    {
                        //alert(valus[k]);
                        idiv5.setAttribute('value','0');
                    }
                    else
                    {
                        idiv5.setAttribute('value',valus[k]);
                    }
                }
                else
                {
                    if(valus[k] == '' || valus[k] == '0')
                    {
                        idiv5.setAttribute('tabindex','');
                    }
                    else
                    {
                        idiv5.setAttribute('tabindex',valus[k]);
                    }
                }
                var textadd=texts[k].replace(/&amp;/g,'&');
                var idiv5txt=document.createTextNode(textadd);
                idiv5.onclick=sel_text1;
                idiv5.appendChild(idiv5txt);
                idiv4.appendChild(idiv5);
            }
            odiv.appendChild(idiv1);
            odiv.appendChild(idiv2);
            idiv3.appendChild(idiv4);
            odiv.appendChild(idiv3);
            if(getid('drop_down_fill'+i))
            {
                getid('drop_down_fill'+i).appendChild(odiv);
            }
            var divss = document.getElementsByTagName("input");
            var lens = divss.length;
            var thisDivs;
            for (var k6 = 0; k6 < lens; k6++)
            {
	            thisDivs = divss[k6];
	            if (thisDivs.className == 'hiddentxt')
	            {
	                if(thisDivs.id.indexOf('textsearchname0') != -1)
                    {
                        getid("drop_downtxt0").innerHTML=getid(thisDivs.id).value;
                        if(getid(thisDivs.id).value == '' || getid(thisDivs.id).value == '0')
                        {
                            getid("drop_downtxt0").innerHTML=initval;
                        }
                    }
	                else if(thisDivs.id.indexOf('textsearchname1') != -1)
	                {
	                    if(getid("drop_downtxt1"))
	                    {
	                        getid("drop_downtxt1").innerHTML=getid(thisDivs.id).value;
                            if(getid(thisDivs.id).value == '' || getid(thisDivs.id).value == '0')
                            {
                                getid("drop_downtxt1").innerHTML=initval;
                            }
                         } 
	                }	                
	            }
            }           
        }
        if (thisDiv.className == 'contact_date')
        {
            thisDiv.style.display="none";
             for(var j=0;j<thisDiv.childNodes.length;j++)
            {
                if(thisDiv.childNodes[j].value)
                {
                    cdate[cdvals]=thisDiv.childNodes[j].value;
                    cdvals++;
                }
            }
            var odiv=document.createElement('div');
            odiv.setAttribute('id','drop_date'+datecount);
           if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
           {
            odiv.setAttribute('className','drop_dates');
           }
           else
           {
            odiv.setAttribute('class','drop_dates');
           }
            //odiv.style.top=thisDiv.offsetTop+"px";
            var idiv1=document.createElement('input');
            idiv1.setAttribute('type','text');
            idiv1.setAttribute('readOnly','-1');
            idiv1.setAttribute('value',cdate[0]);
            idiv1.setAttribute('id','drop_datetxt'+datecount);
             if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
            {
                idiv1.setAttribute('className','drop_datetxts');
            }
            else
            {
                idiv1.setAttribute('class','drop_datetxts');
            }
            idiv1.onclick=show_div_date;
            

            var idiv2=document.createElement('img');
            idiv2.setAttribute('id','drop_datebtn'+datecount);
            idiv2.setAttribute('src','http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_btn_dropdown.gif');
            if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
            {
                idiv2.setAttribute('className','drop_datebtns');
            }
            else
            {
                idiv2.setAttribute('class','drop_datebtns');
            }
            idiv2.onclick=show_div_date;

            var idiv3=document.createElement('div');
            idiv3.setAttribute('id','drop_datelay'+datecount);
             if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
           {
                idiv3.setAttribute('className','drop_datelays');
            }
            else
            {
                idiv3.setAttribute('class','drop_datelays');
            }
                
            var idiv4=document.createElement('ul');

            var idiv5=document.createElement('li');
            idiv5.setAttribute('id','0');
            var idiv5txt=document.createTextNode(cdate[0]);
           
             idiv5.onclick=sel_date;
            idiv5.appendChild(idiv5txt);
            idiv4.appendChild(idiv5);
            for(var k=1;k<cdate.length;k++)
            {
                var idiv5=document.createElement('li');
                idiv5.setAttribute('id',k);

                var idiv5txt=document.createTextNode(cdate[k]);
                idiv5.onclick=sel_date;
                idiv5.appendChild(idiv5txt);
                idiv4.appendChild(idiv5);
            }
            odiv.appendChild(idiv1);
            odiv.appendChild(idiv2);
            idiv3.appendChild(idiv4);
            odiv.appendChild(idiv3);
            if(datecount==1)
            {
                if(getid('con_date'))
                {
                    getid('con_date').appendChild(odiv);
                }
            }
            else if(datecount==2)
            {
               if(getid('con_date1'))
                {
                    getid('con_date1').appendChild(odiv);
                } 
            }
            else if(datecount==3)
            {
               if(getid('con_date2'))
                {
                    getid('con_date2').appendChild(odiv);
                } 
            }
            datecount++;           
        }
        
        if (thisDiv.className == 'contact_month')
        {
            thisDiv.style.display="none";
             for(var j=0;j<thisDiv.childNodes.length;j++)
            {
                if(thisDiv.childNodes[j].value)
                {
                    cmonth[cmvals]=thisDiv.childNodes[j].value;
                    cmvals++;
                }
            }
            var odiv=document.createElement('div');
            odiv.setAttribute('id','drop_month'+monthcount);
             if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
           {
                odiv.setAttribute('className','drop_months');
            }
            else
            {
                odiv.setAttribute('class','drop_months');
            }
            //odiv.style.top=thisDiv.offsetTop+"px";
            var idiv1=document.createElement('input');
            idiv1.setAttribute('type','text');
            idiv1.setAttribute('readOnly','-1');
            idiv1.setAttribute('value',cmonth[0]);
            idiv1.setAttribute('id','drop_monthtxt'+monthcount);
             if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
           {
                idiv1.setAttribute('className','drop_monthtxts');
            }
            else
            {
                idiv1.setAttribute('class','drop_monthtxts');
            }
            idiv1.onclick=show_div_month;

            var idiv2=document.createElement('img');
            idiv2.setAttribute('id','drop_monthbtn'+monthcount);
            idiv2.setAttribute('src','http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_btn_dropdown.gif');
             if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
           {
                idiv2.setAttribute('className','drop_monthbtns');
            }
            else
            {
                idiv2.setAttribute('class','drop_monthbtns');
            }
            idiv2.onclick=show_div_month;

            var idiv3=document.createElement('div');
            idiv3.setAttribute('id','drop_monthlay'+monthcount);
             if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
           {
                idiv3.setAttribute('className','drop_monthlays');
            }
            else
            {
                idiv3.setAttribute('class','drop_monthlays');
            }    
            var idiv4=document.createElement('ul');

            var idiv5=document.createElement('li');
            var idiv5txt=document.createTextNode(cmonth[0]);
            //idiv5.onclick=sel_monthtext;
            idiv5.setAttribute('id','0');
            idiv5.onclick=sel_month;
            idiv5.appendChild(idiv5txt);
            idiv4.appendChild(idiv5);
            
            for(var k=1;k<cmonth.length;k++)
            {
                var idiv5=document.createElement('li');
                idiv5.setAttribute('id',k);
                var idiv5txt=document.createTextNode(cmonth[k]);
                idiv5.onclick=sel_month;
                idiv5.appendChild(idiv5txt);
                idiv4.appendChild(idiv5);
            }
            odiv.appendChild(idiv1);
            odiv.appendChild(idiv2);
            idiv3.appendChild(idiv4);
            odiv.appendChild(idiv3);
            
            if(monthcount==1)
            {
                if(getid('con_month'))
                {
                    getid('con_month').appendChild(odiv);
                }
            }
            else if(monthcount==2)
            {
               if(getid('con_month1'))
                {
                    getid('con_month1').appendChild(odiv);
                } 
            }
            else if(monthcount==3)
            {
               if(getid('con_month2'))
                {
                    getid('con_month2').appendChild(odiv);
                } 
            }
            monthcount++;
           
        }
        if (thisDiv.className == 'contact_year')
        {
            cyvals=0;
            thisDiv.style.display="none";
            for(var j=0;j<thisDiv.childNodes.length;j++)
            {
                if(thisDiv.childNodes[j].value)
                {
                    cyear[cyvals]=thisDiv.childNodes[j].value;
                    cyvals++;
                }
            }
            var odiv=document.createElement('div');
            odiv.setAttribute('id','drop_year'+yearcount);
             if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
           {
                odiv.setAttribute('className','drop_years');
            }
            else
            {
                odiv.setAttribute('class','drop_years');
            }
            //odiv.style.top=thisDiv.offsetTop+"px";
            var idiv1=document.createElement('input');
            idiv1.setAttribute('type','text');
            idiv1.setAttribute('readOnly','-1');
            idiv1.setAttribute('value',cyear[0]);
            idiv1.setAttribute('id','drop_yeartxt'+yearcount);
             if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
           {
                idiv1.setAttribute('className','drop_yeartxts');
            }
            else
            {
                idiv1.setAttribute('class','drop_yeartxts');
            }
            idiv1.onclick=show_div_year;
            
            
            var idiv2=document.createElement('img');
            idiv2.setAttribute('id','drop_yearbtn'+yearcount);
            idiv2.setAttribute('src','http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_btn_dropdown.gif');
             if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
           {
                idiv2.setAttribute('className','drop_yearbtns');
            }
            else
            {
                idiv2.setAttribute('class','drop_yearbtns');
            }
            idiv2.onclick=show_div_year;

            var idiv3=document.createElement('div');
            idiv3.setAttribute('id','drop_yearlay'+yearcount);
             if(navigator.userAgent.indexOf('MSIE 7.0') != -1 || navigator.userAgent.indexOf('MSIE 6.0') != -1)
           {
                idiv3.setAttribute('className','drop_yearlays');
            }
            else
            {
                idiv3.setAttribute('class','drop_yearlays');
            }    
            var idiv4=document.createElement('ul');

            var idiv5=document.createElement('li');
            var idiv5txt=document.createTextNode(cyear[0]);
           
            //idiv5.onclick=sel_text;
            idiv5.appendChild(idiv5txt);
            idiv5.setAttribute('id','0');
            idiv5.onclick=sel_year;
            idiv4.appendChild(idiv5);
            for(var k=1;k<cyear.length;k++)
            {
                var idiv5=document.createElement('li');
                idiv5.setAttribute('id',cyear[k]);
                var idiv5txt=document.createTextNode(cyear[k]);
                idiv5.onclick=sel_year;
                idiv5.appendChild(idiv5txt);
                idiv4.appendChild(idiv5);
            }
            odiv.appendChild(idiv1);
            odiv.appendChild(idiv2);
            idiv3.appendChild(idiv4);
            odiv.appendChild(idiv3);
            if(yearcount==1)
            {
                if(getid('con_year'))
                {
                    getid('con_year').appendChild(odiv);
                }
            }
            else if(yearcount==2)
            {
               if(getid('con_year1'))
                {
                    getid('con_year1').appendChild(odiv);
                } 
            }
            else if(yearcount==3)
            {
               if(getid('con_year2'))
                {
                    getid('con_year2').appendChild(odiv);
                } 
            }
            yearcount++;           
        }
    }
    var divs = document.getElementsByTagName("input");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
        thisDiv = divs[i];
        if (thisDiv.className == 'hiddentxt')
        {
            if(thisDiv.id.indexOf('hdndate1') != -1)
            {
                if(getid(thisDiv.id).value != '')
                {
                    getid("drop_datetxt1").value=getid(thisDiv.id).value;
                }
            }
            if(thisDiv.id.indexOf('hdndate2') != -1)
            {
                if(getid(thisDiv.id).value != '')
                {
                    getid("drop_datetxt2").value=getid(thisDiv.id).value;
                }
            }
            if(thisDiv.id.indexOf('hdndate3') != -1)
            {
                if(getid(thisDiv.id).value != '')
                {
                    getid("drop_datetxt3").value=getid(thisDiv.id).value;
                }
            }
            if(thisDiv.id.indexOf('hdnmonthname1') != -1)
            {
                if(getid(thisDiv.id).value != '')
                {
                    getid("drop_monthtxt1").value=getid(thisDiv.id).value;
                }
            }
            if(thisDiv.id.indexOf('hdnmonthname2') != -1)
            {
                if(getid(thisDiv.id).value != '')
                {
                    getid("drop_monthtxt2").value=getid(thisDiv.id).value;
                }
            }
            if(thisDiv.id.indexOf('hdnmonthname3') != -1)
            {
                if(getid(thisDiv.id).value != '')
                {
                    getid("drop_monthtxt3").value=getid(thisDiv.id).value;
                }
            }
            
            if(thisDiv.id.indexOf('hdnyear1') != -1)
            {
                if(getid(thisDiv.id).value != '')
                {
                    getid("drop_yeartxt1").value=getid(thisDiv.id).value;
                }
            }
            if(thisDiv.id.indexOf('hdnyear2') != -1)
            {
                if(getid(thisDiv.id).value != '')
                {
                    getid("drop_yeartxt2").value=getid(thisDiv.id).value;
                }
            }
            if(thisDiv.id.indexOf('hdnyear3') != -1)
            {
                if(getid(thisDiv.id).value != '')
                {
                    getid("drop_yeartxt3").value=getid(thisDiv.id).value;
                }
            }
            
            
            
            if(thisDiv.id.indexOf('txtPressCategory') != -1)
            {
                getid("drop_downtxt").innerHTML=getid(thisDiv.id).value;
                if(getid(thisDiv.id).value == '')
                {
                    getid("drop_downtxt").innerHTML='Select category';
                }
            }	                
        }
    }
    /***************OS Detection*******************/

        if (navigator.userAgent.indexOf("Macintosh")!= -1)
            {
	            //document.getElementById("TopNavContainer").style.fontSize='130%';
				if(document.getElementById("BreadCrumb"))
				{
	            	document.getElementById("BreadCrumb").style.marginTop='-3px';
				}
            }
			if(getid('imagegalleryholder') || getid('imagegalleryholderinner') || getid('designgal') || getid('designgalinspration') || getid('navoptions') || getid('RetailerSearchNFlashMapContainer'))
			{
				var inputs = document.getElementsByTagName("input");
				for (var i = 0; i < inputs.length; i++)
				{
					if(inputs[i].type=='hidden' && inputs[i].id.indexOf('hdnCategoryID')!=-1)
					{				
						catid=inputs[i].value;
					}
					if(inputs[i].type=='hidden' && inputs[i].id.indexOf('hdnLanguageID')!=-1)
					{				
						langid=inputs[i].value;
					}
					if(inputs[i].type=='hidden' && inputs[i].id.indexOf('hdnMessage')!=-1)
					{				
						dlmsg=inputs[i].value;
					}
					if(inputs[i].type=='hidden' && inputs[i].id.indexOf('hdnLanguageName')!=-1)
					{				
						langname=inputs[i].value;
					}
					if(inputs[i].type=='hidden' && inputs[i].id.indexOf('hdnUserID')!=-1)
					{				
						userid=inputs[i].value;
					}
					if(inputs[i].type=='hidden' && inputs[i].id.indexOf('hdnDesignGallery')!=-1)
					{				
						designurl=inputs[i].value;
					}
					if(inputs[i].type=='hidden' && inputs[i].id.indexOf('hdnDreamlist')!=-1)
					{				
						dreamlisturl=inputs[i].value;
					}
					if(inputs[i].type=='hidden' && inputs[i].id.indexOf('hdnPlatinumInspiration')!=-1)
					{				
						inspirationurl=inputs[i].value;
					}
					if(inputs[i].type=='hidden' && inputs[i].id.indexOf('hdnRetailerSearch')!=-1)
					{				
						retailersearchurl=inputs[i].value;
					}
					if(inputs[i].type=='hidden' && inputs[i].id.indexOf('hdnDesignerProfile')!=-1)
					{				
						designerurl=inputs[i].value;
					}					
				}
				if(langid == '1')
				{
					countryname='USA';	
				}
				else if(langid == '2')
				{
					countryname='UK';
				}
				else if(langid == '3')
				{
					countryname='INDIA';
				}
				else if(langid == '4')
				{
					countryname='ITALY';
				}
				else if(langid == '5')
				{
					countryname='GERMANY';
				}
				else if(langid == '6')
				{
					countryname='CHINA';	
				}
				else if(langid == '7')
				{
					countryname='JAPAN';
				}
				else if(langid == '10')
				{
					countryname='FRANCE';
				}
				else if(langid == '11')
				{
					countryname='KOREA';
				}
				
			}
			if(window.location.href.toLowerCase().indexOf('categoryid') != -1 && window.location.href.toLowerCase().indexOf('typeid') != -1)
			{
				builddghome=2;	
			}
			if(window.location.href.toLowerCase().indexOf('showall=1') != -1)
			{
				builddghome=3;	
			}
			else if(window.location.href.toLowerCase().indexOf('mostviewed=1') != -1)
			{
				var builddghome=7;	
			}
			else if(window.location.href.toLowerCase().indexOf('budget.aspx') != -1)
			{
				builddghome=6;	
			}
			else if(window.location.href.toLowerCase().indexOf('productid') != -1 && window.location.href.toLowerCase().indexOf('categoryid') != -1 && window.location.href.toLowerCase().indexOf(designurl) != -1)
			{
				builddghome=0;	
				paramsnew=window.location.href.toLowerCase().split('#');
				paramsnew=paramsnew[1].split('=');
				ldprodfirst=paramsnew[1];
			}
			else if(window.location.href.toLowerCase().indexOf(inspirationurl) != -1)
			{
				builddghome=1;	
				ldfirst=0;
				paramsnew=window.location.href.toLowerCase().split('=');
				ldprodfirst=paramsnew[2];
				if(window.location.href.indexOf('#productid=') != -1)
				{
				   ldfirst=1;
				}
			}
			else if(window.location.href.toLowerCase().indexOf(dreamlisturl) != -1)
			{
				builddghome=4;
				ldfirst=0;
				paramsnew=window.location.href.toLowerCase().split('=');
				if(window.location.href.indexOf('#productid=') != -1)
				{
				   ldfirst=1;
				   ldprodfirst=paramsnew[1];
				}
			}
			
		if(getid('imagegalleryholder') || getid('RetailerSearchContainer2'))
		{	
			if(getid('imagegalleryholder'))
			{
				var imgs = getid('imagegalleryholder').getElementsByTagName("img");
			}
			if(getid('imagegalleryholderinner'))
			{
				var imgs = getid('imagegalleryholderinner').getElementsByTagName("img");
			}
			for (var i = 0; i < imgs.length; i++)
			{
				imgs[i].style.cursor="pointer";
				if(imgs[i].className=='imgprev')
				{				
					imgs[i].setAttribute('id','previmgslide');
					imgs[i].onclick=movesliderleft;
				}
				else if(imgs[i].className=='imgnext')
				{
					imgs[i].setAttribute('id','nextimgslide');
					imgs[i].onclick=movesliderright;
				}
			}
			readpagevariables('/'+langname+'/include/DGLoadContent.aspx?languageid='+langid);
		} 
		
		else if(getid('designgal') && !getid('RetailerSearchContainer'))
		{	
			var imgs = getid('imagegalleryholderinner').getElementsByTagName("img");
			for (var i = 0; i < imgs.length; i++)
			{
				imgs[i].style.cursor="pointer";
				if(imgs[i].className=='imgprev')
				{				
					imgs[i].setAttribute('id','previmgslide');
					imgs[i].onclick=movesliderleft;
				}
				else if(imgs[i].className=='imgnext')
				{
					imgs[i].setAttribute('id','nextimgslide');
					imgs[i].onclick=movesliderright;
				}
			}
			readpagevariablesinner('/'+langname+'/include/DGLoadContent.aspx?languageid='+langid);
		}
		else if(getid('designgalinspration'))
		{	
			var imgs = getid('imagegalleryholderinner').getElementsByTagName("img");
			for (var i = 0; i < imgs.length; i++)
			{
				imgs[i].style.cursor="pointer";
				if(imgs[i].className=='imgprev')
				{				
					imgs[i].setAttribute('id','previmgslide');
					imgs[i].onclick=movesliderleft;
				}
				else if(imgs[i].className=='imgnext')
				{
					imgs[i].setAttribute('id','nextimgslide');
					imgs[i].onclick=movesliderright;
				}
			}
			readpagevariablesinspiration('/'+langname+'/include/DGLoadContent.aspx?languageid='+langid);
		}
		else if(window.location.href.toLowerCase().indexOf('ja/') != -1 && (window.location.href.toLowerCase().indexOf('/ja/retailer-search/retailer-search-result.aspx') != -1 || window.location.href.toLowerCase().indexOf('/ja/design-gallery/tdp-glossary.aspx') != -1))
		{
			if(window.location.href.toLowerCase().indexOf('returnurl=/ja/retailer-search/retailer-search-result.aspx') == -1)
			{
			    readpagevariables('/'+langname+'/include/DGLoadContent.aspx?languageid='+langid);
			}
		}
		else
		{	
			if(langid != 0)
			{
				readpagenavinspiration('/'+langname+'/include/DGLoadLeftNav.aspx?LanguageID='+langid);
			}
			if(builddghome == 6)
			{
				langname='en-US';
				langid=1;
				designurl='design-gallery.aspx';
				if(getid('imagegalleryholder'))
				{
					var imgs = getid('imagegalleryholder').getElementsByTagName("img");
				}
				if(getid('imagegalleryholderinner'))
				{
					var imgs = getid('imagegalleryholderinner').getElementsByTagName("img");
				}
				for (var i = 0; i < imgs.length; i++)
				{
					imgs[i].style.cursor="pointer";
					if(imgs[i].className=='imgprev')
					{				
						imgs[i].setAttribute('id','previmgslide');
						imgs[i].onclick=movesliderleft;
					}
					else if(imgs[i].className=='imgnext')
					{
						imgs[i].setAttribute('id','nextimgslide');
						imgs[i].onclick=movesliderright;
					}
				}
				readpagevariablesinspiration('/'+langname+'/include/DGLoadContent.aspx?languageid='+langid);
			}
		}
		
		if(window.location.href.toLowerCase().indexOf('budget') != -1)
		{
			document.getElementById("DesignGalContainerOuter").style.display='block';
			document.getElementById("RelatedInfoContainer").style.display='block';
			document.getElementById("imagegalleryholderinner").style.display='block';
		}
}
/****************imagegal homepage *************/
var setstart=0;
var setend=0;
var curpage=1;
var totalpages=0;
var langname='';
var langid='';
function movesliderleft()
{
	if(curpage > 1)
	{
		slidestat=1;
		if(getid('previmgslide'))
		{
			getid('previmgslide').onclick='';
			getid('nextimgslide').onclick='';
		}
		if(getid('mrite'))
		{
			getid('mrite').onclick='';
			getid('mleft').onclick='';
		}
		if(getid('mvsetnext'))
		{
			getid('mvsetprev').onclick='';
			getid('mvsetnext').onclick='';
		}
		if(curpage >3)
		{
			getid('pageslider').style.left=getid('pageslider').offsetLeft+15+'px';	
		}
		getid('cpage'+curpage).style.color="#000000";
		curpage--;
		getid('sliddiv').onmouseout='';
		getid('sliddiv').onmouseover='';
		if(getid('popdesc'))
		{
			getid('popdesc').style.display="none";
		}
		getid('cpage'+curpage).style.color="#46b4e9"
		setend=setstart+700;
		setscrollStart(getid('imageslider'), setstart, setend);
	}
}
function movesliderright()
{
	
	if(curpage < totalpages)
	{
		slidestat=1;
		if(getid('previmgslide'))
		{
			getid('previmgslide').onclick='';
			getid('nextimgslide').onclick='';
		}
		if(getid('mvsetnext'))
		{
			getid('mvsetprev').onclick='';
			getid('mvsetnext').onclick='';
		}
		if(getid('mrite'))
		{
			getid('mrite').onclick='';
			getid('mleft').onclick='';
		}
		if(curpage >=3)
		{
			getid('pageslider').style.left=getid('pageslider').offsetLeft-15+'px';	
		}
		getid('cpage'+curpage).style.color="#000000";
		curpage++;
		getid('cpage'+curpage).style.color="#46b4e9";
		setend=setstart-700;
		setscrollStart(getid('imageslider'), setstart, setend);
	}
}
function jumpslider(no)
{
	if(no >= 1 && no <= totalpages)
	{
		slidestat=1;
		if(getid('previmgslide'))
		{
			getid('previmgslide').onclick='';
			getid('nextimgslide').onclick='';
		}
		if(getid('mvsetnext'))
		{
			getid('mvsetprev').onclick='';
			getid('mvsetnext').onclick='';
		}
		if(getid('mrite'))
		{
			getid('mrite').onclick='';
			getid('mleft').onclick='';
		}
		getid('cpage'+curpage).style.color="#000000";
		curpage=no;
		getid('cpage'+no).style.color="#46b4e9";
		setend=-((no-1)*700);
		setscrollStart(getid('imageslider'), setstart, setend);
	}
}
function readpagevariables(geturl)
{
	try
	{
		loadXMLDoc(geturl,1);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}
}
function readpagevariablesinspiration(geturl)
{
	try
	{
		loadXMLDoc(geturl,7);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}
}
function readpagevariablesinner(geturl)
{
	try
	{
		loadXMLDoc(geturl,3);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}
}
function readpagenavinspiration(geturl)
{
	try
	{
		loadXMLDoc(geturl,5);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}
}
function readgalleryvariables(geturl)
{
	try
	{
		loadXMLDoc(geturl,2);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}
}
function loadXMLDoc(url,stats)
{
	if (window.ActiveXObject)
	{
		isIE = true;
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req)
		{
			if(stats == 1)
			{
				req.onreadystatechange = createpages;
			}
			else if(stats == 3)
			{
				req.onreadystatechange = createpagesinner;
			}
			else if(stats == 5)
			{
				req.onreadystatechange = buildnavinspiration;
			}
			else if(stats == 7)
			{
				req.onreadystatechange = createpagesinspiration;
			}
			else
			{
				req.onreadystatechange = creategal;	
			}
			req.open("GET", url, true);
			req.send();
		}
	}
	else if (window.XMLHttpRequest)
	{
		req = new XMLHttpRequest();
		if(stats == 1)
			{
				req.onreadystatechange = createpages;
			}
			else if(stats == 3)
			{
				req.onreadystatechange = createpagesinner;
			}
			else if(stats == 5)
			{
				req.onreadystatechange = buildnavinspiration;
			}
			else if(stats == 7)
			{
				req.onreadystatechange = createpagesinspiration;
			}
			else
			{
				req.onreadystatechange = creategal;	
			}
		req.open("GET", url, true);
		req.send(null);
	}	
}
var pagesdetails;
var gallery;

function createpages()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			pagesdetails = req.responseXML.getElementsByTagName("content");
			
			if(getid('RetailerSearchContainer'))
			{
				builddghome1=10;
				var restilerproduct=window.location.href.toLowerCase().split('productid=')[1];
				var inputs = document.getElementsByTagName("input");
				if(restilerproduct)
				{
					loaddgrproductxml('/'+langname+'/include/DGLoadProductDetails.aspx?LanguageID='+langid+'&productid='+restilerproduct);
				}
				else
				{
					getid('DesignGalContainerOuter').style.display="none";
				}
				
			}
			
			else if(getid('RetailerSearchContainer2'))
			{
				readpagenavinspiration('/'+langname+'/include/DGLoadLeftNav.aspx?LanguageID='+langid);	
				getid('paging').innerHTML='<div class="pgtext">'+pagesdetails[1].getAttribute('Value')+'</div>';
			}
			else if(getid('TdpGlossary'))
			{
				readpagenavinspiration('/'+langname+'/include/DGLoadLeftNav.aspx?LanguageID='+langid);	
				//getid('paging').innerHTML='<div class="pgtext">'+pagesdetails[1].getAttribute('Value')+'</div>';
			}
			else
			{
				sitehome=1;
				readgalleryvariables('/'+langname+'/include/DGLoadHomeproducts.aspx?languageid='+langid);
				getid('paging').innerHTML='<div class="pgtext">'+pagesdetails[1].getAttribute('Value')+'</div>';
			}
		}
	}
}
var sitehome=0
function createpagesinspiration()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			pagesdetails = req.responseXML.getElementsByTagName("content");
			getid('paging').innerHTML='<div class="pgtext">'+pagesdetails[1].getAttribute('Value')+'</div>';
			readpagenavinspiration('/'+langname+'/include/DGLoadLeftNav.aspx?LanguageID='+langid);
		}
	}
}
var pagesdetails;
function createpagesinner()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			pagesdetails = req.responseXML.getElementsByTagName("content");
			getid('paging').innerHTML='<div class="pgtext">'+pagesdetails[1].getAttribute('Value')+'</div>';
			if(builddghome == 0)
			{
				var params=window.location.href.toLowerCase().split('#');
				var params=params[1].split('=');
				readnavselectedvaribales('/'+langname+'/include/DGLoadSelectedItemsLeftNav.aspx?productid='+params[1]);
			}
			else
			{
				getid('DesignGalContainerOuter').style.display="none";
				getid('RelatedInfoContainer').style.display="none";
				getid('paging').style.display="none";
				getid('imagegalleryholderinner').style.display="none";
				if(builddghome==2 || builddghome==3 || builddghome==7)
				{
					readdgdescription1();
				}
				else if(builddghome==4)
				{
					if(dlmsg == 'Message3')
					{
						getid('productexists').style.display='block';	
					}
					else if(window.location.href.toLowerCase().indexOf('productid') != -1)
					{
						getid('productadded').style.display='block';
					}
					readpagenavinspiration('/'+langname+'/include/DGLoadLeftNav.aspx?LanguageID='+langid+'&DreamList=1'+'&UserID='+userid);
				}
				else
				{
					readnavvaribales('/'+langname+'/include/DGLoadLeftNav.aspx?LanguageID='+langid);
				}
			}
			getid('mleft').appendChild(document.createTextNode(pagesdetails[2].getAttribute('Value')));
			getid('mrite').appendChild(document.createTextNode(pagesdetails[11].getAttribute('Value')));
			if(getid('mrite'))
			{
				getid('mrite').onclick=shownextproduct;
				getid('mleft').onclick=showprevproduct;
			}
		}
	}	
}
function creategal()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			gallery = req.responseXML.getElementsByTagName("product");
			getid('imageslider').style.width=(gallery.length*102)+"px";
			var sliddivs=document.createElement('div');
			sliddivs.setAttribute('id','sliddiv');
			var ttnum=gallery.length/7;
			ttnum=ttnum+'';
			if(ttnum.indexOf('.') != -1)
			{
				ttnum=ttnum.split('.');
				ttnum[0]=Number(ttnum[0]);
				totalpages=(ttnum[0]+1);
			}
			else
			{
				totalpages=ttnum;	
			}
			for(var i=0;i<gallery.length;i++)
			{
				
				var outdivout=document.createElement('div');
				outdivout.className='outdivout';
				
				var outdiv=document.createElement('div');
				outdiv.className='outdiv';
				var linkto=document.createElement('a');
				linkto.setAttribute('id','imgno_'+(i+1)+'_'+gallery[i].getAttribute('productid'));
				linkto.onmouseover=movesliddiv;
				
				linkto.setAttribute('href',designurl+'#productid='+gallery[i].getAttribute('productid'));
			
				var span=document.createElement('span');
							
				var imgs=document.createElement('img');
				//linkto.style.background='url('+gallery[i].getAttribute('smallthumbnail')+') no-repeat center center';
				imgs.setAttribute('src',gallery[i].getAttribute('smallthumbnail'));
				imgs.setAttribute('alt',gallery[i].getAttribute('name'));
				
				//imgs.style.width='99px';
				//imgs.style.height='121px';				
				
				
				var popdiv=document.createElement('div');
				popdiv.setAttribute('id','popdesc');
				popdiv.className="popdescs";
				
				/*var poptxt=document.createTextNode(gallery[i].getAttribute('name'));
				popdiv.appendChild(poptxt);*/

				linkto.appendChild(span);
				linkto.appendChild(imgs);
				
				
				/*getid('popdesc'+i).style.left=(i*102)+33+"px";*/
				outdiv.appendChild(linkto);
				outdivout.appendChild(outdiv);
				getid('imageslider').appendChild(outdivout);
				
			
			}
						
			getid('imagegalleryholder').appendChild(popdiv);
			getid('imageslider').appendChild(sliddivs);
			getid('sliddiv').style.width="98px";
			getid('sliddiv').style.height="120px";
			getid('sliddiv').style.border="1px solid #46b4e9";
			getid('sliddiv').style.position="absolute";
			getid('sliddiv').style.left="0px";
			getid('sliddiv').style.top="0px";
			var linkto=document.createElement('a');
			linkto.setAttribute('id','goto');
			getid('sliddiv').appendChild(linkto);
			getid('goto').style.width="98px";
			getid('goto').style.height="120px";
			curno=1;
			getid('goto').setAttribute('href','javascript:void(0)');
			getid('goto').onmouseover=movesliddiv;
			getid('goto').innerHTML='<img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_transcyimg.gif">';
			getid('goto').onmouseout=hidedesc;
			getid('paging').style.display="block";
			var pgcnt='';
			pgcnt='<div class="prevlnk"><a href="javascript:void(0)" onclick="javascript:movesliderleft();" id="mvsetprev"><img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_arrow_blue2.gif" alt="Previous" /></a></div> <div id="pageholder"><div id="pageslider">';
			for(var i=1;i<=totalpages;i++)
			{
				pgcnt+='<a href="javascript:void(0)" onclick="javascript:jumpslider('+i+');" id="cpage'+i+'">'+i+'</a> ';	
			}
			pgcnt+='</div></div><div class="prevlnk rite"><a href="javascript:void(0)" onclick="javascript:movesliderright();" id="mvsetnext"><img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_arrow_blue.gif" alt="Previous" /></a></div> ';
			getid('paging').innerHTML+='<div class="pgcnt">'+pgcnt+'</div>';
			if(totalpages <= 3)
			{
				getid('pageholder').style.width=(totalpages*15)+'px';
			}
			getid('pageslider').style.width=(gallery.length*15)+'px';
			getid('cpage'+1).style.color="#46b4e9";
			//callalign=setTimeout("alnimg()",100);
		}
	}
	
}
var callalign=0;
var forstart=0;
function alnimg()
{
	var imgaln=getid('imageslider').getElementsByTagName('img');
	for(var i=forstart;i<imgaln.length;i++)
	{
		imgaln[i].parentNode.parentNode.style.background="none";
		//alert(imgaln[i].offsetWidth);
	}
	/*var imgaln=getid('imageslider').getElementsByTagName('div');
	for(var i=0;i<imgaln.length;i++)
	{
		if(imgaln[i].className=='outdiv')
		{
			imgaln[i].style.background="none";
		}
		//alert(imgaln[i].offsetWidth);
	}*/
}
var curno=0;
var startpos=0;
var showdesctime=0;
var showdescstart=0;
var ldlinkid='';
var slidestat=0;
var cursldloc=1;
function movesliddiv()
{
	if(slidestat ==0)
	{
		layout=0;
		clearTimeout(showdesctime);
		ldlinkid=this.id;
		countsld=ldlinkid.split('_');
		curgalpod=countsld[1];
		curprod=curgalpod;
		//this.onmouseout=hidedesc;
		getid('goto').href=this.href;
		getid('goto').innerHTML='<img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_transcyimg.gif" />';
		getid('goto').onmouseout=hidedesc;
		getid('goto').onmouseover='';
		getid('popdesc').style.display="none";
		
		if(navigator.userAgent.indexOf('MSIE 6') !=1 || navigator.userAgent.indexOf('MSIE 7') !=1 )
		{
			var imgnocur=this.id.split('_');
			if(!imgnocur[1])
			{
				imgnocur[1]=0;	
			}
			getid('sliddiv').style.left=((imgnocur[1]-1)*100)+'px';		
		}
		else
		{
			getid('sliddiv').style.left=this.offsetLeft+'px';
		}
		if(this.id.indexOf('imgno') != -1)
		{
			splitcurno=this.id.split('_');
			curno=splitcurno[1];
		}
		if(layout==0)
		{
			showdesc();
		}
		if(lnnext == 1)
		{
			setend=setstart-700;
			setscrollStart(getid('imageslider'), setstart, setend);
			lnnext=0;
		}
		else if(lnnext == 2)
		{
			setend=setstart+700;
			setscrollStart(getid('imageslider'), setstart, setend);
			lnnext=0;
		}
		else
		{
			if(getid('mrite'))
			{
				getid('mrite').onclick=shownextproduct;
				getid('mleft').onclick=showprevproduct;
			}
		}
		if(getid('previmgslide'))
		{
			getid('previmgslide').onclick=movesliderleft;
			getid('nextimgslide').onclick=movesliderright;
		}
		if(getid('mvsetnext'))
		{
			getid('mvsetprev').onclick=movesliderleft;
			getid('mvsetnext').onclick=movesliderright;
		}
		//scrollStart(getid('sliddiv'), startpos, this.offsetLeft);
	}
}
function fadedesc(elem,startmar,endmar,finmar,steps,intervals,powr,stat)
{
	pophide=0;
	if (elem.bgFadeInt1) window.clearInterval(elem.bgFadeInt1);
	var actStep = 0;
	elem.bgFadeInt1 = window.setInterval(
	function() 
	{
		elem.style.opacity = easeInOut(startmar[0],endmar[0],steps,actStep,powr)/100;
		elem.style.MozOpacity = easeInOut(startmar[0],endmar[0],steps,actStep,powr)/100;
		elem.style.KhtmlOpacity = easeInOut(startmar[0],endmar[0],steps,actStep,powr)/100;
		elem.style.filter = "alpha(opacity="+easeInOut(startmar[0],endmar[0],steps,actStep,powr)+ ")";
		actStep++;
		if (actStep > steps) 
		{
			elem.style.opacity = easeInOut(startmar[0],endmar[0],steps,actStep,powr)/100;
			elem.style.MozOpacity = easeInOut(startmar[0],endmar[0],steps,actStep,powr)/100;
			elem.style.KhtmlOpacity = easeInOut(startmar[0],endmar[0],steps,actStep,powr)/100;
			elem.style.filter = "alpha(opacity="+easeInOut(startmar[0],endmar[0],steps,actStep,powr)+ ")";
			window.clearInterval(elem.bgFadeInt1);
			if(stat == 5)
			{
				fadedesc(getid(fadeid),[40],[0],0,15,5,1);	
			}
			if(stat == 2)
			{
				getid('popdesc').style.display="none";
				curprod=cursldloc;
				countslds=cursldloc;
				countsldsrev=cursldloc;
				getid('sliddiv').style.left=((cursldloc-1)*100)+'px';	
			}
		}
	},intervals)
}
function newmvslid()
{
	curno=1;
	getid('sliddiv').onmouseover='';
	showdesc();
}
function showdesc()
{
	if(!curno)
	{
		curno=1;	
	}
	if(pophide == 0)
	{
		if(curno == 1)
		{
			if(sitehome == 1)
			{
				getid('popdesc').innerHTML=gallery[curno-1].getAttribute('name');
			}
			else
			{
				if(firsttxt != '')
				{
					getid('popdesc').innerHTML=gallery[firsttxt-1].getAttribute('name');
				}
				else
				{
					getid('popdesc').innerHTML=gallery[curno-1].getAttribute('name');
				}	
					
			}
			
		}
		else
		{
			if(sitehome == 1)
			{
				getid('popdesc').innerHTML=gallery[curno-1].getAttribute('name');
			}		
			else
			{    //upadted by faluludeen - updated from getid('popdesc').innerHTML=gallery[curno-2].getAttribute('name');
				if(firsttxt != '')
				{
					getid('popdesc').innerHTML=gallery[curno-2].getAttribute('name');
				}
				else
				{
					getid('popdesc').innerHTML=gallery[curno-1].getAttribute('name');
				}
			}
		}		
		getid('popdesc').style.left=((((curno-1)*100) - (curpage-1)*700 )+42)+"px";
		getid('popdesc').style.top="-112px";
		getid("popdesc").style.opacity=0;
		getid("popdesc").style.MozOpacity=0;
		getid("popdesc").style.KhtmlOpacity=0;
		getid("popdesc").style.filter="alpha(opacity="+0+ ")";
		getid('popdesc').style.display="block";
		fadedesc(getid('popdesc'),[0],[100],100,30,10,2,1);
	}
}
var scrollanim = {time:0, begin:0, change:0.0, duration:0.0, element:null, timer:null};

function scrollStart(elem, start, end)
{
	if (scrollanim.timer != null) {
		clearInterval(scrollanim.timer);
		scrollanim.timer = null;
	}
	scrollanim.time = 0;
	scrollanim.begin = start;
	scrollanim.change = end - start;
	scrollanim.duration = 30;
	scrollanim.element = elem;
	scrollanim.timer = setInterval("scrollHorizAnim();", 5);
}
function setscrollStart(elem, start, end)
{
	if (scrollanim.timer != null) {
		clearInterval(scrollanim.timer);
		scrollanim.timer = null;
	}
	scrollanim.time = 0;
	scrollanim.begin = start;
	scrollanim.change = end - start;
	scrollanim.duration = 30;
	scrollanim.element = elem;
	scrollanim.timer = setInterval("setscrollHorizAnim();", 20);
}

function scrollVertAnim()
{
	if (scrollanim.time > scrollanim.duration) {
		clearInterval(scrollanim.timer);
		scrollanim.timer = null;
	}
	else {
		move = sineInOut(scrollanim.time, scrollanim.begin, scrollanim.change, scrollanim.duration);
		scrollanim.element.scrollTop = move; 
		scrollanim.time++;
	}
}

function scrollHorizAnim()
{
	if (scrollanim.time > scrollanim.duration) {
		clearInterval(scrollanim.timer);
		scrollanim.timer = null;
		if(layout==0)
		{
			showdesc();
		}
		if(lnnext == 1)
		{
			setend=setstart-700;
			setscrollStart(getid('imageslider'), setstart, setend);
			lnnext=0;
		}
		else if(lnnext == 2)
		{
			setend=setstart+700;
			setscrollStart(getid('imageslider'), setstart, setend);
			lnnext=0;
		}
		else
		{
			if(getid('mrite'))
			{
				getid('mrite').onclick=shownextproduct;
				getid('mleft').onclick=showprevproduct;
			}
		}
		if(getid('previmgslide'))
		{
			getid('previmgslide').onclick=movesliderleft;
			getid('nextimgslide').onclick=movesliderright;
		}
		if(getid('mvsetnext'))
		{
			getid('mvsetprev').onclick=movesliderleft;
			getid('mvsetnext').onclick=movesliderright;
		}
	}
	else {
		startpos = cubicInOut(scrollanim.time, scrollanim.begin, scrollanim.change, scrollanim.duration);
		scrollanim.element.style.left = startpos+"px";
		scrollanim.time++;
	}
}

function setscrollHorizAnim()
{
	if (scrollanim.time > scrollanim.duration) {
		clearInterval(scrollanim.timer);
		scrollanim.timer = null;
		if(getid('mrite'))
		{
			getid('mrite').onclick=shownextproduct;
			getid('mleft').onclick=showprevproduct;
		}
		if(getid('previmgslide'))
		{
			getid('previmgslide').onclick=movesliderleft;
			getid('nextimgslide').onclick=movesliderright;
		}
		if(getid('mvsetnext'))
		{
			getid('mvsetprev').onclick=movesliderleft;
			getid('mvsetnext').onclick=movesliderright;
		}
		slidestat=0;
		
	}
	else {
		setstart = cubicInOut(scrollanim.time, scrollanim.begin, scrollanim.change, scrollanim.duration);
		scrollanim.element.style.left = setstart+"px";
		scrollanim.time++;
	}
}
var layout=0;
function hidedesc()
{
    
	layout=1;
	getid('goto').onmouseover=showdesc;
	curno=defcurno;
	fadedesc(getid('popdesc'),[100],[0],0,30,10,2,2);
}
function easeInOut(minValue,maxValue,totalSteps,actualStep,powr) {
//Generic Animation Step Value Generator By www.hesido.com
	var delta = maxValue - minValue;
	var stepp = minValue+(Math.pow(((1 / totalSteps)*actualStep),powr)*delta);
	return Math.ceil(stepp)
}

function sineInOut(t, b, c, d)
{
	return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
}

function cubicIn(t, b, c, d) {
	return c*(t/=d)*t*t + b;
}

function cubicOut(t, b, c, d) {
	return c*((t=t/d-1)*t*t + 1) + b;
}

function cubicInOut(t, b, c, d)
{
	if ((t/=d/2) < 1) return c/2*t*t*t + b;
	return c/2*((t-=2)*t*t + 2) + b;
}

/****************imagegal homepage ends *************/

/************** DG Navigation ***************/
function readnavvaribales(geturl)
{
	try
	{
		loadXMLNav(geturl,1);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}	
}
function readnavselectedvaribales(geturl)
{
	try
	{
		loadXMLNav(geturl,3);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}	
}
function readdghome(geturl)
{
	try
	{
		loadXMLNav(geturl,2);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}	
}
function loadXMLNav(url,stats)
{
	if (window.ActiveXObject)
	{
		isIE = true;
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req)
		{
			
			if(stats == 1)
			{
				req.onreadystatechange = buildnav;	
			}
			else if(stats == 2)
			{
				req.onreadystatechange = builddghomecenter;	
			}
			else if(stats == 3)
			{
				req.onreadystatechange = buildnavselected;	
			}
			else if(stats == 4)
			{
				req.onreadystatechange = loaddgprices;	
			}
			else if(stats == 5)
			{
				req.onreadystatechange = loadproductdetails;	
			}
			else if(stats == 6)
			{
				req.onreadystatechange = updateproductview;	
			}
			else if(stats == 7)
			{
				req.onreadystatechange = updatejewellview;	
			}
			else if(stats == 8)
			{
				req.onreadystatechange = loadmorefromdesigner;	
			}
			else if(stats == 9)
			{
				req.onreadystatechange = removeproduct;	
			}
			req.open("GET", url, true);
			req.send();
		}
	}
	else if (window.XMLHttpRequest)
	{
		req = new XMLHttpRequest();
		if(stats == 1)
		{
			req.onreadystatechange = buildnav;
		}
		else if(stats == 2)
		{
			req.onreadystatechange = builddghomecenter;	
		}
		else if(stats == 3)
		{
			req.onreadystatechange = buildnavselected;	
		}
		else if(stats == 4)
		{
			req.onreadystatechange = loaddgprices;	
		}
		else if(stats == 5)
		{
			req.onreadystatechange = loadproductdetails;	
		}
		else if(stats == 6)
		{
			req.onreadystatechange = updateproductview;	
		}
		else if(stats == 7)
			{
				req.onreadystatechange = updatejewellview;	
			}
		else if(stats == 8)
		{
			req.onreadystatechange = loadmorefromdesigner;	
		}
		else if(stats == 9)
			{
				req.onreadystatechange = removeproduct;	
			}
		req.open("GET", url, true);
		req.send(null);
	}	
}
function buildnavinspiration()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			navcategory = req.responseXML.getElementsByTagName("category");
			var firstul=document.createElement('ul');
			firstul.className='rootGroup dgnav';
			getid('navoptions').appendChild(firstul);
			
			var firstli=document.createElement('li');
			firstli.className='item first';
			
			var firstlink=document.createElement('a');
			firstlink.setAttribute('href','/'+langname+'/'+designurl+'?showall=1');
			
			showallitems = req.responseXML.getElementsByTagName("designgallery");
			var firsttext=document.createTextNode(showallitems[0].getAttribute('ShowAllItems'));
			
			firstlink.appendChild(firsttext);
			
			firstli.appendChild(firstlink);
			
			firstul.appendChild(firstli);
			
			
			var secli=document.createElement('li');
			secli.className='item sec';
			
			var seclink=document.createElement('a');
			seclink.setAttribute('href','/'+langname+'/'+designurl+'?mostviewed=1');
			
			showallitems = req.responseXML.getElementsByTagName("designgallery");
			
			//var firsttext=document.createTextNode(showallitems[0].getAttribute('MostViewedItems'));
			
			var sectext=document.createTextNode(pagesdetails[13].getAttribute('Value'));
			
			seclink.appendChild(sectext);
			
			secli.appendChild(seclink);
			
			firstul.appendChild(secli);
			
			
			
			for(var i=0;i<navcategory.length;i++)
			{
				var otherlis=document.createElement('li');
				otherlis.className='item';
				otherlis.id='items'+navcategory[i].getAttribute('id');
				var otherlink=document.createElement('a');
				otherlink.setAttribute('href','javascript:void(0)');
				var otherspan=document.createElement('span');
				otherlink.className='';
				otherlink.onclick=openinner;
				var othertext=document.createTextNode(navcategory[i].getAttribute('name'));
				if(navcategory[i].childNodes.length > 0)
				{
					var innerul=document.createElement('ul');
				}
				for(var j=0;j<navcategory[i].childNodes.length;j++)
				{
					var innerli=document.createElement('li');
					innerli.className='items';
					
					var innerlink=document.createElement('a');
					innerlink.setAttribute('href','/'+langname+'/'+designurl+'?categoryid='+navcategory[i].getAttribute('id')+'&typeid='+navcategory[i].childNodes[j].getAttribute('typeid'));
					innerlink.onclick=updatenmove;
					innerlink.setAttribute('id','prodtype_'+navcategory[i].getAttribute('id')+'_'+navcategory[i].childNodes[j].getAttribute('typeid'));
					var innertext=document.createTextNode(navcategory[i].childNodes[j].childNodes[0].nodeValue);
					var innercount=document.createTextNode(' ('+navcategory[i].childNodes[j].getAttribute('count')+')');
					
					innerlink.appendChild(innertext);
					innerlink.appendChild(innercount);
					innerli.appendChild(innerlink);
					innerul.appendChild(innerli);
					for(var chkopen1=0;chkopen1<typeselect.length;chkopen1++)
					{
						if(navcategory[i].childNodes[j].getAttribute('typeid')==typeselect[chkopen1])
						{
							innerlink.className='item selected';
						}
					}
				}
				otherspan.appendChild(othertext);
				otherlink.appendChild(otherspan);
				otherlis.appendChild(otherlink);
				otherlis.appendChild(innerul);
				firstul.appendChild(otherlis);
			}
			navlinks = req.responseXML.getElementsByTagName("link");
			if(navlinks.length > 0)
			{
				var linksul=document.createElement('ul');
				linksul.className='scndul';
				linksul.id='scndulno';
			}
			var submenu=0;
			for(var j=0;j<navlinks.length;j++)
			{
				if(navlinks[j].getAttribute('menu') != 'submenu')
				{
					var linksli=document.createElement('li');
					linksli.className='item';
					if(navlinks[j].getAttribute('menu') == 'mainmenu')
					{
						linksli.className='item selected';	
					}
					var linkslink=document.createElement('a');
					linkslink.setAttribute('href',navlinks[j].getAttribute('linkurl'));
				 	var linkstext=document.createTextNode(navlinks[j].childNodes[0].nodeValue);
					var linkspan=document.createElement('span');
					
					linkspan.appendChild(linkstext);
					linkslink.appendChild(linkspan);
					linksli.appendChild(linkslink);
					linksul.appendChild(linksli);
				}
				if(navlinks[j].getAttribute('menu') == 'mainmenu' && submenu ==0)
				{
					var innerlinksul=document.createElement('ul');
					linksli.appendChild(innerlinksul);
					submenu=1;
				}
				if(navlinks[j].getAttribute('menu') == 'submenu')
				{
					var innerlinksli=document.createElement('li');
					innerlinksli.className='inneritem';
					var innerlinkslink=document.createElement('a');
					innerlinkslink.setAttribute('href',navlinks[j].getAttribute('linkurl'));
					if(builddghome == 4)
					{
						innerlinkslink.className='selected';	
					}
					var innerlinkstext=document.createTextNode(navlinks[j].childNodes[0].nodeValue);
					
					var linkspan=document.createElement('span');
					
					linkspan.appendChild(innerlinkstext);
					
					innerlinksul.appendChild(innerlinksli);
					innerlinksli.appendChild(innerlinkslink);
					innerlinkslink.appendChild(linkspan);  
				}
				
			}
			getid('navoptions').appendChild(firstul);
			getid('navoptions').appendChild(linksul);
			var sectext=getid('scndulno').innerHTML;
			sectext=sectext.replace('&lt;br/&gt;','<br />');
			getid('scndulno').innerHTML=sectext;
			if(builddghome==6)
			{
				loaddggallery();
			}
			if(getid('DesignGalContainerOuter'))
			{
				loaddggallery();
			}
			if(getid('RetailerSearchContainer2'))
			{
				builddghome=5;
				loaddggallery();
			}			
		}
	}
	
}
function updatenmove()
{
	var ntypeid=this.href.split("=");
	updatejewelleryviewxml('/'+langname+'/include/DGUpdateJewelleryViewCount.aspx?Jewellerytypeid='+ntypeid[2]);
	return true;
}
function buildnav()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			ldfirst=0;
			navcategory = req.responseXML.getElementsByTagName("category");
			var firstul=document.createElement('ul');
			firstul.className='rootGroup dgnav';
			getid('navoptions').appendChild(firstul);
			
			var firstli=document.createElement('li');
			firstli.className='item first';
			
			var firstlink=document.createElement('a');
			firstlink.setAttribute('href','javascript:void(0)');
			firstlink.onclick=showallprod;
			
			showallitems = req.responseXML.getElementsByTagName("designgallery");
			var firsttext=document.createTextNode(showallitems[0].getAttribute('ShowAllItems'));
			
			firstlink.appendChild(firsttext);
			
			firstli.appendChild(firstlink);
			
			firstul.appendChild(firstli);
			
			
			var secli=document.createElement('li');
			secli.className='item sec';
			
			var seclink=document.createElement('a');
			seclink.setAttribute('href','javascript:void(0)');
			seclink.onclick=mostprod;
			var sectext=document.createTextNode(pagesdetails[13].getAttribute('Value'));
			
			seclink.appendChild(sectext);
			showallitems = req.responseXML.getElementsByTagName("designgallery");
			
			//var firsttext=document.createTextNode(showallitems[0].getAttribute('MostViewedItems'));
			
			
			
			secli.appendChild(seclink);
			
			firstul.appendChild(secli);
			
			for(var i=0;i<navcategory.length;i++)
			{


				var otherlis=document.createElement('li');
				otherlis.className='item';
				otherlis.id='items'+navcategory[i].getAttribute('id');
				var otherlink=document.createElement('a');
				otherlink.setAttribute('href','javascript:void(0)');
				var otherspan=document.createElement('span');
				otherlink.className='';
				otherlink.onclick=openinner;
				var othertext=document.createTextNode(navcategory[i].getAttribute('name'));
				if(navcategory[i].childNodes.length > 0)
				{
					var innerul=document.createElement('ul');
				}
				for(var j=0;j<navcategory[i].childNodes.length;j++)
				{
					var innerli=document.createElement('li');
					innerli.className='items';
					
					var innerlink=document.createElement('a');
					innerlink.setAttribute('href','javascript:void(0)');
					innerlink.onclick=readdgdescription;
					innerlink.setAttribute('id','prodtype_'+navcategory[i].getAttribute('id')+'_'+navcategory[i].childNodes[j].getAttribute('typeid'));
					var innertext=document.createTextNode(navcategory[i].childNodes[j].childNodes[0].nodeValue);
					var innercount=document.createTextNode(' ('+navcategory[i].childNodes[j].getAttribute('count')+')');
					
					innerlink.appendChild(innertext);
					innerlink.appendChild(innercount);
					innerli.appendChild(innerlink);
					innerul.appendChild(innerli);
					for(var chkopen1=0;chkopen1<typeselect.length;chkopen1++)
					{
						if(navcategory[i].childNodes[j].getAttribute('typeid')==typeselect[chkopen1])
						{
							innerlink.className='item selected';
						}
					}
				}
				otherspan.appendChild(othertext);
				otherlink.appendChild(otherspan);
				otherlis.appendChild(otherlink);
				otherlis.appendChild(innerul);
				firstul.appendChild(otherlis);
			}
			navlinks = req.responseXML.getElementsByTagName("link");
			if(navlinks.length > 0)
			{
				var linksul=document.createElement('ul');
				linksul.className='scndul';
				linksul.id='scndulno';
			}
			for(var j=0;j<navlinks.length;j++)
			{
				var linksli=document.createElement('li');
				linksli.className='item';
				var linkslink=document.createElement('a');
				linkslink.setAttribute('href',navlinks[j].getAttribute('linkurl'));
				var linkstext=document.createTextNode(navlinks[j].childNodes[0].nodeValue);
				linkslink.appendChild(linkstext);
				linksli.appendChild(linkslink);
				linksul.appendChild(linksli);
			}
			getid('navoptions').appendChild(firstul);
			getid('navoptions').appendChild(linksul);
			var sectext=getid('scndulno').innerHTML;
			sectext=sectext.replace('&lt;br/&gt;','<br />');
			getid('scndulno').innerHTML=sectext;
			if(!builddghome)
			{
				readdghome('/'+langname+'/include/DGLoadLatestProducts.aspx?languageid='+langid);
			}
			else if(builddghome==4)
			{
				loaddggallery();
			}
		}
	}
	
}
var postparams='';
var result;
var categorynav=new Array();
var typeidnav=new Array();
var categoryselect=new Array();
var typeselect=new Array();
function buildnavselected()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			postparams='';
			result = req.responseXML.getElementsByTagName("item");
			categorynav[0]=result[0].getAttribute('categoryid');
			typeidnav[categorynav[0]]=result[0].getAttribute('typeid');
			if(window.location.href.toLowerCase().indexOf('pricerangeid') != -1)
			{
				var urlsplit=window.location.href.toLowerCase().split('?');
				var urlsplit2=urlsplit[1].split('&');
				var urlsplit3=urlsplit2[0].split('=');
				var price=urlsplit3[1];

			}
			else
			{
				var price=0	
			}
			for(var i=0;i<categorynav.length;i++)
			{
				postparams='<designGallery Result="Success" PriceRange="'+price+'"><item categoryid="'+categorynav[i]+'" typeid="'+typeidnav[categorynav[i]]+'" /></designGallery>';
			}
			categoryselect[0]=categorynav[0];
			typeselect[0]=result[0].getAttribute('typeid');
			/*categoryselect[result[0].getAttribute('categoryid')]=result[0].getAttribute('typeid');
			postparams='<designGallery Result="Success" PriceRange="0"><item categoryid="'+result[0].getAttribute('categoryid')+'" typeid="'+result[0].getAttribute('typeid')+'" /></designGallery>';*/
			readdgdescription();
		}
	}	
}
var openmenu=new Array();
function openinner()
{
	getid('navoptions').childNodes[0].childNodes[1].className='item sec';
	getid('navoptions').childNodes[0].childNodes[0].className='item first';
	var curli=Number(this.parentNode.id.replace('items',''));
	var hei=0;
	for(var j=0;j<this.parentNode.childNodes[1].childNodes.length;j++)
	{
		hei=hei+this.parentNode.childNodes[1].childNodes[j].offsetHeight;
	}
	openmenu[curli]=hei+this.parentNode.childNodes[1].childNodes[(this.parentNode.childNodes[1].childNodes.length-1)].offsetHeight;
	this.onclick=closeinner;
	this.className=this.className+' selected';
	navscrollStart(getid(this.parentNode.id), this.parentNode.offsetHeight, hei+this.parentNode.childNodes[1].childNodes[(this.parentNode.childNodes[1].childNodes.length-1)].offsetHeight,0)
}
var closenoload=0;
function closeinner()
{
	if(getid('poupdivempty'))
	{
		getid('poupdivempty').style.display="none";
	}
	getid('RelatedInfoContainer').style.display="block";
	if(getid('imagegalleryholderinner'))
	{
		getid('imagegalleryholderinner').style.display="block";
		if(categoryselect.length >1)
		{
			var notcurrent=0;
			var curclikid=this.parentNode.id.replace('items','');
			closenoload=1;
			ldfirst=0;
			var curno=Number(this.parentNode.id.replace('items',''));
			openmenu[curno]=15;
			this.onclick=openinner;
			this.className='';
			newcall='';
			for(var i=0;i<categoryselect.length;i++)
			{
				if(categoryselect[i]==curno)
				{
					notcurrent=1;
					categoryselect.splice(i,1);
					typeselect.splice(i,1);
				}
			}
			if(notcurrent == 1)
			{
				for(var i=0;i<categoryselect.length;i++)
				{
					newcall=newcall+'<item categoryid="'+categoryselect[i]+'" typeid="'+typeselect[i]+'" />'
				}
				postparams='<designGallery Result="Success" PriceRange="0">'+newcall+'</designGallery>';
				navscrollStart(getid(this.parentNode.id),this.parentNode.offsetHeight, 20,1);	
			}
			else
			{
				navscrollStart(getid(this.parentNode.id),this.parentNode.offsetHeight, 20,0);	
			}
		}
		else if(categoryselect.length ==1)
		{
			var ckopn=0;
			var curno=Number(this.parentNode.id.replace('items',''));
			for(var i=0;i<categoryselect.length;i++)
			{
				if(categoryselect[i]==curno)
				{
					ckopn=1;
				}				
			}
			if(ckopn == 1)
			{
				showallprod();	
			}
			else
			{
				this.onclick=openinner;
				this.className='';
				navscrollStart(getid(this.parentNode.id),this.parentNode.offsetHeight, 20,0);	
			}
		}
		else
		{
			this.onclick=openinner;
			this.className='';
			navscrollStart(getid(this.parentNode.id),this.parentNode.offsetHeight, 20,0);	
		}
	}
	else
	{
		this.onclick=openinner;
		this.className='';
		navscrollStart(getid(this.parentNode.id),this.parentNode.offsetHeight, 20,0);	
	}
}
function opennav(st)
{
	if (scrollanim.time > scrollanim.duration) 
	{
		clearInterval(scrollanim.timer);
		scrollanim.timer = null;
		if(st==1)
		{
			readdgdescription();
		}
	}
	else 
	{
		openpos = cubicInOut(scrollanim.time, scrollanim.begin, scrollanim.change, scrollanim.duration);
		scrollanim.element.style.height = openpos+"px";
		scrollanim.time++;
	}
}
function navscrollStart(elem, start, end,st)
{
	if (scrollanim.timer != null) {
		clearInterval(scrollanim.timer);
		scrollanim.timer = null;
	}
	scrollanim.time = 0;
	scrollanim.begin = start;
	scrollanim.change = end - start;
	scrollanim.duration = 30;
	scrollanim.element = elem;
	scrollanim.timer = setInterval("opennav("+st+");", 1);
}
/************** DG Navigation ends***************/
/************** DG Home block starts***************/
var fadeid;
function fadebgs()
{
	fadeid=this.id;
	fadedesc(getid(this.id),[40],[40],40,5,5,3,5);
}
function fadebgsout()
{
	fadeid=this.id;
	fadedesc(getid(this.id),[0],[0],0,20,10,5);
}

function builddghomecenter()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			dghomelst = req.responseXML.getElementsByTagName("product");
			var dghomedivholder=document.createElement('div');
			dghomedivholder.id='dghomedivholder';
			for(var i=0;i<dghomelst.length;i++)
			{
				var dghomediv=document.createElement('div');
				dghomediv.className='dgimgdiv';
				
				var dghomelink=document.createElement('a');
				dghomelink.className='dgimglink';
				dghomelink.id='overlink'+i;
				dghomelink.href='javascript:void(0)';
				dghomelink.onmouseover=fadebgs;
				dghomelink.onclick=readdgdescription1;
				dghomelink.setAttribute('id','prodtype_1_'+i+'_main');
				
				dghomelink.onmouseout=fadebgsout;
				
				var dghomespan=document.createElement('span');
				dghomespan.className='dgimgtxt';
				
				var dghomespantext=document.createTextNode(dghomelst[i].getAttribute('name'));
				var dghomespanimg=document.createElement('img');
				dghomespanimg.src=dghomelst[i].getAttribute('smallthumbnail');
				
				dghomediv.appendChild(dghomespanimg);
				dghomespan.appendChild(dghomespantext);
				dghomediv.appendChild(dghomespan);
				dghomediv.appendChild(dghomelink);
				dghomedivholder.appendChild(dghomediv);
			}	
			getid('designgal').appendChild(dghomedivholder);
			getid('DesignOuterContainer').style.display="block";
		}
	}
}
/**************  DG Home block ends***************/
/**************  DG block starts***************/
if(navigator.userAgent.indexOf('MSIE 6') != -1)
{
	var shttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
	var shttp = new XMLHttpRequest();
}

var categoryselect=new Array();
var typeselect=new Array();
var newcall='';
var navcategory;
var queryprice=0;
function readdgdescription1()
{
	if(builddghome == 2)
	{
		var querystr1=window.location.href.toLowerCase().split('#');
		var querystr=querystr1[0].toLowerCase().split('?');	
		qrysplit=querystr[1].split('&');
		for(var i=0;i<qrysplit.length;i++)
		{
			if(qrysplit[i].indexOf('pricerangeid') != -1)
			{
				pricerng=qrysplit[i].split('=');
				price=pricerng[1];
				queryprice=pricerng[1];
			}
			if(qrysplit[i].indexOf('categoryid') != -1)
			{
				pricerng=qrysplit[i].split('=');
				categorynav[0]=pricerng[1];
			}
			if(qrysplit[i].indexOf('typeid') != -1)
			{
				pricerng=qrysplit[i].split('=');
				typeidnav[categorynav[0]]=pricerng[1];
			}
		}
		for(var i=0;i<categorynav.length;i++)
		{
			postparams='<designGallery Result="Success" PriceRange="'+price+'"><item categoryid="'+categorynav[i]+'" typeid="'+typeidnav[categorynav[i]]+'" /></designGallery>';
		}
		categoryselect[0]=categorynav[0];
		typeselect[0]=typeidnav[categorynav[0]];
		/*categoryselect[result[0].getAttribute('categoryid')]=result[0].getAttribute('typeid');
		postparams='<designGallery Result="Success" PriceRange="0"><item categoryid="'+result[0].getAttribute('categoryid')+'" typeid="'+result[0].getAttribute('typeid')+'" /></designGallery>';*/
	}
	else if(builddghome == 3)
	{
		shwall=1;
		postparams='<designGallery Result="Success" PriceRange="0"></designGallery>'
	}
	else if(builddghome == 7)
	{
		msviewed=1;
		postparams='<designGallery Result="Success" PriceRange="0"></designGallery>'
	}
	else
	{
		var pslit=this.id.split('_');
		var p2split=getid('navoptions').childNodes[0].childNodes[2].childNodes[1].childNodes[pslit[2]].childNodes[0].id.split('_');
		categorynav[0]=p2split[1];
		typeidnav[categorynav[0]]=p2split[2];
		for(var i=0;i<categorynav.length;i++)
		{
			postparams='<designGallery Result="Success" PriceRange="0"><item categoryid="'+categorynav[i]+'" typeid="'+typeidnav[categorynav[i]]+'" /></designGallery>';
		}
		categoryselect[0]=categorynav[0];
		typeselect[0]=typeidnav[categorynav[0]];
	}
	readdgdescription();
}
var updatecurid;
function readdgdescription()
{
	updatecurid=this.id;
	if(getid('dghomedivholder'))
	{
		getid('dghomedivholder').style.display="none";
	}
	if(builddghome == 3)
	{
		shwall=1;
	}
	
	if(builddghome == 7)
	{
		msviewed=1;
	}
	else
	{
		shwall=0;
		msviewed=0;
	}
	var sellevl1=0;
	var already=0;
	var url='/'+langname+'/include/DGLoadLeftNavWithSelection.aspx?LanguageID='+langid;
	if(postparams=='')
	{
		newcall='';
		var conchk=0;
		var parmsplit=this.id.split('_');
		for(var i=0;i<categoryselect.length;i++)
		{
			if(Number(categoryselect[i])==Number(parmsplit[1]))
			{
				conchk=1;
				typeselect[i]=parmsplit[2];
			}

		}
		if(conchk==0)
		{
			categoryselect[(categoryselect.length)]=parmsplit[1];
			
			typeselect[(typeselect.length)]=parmsplit[2];
		}
		for(var i=0;i<categoryselect.length;i++)
		{
			newcall=newcall+'<item categoryid="'+categoryselect[i]+'" typeid="'+typeselect[i]+'" />'

		}
		postparams='<designGallery Result="Success" PriceRange="0">'+newcall+'</designGallery>';
	}
	shttp.open("POST", url, true);
	//Send the proper header information along with the request
	shttp.onreadystatechange = function() 
	{//Call a function when the state changes.
		if(shttp.readyState == 4 && shttp.status == 200) 
		{
			postparams='';
			getid('navoptions').innerHTML='';
			navcategory = shttp.responseXML.getElementsByTagName("category");
			var firstul=document.createElement('ul');
			firstul.className='rootGroup dgnav';
			getid('navoptions').appendChild(firstul);
			
			var firstli=document.createElement('li');
			firstli.className='item first';
			
			var firstlink=document.createElement('a');
			firstlink.setAttribute('href','javascript:void(0)');
			firstlink.onclick=showallprod;
			
			showallitems = shttp.responseXML.getElementsByTagName("designgallery");
			var firsttext=document.createTextNode(showallitems[0].getAttribute('ShowAllItems'));
			
			firstlink.appendChild(firsttext);
			
			firstli.appendChild(firstlink);
			
			firstul.appendChild(firstli);
			
			var secli=document.createElement('li');
			secli.className='item sec';
			
			var seclink=document.createElement('a');
			seclink.setAttribute('href','javascript:void(0)');
			seclink.onclick=mostprod;
			var sectext=document.createTextNode(pagesdetails[13].getAttribute('Value'));
			
			seclink.appendChild(sectext);
			showallitems = req.responseXML.getElementsByTagName("designgallery");
			
			//var firsttext=document.createTextNode(showallitems[0].getAttribute('MostViewedItems'));
			
			
			
			secli.appendChild(seclink);
			
			firstul.appendChild(secli);
			
			for(var i=0;i<navcategory.length;i++)
			{
				var otherlis=document.createElement('li');
				otherlis.className='item';
				otherlis.id='items'+navcategory[i].getAttribute('id');
				var otherlink=document.createElement('a');
				otherlink.setAttribute('href','javascript:void(0)');
				var otherspan=document.createElement('span');
				otherlink.className='';
				otherlink.onclick=openinner;
				var othertext=document.createTextNode(navcategory[i].getAttribute('name'));
				if(navcategory[i].childNodes.length > 0)
				{
					var innerul=document.createElement('ul');
				}
				for(var j=0;j<navcategory[i].childNodes.length;j++)
				{
					var innerli=document.createElement('li');
					innerli.className='items';
					
					var innerlink=document.createElement('a');
					innerlink.setAttribute('href','javascript:void(0)');
					innerlink.onclick=readdgdescription;
					innerlink.setAttribute('id','prodtype_'+navcategory[i].getAttribute('id')+'_'+navcategory[i].childNodes[j].getAttribute('typeid'));
					var innertext=document.createTextNode(navcategory[i].childNodes[j].childNodes[0].nodeValue);
					var innercount=document.createTextNode(' ('+navcategory[i].childNodes[j].getAttribute('count')+')');
					
					innerlink.appendChild(innertext);
					innerlink.appendChild(innercount);
					innerli.appendChild(innerlink);
					innerul.appendChild(innerli);
					for(var chkopen1=0;chkopen1<typeselect.length;chkopen1++)
					{
						if(navcategory[i].childNodes[j].getAttribute('typeid')==typeselect[chkopen1])
						{
							innerlink.className='item selected';
							updatecurid='prodtype_'+navcategory[i].getAttribute('id')+'_'+navcategory[i].childNodes[j].getAttribute('typeid');
						}
					}
				}
				otherspan.appendChild(othertext);
				otherlink.appendChild(otherspan);
				otherlis.appendChild(otherlink);
				otherlis.appendChild(innerul);
				firstul.appendChild(otherlis);
			}
			for(var chkopen=0;chkopen<categoryselect.length;chkopen++)
			{
				var hei=0;
				for(var j=0;j<getid('items'+categoryselect[chkopen]).childNodes[1].childNodes.length;j++)
				{
					hei=hei+getid('items'+categoryselect[chkopen]).childNodes[1].childNodes[j].offsetHeight;
					
				}
				getid('items'+categoryselect[chkopen]).style.height=(hei+getid('items'+categoryselect[chkopen]).childNodes[1].childNodes[(getid('items'+categoryselect[chkopen]).childNodes[1].childNodes.length-1)].offsetHeight)+"px";
				getid('items'+categoryselect[chkopen]).childNodes[0].className='selected';
				getid('items'+categoryselect[chkopen]).childNodes[0].onclick=closeinner;
			}
			var navlinks = shttp.responseXML.getElementsByTagName("link");
			if(navlinks.length > 0)
			{
				var linksul=document.createElement('ul');
				linksul.className='scndul';
				linksul.id='scndulno';
				getid('navoptions').appendChild(linksul);
			}
			for(var j=0;j<navlinks.length;j++)
			{
				var linksli=document.createElement('li');
				linksli.className='item';
				var linkslink=document.createElement('a');
				linkslink.setAttribute('href',navlinks[j].getAttribute('linkurl'));
				
				var linkstext=document.createTextNode(navlinks[j].childNodes[0].nodeValue);
				linkslink.appendChild(linkstext);
				linksli.appendChild(linkslink);
				linksul.appendChild(linksli);
			}
			var sectext=getid('scndulno').innerHTML;
			sectext=sectext.replace('&lt;br/&gt;','<br />');
			getid('scndulno').innerHTML=sectext;
			if(this.id)
			{
				updatejewelleryviewxml('/'+langname+'/include/DGUpdateJewelleryViewCount.aspx?Jewellerytypeid='+parmsplit[2]);
			}
			loaddggallery();
		}
	}
	shttp.setRequestHeader("Content-type", "text/xml");
	shttp.setRequestHeader("Content-length", postparams.length);
	shttp.setRequestHeader("Connection", "close");
	shttp.send(postparams)	
}
var shwall=0;
function showallprod()
{
	getid('navoptions').childNodes[0].childNodes[0].className=getid('navoptions').childNodes[0].childNodes[0].className+' selected';
	getid('navoptions').childNodes[0].childNodes[1].className='item sec';
	if(getid('dghomedivholder'))
	{
		getid('dghomedivholder').style.display="none";
	}
	categoryselect.splice(i,categoryselect.length);
	typeselect.splice(i,typeselect.length);
	shwall=1;
	//added by faluludeen to clear most viewed flag
	msviewed=0;
	for(var i=0;i<navcategory.length;i++)
	{
		getid('items'+navcategory[i].getAttribute('id')).style.height="20px";
		getid('items'+navcategory[i].getAttribute('id')).childNodes[0].className='';
		getid('items'+navcategory[i].getAttribute('id')).childNodes[0].onclick=openinner;
	}
	for(var i=0;i<navcategory.length;i++)
	{
		for(var j=0;j<navcategory[i].childNodes.length;j++)
		{
			getid('prodtype_'+navcategory[i].getAttribute('id')+'_'+navcategory[i].childNodes[j].getAttribute('typeid')).className='';
		}
	}	
	loaddggallery();
}
var msviewed=0;
function mostprod()
{
    
    

	getid('navoptions').childNodes[0].childNodes[1].className=getid('navoptions').childNodes[0].childNodes[0].className+' selected';
	getid('navoptions').childNodes[0].childNodes[0].className='item first';
	if(getid('dghomedivholder'))
	{
		getid('dghomedivholder').style.display="none";
	}
	categoryselect.splice(i,categoryselect.length);
	typeselect.splice(i,typeselect.length);
	msviewed=1;
	//added by faluludeen to clear show all flag
	shwall=0;
	
	
	for(var i=0;i<navcategory.length;i++)
	{
		getid('items'+navcategory[i].getAttribute('id')).style.height="20px";
		getid('items'+navcategory[i].getAttribute('id')).childNodes[0].className='';
		getid('items'+navcategory[i].getAttribute('id')).childNodes[0].onclick=openinner;
	}
	for(var i=0;i<navcategory.length;i++)
	{
		for(var j=0;j<navcategory[i].childNodes.length;j++)
		{
			getid('prodtype_'+navcategory[i].getAttribute('id')+'_'+navcategory[i].childNodes[j].getAttribute('typeid')).className='';
		}
	}	
	loaddggallery();
}

var prodar=new Array();
var gallery;
var fcnt=0;
var vrcnt=1;
var price=0;
var thnksprodid=0;
function loaddggallery()
{
	firsttxt='';
	
	vrcnt=1;
	countslds=1
	prodar = [];
	curpage=1;
	setstart=0;
	setend=0;
	getid('imageslider').style.left='0px';
	newcall='';
	getid('paging').innerHTML='';
	getid('imageslider').innerHTML='';
	if(window.location.href.toLowerCase().indexOf('pricerangeid') != -1)
	{
		querystr=window.location.href.toLowerCase().split('?');	
		qrysplit=querystr[1].split('&');
		for(var i=0;i<qrysplit.length;i++)
		{
			if(qrysplit[i].indexOf('pricerangeid') != -1)
			{
				pricerng=qrysplit[i].split('=');
				pricerng=pricerng[1].split('#');
				price=pricerng[0];
				queryprice=pricerng[0];
			}
		}
	}
	if(shwall == 1)
	{
		var url='/'+langname+'/include/DGLoadAllProducts.aspx?LanguageID='+langid;
		if(postparams=='')
		{
			postparams='<designGallery Result="Success" PriceRange="'+price+'" />';
		}	
	}
	else if(msviewed == 1)
	{
		var url='/'+langname+'/include/DGLoadMostViewedProducts.aspx?LanguageID='+langid;
		if(postparams=='')
		{
			postparams='<designGallery Result="Success" PriceRange="'+price+'" />';
		}	
	}
	else if(builddghome == 1)
	{
		var url='/'+langname+'/include/DGLoadPlatinumProducts.aspx?LanguageID='+langid;
		if(postparams=='')
		{
			postparams='<designGallery PriceRange="'+price+'" />';
		}	
	}
	else if(builddghome == 4)
	{
		var url='/'+langname+'/include/DGLoadUserDreamList.aspx?LanguageID='+langid+'&UserID='+userid;
		if(postparams=='')
		{
			postparams='<designGallery PriceRange="'+price+'" />';
		}	
	}
	else if(builddghome == 5)
	{
		var qurs=window.location.href.toLowerCase().split('=');
		var dids=qurs[1].split('&');
		var url='/'+langname+'/include/DGLoadDesignerproducts.aspx?LanguageID='+langid+'&DesignerID='+dids[0];
		if(postparams=='')
		{
			postparams='<designGallery PriceRange="'+price+'" />';
		}
	}
	else if(builddghome == 6)
	{
		if(priceid)
		{
			price=priceid;
		}
		else
		{
			priceid=0;
		}
		var url='/'+langname+'/include/DGLoadProducts.aspx?LanguageID='+langid;
		postparams=='';
		newcall='<item categoryid="1" typeid="22" />'
		postparams='<designGallery Result="Success" PriceRange="'+price+'">'+newcall+'</designGallery>';
	}
	else
	{
		var url='/'+langname+'/include/DGLoadProducts.aspx?LanguageID='+langid;
		if(postparams=='')
		{
			for(var i=0;i<categoryselect.length;i++)
			{
				newcall=newcall+'<item categoryid="'+categoryselect[i]+'" typeid="'+typeselect[i]+'" />'
				if(typeselect[i] == 396)
				{
					thnksprodid=1;	
				}
				else
				{
					thnksprodid=0;	
				}
			}
			if(queryprice != 0)
			{
				newprice=queryprice;
			}
			else if(selprice == '')
			{
				newprice=0;	
			}
			else
			{
				newprice=selprice;
			}
			postparams='<designGallery Result="Success" PriceRange="'+newprice+'">'+newcall+'</designGallery>';
		}
		
	}
	shttp.open("POST", url, true);
	
	//Send the proper header information along with the request
	shttp.onreadystatechange = function() 
	{//Call a function when the state changes.
		if(shttp.readyState == 4 && shttp.status == 200) 
		{
			postparams='';
			gallery = shttp.responseXML.getElementsByTagName("product");
			if(gallery.length == 0 && builddghome != 5)
			{
				getid('paging').innerHTML='';
				getid('prices').innerHTML='';
				if(!getid('poupdivempty'))
				{
					var popupdiv=document.createElement('div');
					popupdiv.id='poupdivempty';
					popupdiv.appendChild(document.createTextNode(pagesdetails[0].getAttribute('Value')));
					getid('DesignGalContainerOuter').appendChild(popupdiv);	
				}
				getid('imagegalleryholderinner').style.display="none";
				getid('DesignGalContainerOuter').style.height="430px";
				getid('RelatedInfoContainer').style.display="none";
				getid('poupdivempty').style.display="block";
				if(builddghome == 4)
				{
					getid('DList').style.display="block";
				}
				getid('poupdivempty').style.display="block";
				getid('galmid').style.display="none";
				loaddgpricexml();
			}
			else
			{
				if(builddghome != 5 && builddghome!=6)
				{
					getid('DesignGalContainerOuter').style.height="auto";
					getid('imageslider').style.width=(gallery.length*102)+"px";
					var sliddivs=document.createElement('div');
					sliddivs.setAttribute('id','sliddiv');
					var ttnum=gallery.length/7;
					ttnum=ttnum+'';
					if(ttnum.indexOf('.') != -1)
					{
						ttnum=ttnum.split('.');
						ttnum[0]=Number(ttnum[0]);
						totalpages=(ttnum[0]+1);
					}
					else
					{
						totalpages=ttnum;	
					}
					var incpop=1;
					
					if((builddghome == 0 || builddghome == 1 || builddghome == 4) && ldfirst == 1)
					{
						for(var i=1;i<=gallery.length;i++)
						{
							if(ldprodfirst == gallery[i-1].getAttribute('productid'))
							{
								curprod=1;
								
								var outdivout=document.createElement('div');
								outdivout.className='outdivout';
								
								var outdiv=document.createElement('div');
								outdiv.className='outdiv';
								
								var span=document.createElement('span');
								
								var linkto=document.createElement('a');
								if(i==1)
								{
									ldlinkid='imgno_'+1+'_'+gallery[i-1].getAttribute('productid');
									curprod=1;
								}
								firsttxt=i;
								prodar[1]=gallery[i-1].getAttribute('productid');
								linkto.setAttribute('id','imgno_'+1+'_'+gallery[i-1].getAttribute('productid'));
								//linkto.style.background='url('+gallery[i-1].getAttribute('smallthumbnail')+') no-repeat center center';
								linkto.onmouseover=movesliddiv;
								
								
								//linkto.href='#productid='+gallery[i-1].getAttribute('productid');
								linkto.href='javascript:void(0)';
								linkto.onclick=callproductdetail;
								
								var imgs=document.createElement('img');
								imgs.setAttribute('src',gallery[i-1].getAttribute('smallthumbnail'));
								imgs.setAttribute('alt',gallery[i-1].getAttribute('name'));
								
								
								
								var popdiv=document.createElement('div');
								popdiv.setAttribute('id','popdesc');
								popdiv.className="popdescs";
								linkto.appendChild(span);
								linkto.appendChild(imgs);
								outdiv.appendChild(linkto);
								outdivout.appendChild(outdiv);
								getid('imageslider').appendChild(outdivout);
							}
						}
						fcnt=1;
						incpop++
						vrcnt++;
					}
					for(var i=1;i<=gallery.length;i++)
					{
					    
						if(ldprodfirst != gallery[i-1].getAttribute('productid'))
						{
							var outdivout=document.createElement('div');
							outdivout.className='outdivout';
							var outdiv=document.createElement('div');
							outdiv.className='outdiv';
							var span=document.createElement('span');
							var linkto=document.createElement('a');
							if(fcnt!=1 && i==1)
							{
								ldlinkid='imgno_'+(incpop)+'_'+gallery[i-1].getAttribute('productid');
								curprod=1;
							}
							prodar[vrcnt]=gallery[i-1].getAttribute('productid');
							linkto.setAttribute('id','imgno_'+(incpop)+'_'+gallery[i-1].getAttribute('productid'));
							//linkto.style.background='url('+gallery[i-1].getAttribute('smallthumbnail')+') no-repeat center center';
							linkto.onmouseover=movesliddiv;
							
							linkto.href='javascript:void(0)';
							//linkto.href='#productid='+gallery[i-1].getAttribute('productid');
							linkto.onclick=callproductdetail;
							linkto.style.background='url(http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_preloader.gif) no-repeat center center';
							
							var imgs=document.createElement('img');
							imgs.setAttribute('src',gallery[i-1].getAttribute('smallthumbnail'));
							imgs.setAttribute('alt',gallery[i-1].getAttribute('name'));
							
							
							var popdiv=document.createElement('div');
							popdiv.setAttribute('id','popdesc');
							popdiv.className="popdescs";
							linkto.appendChild(span);
							linkto.appendChild(imgs);
							outdiv.appendChild(linkto);
							outdivout.appendChild(outdiv);
							getid('imageslider').appendChild(outdivout);
							incpop++;
							vrcnt++;
						}
						
					}
					if(!getid('popdesc'))
					{
						getid('imagegalleryholderinner').appendChild(popdiv);
					}
					getid('imageslider').appendChild(sliddivs);
					getid('sliddiv').style.width="98px";
					getid('sliddiv').style.height="120px";
					getid('sliddiv').style.border="1px solid #46b4e9";
					getid('sliddiv').style.position="absolute";
					getid('sliddiv').style.left="0px";
					getid('sliddiv').style.top="0px";
					var linkto=document.createElement('a');
					linkto.setAttribute('id','goto');
					linkto.onclick=callproductdetail;
					getid('sliddiv').appendChild(linkto);
					getid('goto').style.width="98px";
					getid('goto').style.height="120px";
					getid('goto').innerHTML='<img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_transcyimg.gif">';
					getid('goto').setAttribute('href','javascript:void(0)');
					getid('goto').onmouseover=movesliddiv;
					getid('goto').onmouseout=hidedesc;
					getid('goto').inerHTML='<img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_transcyimg.gif">';
					getid('paging').innerHTML='<div class="pgtext">'+pagesdetails[1].getAttribute('Value')+'</div>';
					var pgcnt='';
					if(totalpages > 1)
					{
						pgcnt='<div class="prevlnk"><a href="javascript:void(0)" onclick="javascript:movesliderleft();"><img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_arrow_blue2.gif" alt="Previous" /></a></div> <div id="pageholder"><div id="pageslider">';
						getid('previmgslide').style.display="block";
						getid('nextimgslide').style.display="block";
					}
					else
					{
						pgcnt='<div class="prevlnk"></div> <div id="pageholder"><div id="pageslider">';
						getid('previmgslide').style.display="none";
						getid('nextimgslide').style.display="none";
					}
					
					for(var i=1;i<=totalpages;i++)
					{
						pgcnt+='<a href="javascript:void(0)" onclick="javascript:jumpslider('+i+');" id="cpage'+i+'">'+i+'</a> ';	
					}
					if(totalpages > 1)
					{
						pgcnt+='</div></div><div class="prevlnk rite"><a href="javascript:void(0)" onclick="javascript:movesliderright();"><img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_arrow_blue.gif" alt="Previous" /></a></div> ';
					}
					else
					{
						pgcnt+='</div></div><div class="prevlnk rite"></div> ';
					}
					getid('paging').innerHTML+='<div class="pgcnt">'+pgcnt+'</div>';
					if(totalpages <= 3)
					{
						getid('pageholder').style.width=(totalpages*15)+'px';
					}
					getid('pageslider').style.width=(gallery.length*15)+'px';
					getid('cpage'+1).style.color="#46b4e9";
					if(getid('mrite'))
					{
						getid('mrite').onclick=shownextproduct;
						getid('mleft').onclick=showprevproduct;
					}
					//callalign=setTimeout("alnimg()",100);
					loaddgpricexml();					
				}
				else
				{
					if(gallery.length != 0)
					{
						getid('imageslider').style.width=(gallery.length*102)+"px";
						var sliddivs=document.createElement('div');
						sliddivs.setAttribute('id','sliddiv');
						var ttnum=gallery.length/7;
						ttnum=ttnum+'';
						if(ttnum.indexOf('.') != -1)
						{
							ttnum=ttnum.split('.');
							ttnum[0]=Number(ttnum[0]);
							totalpages=(ttnum[0]+1);
						}
						else
						{
							totalpages=ttnum;	
						}
						for(var i=0;i<gallery.length;i++)
						{
							var outdivout=document.createElement('div');
							outdivout.className='outdivout';							
							var outdiv=document.createElement('div');
							outdiv.className='outdiv';
							var span=document.createElement('span');
							var linkto=document.createElement('a');
							linkto.setAttribute('id','imgno_'+(i+1)+'_'+gallery[i].getAttribute('productid'));
							//linkto.style.background='url('+gallery[i].getAttribute('smallthumbnail')+') no-repeat center center';
							linkto.onmouseover=movesliddiv;
							
							if(builddghome==6)
							{
								linkto.setAttribute('href','../'+designurl+'?pricerangeid='+priceid+'#productid='+gallery[i].getAttribute('productid'));
							}
							else
							{
								linkto.setAttribute('href','../'+designurl+'#productid='+gallery[i].getAttribute('productid'));
							}
							linkto.style.background='url(http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_preloader.gif) no-repeat center center';
							
							var imgs=document.createElement('img');
							
							imgs.setAttribute('src',gallery[i].getAttribute('smallthumbnail'));
							imgs.setAttribute('alt',gallery[i].getAttribute('name'));
							
							
							var popdiv=document.createElement('div');
							popdiv.setAttribute('id','popdesc');
							popdiv.className="popdescs";
							
							/*var poptxt=document.createTextNode(gallery[i].getAttribute('name'));
							popdiv.appendChild(poptxt);*/
							linkto.appendChild(span);
							linkto.appendChild(imgs);
							
							
							/*getid('popdesc'+i).style.left=(i*102)+33+"px";*/
							outdiv.appendChild(linkto);
							outdivout.appendChild(outdiv);
							getid('imageslider').appendChild(outdivout);
						}
						getid('imagegalleryholderinner').appendChild(popdiv);
						getid('imageslider').appendChild(sliddivs);
						getid('sliddiv').style.width="98px";
						getid('sliddiv').style.height="120px";
						getid('sliddiv').style.border="1px solid #46b4e9";
						getid('sliddiv').style.position="absolute";
						getid('sliddiv').style.left="0px";
						getid('sliddiv').style.top="0px";
						var linkto=document.createElement('a');
						linkto.setAttribute('id','goto');
						getid('sliddiv').appendChild(linkto);
						getid('goto').style.width="98px";
						getid('goto').style.height="120px";
						getid('goto').innerHTML='<img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_transcyimg.gif">';
						getid('goto').setAttribute('href','javascript:void(0)');
						getid('goto').onmouseover=movesliddiv;
						getid('goto').onmouseout=hidedesc;
						getid('paging').style.display="block";
						var pgcnt='';
					if(totalpages > 1)
					{
						pgcnt='<div class="prevlnk"><a href="javascript:void(0)" onclick="javascript:movesliderleft();"><img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_arrow_blue2.gif" alt="Previous" /></a></div> <div id="pageholder"><div id="pageslider">';
						getid('previmgslide').style.display="block";
						getid('nextimgslide').style.display="block";
					}
					else
					{
						pgcnt='<div class="prevlnk"></div> <div id="pageholder"><div id="pageslider">';
						getid('previmgslide').style.display="none";
						getid('nextimgslide').style.display="none";
					}
					
					for(var i=1;i<=totalpages;i++)
					{
						pgcnt+='<a href="javascript:void(0)" onclick="javascript:jumpslider('+i+');" id="cpage'+i+'">'+i+'</a> ';	
					}
					if(totalpages > 1)
					{
						pgcnt+='</div></div><div class="prevlnk rite"><a href="javascript:void(0)" onclick="javascript:movesliderright();"><img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_arrow_blue.gif" alt="Previous" /></a></div> ';
					}
					else
					{
						pgcnt+='</div></div><div class="prevlnk rite"></div> ';
					}
						
						getid('paging').innerHTML+='<div class="pgcnt">'+pgcnt+'</div>';
						if(totalpages <= 3)
						{
							getid('pageholder').style.width=(totalpages*15)+'px';
						}
						getid('pageslider').style.width=(gallery.length*15)+'px';
						getid('cpage'+1).style.color="#46b4e9";
						getid('imagegalleryholderinner').style.display="block";
						//callalign=setTimeout("alnimg()",100);
					}
				}
			}
		}
	}
	shttp.setRequestHeader("Content-type", "text/xml");
	shttp.setRequestHeader("Content-length", postparams.length);
	shttp.setRequestHeader("Connection", "close");
	shttp.send(postparams);
}
function loaddgpricexml()
{
	fcnt=1;
	curpage=1;
	geturl='/'+langname+'/include/DGLoadPrices.aspx?LanguageID='+langid;
	try
	{
		loadXMLNav(geturl,4);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}	
}
function loaddgrproductxml(geturl)
{
	try
	{
		loadXMLNav(geturl,5);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}	
}
function loaddgprices()
{
	
	getid('prices').innerHTML='';
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			pricerange  = req.responseXML.getElementsByTagName("pricerange");
			for(var i=0;i<pricerange.length;i++)
			{
				var dgpricelink=document.createElement('a');
				selprice=selprice.replace('price','');
				if(queryprice != 0 && selprice !=0)
				{
					price=0;
				}
				if(i==0 && selprice=='' && price==0)
				{
					dgpricelink.className="selected";	
				}
				else if(selprice==pricerange[i].getAttribute('priceid') || price==pricerange[i].getAttribute('priceid'))
				{
					dgpricelink.className="selected";	
				}
				dgpricelink.id="price"+pricerange[i].getAttribute('priceid');
				dgpricelink.href="javascript:void(0);"
				dgpricelink.onclick=changeprice;
				
				var dgpricetext=document.createTextNode(pricerange[i].childNodes[0].nodeValue);
				dgpricelink.appendChild(dgpricetext);
				
				getid('prices').appendChild(dgpricelink);
			}
			if(gallery.length != 0)
			{
				if(ldfirst == 1 && closenoload==0 && builddghome != 2 && builddghome != 3 && builddghome != 7)
				{
					callproductdetailfirst();	
					ldfirst=0;
				}
				else if(ldfirst == 1)
				{
					callproductdetailfirst();	
					ldfirst=0;
				}
				else if(closenoload==0 || closenoload==1 || builddghome == 2 || builddghome == 3 || builddghome == 7 || builddghome == 1)
				{
					closenoload=0;
					callproductdetail();
				}
			}
		}
	}
}
curprod=0;
var selprice='';
function changeprice()
{
	selprice=this.id;
	getid('galmid').style.display="block";
	if(getid('poupdivempty'))
	{
		getid('poupdivempty').style.display="none";
	}
	var priceid=Number(this.id.replace('price',''));
	if(shwall == 1)
	{
		postparams='<designGallery Result="Success" PriceRange="'+priceid+'">'+newcall+'</designGallery>';
	}
	if(msviewed == 1)
	{
		postparams='<designGallery Result="Success" PriceRange="'+priceid+'">'+newcall+'</designGallery>';
	}
	else
	{
		for(var i=0;i<categoryselect.length;i++)
		{
			newcall=newcall+'<item categoryid="'+categoryselect[i]+'" typeid="'+typeselect[i]+'" />'
		}
		postparams='<designGallery Result="Success" PriceRange="'+priceid+'">'+newcall+'</designGallery>';
	}
	loaddggallery();
}
var defcurno;
function callproductdetail()
{
	cursldloc=curprod;
	prodid=ldlinkid.split('_');
	cproduct=prodid[2];
	curno=prodid[1];
	defcurno=prodid[1];
	if(builddghome == 4)
	{
		if(window.location.href.indexOf('#productid') != -1)
		{	
			getid('ctl00_hdnDGProductID').value=cproduct;
			window.location.hash = 'productid='+cproduct;
		}
		else
		{
			getid('ctl00_hdnDGProductID').value=cproduct;
			window.location.href=window.location.href+'#productid='+cproduct;
		}
		loaddgrproductxml('/'+langname+'/include/DGLoadProductDetails.aspx?LanguageID='+langid+'&productid='+cproduct+'&DreamList=1');
	}
	else if(builddghome == 1)
	{
		if(window.location.href.indexOf('#productid') != -1)
		{	
			getid('ctl00_hdnDGProductID').value=prodid[2];
			window.location.hash = 'productid='+prodid[2];
		}
		else
		{
			getid('ctl00_hdnDGProductID').value=prodid[2];
			window.location.href=window.location.href+'#productid='+prodid[2];
		}
		loaddgrproductxml('/'+langname+'/include/DGLoadProductDetails.aspx?LanguageID='+langid+'&productid='+prodid[2]+'&pi=1');
	}
	else
	{
		if(window.location.href.indexOf('#productid') != -1)
		{	
			//getid('ctl00_hdnDGProductID').value=prodid[2];
			window.location.hash = 'productid='+prodid[2];
		}
		else
		{
			//getid('ctl00_hdnDGProductID').value=prodid[2];
			window.location.href=window.location.href+'#productid='+prodid[2];
		}
		loaddgrproductxml('/'+langname+'/include/DGLoadProductDetails.aspx?LanguageID='+langid+'&productid='+prodid[2]);		
	}
}
var lnnext=0;
var pgslidecnt=0;
var countsldsrev=1;
var countslds=1;
var pophide=0;
function shownextproduct()
{
	pophide=1;
	this.onclick='';
	if(countslds >7)
	{
		countslds=(countslds-(curpage-1)*7)
	}
	if(curprod<gallery.length)
	{
		if(countslds==7)
		{
			lnnext=1;
			getid('cpage'+curpage).style.color="#000000";
			curpage++;
			getid('cpage'+curpage).style.color="#46B4E9";
			countslds=1;
		}
		else
		{
			countslds++;	
		}
		countsldsrev=countslds;
		curprod++;
		cursldloc=curprod;
		scrollStart(getid('sliddiv'), getid('sliddiv').offsetLeft, getid('sliddiv').offsetLeft+100);
		//alert(Number(curprod));
		//alert(prodar.length);
		window.location.hash = 'productid='+prodar[(Number(curprod))];
		//alert('/'+langname+'/include/DGLoadProductDetails.aspx?LanguageID='+langid+'&productid='+prodar[(Number(curprod))]);
		loaddgrproductxml('/'+langname+'/include/DGLoadProductDetails.aspx?LanguageID='+langid+'&productid='+prodar[(Number(curprod))]);
		pgslidecnt++;
	}	
}
function showprevproduct()
{
	pophide=1;
	this.onclick='';
	if(countsldsrev >7)
	{
		countsldsrev=(countsldsrev-(curpage-1)*7)
	}
	if(curprod>1)
	{
		if(countsldsrev==1)
		{
			lnnext=2;
			countsldsrev=7;
			getid('cpage'+curpage).style.color="#000000";
			curpage--;
			getid('cpage'+curpage).style.color="#46B4E9";
		}
		else
		{
			countsldsrev--;	
		}
		countslds=countsldsrev;
		scrollStart(getid('sliddiv'), getid('sliddiv').offsetLeft, getid('sliddiv').offsetLeft-100);
		window.location.hash = 'productid='+prodar[(Number(curprod)-1)];
		loaddgrproductxml('/'+langname+'/include/DGLoadProductDetails.aspx?LanguageID='+langid+'&productid='+prodar[(Number(curprod)-1)]);
		curprod--;
		cursldloc=curprod;
	}	
}
var ldprdt=0;
var cproduct=0;
function callproductdetailfirst()
{
	prodid=window.location.href.toLowerCase().split('=');
	curno=0;
	if(builddghome == 1)
	{
		loaddgrproductxml('/'+langname+'/include/DGLoadProductDetails.aspx?LanguageID='+langid+'&productid='+prodid[2]+'&pi=1');
	}
	else if(builddghome == 4)
	{
		if(window.location.href.toLowerCase().indexOf('productid') != -1)
		{
			prodid=window.location.href.toLowerCase().split('=');
			ldprdt=prodid[1]
		}
		else
		{
			prodid=ldlinkid.split('_');
			ldprdt=prodid[2]
		}
		cproduct=ldprdt;
		if(window.location.href.indexOf('#productid') != -1)
		{
			document.location.hash = 'productid='+ldprdt;
		}
		else
		{
			window.location.href=window.location.href+'#productid='+ldprdt;
		}
		loaddgrproductxml('/'+langname+'/include/DGLoadProductDetails.aspx?LanguageID='+langid+'&productid='+ldprdt+'&DreamList=1');
	}
	else
	{
		if(window.location.href.toLowerCase().indexOf('#productid') != -1)
		{
			prodid=window.location.href.toLowerCase().split('#');
			prodid=prodid[1].split('=');
			ldprdt=prodid[1]
			cproduct=ldprdt;
		}
		else
		{
			prodid=ldlinkid.split('_');
			ldprdt=prodid[2]
			cproduct=ldprdt;
		}
		loaddgrproductxml('/'+langname+'/include/DGLoadProductDetails.aspx?LanguageID='+langid+'&productid='+ldprdt);
	}
}
function chngpopimg()
{
	var newsrc=Number(this.id.replace('altimge',''));	
	getid('largeimage').src=bigimgsrc[newsrc];
}
var bigimageopen='';
var bigimgsrc=new Array();
var largeimgsrc=new Array();
var otherimgcount=0;
var currenttype='';
var currentname='';
function loadproductdetails()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			if(builddghome1== 10)
			{
				//getid('DesignOuterContainer').style.display="none";
				otherimgcount=0;
				var innercnt='';
				bigimage = req.responseXML.getElementsByTagName("bigimage");
				bigimageopen=bigimage[0].childNodes[0].nodeValue;
				var popupdiv=document.createElement('div');
				popupdiv.id='poupdiv';
				
				var poupdivleft=document.createElement('div');
				poupdivleft.id='poupdivleft';
				
				var poupdivright=document.createElement('div');
				poupdivright.id='poupdivright';
				
				otherimage = req.responseXML.getElementsByTagName("altimage1");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge0';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					otherimgs.onclick=chngpopimg;
					bigimgsrc[0]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[0]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				
				otherimage = req.responseXML.getElementsByTagName("altimage2");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge1';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					otherimgs.onclick=chngpopimg;
					bigimgsrc[1]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[1]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				otherimage = req.responseXML.getElementsByTagName("altimage3");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge2';
					otherimgs.onclick=chngpopimg;
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					bigimgsrc[2]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[2]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				otherimage = req.responseXML.getElementsByTagName("altimage4");
				if(otherimage[0].getAttribute('bigimage') != '')
				{				
					
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge3';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					bigimgsrc[3]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[3]=otherimage[0].getAttribute('largethumbnail');
					otherimgs.onclick=chngpopimg;
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				
				var popupdivimg=document.createElement('img');
				popupdivimg.id='largeimage';
				popupdivimg.src='';
				popupdivimg.background='url(http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_preloader.gif) no-repeat center center';
				popupdiv.appendChild(poupdivleft);
				poupdivleft.appendChild(poupdivright);
				poupdivleft.appendChild(popupdivimg);
				var popupdivclose=document.createElement('div');
				popupdivclose.className='closepop';
				popupdivclose.onclick=closepopdiv;
				poupdivleft.appendChild(popupdivclose);
															
				
				largeimage  = req.responseXML.getElementsByTagName("largethumbnail");
				innercnt='<div id="LeftContOuter" class="largethumb"><img id="ctl00_Contentplaceholder2_ctl00_imgLargeThumb" src="'+largeimage[0].childNodes[0].nodeValue+'" onclick="javascript:openimage();" style="border:0px;" /></div>';			
				var pricenote  = req.responseXML.getElementsByTagName("pricedescription"); 
				//
				description  = req.responseXML.getElementsByTagName("description");   
				innercnt=innercnt+'<div id="RightContOuter"><strong><span id="ctl00_Contentplaceholder2_ctl00_lblDescriptionTitle">'+description[0].getAttribute('name')+'</span></strong><br /><p>'+description[0].childNodes[0].nodeValue+'</p>';
				var price  = req.responseXML.getElementsByTagName("priceband");
				if(price[0].childNodes[0])
				{
					innercnt=innercnt+'<strong><span id="ctl00_Contentplaceholder2_ctl00_lblPriceRangeTitle">'+price[0].getAttribute('name')+'</span></strong><br /><p class="txtBlue"><span id="ctl00_Contentplaceholder2_ctl00_lblPriceRange">'+price[0].childNodes[0].nodeValue+'</span></p>';
				}
/*				if(window.location.href.toLowerCase().indexOf('en/') != -1)
				{
					innercnt=innercnt+'<div id="pricenote"></div>';
				}*/
				var ddetail  = req.responseXML.getElementsByTagName("designerdetail");
				if(ddetail[0].getAttribute('name') != 'null')
				{
					designername = req.responseXML.getElementsByTagName("designername");
					telephone = req.responseXML.getElementsByTagName("telephone");
					website = req.responseXML.getElementsByTagName("website");
					profilelink = req.responseXML.getElementsByTagName("profilelink");
					
					innercnt=innercnt+'<div id="divDesignerDeatils" runat="server" class="designDetailDesc">'
					if(ddetail[0].getAttribute('name') != 'null')
					{
						innercnt=innercnt+'<h2 class="designDetail" onclick="javascript:opendetail();">'+ddetail[0].getAttribute('name')+'</h2>'
					}
					if(designername[0].childNodes[0].nodeValue != 'null')
					{
						innercnt=innercnt+'<p>'+designername[0].childNodes[0].nodeValue+'</p>'
					}
					if(telephone[0].childNodes[0].nodeValue != 'null')
					{
						innercnt=innercnt+'<p>'+telephone[0].childNodes[0].nodeValue+'</p>'
					}
					if(website[0].getAttribute('name') != 'null')
					{
						innercnt=innercnt+'<p><a href="'+website[0].getAttribute('name')+'" target="_blank" title="'+website[0].childNodes[0].nodeValue+'">'+website[0].childNodes[0].nodeValue+'</a></p>'
					}
					if(profilelink[0].childNodes[0].nodeValue != 'null')
					{
						innercnt=innercnt+'<p><a href="'+profilelink[0].childNodes[0].nodeValue+'" title="'+profilelink[0].getAttribute('name')+'" class="linkPro">'+profilelink[0].getAttribute('name')+'</a></p>'
					}
					innercnt=innercnt+'</div>';
				}
				if(window.location.href.toLowerCase().indexOf('en/') != -1)
				{
					findretailer = req.responseXML.getElementsByTagName("findaretailer");
					if(findretailer[0].getAttribute('link') != 'null')
					{							
						innercnt=innercnt+'<p><a href="'+findretailer[0].getAttribute('link')+'" title="'+findretailer[0].getAttribute('name')+'"><strong>'+findretailer[0].getAttribute('name')+'</strong></a></p>';
					}
				}
				/*var morecollection = req.responseXML.getElementsByTagName("morecollection");
				if(morecollection[0].childNodes[0].nodeValue != 'null')
				{
					innercnt=innercnt+'<a href="javascript:void(0)" onclick="javascript:moreincollection(\''+morecollection[0].childNodes[0].nodeValue+'\')" title="'+morecollection[0].getAttribute('name')+'" class="moreDesigner">'+morecollection[0].getAttribute('name')+'</a><br class="clear" />';
				}
				var moredesigner = req.responseXML.getElementsByTagName("moredesigner");	
				if(moredesigner[0].childNodes[0].nodeValue != 'null')
				{
					innercnt=innercnt+'<a href="javascript:void(0)" onclick="javascript:morefromdesigner(\''+moredesigner[0].childNodes[0].nodeValue+'\')" title="'+moredesigner[0].getAttribute('name')+'" class="moreDesigner">'+moredesigner[0].getAttribute('name')+'</a><br class="clear" />';
				}*/
				var moreweddingband = req.responseXML.getElementsByTagName("moreweddingband");	
				if(moreweddingband[0].childNodes[0].nodeValue != 'null')
				{
					innercnt=innercnt+'<a href="javascript:void(0)" onclick="javascript:moreincollection(\''+moreweddingband[0].childNodes[0].nodeValue+'\')" title="'+moreweddingband[0].getAttribute('name')+'" class="moreDesigner">'+moreweddingband[0].getAttribute('name')+'</a><br class="clear" />';
				}
				pname = req.responseXML.getElementsByTagName("Productid");
				if(pname[0].childNodes[0].nodeValue != 'null')
				{
					var npno=pname[0].childNodes[0].nodeValue;
				}
				var sendlink = req.responseXML.getElementsByTagName("link");	
				innercnt=innercnt+'<a href="'+sendlink[0].getAttribute('linkurl')+'" title="'+sendlink[0].getAttribute('name')+'" class="sndFrd">'+sendlink[0].getAttribute('name')+'</a><br class="clear" />';
				innercnt=innercnt+'<a href="'+sendlink[1].getAttribute('linkurl')+'" title="'+sendlink[1].getAttribute('name')+'" class="drmList">'+sendlink[1].getAttribute('name')+'</a><br class="clear" />';
				innercnt=innercnt+'<br /><strong>'+pagesdetails[6].getAttribute('Value')+'</strong><br class="clear" /><a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=1&lang='+langname+'&page='+retailersearchurl+'" target="_blank"><img src="http://c554952.r52.cf2.rackcdn.com/Images_diggit.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=2&lang='+langname+'&page='+retailersearchurl+'" target="_blank"><img src="/images/facebook.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=3&lang='+langname+'&page='+retailersearchurl+'" target="_blank"><img src="/images/delicious.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=4&lang='+langname+'&page='+retailersearchurl+'" target="_blank"><img src="/images/twitter.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=5&lang='+langname+'&page='+retailersearchurl+'" target="_blank"><img src="/images/google.gif" /></a><br /><br />';
				//innercnt=innercnt+'<br /><strong>'+pagesdetails[6].getAttribute('Value')+'</strong><br class="clear" /><a href="http://digg.com/submit?url=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+ldprdt+'"><img src="/images/diggit.gif" /></a>&nbsp;&nbsp;<a href="http://www.facebook.com/sharer.php?u=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+ldprdt+'"><img src="/images/facebook.gif" /></a>&nbsp;&nbsp;<a href="http://del.icio.us/post?url=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+ldprdt+'"><img src="/images/delicious.gif" /></a>&nbsp;&nbsp;<a href="http://twitter.com/home?status=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+ldprdt+'"><img src="/images/twitter.gif" /></a>&nbsp;&nbsp;<a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+ldprdt+'"><img src="/images/google.gif" /></a><br /><br />';
				innercnt=innercnt+'<a href="javascript:void(0)" title="'+pagesdetails[4].getAttribute('Value')+'" onclick="javascript:openimage();" class="enlarge">'+pagesdetails[4].getAttribute('Value')+'</a>';
				if(otherimgcount !=0)
				{
					var viewtext=largeimage[0].getAttribute('name');
					innercnt=innercnt+'<br /><br /><strong>'+viewtext+'</strong><br />';
					for(var i=0;i<otherimgcount;i++)
					{
						innercnt=innercnt+'<a href="javascript:void(0);" onclick="changeouterimage('+i+')" class="otherviews" id="otherviews'+i+'"></a>'	
					}
				}
				innercnt=innercnt+'</div>';
				if(pagesdetails[3].getAttribute('Value') != '' && !(window.location.href.toLowerCase().toLowerCase().indexOf('en/') != -1))
				{
					innercnt=innercnt+'</div>';
				}
				else
				{
					innercnt=innercnt+'</div>';
				}
							
				getid('RetailerSearchContainer').innerHTML=innercnt;
				//getid('pricenote').innerHTML='<p>'+pricenote[0].childNodes[0].nodeValue+'</p>';
				
				/*var relinfo = req.responseXML.getElementsByTagName("guides");
				innercnt='<div class="brdrTop"></div><div class="brdrMid"><h2 class="title"><span id="ctl00_Contentplaceholder2_ctl00_lblRelatedInfoTitle">'+relinfo[0].getAttribute('heading')+'</span></h2><br class="clear" />';
				if(window.location.href.toLowerCase().indexOf('en/') == -1)
				{
					findretailer = req.responseXML.getElementsByTagName("findaretailer");	
					if(findretailer[0].getAttribute('link') != 'null')
					{
						innercnt=innercnt+'<a href="'+findretailer[0].getAttribute('link')+'" title="'+findretailer[0].getAttribute('name')+'"><strong>'+findretailer[0].getAttribute('name')+'</strong></a><br class="clear" /><br class="clear" />';
					}
				}
				var relitems = req.responseXML.getElementsByTagName("item");
				for(var i=0;i<relitems.length;i++)
				{
					if(i==0)
					{
						innercnt=innercnt+'<div class="conImg"><h2><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoTitle" href="'+relitems[i].getAttribute('sitelink')+'">'+relitems[i].getAttribute('name')+'</a></h2><br class="clear" /><div id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_divDesc" class="relatedInfoDesc"><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoDesc" href="'+relitems[i].getAttribute('sitelink')+'"><span class="txtDesc">'+relitems[i].childNodes[0].nodeValue+'</span></a><br /><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoMore" href="'+relitems[i].getAttribute('sitelink')+'"><span class="moreTxt">'+relitems[i].getAttribute('more')+'</span></a></div><div id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_divImage" class="relatedInfoImg"><img id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_imgInfo" src="'+relitems[i].getAttribute('imageurl')+'" alt="'+relitems[i].getAttribute('name')+'" style="border-width:0px;" /></div></div><br class="clear" />';		
					}
					else
					{
						innercnt=innercnt+'<div class="conImg"><h2><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoTitle" href="'+relitems[i].getAttribute('sitelink')+'">'+relitems[i].getAttribute('name')+'</a></h2><br class="clear" /><div id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_divDesc" class="relatedInfoDesc relatedInfoDescNoImg"><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoDesc" href="'+relitems[i].getAttribute('sitelink')+'"><span class="txtDesc">'+relitems[i].childNodes[0].nodeValue+'</span></a><br /><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoMore" href="'+relitems[i].getAttribute('sitelink')+'"><span class="moreTxt">'+relitems[i].getAttribute('more')+'</span></a></div></div><br class="clear" />';
					}
					
				}*/
				//innercnt=innercnt+'</div><div class="brdrBtm"></div>';
				//getid('RelatedInfoContainer').innerHTML=innercnt;
				getid('RetailerSearchContainer').appendChild(popupdiv);	
				getid('RetailerSearchContainer').style.display="block";
				//getid('RelatedInfoContainer').style.display="block";
				//getid('prices').style.display="block";
				//getid('paging').style.display="block";
				//getid('imagegalleryholderinner').style.display="block";
				//getid('paging').style.display="block";
				//getid('imagegalleryholderinner').style.display="block";
				ldfirst=0;
				fcnt=0;
				ldprodfirst=0;
				//getid('ldprevnext').style.display="block";
				getid('largeimage').style.width="auto";
				getid('largeimage').style.height="auto";
				//updateproductviewxml('/'+langname+'/include/DGUpdateProductViewCount.aspx?productid='+cproduct);
			}
			else if(builddghome == 1)
			{
				getid('DesignOuterContainer').style.display="none";
				getid('RelatedInfoContainer').style.display="block";
				otherimgcount=0;
				var innercnt='';
				bigimage = req.responseXML.getElementsByTagName("bigimage");
				bigimageopen=bigimage[0].childNodes[0].nodeValue;
				var popupdiv=document.createElement('div');
				popupdiv.id='poupdiv';
				
				var poupdivleft=document.createElement('div');
				poupdivleft.id='poupdivleft';
				
				var poupdivright=document.createElement('div');
				poupdivright.id='poupdivright';
				
				otherimage = req.responseXML.getElementsByTagName("altimage1");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge0';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					otherimgs.onclick=chngpopimg;
					bigimgsrc[0]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[0]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				
				otherimage = req.responseXML.getElementsByTagName("altimage2");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge1';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					otherimgs.onclick=chngpopimg;
					bigimgsrc[1]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[1]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				otherimage = req.responseXML.getElementsByTagName("altimage3");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge2';
					otherimgs.onclick=chngpopimg;
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					bigimgsrc[2]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[2]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				otherimage = req.responseXML.getElementsByTagName("altimage4");
				if(otherimage[0].getAttribute('bigimage') != '')
				{				
					
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge3';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					bigimgsrc[3]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[3]=otherimage[0].getAttribute('largethumbnail');
					otherimgs.onclick=chngpopimg;
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				var popupdivimg=document.createElement('img');
				popupdivimg.id='largeimage';
				popupdivimg.src='';
				popupdivimg.background='url(http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_preloader.gif) no-repeat center center';
				popupdiv.appendChild(poupdivleft);
				poupdivleft.appendChild(poupdivright);
				poupdivleft.appendChild(popupdivimg);
				var popupdivclose=document.createElement('div');
				popupdivclose.className='closepop';
				popupdivclose.onclick=closepopdiv;
				poupdivleft.appendChild(popupdivclose);
				largeimage  = req.responseXML.getElementsByTagName("largethumbnail");
				innercnt='<div class="gallerybrdTop"></div><div class="gallerybrdMid" id="galmid"><div id="LeftContOuter" class="largethumb"><img id="ctl00_Contentplaceholder2_ctl00_imgLargeThumb" src="'+largeimage[0].childNodes[0].nodeValue+'" onclick="javascript:openimage();" style="border-width:0px;" /></div>';
				
				description  = req.responseXML.getElementsByTagName("platinum");   
				innercnt=innercnt+'<div id="RightContOuter">'+description[0].childNodes[0].nodeValue+'<br />';
				if(otherimgcount !=0)
				{
					var viewtext=largeimage[0].getAttribute('name');
					innercnt=innercnt+'<strong>'+viewtext+'</strong><br />';
					for(var i=0;i<otherimgcount;i++)
					{
						innercnt=innercnt+'<a href="javascript:void(0);" onclick="changeouterimage('+i+')" class="otherviews" id="otherviews'+i+'"></a>'
					}
				}
				innercnt=innercnt+'</div>';
				innercnt=innercnt+'</div><div class="gallerybrdBtm" id="pricenote"></div>';
				getid('DesignGalContainerOuter').innerHTML=innercnt;
				getid('DesignGalContainerOuter').appendChild(popupdiv);	
				
				innercnt='<div class="brdrTop"></div><div class="brdrMid">';
				var ddetail  = req.responseXML.getElementsByTagName("designerdetail");
				if(ddetail[0].getAttribute('name') != 'null')
				{
					designername = req.responseXML.getElementsByTagName("designername");
					telephone = req.responseXML.getElementsByTagName("telephone");
					website = req.responseXML.getElementsByTagName("website");
					profilelink = req.responseXML.getElementsByTagName("profilelink");
					innercnt=innercnt+'<div id="divDesignerDeatils" runat="server" class="designDetailDesc">';
					innercnt=innercnt+'<h2 class="designDetail" onclick="javascript:opendetail();">'+ddetail[0].getAttribute('name')+'</h2>'
					if(designername[0].childNodes[0].nodeValue != 'null')
					{
						innercnt=innercnt+'<p>'+designername[0].childNodes[0].nodeValue+'</p>'
					}
					if(telephone[0].childNodes[0].nodeValue != 'null')
					{
						innercnt=innercnt+'<p>'+telephone[0].childNodes[0].nodeValue+'</p>'
					}
					if(website[0].childNodes[0].nodeValue != 'null')
					{
						innercnt=innercnt+'<p><a href="'+website[0].getAttribute('name')+'" target="_blank" title="'+website[0].childNodes[0].nodeValue+'" class="webLink">'+website[0].childNodes[0].nodeValue+'</a></p>'
					}
					if(profilelink[0].getAttribute('name') != 'null')
					{
						innercnt=innercnt+'<p><a href="'+profilelink[0].childNodes[0].nodeValue+'" title="'+profilelink[0].getAttribute('name')+'" class="linkPro">'+profilelink[0].getAttribute('name')+'</a></p>'
					}
					innercnt=innercnt+'</div>';
				}
				var moredesigner  = req.responseXML.getElementsByTagName("moredesigner");
				if(moredesigner[0].childNodes[0].nodeValue!='null')
				{
					innercnt=innercnt+'<a href="javascript:void(0)" onclick="javascript:morefromdesigner(\''+moredesigner[0].childNodes[0].nodeValue+'\')" title="'+moredesigner[0].getAttribute('name')+'" class="moreDesigner">'+moredesigner[0].getAttribute('name')+'</a><br class="clear" />';
				}
				pname = req.responseXML.getElementsByTagName("Productid");
				if(pname[0].childNodes[0].nodeValue != 'null')
				{
					var npno=pname[0].childNodes[0].nodeValue;
				}
				var sendlink = req.responseXML.getElementsByTagName("link");
				innercnt=innercnt+'<a href="'+sendlink[0].getAttribute('linkurl')+'" title="'+sendlink[0].getAttribute('name')+'" class="sndFrd">'+sendlink[0].getAttribute('name')+'</a><br class="clear" />';
				innercnt=innercnt+'<a href="'+sendlink[1].getAttribute('linkurl')+'" title="'+sendlink[1].getAttribute('name')+'" class="drmList">'+sendlink[1].getAttribute('name')+'</a><br class="clear" />';
				innercnt=innercnt+'<br /><strong>'+pagesdetails[6].getAttribute('Value')+'</strong><br class="clear" /><a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=1&lang='+langname+'&page='+designurl+'" target="_blank"><img src="http://c554952.r52.cf2.rackcdn.com/Images_diggit.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=2&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/facebook.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=3&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/delicious.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=4&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/twitter.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=5&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/google.gif" /></a><br /><br />';
				//innercnt=innercnt+'<br /><strong>'+pagesdetails[6].getAttribute('Value')+'</strong><br class="clear" /><a href="http://digg.com/submit?url=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+npno+'"><img src="/images/diggit.gif" /></a>&nbsp;&nbsp;<a href="http://www.facebook.com/sharer.php?u=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+npno+'"><img src="/images/facebook.gif" /></a>&nbsp;&nbsp;<a href="http://del.icio.us/post?url=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+npno+'"><img src="/images/delicious.gif" /></a>&nbsp;&nbsp;<a href="http://twitter.com/home?status=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+npno+'"><img src="/images/twitter.gif" /></a>&nbsp;&nbsp;<a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+npno+'"><img src="/images/google.gif" /></a><br /><br />';
				innercnt=innercnt+'<a href="javascript:void(0)" title="Enlarge image" onclick="javascript:openimage();" class="enlarge">Enlarge image</a></div></div><div class="gallerybrdBtm" id="pricenote"></div></div>';
				innercnt+='</div><div class="brdrBtm"></div>';	
				getid('RelatedInfoContainer').innerHTML=innercnt;
				getid('ldprevnext').style.display="block";
				getid('designgalinspration').style.display="block";
				getid('imagegalleryholderinner').style.display="block";
				getid('prices').style.display="block";
				getid('paging').style.display="block";
				getid('DesignGalContainerOuter').style.display="block";
				getid('RelatedInfoContainer').style.display="block";
				getid('largeimage').style.width="auto";
				getid('largeimage').style.height="auto";
				_gaq.push(['_trackEvent', countryname+'-'+currentsection, 'View', currenttype+'-'+currentname]);
			}
			else if(builddghome == 4)
			{
				getid('RelatedInfoContainer').style.display="block";
				getid('DesignOuterContainer').style.display="none";
				otherimgcount=0;
				var innercnt='';
				bigimage = req.responseXML.getElementsByTagName("bigimage");
				bigimageopen=bigimage[0].childNodes[0].nodeValue;
				var popupdiv=document.createElement('div');
				popupdiv.id='poupdiv';
				
				var poupdivleft=document.createElement('div');
				poupdivleft.id='poupdivleft';
				
				var poupdivright=document.createElement('div');
				poupdivright.id='poupdivright';
				
				otherimage = req.responseXML.getElementsByTagName("altimage1");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge0';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					otherimgs.onclick=chngpopimg;
					bigimgsrc[0]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[0]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				
				otherimage = req.responseXML.getElementsByTagName("altimage2");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge1';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					otherimgs.onclick=chngpopimg;
					bigimgsrc[1]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[1]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				otherimage = req.responseXML.getElementsByTagName("altimage3");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge2';
					otherimgs.onclick=chngpopimg;
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					bigimgsrc[2]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[2]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				otherimage = req.responseXML.getElementsByTagName("altimage4");
				if(otherimage[0].getAttribute('bigimage') != '')
				{				
					
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge3';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					bigimgsrc[3]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[3]=otherimage[0].getAttribute('largethumbnail');
					otherimgs.onclick=chngpopimg;
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				
				var popupdivimg=document.createElement('img');
				popupdivimg.id='largeimage';
				popupdivimg.src='';
				popupdivimg.background='url(http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_preloader.gif) no-repeat center center';
				popupdiv.appendChild(poupdivleft);
				poupdivleft.appendChild(poupdivright);
				poupdivleft.appendChild(popupdivimg);
				var popupdivclose=document.createElement('div');
				popupdivclose.className='closepop';
				popupdivclose.onclick=closepopdiv;
				poupdivleft.appendChild(popupdivclose);
															
				
				largeimage  = req.responseXML.getElementsByTagName("largethumbnail");
				innercnt='<div class="gallerybrdTop"></div><div class="gallerybrdMid" id="galmid"><div id="LeftContOuter" class="largethumb"><img id="ctl00_Contentplaceholder2_ctl00_imgLargeThumb" src="'+largeimage[0].childNodes[0].nodeValue+'" onclick="javascript:openimage();" style="border-width:0px;" /></div>';			
				var pricenote  = req.responseXML.getElementsByTagName("pricedescription"); 
				//
				currenttype=req.responseXML.getElementsByTagName("name")[0].getAttribute('typename');
				currentname=req.responseXML.getElementsByTagName("name")[0].childNodes[0].nodeValue;
				description  = req.responseXML.getElementsByTagName("description");   
				innercnt=innercnt+'<div id="RightContOuter"><strong><span id="ctl00_Contentplaceholder2_ctl00_lblDescriptionTitle">'+description[0].getAttribute('name')+'</span></strong><br /><p>'+description[0].childNodes[0].nodeValue+'</p>';
				var price  = req.responseXML.getElementsByTagName("priceband");
				if(price[0].childNodes[0])
				{
					innercnt=innercnt+'<strong><span id="ctl00_Contentplaceholder2_ctl00_lblPriceRangeTitle">'+price[0].getAttribute('name')+'</span></strong><br /><p class="txtBlue"><span id="ctl00_Contentplaceholder2_ctl00_lblPriceRange">'+price[0].childNodes[0].nodeValue+'</span></p>';
				}
				/*if(window.location.href.toLowerCase().indexOf('en/') != -1)
				{
					innercnt=innercnt+'<div id="pricenote"></div>';
				}*/
				findretailer = req.responseXML.getElementsByTagName("findaretailer");	
				if(findretailer[0].getAttribute('link') != 'null')
				{
					innercnt=innercnt+'<p><a href="'+findretailer[0].getAttribute('link')+'" title="'+findretailer[0].getAttribute('name')+'"><strong>'+findretailer[0].getAttribute('name')+'</strong></a></p>';
				}
				pname = req.responseXML.getElementsByTagName("Productid");
				if(pname[0].childNodes[0].nodeValue != 'null')
				{
					var npno=pname[0].childNodes[0].nodeValue;
				}
				var sendlink = req.responseXML.getElementsByTagName("link");	
				innercnt=innercnt+'<a href="'+sendlink[0].getAttribute('linkurl')+'" title="'+sendlink[0].getAttribute('name')+'" class="sndFrd">'+sendlink[0].getAttribute('name')+'</a><br class="clear" />';
				innercnt=innercnt+'<a href="javascript:void(0);" title="'+sendlink[1].getAttribute('name')+'" onclick="removelist();" class="removedrmList">'+sendlink[1].getAttribute('name')+'</a><br class="clear" />';
				
				innercnt=innercnt+'<br /><strong>'+pagesdetails[6].getAttribute('Value')+'</strong><br class="clear" /><a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=1&lang='+langname+'&page='+designurl+'" target="_blank"><img src="http://c554952.r52.cf2.rackcdn.com/Images_diggit.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=2&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/facebook.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=3&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/delicious.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=4&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/twitter.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=5&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/google.gif" /></a><br /><br />';
				//innercnt=innercnt+'<br /><strong>'+pagesdetails[6].getAttribute('Value')+'</strong><br class="clear" /><a href="http://digg.com/submit?url=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+npno+'"><img src="/images/diggit.gif" /></a>&nbsp;&nbsp;<a href="http://www.facebook.com/sharer.php?u=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+npno+'"><img src="/images/facebook.gif" /></a>&nbsp;&nbsp;<a href="http://del.icio.us/post?url=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+npno+'"><img src="/images/delicious.gif" /></a>&nbsp;&nbsp;<a href="http://twitter.com/home?status=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+npno+'"><img src="/images/twitter.gif" /></a>&nbsp;&nbsp;<a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+npno+'"><img src="/images/google.gif" /></a><br /><br />';
				innercnt=innercnt+'<a href="javascript:void(0)" title="'+pagesdetails[4].getAttribute('Value')+'" onclick="javascript:openimage();" class="enlarge">'+pagesdetails[4].getAttribute('Value')+'</a>';
				if(otherimgcount !=0)
				{
					
					var viewtext=largeimage[0].getAttribute('name');
					innercnt=innercnt+'<br /><br /><strong>'+viewtext+'</strong><br />';
					for(var i=0;i<otherimgcount;i++)
					{
						innercnt=innercnt+'<a href="javascript:void(0);" onclick="changeouterimage('+i+')" class="otherviews" id="otherviews'+i+'"></a>'	
					}
				}
				innercnt=innercnt+'</div></div>';
				if(pagesdetails[3].getAttribute('Value') != '' && !(window.location.href.toLowerCase().indexOf('en/') != -1))
				{
					innercnt=innercnt+'<div class="gallerybrdBtm" id="pricenote"></div></div>';
				}
				else
				{
					innercnt=innercnt+'<div class="gallerybrdBtm" id="pricenote"></div></div>';
				}
							
				getid('DesignGalContainerOuter').innerHTML=innercnt;
				getid('pricenote').innerHTML='<p>'+pricenote[0].childNodes[0].nodeValue+'</p>';
				
				var relinfo = req.responseXML.getElementsByTagName("guides");
				innercnt='<div class="brdrTop"></div><div class="brdrMid"><h2 class="title"><span id="ctl00_Contentplaceholder2_ctl00_lblRelatedInfoTitle">'+relinfo[0].getAttribute('heading')+'</span></h2><br class="clear" />';
				var relitems = req.responseXML.getElementsByTagName("item");
				for(var i=0;i<relitems.length;i++)
				{
					if(i==0)
					{
						innercnt=innercnt+'<div class="conImg"><h2><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoTitle" href="'+relitems[i].getAttribute('sitelink')+'">'+relitems[i].getAttribute('name')+'</a></h2><br class="clear" /><div id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_divDesc" class="relatedInfoDesc"><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoDesc" href="'+relitems[i].getAttribute('sitelink')+'"><span class="txtDesc">'+relitems[i].childNodes[0].nodeValue+'</span></a><br /><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoMore" href="'+relitems[i].getAttribute('sitelink')+'"><span class="moreTxt">'+relitems[i].getAttribute('more')+'</span></a></div><div id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_divImage" class="relatedInfoImg"><img id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_imgInfo" src="'+relitems[i].getAttribute('imageurl')+'" alt="'+relitems[i].getAttribute('name')+'" style="border-width:0px;" /></div></div><br class="clear" />';		
					}
					else
					{
						innercnt=innercnt+'<div class="conImg"><h2><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoTitle" href="'+relitems[i].getAttribute('sitelink')+'">'+relitems[i].getAttribute('name')+'</a></h2><br class="clear" /><div id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_divDesc" class="relatedInfoDesc relatedInfoDescNoImg"><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoDesc" href="'+relitems[i].getAttribute('sitelink')+'"><span class="txtDesc">'+relitems[i].childNodes[0].nodeValue+'</span></a><br /><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoMore" href="'+relitems[i].getAttribute('sitelink')+'"><span class="moreTxt">'+relitems[i].getAttribute('more')+'</span></a></div></div><br class="clear" />';
					}
					
				}
				innercnt=innercnt+'</div><div class="brdrBtm"></div>';
				getid('RelatedInfoContainer').innerHTML=innercnt;
				getid('DesignGalContainerOuter').appendChild(popupdiv);	
				getid('DesignGalContainerOuter').style.display="block";
				getid('RelatedInfoContainer').style.display="block";
				getid('prices').style.display="block";
				getid('paging').style.display="block";
				getid('imagegalleryholderinner').style.display="block";
				getid('paging').style.display="block";
				getid('imagegalleryholderinner').style.display="block";
				ldfirst=0;
				fcnt=0;
				ldprodfirst=0;
				getid('ldprevnext').style.display="block";
				getid('productadded').style.display='none';
				//getid('productexists').style.display='none';
				getid('largeimage').style.width="auto";
				getid('largeimage').style.height="auto";
				_gaq.push(['_trackEvent', countryname+'-'+currentsection, 'View', currenttype+'-'+currentname]);
				updateproductviewxml('/'+langname+'/include/DGUpdateProductViewCount.aspx?productid='+cproduct);
			}
			
			else
			{
				getid('RelatedInfoContainer').style.display="block";
				getid('DesignOuterContainer').style.display="none";
				otherimgcount=0;
				var innercnt='';
				bigimage = req.responseXML.getElementsByTagName("bigimage");
				bigimageopen=bigimage[0].childNodes[0].nodeValue;
				var popupdiv=document.createElement('div');
				popupdiv.id='poupdiv';
				
				var poupdivleft=document.createElement('div');
				poupdivleft.id='poupdivleft';
				
				var poupdivright=document.createElement('div');
				poupdivright.id='poupdivright';
				
				otherimage = req.responseXML.getElementsByTagName("altimage1");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge0';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					otherimgs.onclick=chngpopimg;
					bigimgsrc[0]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[0]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				
				otherimage = req.responseXML.getElementsByTagName("altimage2");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge1';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					otherimgs.onclick=chngpopimg;
					bigimgsrc[1]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[1]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				otherimage = req.responseXML.getElementsByTagName("altimage3");
				if(otherimage[0].getAttribute('bigimage') != '')
				{
					
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge2';
					otherimgs.onclick=chngpopimg;
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					bigimgsrc[2]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[2]=otherimage[0].getAttribute('largethumbnail');
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				otherimage = req.responseXML.getElementsByTagName("altimage4");
				if(otherimage[0].getAttribute('bigimage') != '')
				{				
					
					var otherimgs=document.createElement('img');
					otherimgs.id='altimge3';
					otherimgs.src=otherimage[0].childNodes[0].nodeValue;
					bigimgsrc[3]=otherimage[0].getAttribute('bigimage');
					largeimgsrc[3]=otherimage[0].getAttribute('largethumbnail');
					otherimgs.onclick=chngpopimg;
					poupdivright.appendChild(otherimgs);
					otherimgcount++;
				}
				
				var popupdivimg=document.createElement('img');
				popupdivimg.id='largeimage';
				popupdivimg.src='';
				popupdivimg.background='url(http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_preloader.gif) no-repeat center center';
				popupdiv.appendChild(poupdivleft);
				poupdivleft.appendChild(poupdivright);
				poupdivleft.appendChild(popupdivimg);
				var popupdivclose=document.createElement('div');
				popupdivclose.className='closepop';
				popupdivclose.onclick=closepopdiv;
				poupdivleft.appendChild(popupdivclose);
															
				
				largeimage  = req.responseXML.getElementsByTagName("largethumbnail");
				if(thnksprodid == 1 && langname=='ja')
				{
					innercnt='<div class="gallerybrdTop"></div><div class="gallerybrdMid" id="galmid"><div id="LeftContOuter" class="largethumb"><img id="ctl00_Contentplaceholder2_ctl00_imgLargeThumb" src="'+largeimage[0].childNodes[0].nodeValue+'" onclick="javascript:openimage();" style="border:0px;" /><a class="tdplink" href="/ja/media-center/thanks-days.aspx">サンクスデイズ・プラチナ トップに戻る</a></div>';			
				}
				else
				{
					innercnt='<div class="gallerybrdTop"></div><div class="gallerybrdMid" id="galmid"><div id="LeftContOuter" class="largethumb"><img id="ctl00_Contentplaceholder2_ctl00_imgLargeThumb" src="'+largeimage[0].childNodes[0].nodeValue+'" onclick="javascript:openimage();" style="border:0px;" /></div>';			
				}
				
				var pricenote  = req.responseXML.getElementsByTagName("pricedescription"); 
				//
				currenttype=req.responseXML.getElementsByTagName("name")[0].getAttribute('typename');
				currentname=req.responseXML.getElementsByTagName("name")[0].childNodes[0].nodeValue;
				description  = req.responseXML.getElementsByTagName("description");   
				innercnt=innercnt+'<div id="RightContOuter"><strong><span id="ctl00_Contentplaceholder2_ctl00_lblDescriptionTitle">'+description[0].getAttribute('name')+'</span></strong><br /><p>'+description[0].childNodes[0].nodeValue+'</p>';
				var price  = req.responseXML.getElementsByTagName("priceband");
				if(price[0].childNodes[0])
				{
					innercnt=innercnt+'<strong><span id="ctl00_Contentplaceholder2_ctl00_lblPriceRangeTitle">'+price[0].getAttribute('name')+'</span></strong><br /><p class="txtBlue"><span id="ctl00_Contentplaceholder2_ctl00_lblPriceRange">'+price[0].childNodes[0].nodeValue+'</span></p>';
				}
				/*if(window.location.href.toLowerCase().indexOf('en/') != -1)
				{
					innercnt=innercnt+'<div id="pricenote"></div>';
				}*/
				var ddetail  = req.responseXML.getElementsByTagName("designerdetail");
				if(ddetail[0].getAttribute('name') != 'null')
				{
					designername = req.responseXML.getElementsByTagName("designername");
					telephone = req.responseXML.getElementsByTagName("telephone");
					website = req.responseXML.getElementsByTagName("website");
					profilelink = req.responseXML.getElementsByTagName("profilelink");
					
					innercnt=innercnt+'<div id="divDesignerDeatils" runat="server" class="designDetailDesc">'
					if(ddetail[0].getAttribute('name') != 'null')
					{
						innercnt=innercnt+'<h2 class="designDetail" onclick="javascript:opendetail();">'+ddetail[0].getAttribute('name')+'</h2>'
					}
					if(designername[0].childNodes[0].nodeValue != 'null')
					{
						innercnt=innercnt+'<p>'+designername[0].childNodes[0].nodeValue+'</p>'
					}
					if(telephone[0].childNodes[0].nodeValue != 'null')
					{
						innercnt=innercnt+'<p>'+telephone[0].childNodes[0].nodeValue+'</p>'
					}
					if(website[0].getAttribute('name') != 'null')
					{
						innercnt=innercnt+'<p><a href="'+website[0].getAttribute('name')+'" target="_blank" title="'+website[0].childNodes[0].nodeValue+'">'+website[0].childNodes[0].nodeValue+'</a></p>'
					}
					if(profilelink[0].childNodes[0].nodeValue != 'null')
					{
						innercnt=innercnt+'<p><a href="'+profilelink[0].childNodes[0].nodeValue+'" title="'+profilelink[0].getAttribute('name')+'" class="linkPro">'+profilelink[0].getAttribute('name')+'</a></p>'
					}
					innercnt=innercnt+'</div>';
				}
				if(window.location.href.toLowerCase().indexOf('en/') != -1)
				{
					findretailer = req.responseXML.getElementsByTagName("findaretailerwithoutproduct");
					if(findretailer[0].getAttribute('link') != 'null')
					{							
						innercnt=innercnt+'<p><a href="'+findretailer[0].getAttribute('link')+'" title="'+findretailer[0].getAttribute('name')+'"><strong>'+findretailer[0].getAttribute('name')+'</strong></a></p>';
					}
				}
				var morecollection = req.responseXML.getElementsByTagName("morecollection");
				if(morecollection[0].childNodes[0].nodeValue != 'null')
				{
					innercnt=innercnt+'<a href="javascript:void(0)" onclick="javascript:moreincollection(\''+morecollection[0].childNodes[0].nodeValue+'\')" title="'+morecollection[0].getAttribute('name')+'" class="moreDesigner">'+morecollection[0].getAttribute('name')+'</a><br class="clear" />';
				}
				
				
				
				
				var moredesigner = req.responseXML.getElementsByTagName("moredesigner");	
				if(moredesigner[0].childNodes[0].nodeValue != 'null')
				{
					innercnt=innercnt+'<a href="javascript:void(0)" onclick="javascript:morefromdesigner(\''+moredesigner[0].childNodes[0].nodeValue+'\')" title="'+moredesigner[0].getAttribute('name')+'" class="moreDesigner">'+moredesigner[0].getAttribute('name')+'</a><br class="clear" />';
				}
				
				var moreweddingband = req.responseXML.getElementsByTagName("moreweddingband");	
				if(moreweddingband[0].childNodes[0].nodeValue != 'null')
				{
					innercnt=innercnt+'<a href="javascript:void(0)" onclick="javascript:moreincollection(\''+moreweddingband[0].childNodes[0].nodeValue+'\')" title="'+moreweddingband[0].getAttribute('name')+'" class="moreDesigner">'+moreweddingband[0].getAttribute('name')+'</a><br class="clear" />';
				}
				pname = req.responseXML.getElementsByTagName("Productid");
				if(pname[0].childNodes[0].nodeValue != 'null')
				{
					var npno=pname[0].childNodes[0].nodeValue;
				}
				var findretailer = req.responseXML.getElementsByTagName("findaretailer");
				if(findretailer[0].getAttribute('link') != 'null')
				{							
					innercnt=innercnt+'<p><a href="'+findretailer[0].getAttribute('link')+'" title="'+findretailer[0].getAttribute('name')+'"><strong>'+findretailer[0].getAttribute('name')+'</strong></a></p>';
				}
				var sendlink = req.responseXML.getElementsByTagName("link");	
				innercnt=innercnt+'<a href="'+sendlink[0].getAttribute('linkurl')+'" title="'+sendlink[0].getAttribute('name')+'" class="sndFrd">'+sendlink[0].getAttribute('name')+'</a><br class="clear" />';
				innercnt=innercnt+'<a href="'+sendlink[1].getAttribute('linkurl')+'" title="'+sendlink[1].getAttribute('name')+'" class="drmList">'+sendlink[1].getAttribute('name')+'</a><br class="clear" />';
				innercnt=innercnt+'<br /><strong>'+pagesdetails[6].getAttribute('Value')+'</strong><br class="clear" /><a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=1&lang='+langname+'&page='+designurl+'" target="_blank"><img src="http://c554952.r52.cf2.rackcdn.com/Images_diggit.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=2&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/facebook.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=3&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/delicious.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=4&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/twitter.gif" /></a>&nbsp;&nbsp;<a href="http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+npno+'&smtype=5&lang='+langname+'&page='+designurl+'" target="_blank"><img src="/images/google.gif" /></a><br /><br />';
				//innercnt=innercnt+'<br /><strong>'+pagesdetails[6].getAttribute('Value')+'</strong><br class="clear" /><a href="http://digg.com/submit?url=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+ldprdt+'"><img src="/images/diggit.gif" /></a>&nbsp;&nbsp;<a href="http://www.facebook.com/sharer.php?u=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+ldprdt+'"><img src="/images/facebook.gif" /></a>&nbsp;&nbsp;<a href="http://del.icio.us/post?url=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+ldprdt+'"><img src="/images/delicious.gif" /></a>&nbsp;&nbsp;<a href="http://twitter.com/home?status=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+ldprdt+'"><img src="/images/twitter.gif" /></a>&nbsp;&nbsp;<a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://preciousplatinum.com/'+langname+'/'+designurl+'?productid='+ldprdt+'"><img src="/images/google.gif" /></a><br /><br />';
				innercnt=innercnt+'<a href="javascript:void(0)" title="'+pagesdetails[4].getAttribute('Value')+'" onclick="javascript:openimage();" class="enlarge">'+pagesdetails[4].getAttribute('Value')+'</a>';
				if(otherimgcount !=0)
				{
					var viewtext=largeimage[0].getAttribute('name');
					innercnt=innercnt+'<br /><br /><strong>'+viewtext+'</strong><br />';
					for(var i=0;i<otherimgcount;i++)
					{
						innercnt=innercnt+'<a href="javascript:void(0);" onclick="changeouterimage('+i+')" class="otherviews" id="otherviews'+i+'"></a>'	
					}
				}
				innercnt=innercnt+'</div></div>';
				if(pagesdetails[3].getAttribute('Value') != '' && !(window.location.href.toLowerCase().toLowerCase().indexOf('en/') != -1))
				{
					innercnt=innercnt+'<div class="gallerybrdBtm" id="pricenote"></div></div>';
				}
				else
				{
					innercnt=innercnt+'<div class="gallerybrdBtm" id="pricenote"></div></div>';
				}
							
				getid('DesignGalContainerOuter').innerHTML=innercnt;
				getid('pricenote').innerHTML='<p>'+pricenote[0].childNodes[0].nodeValue+'</p>';
				
				var relinfo = req.responseXML.getElementsByTagName("guides");
				innercnt='<div class="brdrTop"></div><div class="brdrMid"><h2 class="title"><span id="ctl00_Contentplaceholder2_ctl00_lblRelatedInfoTitle">'+relinfo[0].getAttribute('heading')+'</span></h2><br class="clear" />';
				if(window.location.href.toLowerCase().indexOf('en/') == -1)
				{
					findretailer = req.responseXML.getElementsByTagName("findaretailerwithoutproduct");	
					if(findretailer[0].getAttribute('link') != 'null')
					{
						innercnt=innercnt+'<a href="'+findretailer[0].getAttribute('link')+'" title="'+findretailer[0].getAttribute('name')+'"><strong>'+findretailer[0].getAttribute('name')+'</strong></a><br class="clear" /><br class="clear" />';
					}
				}
				var relitems = req.responseXML.getElementsByTagName("item");
				for(var i=0;i<relitems.length;i++)
				{
					if(i==0)
					{
						innercnt=innercnt+'<div class="conImg"><h2><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoTitle" href="'+relitems[i].getAttribute('sitelink')+'">'+relitems[i].getAttribute('name')+'</a></h2><br class="clear" /><div id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_divDesc" class="relatedInfoDesc"><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoDesc" href="'+relitems[i].getAttribute('sitelink')+'"><span class="txtDesc">'+relitems[i].childNodes[0].nodeValue+'</span></a><br /><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoMore" href="'+relitems[i].getAttribute('sitelink')+'"><span class="moreTxt">'+relitems[i].getAttribute('more')+'</span></a></div><div id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_divImage" class="relatedInfoImg"><img id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_imgInfo" src="'+relitems[i].getAttribute('imageurl')+'" alt="'+relitems[i].getAttribute('name')+'" style="border-width:0px;" /></div></div><br class="clear" />';		
					}
					else
					{
						innercnt=innercnt+'<div class="conImg"><h2><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoTitle" href="'+relitems[i].getAttribute('sitelink')+'">'+relitems[i].getAttribute('name')+'</a></h2><br class="clear" /><div id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_divDesc" class="relatedInfoDesc relatedInfoDescNoImg"><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoDesc" href="'+relitems[i].getAttribute('sitelink')+'"><span class="txtDesc">'+relitems[i].childNodes[0].nodeValue+'</span></a><br /><a id="ctl00_Contentplaceholder2_ctl00_rpRelatedInfo_ctl00_lnkInfoMore" href="'+relitems[i].getAttribute('sitelink')+'"><span class="moreTxt">'+relitems[i].getAttribute('more')+'</span></a></div></div><br class="clear" />';
					}
					
				}
				innercnt=innercnt+'</div><div class="brdrBtm"></div>';
				getid('RelatedInfoContainer').innerHTML=innercnt;
				getid('DesignGalContainerOuter').appendChild(popupdiv);	
				getid('DesignGalContainerOuter').style.display="block";
				getid('RelatedInfoContainer').style.display="block";
				getid('prices').style.display="block";
				getid('paging').style.display="block";
				getid('imagegalleryholderinner').style.display="block";
				getid('paging').style.display="block";
				getid('imagegalleryholderinner').style.display="block";
				ldfirst=0;
				fcnt=0;
				ldprodfirst=0;
				getid('ldprevnext').style.display="block";
				getid('largeimage').style.width="auto";
				getid('largeimage').style.height="auto";
				_gaq.push(['_trackEvent', countryname+'-'+currentsection, 'View', currenttype+'-'+currentname]);
				updateproductviewxml('/'+langname+'/include/DGUpdateProductViewCount.aspx?productid='+cproduct);
			}
			if(langname.toLowerCase() == 'ja')
			{
				opendetail();
			}
		}
	}	
}
/*function updateclick(pid,smno,url)
{
	var xhr = createXMLHttpRequest();
	xhr.onreadystatechange = function()
	{
		if (xhr.readyState==4)
		{ // Request is finished
			if (xhr.status==200)
			{
				if(xhr.responseText.indexOf('FSuccess') != -1)
				{
					window.open(url,'Share','location, status, scrollbars, resizable, dependent, height=400,width=600')
				}
			}
		}
	}
	xhr.open("GET", 'http://'+domain+'/'+langname+'/Include/getSocialMediaClickCount.aspx?productid='+pid+'&smtype='+smno+'', true);
	xhr.send(null);	
}*/
function removelist()
{
	getid('productremoved').style.display='block';
	ldprdt=cproduct;
	removeproductxml('/'+langname+'/include/DGRemoveUserDreamList.aspx?productid='+ldprdt+'&UserID='+userid);
}
function changeouterimage(no)
{
	for(var i=0;i<otherimgcount;i++)
	{
		getid('otherviews'+i).className='otherviews';	
	}
	getid('otherviews'+no).className='otherviewsselected';
	getid('LeftContOuter').childNodes[0].src=largeimgsrc[no];
}
function updateproductviewxml(geturl)
{
	try
	{
		loadXMLNav(geturl,6);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}	
}
function updatejewelleryviewxml(geturl)
{
	try
	{
		loadXMLNav(geturl,7);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}	
}
function removeproductxml(geturl)
{
	try
	{
		loadXMLNav(geturl,9);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}	
}
function updatejewellview()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{	
		}
	}
}
function updateproductview()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{	
			if(updatecurid)
			{
				var catidcheck=updatecurid.split('_');

				if(catid == catidcheck[1] && alreadyclick !=catidcheck[2])
				{
					alreadyclick=catidcheck[2];
					updatejewelleryviewxml('/'+langname+'/include/DGUpdateJewelleryViewCount.aspx?Jewellerytypeid='+catidcheck[2]);	
				}
			}
		}
	}
}
function removeproduct()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{	
		 	window.location='/'+dreamlisturl;
		}
	}
}
function opendetail()
{
	getid('divDesignerDeatils').style.height="auto";
	getid('divDesignerDeatils').childNodes[0].onclick=closedetail;
	getid('divDesignerDeatils').childNodes[0].className='selected';
}
function closedetail()
{
	
	getid('divDesignerDeatils').style.height="20px";
	getid('divDesignerDeatils').childNodes[0].onclick=opendetail;
	getid('divDesignerDeatils').childNodes[0].className='';
}
function openimage()
{
	if(getid('RetailerSearchContainer'))
	{
		getid('poupdiv').style.display="block";
		getid('largeimage').src=bigimageopen;
	}
	else
	{
		getid('imagegalleryholderinner').style.display="none";
		getid('poupdiv').style.display="block";
		getid('largeimage').src=bigimageopen;
	}
}
function closepopdiv()
{
	getid('poupdiv').style.display="none";
	getid('imagegalleryholderinner').style.display="block";
}
function morefromdesigner(dgurl)
{
	var designerid=dgurl.split('=');
	geturl='/'+langname+'/include/DGLoadDesignerProducts.aspx?designerid='+designerid[1]+'&LanguageID='+langid;
	try
	{
		loadXMLNav(geturl,8);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}
}
function moreincollection(dgurl)
{
	geturl=dgurl;
	try
	{
		loadXMLNav(geturl,8);
	}
	catch(e)
	{
		var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
		alert("Unable to get XML data:\n" + msg);
		return;
	}
}
function loadmorefromdesigner()
{
	if (req.readyState == 4)
	{
        if (req.status == 200)
		{
			countslds=1
			prodar=new Array();
			curpage=1;
			setstart=0;
			setend=0;
			getid('imageslider').style.left='0px';
			newcall='';
			getid('imageslider').innerHTML='';
			gallery = req.responseXML.getElementsByTagName("product");
			if(gallery.length == 0)
			{
				getid('paging').innerHTML='';
				getid('prices').innerHTML='';
				if(!getid('poupdivempty'))
				{
					var popupdiv=document.createElement('div');
					popupdiv.id='poupdivempty';
					popupdiv.appendChild(document.createTextNode(pagesdetails[0].getAttribute('Value')));
					getid('DesignGalContainerOuter').appendChild(popupdiv);	
				}
				getid('imagegalleryholderinner').style.display="none";
				getid('poupdivempty').style.display="block";
				getid('galmid').style.display="none";
				getid('DesignGalContainerOuter').style.height="430px";
				getid('RelatedInfoContainer').style.display="none";
				loaddgpricexml();
			}
			else
			{
				getid('DesignGalContainerOuter').style.height="auto";
				getid('imageslider').style.width=(gallery.length*102)+"px";
				var sliddivs=document.createElement('div');
				sliddivs.setAttribute('id','sliddiv');
				var ttnum=gallery.length/7;
				ttnum=ttnum+'';
				if(ttnum.indexOf('.') != -1)
				{
					ttnum=ttnum.split('.');
					ttnum[0]=Number(ttnum[0]);
					totalpages=(ttnum[0]+1);
				}
				else
				{
					totalpages=ttnum;	
				}
				for(var i=1;i<=gallery.length;i++)
				{
					if(ldprodfirst != gallery[i-1].getAttribute('productid'))
					{
						var outdivout=document.createElement('div');
						outdivout.className='outdivout';
						
						var outdiv=document.createElement('div');
						outdiv.className='outdiv';
						
						var linkto=document.createElement('a');
						if(i==1)
						{
							ldlinkid='imgno_'+i+'_'+gallery[i-1].getAttribute('productid');
							curprod=1;
						}
						prodar[(i)]=gallery[i-1].getAttribute('productid');
						linkto.setAttribute('id','imgno_'+(i+fcnt)+'_'+gallery[i-1].getAttribute('productid'));
						linkto.onmouseover=movesliddiv;
						
						linkto.href='#productid='+gallery[i-1].getAttribute('productid');
						linkto.onclick=callproductdetail;
						linkto.style.background='url(http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_preloader.gif) no-repeat center center';
						var span=document.createElement('span');
						var imgs=document.createElement('img');
						imgs.setAttribute('src',gallery[i-1].getAttribute('smallthumbnail'));
						
						//imgs.style.width='99px';
						//imgs.style.height='121px';
						
						var popdiv=document.createElement('div');
						popdiv.setAttribute('id','popdesc');
						popdiv.className="popdescs";
						
						linkto.appendChild(span);
						linkto.appendChild(imgs);
						
						outdiv.appendChild(linkto);
						outdivout.appendChild(outdiv);
						getid('imageslider').appendChild(outdivout);
					}
				}
				if(!getid('popdesc'))
				{
					getid('imagegalleryholderinner').appendChild(popdiv);
				}
				getid('imageslider').appendChild(sliddivs);
				getid('sliddiv').style.width="98px";
				getid('sliddiv').style.height="120px";
				getid('sliddiv').style.border="1px solid #46b4e9";
				getid('sliddiv').style.position="absolute";
				getid('sliddiv').style.left="0px";
				getid('sliddiv').style.top="0px";
				var linkto=document.createElement('a');
				linkto.setAttribute('id','goto');
				linkto.onclick=callproductdetail;
				getid('sliddiv').appendChild(linkto);
				getid('goto').style.width="98px";
				getid('goto').href='javascript:void(0)';
				getid('goto').innerHTML='<img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_transcyimg.gif">';
				getid('goto').setAttribute('href','javascript:void(0)');
				getid('goto').onmouseover=movesliddiv;
				getid('goto').onmouseout=hidedesc;
				getid('goto').style.height="120px";
				getid('paging').innerHTML='<div class="pgtext">'+pagesdetails[1].getAttribute('Value')+'</div>';
				var pgcnt='';
				pgcnt='<div class="prevlnk"><a href="javascript:void(0)" onclick="javascript:movesliderleft();"><img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_arrow_blue2.gif" alt="Previous" /></a></div> <div id="pageholder"><div id="pageslider">';
				for(var i=1;i<=totalpages;i++)
				{
					pgcnt+='<a href="javascript:void(0)" onclick="javascript:jumpslider('+i+');" id="cpage'+i+'">'+i+'</a> ';	
				}
				pgcnt+='</div></div><div class="prevlnk rite"><a href="javascript:void(0)" onclick="javascript:movesliderright();"><img src="http://c554952.r52.cf2.rackcdn.com/App_Themes_PGI_images_arrow_blue.gif" alt="Previous" /></a></div> ';
				getid('paging').innerHTML+='<div class="pgcnt">'+pgcnt+'</div>';
				if(totalpages <= 3)
				{
					getid('pageholder').style.width=(totalpages*15)+'px';
				}
				getid('pageslider').style.width=(gallery.length*15)+'px';
				getid('cpage'+1).style.color="#46b4e9";
				getid('imagegalleryholderinner').style.display="block";
				loaddgpricexml();
			}
		}
	}
}
/**************  DG kblock ends***************/
/**********************Home Image Change US**********************/
function chngimg()
{
	var thedoc = new Array() 
	thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_home-4.jpg';
	thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_PGIHome3.jpg';
	
	var j = 0
	var p = thedoc.length;
	
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
	   preBuffer[i] = new Image()
	   preBuffer[i].src = thedoc[i]
	}
	
	var whichImage = Math.round(Math.random()*(p-1));
	if(getid("homeimg"))
	{
	
		getid("homeimg").src=thedoc[whichImage];
		getid("homeimg").useMap='#Map'+(whichImage+1)+'';	
	}
}

/***********Home Image change UK**********************/
function ukchngimg()
{
	if(getid("ukhomeimg"))
	{
		var thedoc = new Array() 
		thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_UK-PGIHome-v2-1.jpg';
		thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_UK-PGIHome-v2-2.jpg';
		
		var j = 0
		var p = thedoc.length;
		
		var preBuffer = new Array()
		for (i = 0; i < p; i++){
		   preBuffer[i] = new Image()
		   preBuffer[i].src = thedoc[i]
		}
		
		var whichImage = Math.round(Math.random()*(p-1));
	
		getid("ukhomeimg").src=thedoc[whichImage];
		getid("ukhomeimg").useMap='#Map'+(whichImage+1)+'';	
	}
	if(getid("ukCompanyImg"))
	{
		var thedoc = new Array() 
		thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_uk_company_1.jpg';
		thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_uk_company_2.jpg';
		
		var j = 0
		var p = thedoc.length;
		
		var preBuffer = new Array()
		for (i = 0; i < p; i++){
		   preBuffer[i] = new Image()
		   preBuffer[i].src = thedoc[i]
		}
		var whichImage = Math.round(Math.random()*(p-1));
		getid("ukCompanyImg").src=thedoc[whichImage];
		getid("ukCompanyImg").useMap='#Map'+(whichImage+1)+'';	
	}
	if(getid("ukCosmoImg"))
	{
		var thedoc = new Array() 
		thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_uk_cosmo_1.jpg';
		thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_uk_cosmo_2.jpg';
		
		var j = 0
		var p = thedoc.length;
		
		var preBuffer = new Array()
		for (i = 0; i < p; i++){
		   preBuffer[i] = new Image()
		   preBuffer[i].src = thedoc[i]
		}
		var whichImage = Math.round(Math.random()*(p-1));
		getid("ukCosmoImg").src=thedoc[whichImage];
		getid("ukCosmoImg").useMap='#Map'+(whichImage+1)+'';	
	}
	
	if(getid("ukConfettiImg"))
	{
		var thedoc = new Array() 
		thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_Final_confetti_1.jpg';
		thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_Final_confetti_2.jpg';
		
		var j = 0
		var p = thedoc.length;
		
		var preBuffer = new Array()
		for (i = 0; i < p; i++){
		   preBuffer[i] = new Image()
		   preBuffer[i].src = thedoc[i]
		}
		var whichImage = Math.round(Math.random()*(p-1));
		getid("ukConfettiImg").src=thedoc[whichImage];
		getid("ukConfettiImg").useMap='#Map'+(whichImage+1)+'';	
	}
	
	if(getid("ukMarieClaireImg"))
	{
		var thedoc = new Array() 
		thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_Marie_Claire-1.jpg';
		thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_Marie_Claire-2.jpg';
		
		var j = 0
		var p = thedoc.length;
		
		var preBuffer = new Array()
		for (i = 0; i < p; i++){
		   preBuffer[i] = new Image()
		   preBuffer[i].src = thedoc[i]
		}
		var whichImage = Math.round(Math.random()*(p-1));
		getid("ukMarieClaireImg").src=thedoc[whichImage];
		getid("ukMarieClaireImg").useMap='#Map'+(whichImage+1)+'';	
	}
}

/***********Home Image change INDIA**********************/
function inchngimg()
{
	var thedoc = new Array() 
	thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_IndiaMainImage1-2.jpg';
	thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_IndiaMainImage2-2.jpg';
	
	var j = 0
	var p = thedoc.length;
	
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
	   preBuffer[i] = new Image()
	   preBuffer[i].src = thedoc[i]
	}
	
	var whichImage = Math.round(Math.random()*(p-1));
	if(getid("inhomeimg"))
	{
	
		getid("inhomeimg").src=thedoc[whichImage];
		getid("inhomeimg").useMap='#Map'+(whichImage+1)+'';	
	}
}



/***********Home Image change ITALIA**********************/
function itchngimg()
{
	var thedoc = new Array() 
	thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_PGI-it-Home2.jpg';
	thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_PGI-it-Home3.jpg';
	
	var j = 0
	var p = thedoc.length;
	
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
	   preBuffer[i] = new Image()
	   preBuffer[i].src = thedoc[i]
	}
	
	var whichImage = Math.round(Math.random()*(p-1));
	if(getid("ithomeimg"))
	{
	
		getid("ithomeimg").src=thedoc[whichImage];
		getid("ithomeimg").useMap='#Map'+(whichImage+1)+'';	
	}
}

/***********Home Image change German(DE)**********************/
function dechngimg()
{
	var thedoc = new Array() 
	thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/DE-PGIHome1-3.jpg';
	thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/DE-PGIHome2-3.jpg';
	
	var j = 0
	var p = thedoc.length;
	
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
	   preBuffer[i] = new Image()
	   preBuffer[i].src = thedoc[i]
	}
	
	var whichImage = Math.round(Math.random()*(p-1));
	if(getid("dehomeimg"))
	{
	
		getid("dehomeimg").src=thedoc[whichImage];
		getid("dehomeimg").useMap='#Map'+(whichImage+1)+'';	
	}
}

/***********Home Image change France(Fr)**********************/
function frchngimg()
{
	var thedoc = new Array() 
	thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_PGI-fr-Home2.jpg';
	thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_PGI-fr-Home3.jpg';
	
	var j = 0
	var p = thedoc.length;
	
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
	   preBuffer[i] = new Image()
	   preBuffer[i].src = thedoc[i]
	}
	
	var whichImage = Math.round(Math.random()*(p-1));
	if(getid("frhomeimg"))
	{
	
		getid("frhomeimg").src=thedoc[whichImage];
		getid("frhomeimg").useMap='#Map'+(whichImage+1)+'';	
	}
}


/***********Home Image change JAPAN**********************/
function jachngimg()
{
	var thedoc = new Array() 
	thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_Japan1B.jpg';
	thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_Japan2B.jpg';
	
	var j = 0
	var p = thedoc.length;
	
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
	   preBuffer[i] = new Image()
	   preBuffer[i].src = thedoc[i]
	}
	
	var whichImage = Math.round(Math.random()*(p-1));
	if(getid("jahomeimg"))
	{
	
		getid("jahomeimg").src=thedoc[whichImage];
		getid("jahomeimg").useMap='#Map'+(whichImage+1)+'';	
	}
}


/***********Home Image change CHINA**********************/
function cnchngimg()
{
	var thedoc = new Array() 
	thedoc[0] = 'http://c554952.r52.cf2.rackcdn.com/Images_img_china1.jpg';
	thedoc[1] = 'http://c554952.r52.cf2.rackcdn.com/Images_img_china2.jpg';
	
	var j = 0
	var p = thedoc.length;
	
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
	   preBuffer[i] = new Image()
	   preBuffer[i].src = thedoc[i]
	}
	
	var whichImage = Math.round(Math.random()*(p-1));
	if(getid("cnhomeimg"))
	{
	
		getid("cnhomeimg").src=thedoc[whichImage];
		getid("cnhomeimg").useMap='#Map'+(whichImage+1)+'';	
	}
}


function HideDropDown()
{
    getid('drop_downlay').style.display="none";
    
}

function show_img_desc()
{   
    if(getid('drop_down1')!=null)
    {
        getid('drop_down1').style.zIndex = "0";
	    HideDropDown();
	}
    var descno='imgdesc'+Number(this.name.replace('imgs',''));
    getid(descno).style.display="block";
    var div_heightadjust=0;
    div_heightadjust=((getid(descno).innerHTML.length / 11) + 3) * 11 ;
//    var currentdiv_Height = getid(descno).style.height;
//    var div_height=0;

    
    div_height = (div_heightadjust) - ((div_heightadjust )*2); 
    div_height = div_height - 20;
    
//    if(currentdiv_Height != "")
//    {
//        currentdiv_Height= currentdiv_Height.replace("px","");
//        div_height = -currentdiv_Height; 
//        div_heightadjust=currentdiv_Height;
//        div_height = div_height - 20;    
//    }
//    else
//    {
//        div_height = (div_heightadjust) - ((div_heightadjust )*2); 
//        div_height = div_height - 20;    
//    }
    
    if(div_heightadjust > 100)
    {
        getid(descno).style.top=div_height+'px';
        getid(descno).style.height=div_heightadjust+'px';
    }
    
}                                                   
function hide_img_desc()
{   
    var descno='imgdesc'+Number(this.name.replace('imgs',''));
    getid(descno).style.display="none";
}
function hide_divs()
{
    if(countryshow == 1)
    {
        hide_country();
    }
    if(shdiv1!=1 &&  shdiv2 != 1)
    {
        if(categorydiv == 1)
        {
             catdiv=0;
             if(getid("drop_downlay"))
             {
                getid("drop_downlay").style.display="none";
             }
             else
             {
                 getid("drop_downlay0").style.display="none";
                 if(getid("drop_downlay1"))
                 {
                     getid("drop_downlay1").style.display="none";
                     getid("drop_downtxt1").style.display="block";
                     getid("drop_downbtn1").style.display="block";
                 }
             }
        }
        else
        {
           for(var k=1;k<=3;k++)
           {
                var showdivs='drop_datelay'+k;
                var showdivs1='drop_monthlay'+k;
                var showdivs2='drop_yearlay'+k;
                if(getid(showdivs))
                {
                    getid(showdivs).style.display="none";
                }
                if(getid(showdivs1))
                {
                    getid(showdivs1).style.display="none";
                }
                if(getid(showdivs2))
                {
                    getid(showdivs2).style.display="none";
                }
                if(getid('drop_datetxt3'))
                {
                    getid('drop_datetxt3').style.visibility='visible'
                    getid('drop_datebtn3').style.visibility='visible'
                    getid('drop_monthtxt3').style.visibility='visible'
                    getid('drop_monthbtn3').style.visibility='visible'
                    getid('drop_yeartxt3').style.visibility='visible'
                    getid('drop_yearbtn3').style.visibility='visible'
                }
           }
         }
    }
      if(shdiv1 == 1)
      {
        shdiv1=0;
      }
}
function show_country()
{
    countryshow=1;
	getid("drop_down").style.display='block';
	//getid("drop_down").onmouseout=hide_country;
}
function hide_country()
{
	getid("drop_down").style.display='none';
}

function getid(id)
{
	return document.getElementById(id);
}
function show_div()
{
    if(catdiv == 0)
    {
        shdiv1=1;
        categorydiv=1;
        catdiv=1;
        //alert('d1');    
        getid("drop_downlay").style.display="block";
    }
    else
    {
        catdiv=0;
         getid("drop_downlay").style.display="none";
    }
}
function show_div1()
{
   var serno=this.id.replace('drop_downtxt','');
   serno=Number(serno.replace('drop_downbtn',''));
    if(catdiv == 0)
    {
        serchids=serno;
        shdiv1=1;
        categorydiv=1;
        catdiv=1;
        //alert('d1');    
        getid("drop_downlay"+serno).style.display="block";
        if(getid("drop_downtxt"+(serno+1)))
        {
            getid("drop_downtxt"+(serno+1)).style.display="none";
            getid("drop_downbtn"+(serno+1)).style.display="none";
        }
    }
    else
    {
        catdiv=0;
         getid("drop_downlay"+serno).style.display="none";
        if(getid("drop_downtxt"+(serno+1)))
        {
            getid("drop_downtxt"+(serno+1)).style.display="block";
            getid("drop_downbtn"+(serno+1)).style.display="block";
        }
    }
}
function show_div_date()
{
   shdiv1=1;
   for(var k=1;k<=3;k++)
   {
        var showdivs='drop_datelay'+k;
        var showdivs1='drop_monthlay'+k;
        var showdivs2='drop_yearlay'+k;
        if(getid(showdivs))
        {
            getid(showdivs).style.display="none";
        }
        if(getid(showdivs1))
        {
            getid(showdivs1).style.display="none";
        }
        if(getid(showdivs2))
        {
            getid(showdivs2).style.display="none";
        }
   }

   var showno=this.id.replace('drop_datetxt','');
   showno=showno.replace('drop_datebtn','');
   txtnum=showno;
   var showdivs='drop_datelay'+showno;
   if(showdivs == 'drop_datelay2')
   {
        getid('drop_datetxt3').style.visibility='hidden';
        getid('drop_datebtn3').style.visibility='hidden';
        getid('drop_yeartxt3').style.visibility='visible';
        getid('drop_yearbtn3').style.visibility='visible';
        getid('drop_monthtxt3').style.visibility='visible';
        getid('drop_monthbtn3').style.visibility='visible';
   }
   if(showno == 3)
   {
        getid('drop_datetxt3').style.visibility='visible';
        getid('drop_datebtn3').style.visibility='visible';
        getid('drop_yeartxt3').style.visibility='visible';
        getid('drop_yearbtn3').style.visibility='visible';
        getid('drop_monthtxt3').style.visibility='visible';
        getid('drop_monthbtn3').style.visibility='visible';
   }
    //alert('d1');
    getid(showdivs).style.display="block";
}
function show_div_year()
{
    shdiv1=1;
    for(var k=1;k<=3;k++)
    {
        var showdivs='drop_datelay'+k;
        var showdivs1='drop_monthlay'+k;
        var showdivs2='drop_yearlay'+k;
        if(getid(showdivs))
        {
            getid(showdivs).style.display="none";
        }
        if(getid(showdivs1))
        {
            getid(showdivs1).style.display="none";
        }
        if(getid(showdivs2))
        {
            getid(showdivs2).style.display="none";
        }
   }

   var showno=this.id.replace('drop_yeartxt','');
   showno=showno.replace('drop_yearbtn','');
   var showdivs='drop_yearlay'+showno;
   txtnum=showno;
   if(showdivs == 'drop_yearlay2')
   {
        getid('drop_yeartxt3').style.visibility='hidden';
        getid('drop_yearbtn3').style.visibility='hidden';
        getid('drop_datetxt3').style.visibility='visible';
        getid('drop_datebtn3').style.visibility='visible';
        getid('drop_monthtxt3').style.visibility='visible';
        getid('drop_monthbtn3').style.visibility='visible';
   }
   if(showno == 3)
   {
        getid('drop_datetxt3').style.visibility='visible';
        getid('drop_datebtn3').style.visibility='visible';
        getid('drop_yeartxt3').style.visibility='visible';
        getid('drop_yearbtn3').style.visibility='visible';
        getid('drop_monthtxt3').style.visibility='visible';
        getid('drop_monthbtn3').style.visibility='visible';
   }
    //alert('d1');
    getid(showdivs).style.display="block";
}
function show_div_month()
{
   shdiv1=1;
   for(var k=1;k<=3;k++)
   {
        var showdivs='drop_datelay'+k;
        var showdivs1='drop_monthlay'+k;
        var showdivs2='drop_yearlay'+k;
        if(getid(showdivs))
        {
            getid(showdivs).style.display="none";
        }
        if(getid(showdivs1))
        {
            getid(showdivs1).style.display="none";
        }
        if(getid(showdivs2))
        {
            getid(showdivs2).style.display="none";
        }
   }
    var showno=this.id.replace('drop_monthtxt','');
    
  
   showno=showno.replace('drop_monthbtn','');
   txtnum=showno;
   var showdivs='drop_monthlay'+showno;
   if(showdivs == 'drop_monthlay2')
   {
        getid('drop_monthtxt3').style.visibility='hidden'
        getid('drop_monthbtn3').style.visibility='hidden'
        getid('drop_datetxt3').style.visibility='visible';
        getid('drop_datebtn3').style.visibility='visible';
        getid('drop_yeartxt3').style.visibility='visible';
        getid('drop_yearbtn3').style.visibility='visible';
   }
   if(showno == 3)
   {
        getid('drop_datetxt3').style.visibility='visible';
        getid('drop_datebtn3').style.visibility='visible';
        getid('drop_yeartxt3').style.visibility='visible';
        getid('drop_yearbtn3').style.visibility='visible';
        getid('drop_monthtxt3').style.visibility='visible';
        getid('drop_monthbtn3').style.visibility='visible';
   }
    //alert('d1');
    getid(showdivs).style.display="block";
}

function printpage()
{
    window.print();
}
function sel_text()
{
    
    getid("drop_downlay").style.display="none";
    getid("drop_downtxt").innerHTML=this.innerHTML;
    if(navigator.userAgent.indexOf('safari') != -1 || navigator.userAgent.indexOf('Safari') != -1 || navigator.userAgent.indexOf('MSIE 8') != -1)
    {
        var selval=this.value;
    }
    else
    {
        if(this.tabIndex)
        {
            var selval=this.tabIndex;
        }
        else
        {
            var selval=this.tabindex;
        }
    }
    if(selval == -1 || selval=='0')
    {
        selval='';
    }
    var divs = document.getElementsByTagName("input");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
        thisDiv = divs[i];
        if (thisDiv.className == 'hiddentxt')
        {
            
            if(thisDiv.id.indexOf('txtNewsCategory') != -1)
            {
                if(this.innerHTML == 'Select category' || this.innerHTML == 'Select Publication')
                {
                    getid(thisDiv.id).value='';
                }
                else
                {
                    getid(thisDiv.id).value=selval;
                }
            }
            if(thisDiv.id.indexOf('txtNewsCategory1') != -1)
            {
                if(this.innerHTML == 'Select category' || this.innerHTML == 'Select Publication')
                {
                    getid(thisDiv.id).value='';
                }
                else
                {
                    getid(thisDiv.id).value=this.innerHTML;
                }
            }
            if(thisDiv.id.indexOf('txtPressCategory') != -1)
            {
                if(this.innerHTML == 'Select category')
                {
                    getid(thisDiv.id).value='';
                }
                else
                {
                    getid(thisDiv.id).value=selval;
                }
            }
            if(thisDiv.id.indexOf('txtPressCategory1') != -1)
            {
                if(this.innerHTML == 'Select category')
                {
                    getid(thisDiv.id).value='';
                }
                else
                {
                    getid(thisDiv.id).value=this.innerHTML;
                }
            }                            
        }
    }
//    alert(getid("ctl00_IntroTextPlaceHolder1_ctl00_txtNewsCategory").value); 
//alert(postb);
    if(postb == 1)
    {
        //document.aspnetForm.submit();
        __doPostBack('advertisearchive',selval)
    }
}
var serchids=0;
function sel_text1()
{
    
    getid("drop_downlay"+serchids).style.display="none";
    getid("drop_downtxt"+serchids).innerHTML=this.innerHTML;
    if(navigator.userAgent.indexOf('safari') != -1 || navigator.userAgent.indexOf('Safari') != -1 || navigator.userAgent.indexOf('MSIE 8') != -1)
    {
        var selval=this.value;
    }
    else
    {
        if(this.tabIndex)
        {
            var selval=this.tabIndex;
        }
        else
        {
            var selval=this.tabindex;
        }
    }
    if(selval == -1 || selval=='0')
    {
        selval='';
    }
    var divs = document.getElementsByTagName("input");

    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
        thisDiv = divs[i];
        if (thisDiv.className == 'hiddentxt')
        {   
            if(serchids == '0')
            {
                if(thisDiv.id.indexOf('textsearchno0') != -1)
                {
                    if(selval == '' || selval == '0')
                    {
                        getid(thisDiv.id).value='';
                    }
                    else
                    {
                        getid(thisDiv.id).value=selval;
                    }
                }
                if(thisDiv.id.indexOf('textsearchname0') != -1)
                {
                    getid(thisDiv.id).value=this.innerHTML;

                }
            }
            else
            {
                if(thisDiv.id.indexOf('textsearchno1') != -1)
                {
                    if(selval == '' || selval == '0')
                    {
                        getid(thisDiv.id).value='';
                    }
                    else
                    {
                        getid(thisDiv.id).value=selval;
                    }
                }
                if(thisDiv.id.indexOf('textsearchname1') != -1)
                {
                    getid(thisDiv.id).value=this.innerHTML;
                }
            }
        }
        
    }
}

function sel_month()
{
    getid("drop_monthlay"+txtnum).style.display="none";
    getid("drop_monthtxt"+txtnum).value=this.innerHTML;
    var divs = document.getElementsByTagName("input");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
        thisDiv = divs[i];
        if (thisDiv.className == 'hiddentxt')
        {
            if(thisDiv.id.indexOf('hdnmonth'+txtnum) != -1)
            {
                getid(thisDiv.id).value=this.id;
            }
            if(thisDiv.id.indexOf('hdnmonthname'+txtnum) != -1)
            {
                getid(thisDiv.id).value=this.innerHTML;
            }	                
        }
    }
    if(txtnum == 2)
    {
        getid('drop_datetxt3').style.visibility='visible';
        getid('drop_datebtn3').style.visibility='visible';
        getid('drop_monthtxt3').style.visibility='visible';
        getid('drop_monthbtn3').style.visibility='visible';
        getid('drop_yeartxt3').style.visibility='visible';
        getid('drop_yearbtn3').style.visibility='visible';
    }
    //getid("ctl00_ContentPlaceHolder1_ctl00_hdnmonth").value=this.innerHTML;
    check_month(txtnum);
}
function sel_year()
{
    getid("drop_yearlay"+txtnum).style.display="none";
    getid("drop_yeartxt"+txtnum).value=this.innerHTML;
    var divs = document.getElementsByTagName("input");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
        thisDiv = divs[i];
        if (thisDiv.className == 'hiddentxt')
        {
            if(thisDiv.id.indexOf('hdnyear'+txtnum) != -1)
            {
                getid(thisDiv.id).value=this.id;
            }
            if(thisDiv.id.indexOf('hdnyearname'+txtnum) != -1)
            {
                getid(thisDiv.id).value=this.innerHTML;
            }                
        }
    }
    if(txtnum == 2)
    {
        getid('drop_datetxt3').style.visibility='visible';
        getid('drop_datebtn3').style.visibility='visible';
        getid('drop_monthtxt3').style.visibility='visible';
        getid('drop_monthbtn3').style.visibility='visible';
        getid('drop_yeartxt3').style.visibility='visible';
        getid('drop_yearbtn3').style.visibility='visible';
    }
   // getid("ctl00_ContentPlaceHolder1_ctl00_hdnyear").value=this.innerHTML;
    check_year(txtnum);
    
}
function sel_date()
{    
    getid("drop_datelay"+txtnum).style.display="none";
    getid("drop_datetxt"+txtnum).value=this.innerHTML;
    var divs = document.getElementsByTagName("input");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
        thisDiv = divs[i];
        if (thisDiv.className == 'hiddentxt')
        {
            if(thisDiv.id.indexOf('hdndate'+txtnum) != -1)
            {
                getid(thisDiv.id).value=this.id;
            }
            if(thisDiv.id.indexOf('hdndatename'+txtnum) != -1)
            {
                getid(thisDiv.id).value=this.innerHTML;
            }	                
        }
    }
    if(txtnum == 2)
    {
        getid('drop_datetxt3').style.visibility='visible';
        getid('drop_datebtn3').style.visibility='visible';
        getid('drop_monthtxt3').style.visibility='visible';
        getid('drop_monthbtn3').style.visibility='visible';
        getid('drop_yeartxt3').style.visibility='visible';
        getid('drop_yearbtn3').style.visibility='visible';
    }
    //getid("ctl00_ContentPlaceHolder1_ctl00_hdndate").value=this.innerHTML;
    check_date(txtnum);
}
function check_date(no)
{
    var divs = document.getElementsByTagName("input");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
        thisDiv = divs[i];
        if (thisDiv.className == 'hiddentxt')
        {
            if(thisDiv.id.indexOf("hdndate"+no) != -1)
            {
                var dateval=thisDiv.value;
            }
            if(thisDiv.id.indexOf("hdnmonth"+no) != -1)
            {
                var monthval=thisDiv.value;
            }
            if(thisDiv.id.indexOf("hdnyear"+no) != -1)
            {
                var yearval=thisDiv.value;
            }
        }
    }
    if(monthval != '' && monthval != '0' && monthval != '1' && monthval != '3' && monthval != '5' && monthval != '7' && monthval != '8' && monthval != '10' && monthval != '12')
    {
        if(dateval == '31')
        {
            getid("drop_datetxt"+no).value=cdate[0];
            var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdndate'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
            shdiv1=1;
            getid("drop_datelay"+no).style.display="block";
            if(no == 2)
            {
                getid('drop_datetxt3').style.visibility='hidden'
                getid('drop_datebtn3').style.visibility='hidden'
            }
        }
        if(dateval == '30' || dateval == '31' && monthval == '2')
        {
            getid("drop_datetxt"+no).value=cdate[0];
            var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdndate'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
            shdiv1=1;
            getid("drop_datelay"+no).style.display="block";
            if(no == 2)
            {
                getid('drop_datetxt3').style.visibility='hidden'
                getid('drop_datebtn3').style.visibility='hidden'
            }
                       
        }
        if(dateval == '29' && monthval == '2' && yearval!='0')
        {
            var checkyear=yearval/4;
            checkyear=checkyear+'';
            if(checkyear.indexOf('.') != -1)
            {
                getid("drop_datetxt"+no).value=cdate[0];
               var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {

                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdndate'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
                shdiv1=1;
                getid("drop_datelay"+no).style.display="block";
                if(no == 2)
                {
                    getid('drop_datetxt3').style.visibility='hidden'
                    getid('drop_datebtn3').style.visibility='hidden'
                }
            } 
                       
        }
        
    }
   if(yearval != "0" && monthval != "0" && no == 1)
    {
        if(yearval == (tdate.getFullYear()) && monthval == m_names[tdate.getMonth()])
        {
            if(dateval >= tdate.getDate())
            {
                getid("drop_datetxt"+no).value=cdate[0];
                var divs = document.getElementsByTagName("input");
                var len = divs.length;
                var thisDiv;
                for (var i = 0; i < len; i++)
                {
                    thisDiv = divs[i];
                    if (thisDiv.className == 'hiddentxt')
                    {
                        if(thisDiv.id.indexOf('hdndate'+no) != -1)
                        {
                            getid(thisDiv.id).value='';                
                        }	                
                    }
                }
                shdiv1=1;
                getid("drop_datelay"+no).style.display="block";
                if(no == 2)
                {
                    getid('drop_datetxt3').style.visibility='hidden'
                    getid('drop_datebtn3').style.visibility='hidden'
                }
            }
        }
        
    }
}
function check_month(no)
{
    var divs = document.getElementsByTagName("input");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
        thisDiv = divs[i];
        if (thisDiv.className == 'hiddentxt')
        {
            if(thisDiv.id.indexOf("hdndate"+no) != -1)
            {
                var dateval=thisDiv.value;
            }
            if(thisDiv.id.indexOf("hdnmonth"+no) != -1)
            {
                var monthval=thisDiv.value;
            }
            if(thisDiv.id.indexOf("hdnyear"+no) != -1)
            {
                var yearval=thisDiv.value;
            }
        }
    }
    if(dateval == '31')
    {
        if(monthval != '1' && monthval != '3' && monthval != '5' && monthval != '7' && monthval != '8' && monthval != '10' && monthval != '12')
        {
             getid("drop_monthtxt"+no).value=cmonth[0];
             var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdnmonth'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
            // getid(monthtextfield).value='';
             shdiv2=1;
             getid("drop_monthlay"+no).style.display="block";
             if(no == 2)
            {
                getid('drop_monthtxt3').style.visibility='hidden'
                getid('drop_monthbtn3').style.visibility='hidden'
            }
        }
        
    }
    if(dateval == '30' || dateval == '31' && yearval=='0')
    {
        if(monthval == '2')
        {
             getid("drop_monthtxt"+no).value=cmonth[0];
             var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdnmonth'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
             shdiv2=1;
             getid("drop_monthlay"+no).style.display="block";
             if(no == 2)
            {
                getid('drop_monthtxt3').style.visibility='hidden'
                getid('drop_monthbtn3').style.visibility='hidden'
            }
        }
        
    }
    if(dateval == '29' && yearval!='0')
    {
        if(monthval == '2')
        {
            var checkyear=yearval/4;
            checkyear=checkyear+'';
            if(checkyear.indexOf('.') != -1)
            {
                 getid("drop_monthtxt"+no).value=cmonth[0];
                 var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdnmonth'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
                 shdiv2=1;
                 getid("drop_monthlay"+no).style.display="block"; 
                 if(no == 2)
                {
                    getid('drop_monthtxt3').style.visibility='hidden'
                    getid('drop_monthbtn3').style.visibility='hidden'
                }
            }
        }
        
    }
    if(yearval >= (tdate.getFullYear()) && no == 1)
    {
       if(getmonthnum(monthval) > tdate.getMonth())
        {
            getid("drop_monthtxt"+no).value=cmonth[0];
            var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdnmonth'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
            shdiv2=1;
            getid("drop_monthlay"+no).style.display="block";
            if(no == 2)
            {
                getid('drop_monthtxt3').style.visibility='hidden'
                getid('drop_monthbtn3').style.visibility='hidden'
            }
        } 
        
    }
    if(yearval >= (tdate.getFullYear()) && dateval >= tdate.getDate() && no == 1)
    {
        if(monthval == m_names[tdate.getMonth()] || getmonthnum(monthval) >= tdate.getMonth())
        {
            getid("drop_monthtxt"+no).value=cmonth[0];
            var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdnmonth'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
            shdiv2=1;
            getid("drop_monthlay"+no).style.display="block";
            if(no == 2)
            {
                getid('drop_monthtxt3').style.visibility='hidden'
                getid('drop_monthbtn3').style.visibility='hidden'
            }
        }
        
    }
}
function getmonthnum(monthname)
{
    var chknum=0;
    for(var i=0;i<=11;i++)
    {
        if(m_names[i] == monthname)
        {
            var monnum=i++;
        }
    }
    return monnum;
}
function check_year(no)
{
    var divs = document.getElementsByTagName("input");
    var len = divs.length;
    var thisDiv;
    for (var i = 0; i < len; i++)
    {
        thisDiv = divs[i];
        if (thisDiv.className == 'hiddentxt')
        {
            if(thisDiv.id.indexOf("hdndate"+no) != -1)
            {
                var dateval=thisDiv.value;
            }
            if(thisDiv.id.indexOf("hdnmonth"+no) != -1)
            {
                var monthval=thisDiv.value;
            }
            if(thisDiv.id.indexOf("hdnyear"+no) != -1)
            {
                var yearval=thisDiv.value;
            }
        }
    }
    if(dateval == '29' && monthval == '2')
    {
        var checkyear=yearval/4;
        checkyear=checkyear+'';
        if(checkyear.indexOf('.') != -1)
        {
             getid("drop_yeartxt"+no).value=cyear[0];
             var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdnyear'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
             shdiv1=1;
             getid("drop_yearlay"+no).style.display="block"; 
        }
        if(no == 2)
        {
            getid('drop_yeartxt3').style.visibility='hidden'
            getid('drop_yearbtn3').style.visibility='hidden'
        }
    }

    if(getmonthnum(monthval) > tdate.getMonth() && no == 1)
    {
        if(yearval >= (tdate.getFullYear()))
        {
            getid("drop_yeartxt"+no).value=cyear[0];
           var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdnyear'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
            shdiv1=1;
            getid("drop_yearlay"+no).style.display="block";
        }
        if(no == 2)
                {
                    getid('drop_yeartxt3').style.visibility='hidden'
                            getid('drop_yearbtn3').style.visibility='hidden'
                }
    }
    if(yearval > (tdate.getFullYear()) && no == 1)
    {
        getid("drop_yeartxt"+no).value=cyear[0];
        var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdnyear'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
        shdiv1=1;
        getid("drop_yearlay"+no).style.display="block";
        if(no == 2)
                {
                    getid('drop_yeartxt3').style.visibility='hidden'
                            getid('drop_yearbtn3').style.visibility='hidden'
                }
    }
    if(dateval >= tdate.getDate() && getmonthnum(monthval) >= tdate.getMonth() && no == 1)
    {
        if(yearval >= (tdate.getFullYear()))
        {
            getid("drop_yeartxt"+no).value=cyear[0];
            var divs = document.getElementsByTagName("input");
            var len = divs.length;
            var thisDiv;
            for (var i = 0; i < len; i++)
            {
                thisDiv = divs[i];
                if (thisDiv.className == 'hiddentxt')
                {
                    if(thisDiv.id.indexOf('hdnyear'+no) != -1)
                    {
                        getid(thisDiv.id).value='';                
                    }	                
                }
            }
            shdiv1=1;
            getid("drop_yearlay"+no).style.display="block";
        }
        if(no == 2)
                {
                    getid('drop_yeartxt3').style.visibility='hidden'
                            getid('drop_yearbtn3').style.visibility='hidden'
                }
    }
}


/*******************Retaiiler formopen***************************/

function showFdForm()
{
    if(document.getElementById('fdForm').style.display!='block')
    {
        var lblMsg = document.getElementById('ctl00_ContentPlaceHolder1_ctl00_ucFeedback1_lblMsg');
        var lblMsg_textnode = lblMsg.firstChild;
        if(lblMsg.firstChild != null)
            lblMsg_textnode.data = "";

       
        var lblValidation = document.getElementById('ctl00_ContentPlaceHolder1_ctl00_ucFeedback1_validationsummary');
        
        var lblValidation_textnode = lblValidation.firstChild;
        if(lblValidation.firstChild != null)
            lblValidation_textnode.data = "";
        if(lblValidation.secondChild != null)
            lblValidation_textnode.data = "";
        if(lblValidation.thirdChild != null)
            lblValidation_textnode.data = "";
            
        document.getElementById('ctl00_ContentPlaceHolder1_ctl00_ucFeedback1_txtName').value="";
        document.getElementById('ctl00_ContentPlaceHolder1_ctl00_ucFeedback1_txtEmail').value="";
        document.getElementById('ctl00_ContentPlaceHolder1_ctl00_ucFeedback1_txtComments').value="";

        document.getElementById('ctl00_ContentPlaceHolder1_ctl00_ucFeedback1_validationsummary').innerHTML = '';

        document.getElementById('fdForm').style.display='block';
        document.getElementById('arr').className='arrDown';
    }
    else
    {
        document.getElementById('fdForm').style.display='none';
        document.getElementById('arr').className='arr';
    }
}
function showFdFormMsg(){
	 document.getElementById('fdForm').style.display='block';
 document.getElementById('arr').className='arrDown';
}

/*******************Design Gallery Image*************************************************/

function show_image()
{
    getid('DesignOuterContainer').style.display="block";
}


function hide_image()
{
    getid('DesignOuterContainer').style.display="none";
}



/******************************Inspir page*****************************************************/

function insp_show_image()
{
    
    getid('insp').className="insp";
}


function insp_hide_image()
{
    getid('insp').className="";
}


/***************************************Home Flash popup**************************************/

var intervalN;
var pdsDiff=102;
function move(psn,dsc){
 psn=psn%714;
 psn=Number(psn)+37;
 if(dsc!=0){
     if(document.getElementById('flashPopup').style.display!='block'){
      document.getElementById('flashPopup').style.display='block';
     }
     document.getElementById('flashPopup').style.top='-63px';
     document.getElementById('flashPopup').style.left=psn+'px';
     document.getElementById('flashPopup').innerHTML=dsc;
     anim(5);
 }
 else
 {
    document.getElementById('flashPopup').style.display = 'none';
 }
}
function anim(j){
 clearInterval(intervalN);
 if(j<100){
  document.getElementById("flashPopup").style.opacity=j/100;
  document.getElementById("flashPopup").style.MozOpacity=j/100;
  document.getElementById("flashPopup").style.KhtmlOpacity=j/100;
  document.getElementById("flashPopup").style.filter="alpha(opacity="+j+ ")";
  j=j+2;
  j++;
  intervalN=setTimeout('anim('+j+')',10);
 }
/* 
 document.getElementById("flashPopup").style.opacity=1;
 document.getElementById("flashPopup").style.MozOpacity=1;
 document.getElementById("flashPopup").style.KhtmlOpacity=1;
 document.getElementById("flashPopup").style.filter="alpha(opacity="+100+ ")";
 document.getElementById("flashPopup").style.color="#ffffff"
*/
}

/*********Flash Height*************/

function thisMovie(movieName){
    if (navigator.appName.indexOf("Microsoft") != -1){
        return document.getElementById(movieName);
    }else{  
        return document[movieName]  
    }
}
function adjustHeight(val)
{
    if((Number(val)+50)>595)
    {
        if(thisMovie("designGalleryAll").height<Number(val)+50)
        {
            thisMovie("designGalleryAll").height=Number(val)+50;
        }
        if(thisMovie("dreamlistAll")!=null)
        {
            if(thisMovie("dreamlistAll").height<Number(val)+50)
            {
                thisMovie("dreamlistAll").height=Number(val)+50;
            }
        }
        if(thisMovie("priceRange")!=null)
        {
            if(thisMovie("priceRange").height < Number(val)+50)
            {
                thisMovie("priceRange").height= Number(val)+50;
            }
        }
    }
    else
    {
        if(thisMovie("designGalleryAll").height<Number(val)+50)
        {
            thisMovie("designGalleryAll").height=595;
        }
        if(thisMovie("dreamlistAll")!=null)
        {
            if(thisMovie("dreamlistAll").height<Number(val)+50)
            {
                thisMovie("dreamlistAll").height=595;
            }
        }
        if(thisMovie("priceRange")!=null)
        {
            if(thisMovie("priceRange").height<Number(val)+50)
            {
                thisMovie("priceRange").height=595;
            }
        }
        
    }
}
function closeFlash()
{
	getid('imgid').innerHTML='';
	getid('layer').style.visibility="hidden";
	getid('cover').style.display="none";
}
function makeajaxcall()
{
	var xhr = createXMLHttpRequest();
	xhr.onreadystatechange = function()
	{
		if (xhr.readyState==4)
		{ // Request is finished
			if (xhr.status==200)
			{
				var anagramsCSV = xhr.responseText;
				getid('imgid').innerHTML=anagramsCSV;
			}
		}
	}
	xhr.open("GET", ajaxlink, true);
	xhr.send(null);
}
function createXMLHttpRequest()
{
      try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
      try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
      try { return new XMLHttpRequest(); } catch(e) {}
      alert("XMLHttpRequest not supported");
      return null;
}

/***********New Window***********************/

function open_win(url_add)
{
    window.open(url_add,'welcome', 'width=675,height=460,menubar=no,status=no, location=no,toolbar=no,scrollbars=no');
}

function setRegion(flashId)
{
    __doPostBack('retailersearch',flashId);
}
