    
    var delayProdOverLay=null;
    
    function ShowProcessing(varDisplayMessage) {
    
         YAHOO.namespace("example.container");
            
        if (YAHOO.example.container.wait== null) {
            
            // Initialize the temporary Panel to display while waiting for external content to load

            YAHOO.example.container.wait = 
                    new YAHOO.widget.Panel("wait",  
                                                    { width: "240px", 
                                                      fixedcenter: true, 
                                                      close: false, 
                                                      draggable: false, 
                                                      zindex:4,
                                                      modal: true,
                                                      visible: false,
                                                      height: "1px"
                                                    } 
                                                );
    
            YAHOO.example.container.wait.setHeader(varDisplayMessage);            
            YAHOO.example.container.wait.setBody("<img src=\""+ YUICommonPath + "/images/rel_interstitial_loading.gif\"/>");
            YAHOO.example.container.wait.render(document.body);
            
        }
        

        // Define the callback object for Connection Manager that will set the body of our content area when the content has loaded

        // Show the Panel
        YAHOO.example.container.wait.setHeader(varDisplayMessage);
        YAHOO.example.container.wait.show();
    }
    
    function StopProcessing()
    {
            try
            {                
                
                YAHOO.example.container.wait.hide();
                
                if(document.getElementById("lblAddwishlistmsg")!=null)
                    document.getElementById("lblAddwishlistmsg").innerHTML = '';
                    
             }
             catch(ex)
             { }
    }

   
      

//XML HTTP Request
function postRequest(url)
{
    var response=false;
    var xmlHttp = null;

    try{
	        xmlHttp=new XMLHttpRequest();
	        response=true;      
        }      
        catch(e)
        {      
            try {
                    xmlHttp = doCreateObject();
                    response=true;  
            }        
            catch(e)
            {
                response = false;  
            }
        }
        
            if(response && xmlHttp!=null)
            {   
                xmlHttp.open("GET", url, true);
                var responsetext="";
                xmlHttp.onreadystatechange = 
		                function ()
		                {
			                if (xmlHttp.readyState == 4)
			                {
				               responsetext = xmlHttp.responseText;
                							
			                }
		                }
            		    
	                xmlHttp.send(null);		 
        	        var b2bMode=null;
        	        var isUserLoggedIn=null;
        	        var RedirectURL=null;
        	        
        	        try
        	        {  
        	          
        	            if(document.getElementById("hdnB2BModeValue")!=null)
	                        b2bMode = document.getElementById("hdnB2BModeValue").value;	                
	                    else
	                        b2bMode = parent.document.getElementById("hdnB2BModeValue").value;	                
	                      
	                     if(document.getElementById("hdnCheckIsUserRegistered")!=null)   
	                           isUserLoggedIn = document.getElementById("hdnCheckIsUserRegistered").value;
	                     else
	                           isUserLoggedIn = parent.document.getElementById("hdnCheckIsUserRegistered").value;
	                        
                        if(document.getElementById("hdnGetRedirectURL")!=null)
                            RedirectURL = document.getElementById("hdnGetRedirectURL").value;
                         else
                            RedirectURL = parent.document.getElementById("hdnGetRedirectURL").value;                        
                        
                    }
                    catch(ex)
                    {
                       
                    }
                    
                    if(b2bMode!=null && isUserLoggedIn!=null)
                        setTimeout("B2BLoginVerification('"+b2bMode+"','"+isUserLoggedIn+"','"+RedirectURL+"')",1000);
        	           
            } 
    
}

function B2BLoginVerification(b2bMode,isUserLoggedIn, RedirectURL)
{
    if(b2bMode.toLowerCase()=="true" && isUserLoggedIn.toLowerCase()=="false")
    {                           
            if(RedirectURL!=null)
            {
                RedirectURL = RedirectURL.replace("~/","../");
                 if(Minitemplate==true) 
                    {
                        parent.window.location.href = RedirectURL;
                    }
                 else
                    {
                        window.location.href = RedirectURL;
                    }
                        
                return false;
            }
    }    
}  

function doCreateObject()
{
    var i = 0;
    var msxmls = new Array(
      'Msxml2.XMLHTTP.5.0',
      'Msxml2.XMLHTTP.4.0',
      'Msxml2.XMLHTTP.3.0',
      'Msxml2.XMLHTTP',
      'Microsoft.XMLHTTP');
      
    for (i = 0; i < msxmls.length; i++) 
    {      
          try {
            return new ActiveXObject(msxmls[i]);
          } 
          catch (e) { }
    }
}
 function ClosePopup()
{ 
ShowFlag=false;
   if(parent.prdoverlay!=null)
   {
        parent.prdoverlay.hide();
   }
   parent.document.getElementById("ipopup").height="0px";
   parent.document.getElementById("ipopup").src="../iframe.html"; 
}

var ShowFlag=false;
function LoadMiniProduct(Link)
{
   ShowFlag=true;
   delayProdOverLay = setTimeout("LoadDetails('"+ Link +"')",1000);
}

function UnLoadMiniProducts()
{
    if(delayProdOverLay!=null)
    {
        clearTimeout(delayProdOverLay);
        ShowFlag=false;
    }
}

function LoadDetails(Link)
{
   if( ShowFlag==true)
   {
   parent.prdoverlay = new YAHOO.widget.Overlay("ProductPopup", { fixedcenter:true,visible:false,zIndex:100,constraintoviewport: true, draggable:true,width:"500px",height:"700px"} );   
   //ShowProcessing('Quick view loading, please wait...');
   if(parent.prdoverlay!=null)
   {
       parent.prdoverlay.setBody("<iframe name='ipopup' frameborder='0' allowtransparency='true' SCROLLING=NO id='ipopup'> </iframe>");   
       parent.prdoverlay.render(document.body);    
       document.getElementById("ipopup").src=Link;
       document.getElementById("ipopup").style.height=document.getElementById('ProductPopup').clientHeight+"px";
       document.getElementById("ipopup").style.width=document.getElementById('ProductPopup').clientWidth+"px";   
       YAHOO.util.Event.onDOMReady(function()
       {
         parent.prdoverlay.show();         
       }
       );
       
   }
   }
   return false;
}
function OffPopup()
{
    UnLoadMiniProducts();
}
function LoadUrl(Url)
{
    parent.document.location.href=Url;
}
