﻿/*-------------------------------------------------------------------         
        Description			    :	 EsComponents.js 
        Create on			    :    13-02-2009
        Initial Code Created    :    Sathish.M
--------------------------------------------------------------------*/
//Call EStore Handlers
function funCallHandler(HandlerName)
{   
    try
    {    
        new Ajax.Request(HandlerName,
        {
            method   : 'get',
            onSuccess: funOnSuccess,            
            onFailure: funOnFailure
        });
    }
    catch(e)
    {
        alert('@ funCallHandler');       
    }
}
//On Success     
function funOnSuccess(originalRequest)
{   
    arrResponse=new Array();
    var orgRegText='';
    try
    {  
        arrResponse=originalRequest.responseText.split('|');
        if(arrResponse.length>0)
        {
            $('dvResult').innerHTML='';
            $('dvResult').innerHTML=arrResponse[0];
            if($('hdnSiteMap')!=null)
            {
                $('lblSiteMap').innerHTML=$F('hdnSiteMap');
                $('lblCtgDesc').innerHTML=$F('hdn3rdLvlDesc');                
            } 
            if($('hdnPrdDesc')!=null)
                $('h1PrdName').innerHTML=$F('hdnPrdDesc')
                
            switch($('dvResult').innerHTML)
            {   
                case 'Processing Wish List...':
                    window.location=$F('hdnAppPath')+'wish-list.html';
                break;
                case 'Processing Add to Cart...':
                    switch(arrResponse[1])
                    {
                        case 'Gen':
                            if($('hdnUsrId').value!=0)
                               window.location=$F('hdnAppPath')+'ViewCart.aspx';
                            else
                               window.location=$F('hdnAppPath')+'UsrLogin.aspx?mode=nomsrmnt';            
                        break;
                        case 'SA':
                        if($('hdnUsrId').value!=0)
                            //Redirection occures automatically to ViewCart.aspx if all the
                            //measurement flags are set to 'N' else it will move to MsrMntPg.aspx  
                            window.location=$F('hdnAppPath')+'MsrMntPg.aspx?'+arrResponse[2];  
                        else if($('hdnUsrId').value==0)
                            window.location=$F('hdnAppPath')+'UsrLogin.aspx?mode=samsrmnt&url=' + arrResponse[3];
                        break;  
                        case 'SL':
                        case 'GH':
                        case 'KR':
                        case 'SH':
                        case 'SU':
                        if($('hdnUsrId').value!=0)
                            window.location=$F('hdnAppPath')+'MsrMntPg.aspx?'+arrResponse[2];  
                        else if($('hdnUsrId').value==0)
                            window.location=$F('hdnAppPath')+'UsrLogin.aspx?mode=othrmsrmnt&url=' + arrResponse[3];
                        break;   
                    }
                break;                   
            }      
        }
    }
    catch(e)
    {
        //alert('@ funOnSuccess');       
    }         
}
//On Failure 
function funOnFailure(originalRequest)
{
    try
    {
        alert(originalRequest.responseText);
    }
    catch(e)
    {
        alert('@ funOnFailure');            
    }
}

//Change cursor style as hand symbol on mouse over
function funCursorStyle(CtrlId)
{
    try
    {
        $(CtrlId).style.cursor='pointer';
    }
    catch(e)
    {
        alert('@ funCursorStyle');            
    }
}

//Below functions are used to Pop up
function getBrowserSize() 
{
    try
    {
        var myWidth=0, myHeight=0;
	    if( typeof( window.innerWidth ) == 'number' ) 
	    {
		    /*Non-IE*/
            myWidth = screen.width;
            myHeight = screen.height-170;
	    } 
	    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	    {
		    /*IE 6+ in 'standards compliant mode'*/
		    myWidth = document.documentElement.clientWidth;
		    myHeight = document.documentElement.clientHeight;
	    } 
	    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	    {
		    /*IE 4 compatible*/
		    myWidth = document.body.clientWidth;
		    myHeight = document.body.clientHeight;
	    }
	    return new Array(myWidth, myHeight);
    }
    catch(e)
    {
        alert('@ getBrowserSize');
    }		
}
function revealElement(elementID) 
{ 
    try
    {
        var element = document.getElementById(elementID);
	    if (element != null) 
	    {
		    element.style.display = "block";
		    browserSize = getBrowserSize();
		    element.style.position = "absolute";
		    var lft = (browserSize[0]/2) - (element.offsetWidth/2);
		    var tp = browserSize[1]/1 - element.offsetHeight/1;
		    element.style.left= lft+'px';
		    element.style.top= tp+'px';
	    }
    }
    catch(e)
    {
        alert('@ revealElement');
    }
}


/// Products Page User Login 


function funUsrLoginCallHandler(HandlerName)
    {   
        try
        { 
            new Ajax.Request(HandlerName,
            {
                method   : 'get',
                onSuccess: funUsrLoginOnSuccess,            
                onFailure: funUsrLoginOnFailure
            });
        }
        catch(e)
        {
            alert('@ funUsrLoginCallHandler');       
        }
    }
        
    function funUsrLoginOnSuccess(originalRequest)
    {   
        try
        {   
            if(originalRequest.responseText!='Y')
                alert(originalRequest.responseText);
            else
            {
                $('dvLogin').hide();  
                if($('hdnPageName')!=null && $F('hdnPageName')=='Products')
                    window.location=location.href;
                else if($('hdnPageName')==null)
                    window.location=location.href;   
            }
        }
        catch(e)
        {
            alert('@ funUsrLoginOnSuccess');       
        }         
    }

    function funUsrLoginOnFailure(originalRequest)
    {   
        var Err;
        try
        {
            Err=originalRequest.responseText;
        }
        catch(e)
        {
            alert('@ funUsrLoginOnFailure');            
        }
    }
    function funChkLogin()
    {
      try
      {      
      var ErrMsg='',qStr='';      
      if($('txtLogin').value=='')    
         ErrMsg='\n Login-ID Missing/Invalid';
      if($('txtPwd').value=='')
         ErrMsg=ErrMsg + '\n Password';    
      if(ErrMsg!='')
      {  
        alert('Please submit the below required details.\r\n-------------------------------------------------\r'+ErrMsg);                      
        return false;            
      }
      else
      {
           qStr='login|';  
           if($('chRememberMe').checked==true)
                qStr=qStr+'1|';
           else if($('chRememberMe').checked==false)
                qStr=qStr+'0|';
           qStr=qStr+$F('txtLogin')+'|';
           qStr=qStr+$F('txtPwd')+'|';
           funUsrLoginCallHandler($F('hdnAppPath')+'GenetricHandler/ProductDetails.ashx?qStr='+qStr);
           return true;         
      }
      }
      catch(e)
      {
        alert('@ funChkLogin');
      }
    } 
    
    function funRevwPrdCallHandler(HandlerName)
    {   
        try
        { 
            new Ajax.Request(HandlerName,
            {
                method   : 'get',
                onSuccess: funRevwPrdOnSuccess,            
                onFailure: funRevwPrdOnFailure
            });
        }
        catch(e)
        {
            alert('@ funRevwPrdCallHandler');       
        }
    }
        
    function funRevwPrdOnSuccess(originalRequest)
    {   
        try
        {  
            if(originalRequest.responseText=='No')
            {
                alert('We are sorry you cannot give ratings until you have made atleast one purchase with us.');
                $('dvVisitorsReview').hide();
            }
            else if(originalRequest.responseText=='Yes')
            {
                alert('Thanks for your reviews.');
                funResetVisitorsReview();
                $('dvVisitorsReview').hide();
            }
        }
        catch(e)
        {
            alert('@ funRevwPrdOnSuccess');       
        }         
    }

    function funRevwPrdOnFailure(originalRequest)
    {
        var Err;
        try
        {
            Err=originalRequest.responseText;
        }
        catch(e)
        {
            alert('@ funRevwPrdOnFailure');            
        }
    }

function funSubmitVisitorsReview()
{   
    var ErrMsg='';
    try
    {  
        if(rated=='')
            ErrMsg='\n Rating';    
        if($F('txtVisitorsComments')=='')        
            ErrMsg=ErrMsg+'\n Comment';    
        if(ErrMsg!='')
        {
            alert('Please submit the below required details.\r\n-------------------------------------------------\r'+ErrMsg);  
            return false;            
        }
        else
        {
           var qStr='';
           qStr='revwprd|';
           qStr=qStr+$F('hdnPrdId')+'|';
           switch($('hdnRating').value)
           {
                case 'Okay':
                    qStr=qStr+'1|';
                    break;
                case 'Good':
                    qStr=qStr+'2|';
                    break;
                case 'Great':
                    qStr=qStr+'3|';
                    break;
                case 'Excellent':
                    qStr=qStr+'4|';
                    break;
                case 'Wow':
                    qStr=qStr+'5|';
                    break;
                    
           }
           qStr=qStr+$F('txtVisitorsComments')+'|';
           funRevwPrdCallHandler($F('hdnAppPath')+'GenetricHandler/ProductDetails.ashx?qStr='+qStr);
           return true;        
        }
    }
    catch(e)
    {
        alert('@ funSubmitVisitorsReview');
    }
}

function funResetVisitorsReview()
{
    try
    {  
        rated='';
        $('_1').className = '';
        $('_2').className = '';
        $('_3').className = '';
        $('_4').className = '';
        $('_5').className = '';
        $('hdnRating').value='';
        $("spnRateStatus").innerHTML='';
        $('txtVisitorsComments').value='';
    }
    catch(e)
    {
        alert('@ funResetVisitorsReview');
    }    
} 



function funRefrAFrndCallHandler(HandlerName)
    {   
        try
        {    
            new Ajax.Request(HandlerName,
            {
                method   : 'get',
                onSuccess: funRefrAFrndOnSuccess,            
                onFailure: funRefrAFrndOnFailure
            });
        }
        catch(e)
        {
            alert('@ funRefrAFrndCallHandler');       
        }
    }
        
    function funRefrAFrndOnSuccess(originalRequest)
    {   
        try
        {   
            $('dvRefFrnd').hide();
        }
        catch(e)
        {
            alert('@ funRefrAFrndOnSuccess');       
        }         
    }

    function funRefrAFrndOnFailure(originalRequest)
    {
        var Err;
        try
        {
            Err=originalRequest.responseText;
        }
        catch(e)
        {
            alert('@ funRefrAFrndOnFailure');            
        }
    }

    function funReferAFrnd()
    { 
        var ErrMsg='';
        try
        {
            if($F('txtYourName')=='')        
                ErrMsg='\n Name';    
            if($F('txtYourEmailId')=='' || emailCheck($F('txtYourEmailId'))==false)    
                ErrMsg=ErrMsg + '\n EmailId is Missing/Invalid';   
            if($F('txtMessage')=='')    
                 ErrMsg=ErrMsg + '\n Message';    
            if($F('txtFrndName')=='')    
                ErrMsg=ErrMsg + '\n Friends Name';     
            if($F('txtFrndEmailId')=='' || emailCheck($F('txtFrndEmailId'))==false)    
                ErrMsg=ErrMsg + '\n Friends EmailId is Missing/Invalid';   
//            if(funInvalidSplSymbols($F('txtMessage')==false)
//                ErrMsg=ErrMsg + '\n Remove special characters in message'; 
            if(ErrMsg!='')
            {
                alert('Please submit the below required details.\r\n-------------------------------------------------\r'+ErrMsg);  
                return false;            
            }
            else
            {   
               alert('Your referral email has been sent.');
               var qStr='';
               qStr='refafrnd|';
               qStr=qStr+$F('txtYourName')+'|';
               qStr=qStr+$F('txtYourEmailId')+'|';
               qStr=qStr+$F('txtFrndName')+'|';
               qStr=qStr+$F('txtFrndEmailId')+'|';
               qStr=qStr+$F('txtMessage')+'|';
               if('<%=Session["EStoreId"] %>'==87)
                funRefrAFrndCallHandler('../EStoreUI/GenetricHandler/ProductDetails.ashx?qStr='+qStr);
               else
                funRefrAFrndCallHandler('../GenetricHandler/ProductDetails.ashx?qStr='+qStr);
                
               funResetReferAFrnd();
               $('dvRefFrnd').hide();
               return true;        
            }
        }
        catch(e)
        {
            alert('@ funReferAFrnd');
        }
    }
    function funResetReferAFrnd()
    {
        try
        {   
            $('txtYourName').value='';        
            $('txtYourEmailId').value='';
            $('txtMessage').value='';    
            $('txtFrndName').value='';    
            $('txtFrndEmailId').value='';
        }
        catch(e)
        {
            alert('@ funResetReferAFrnd');
        }            
    }
    
    function funInvalidSplSymbols(param)
    {
        try
        {
            flg=0;
            str='';
            spc=''
            arw='';
            for (var i=0;i< param.length;i++)
            {
                cmp="<>?;'%$&"
                tst=param.substring(i,i+1)
                if (cmp.indexOf(tst)>-1)
                {
                    flg++;
                    str+=' '+tst;
                    spc+=tst;
                    arw+='^';
                }
                else
                {
                    arw+=' ';
                }
            }
            if (flg!=0)
            {
                if (spc.indexOf(' ')>-1) 
                {
                    str+=' and a space';
                }
                return false;
            }
        }
        catch(e)
        {
            alert('@ funInvalidSplSymbols');
        }
     }
     

//-----------------------------------------------------------------------------------------------------------------------
//1.Measurement Pop up

var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;
var origWidth, origHeight;
if (nodyn) { event = "nope" }   // avoid error of passing event object in older browsers
var tipFollowMouse= false;	    // CUSTOMIZE HERE -  settings for tooltip and Do you want tip to move when mouse moves over link?
var tipWidth=0;
var offX= 0;	                // how far from mouse to show tip
var offY= 0;


function funGetXYPos(pEvent,pElementId,pElementFlag)
{ 
    var vMsrPopup='';
    try
    {   
        if (!tipFollowMouse) 
        {
            standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	        mouseX = (ns5)? pEvent.pageX: window.event.clientX + standardbody.scrollLeft;    
	        mouseY = (ns5)? pEvent.pageY: window.event.clientY + standardbody.scrollTop;     
        }
        // tooltip width and height
        var vTpWd = (ie4||ie5)? pElementId.clientWidth: pElementId.offsetWidth;
        var vTpHt = (ie4||ie5)? pElementId.clientHeight: pElementId.offsetHeight;
        // document area in view (subtract scrollbar width for ns)
        var vWinWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
        var vWinHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
        // check mouse position against tip and window dimensions and position the tooltip 
        if(pElementFlag == 'Center' || pElementFlag=='LargeFabric')
        {
            if ((mouseX+offX+vTpWd)>vWinWd) 
                pElementId.style.left = (mouseX-400)+"px";
            else 
                pElementId.style.left = (mouseX-400)+"px";
            if ((mouseY+offY+vTpHt)>vWinHt) 
                pElementId.style.top = vWinHt-(vTpHt+offY)+"px";
            else 
                pElementId.style.top = mouseY+offY+"px";   
        }
        else if(pElementFlag!='Center')
        {
            if ((mouseX+offX+vTpWd)>vWinWd) 
                pElementId.style.left = mouseX-(vTpWd+offX)+"px";
            else pElementId.style.left = mouseX+offX+"px";
            if ((mouseY+offY+vTpHt)>vWinHt) 
                pElementId.style.top = vWinHt-(vTpHt+offY)+"px";
            else 
                pElementId.style.top = mouseY+offY+"px";  
        }        
        return new Array(pElementId.style.left, pElementId.style.top);
    }
    catch(e)
    {
        alert(e);
        alert('@ funGetXYPos');
    }
}

function funOnPopupHO(pEvent,pElementId,pElementValue) 
{   
    var vElement=$(pElementId);
    var vLeft=0, vTop=0,vHelpCont='';
    arrEleValue=new Array();
    try
    {   
        //alert(pElementValue);
        arrEleValue=pElementValue.split('^');
                
        if (vElement != null) 
        {
            browserSize = funGetXYPos(pEvent,vElement,pElementValue);
            vElement.style.position = "absolute";
            vElement.style.left =browserSize[0];
            vElement.style.top = browserSize[1];
            
            if(arrEleValue[0]=='saree')
            {
            
                vHelpCont="<table border='1' cellpadding='0' cellspacing='0'  style='width: 300px'>";    
                
                vHelpCont+="<tr>";
                vHelpCont+="<td colspan='5' style='width: 300px;height:20px;text-align:center'>";    
                vHelpCont+="<span class='tagtxt'><strong>Product Code:</strong> "+arrEleValue[2]+"</span>";            
                vHelpCont+="</td>";                
                vHelpCont+="</tr>";
                
                vHelpCont+="<tr>";
                vHelpCont+="<td style='width: 20px;height:20px;text-align:center'>";            
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 100px;height:20px;text-align:center'><span class='tagtxt'><strong>Saree</strong></span>";            
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 50px;height:20px;text-align:center'><span class='tagtxt'><strong>Blouse</strong></span>";            
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 80px;height:20px;text-align:center'><span class='tagtxt'><strong>Total</strong></span>";            
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 50px;height:20px;text-align:center'><span class='tagtxt'><strong>Margin</strong></span>";                        
                vHelpCont+="</td>";
                vHelpCont+="</tr>";
              
                vHelpCont+="<tr>";
                vHelpCont+="<td style='width: 20px;height:20px;text-align:center'><span class='tagtxt'><strong>B2C</strong></span>";            
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 100px;height:20px;text-align:center'>";                 
                if(arrEleValue[1]=='0')
                    vHelpCont+="<span class='tagtxt'>"+arrEleValue[4]+"</span>";          
                else if(arrEleValue[1]=='1')
                    vHelpCont+="<span class='tagtxt'>"+arrEleValue[6]+"</span>";     
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 50px;height:20px;text-align:center'>";   
                vHelpCont+="<span class='tagtxt'>"+arrEleValue[8]+"</span>";                
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 80px;height:20px;text-align:center'>";  
                vHelpCont+="<span class='tagtxt'>"+arrEleValue[11]+"</span>";
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 50px;height:20px;text-align:center'>";                        
                vHelpCont+="</td>";
                vHelpCont+="</tr>";
                
                vHelpCont+="<tr>";
                vHelpCont+="<td style='width: 20px;height:20px;text-align:center'><span class='tagtxt'><strong>B2B</strong></span>";            
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 100px;height:20px;text-align:center'>"; 
                if(arrEleValue[1]=='0')
                    vHelpCont+="<span class='tagtxt'>"+arrEleValue[3]+"</span>";          
                else if(arrEleValue[1]=='1')
                    vHelpCont+="<span class='tagtxt'>"+arrEleValue[5]+"</span>";          
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 50px;height:20px;text-align:center'>";   
                vHelpCont+="<span class='tagtxt'>"+arrEleValue[7]+"</span>";            
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 80px;height:20px;text-align:center'>";  
                vHelpCont+="<span class='tagtxt'>"+arrEleValue[10]+"</span>";          
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 50px;height:20px;text-align:center'>";                        
                vHelpCont+="<span class='tagtxt'>"+arrEleValue[9]+"%</span>";   
                vHelpCont+="</td>";
                vHelpCont+="</tr>";
                 
                vHelpCont+="<tr>";
                vHelpCont+="<td colspan='5' style='width: 300px;height:20px;text-align:justify'>";    
                vHelpCont+="<span class='tagtxt'>The above calculations is made on the actual retail price of the saree with a patterned blouse stitching. The Margin % is the earning % against the b2b cost price</span>";            
                vHelpCont+="</td>";                
                vHelpCont+="</tr>";
               
             }
             else if(arrEleValue[0]!='saree')
             {
                vHelpCont="<table border='1' cellpadding='0' cellspacing='0'  style='width: 200px'>";            
                
                vHelpCont+="<tr>";
                vHelpCont+="<td colspan='3' style='width: 200px;height:10px;padding-left:2px;padding-right:2px;text-align:center'>";            
                vHelpCont+="<span class='tagtxt'><strong>Product Code:</strong> "+arrEleValue[2]+"</span>";                    
                vHelpCont+="</td>";
                vHelpCont+="</tr>";
                
                vHelpCont+="<tr>";
                vHelpCont+="<td style='width: 20px;height:20px;padding-left:2px;padding-right:2px;text-align:center'>";            
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 130px;padding-left:2px;padding-right:2px;text-align:center'>";   
                vHelpCont+="<span class='tagtxt'><strong>Price</strong></span>";                    
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 50px;padding-left:2px;padding-right:2px;text-align:center'>";            
                vHelpCont+="<span class='tagtxt'><strong>Margin</strong></span>";                    
                vHelpCont+="</td>";
                vHelpCont+="</tr>";                
              
                vHelpCont+="<tr>";
                vHelpCont+="<td style='width: 20px;height:20px;padding-left:2px;padding-right:2px;text-align:left'>";   
                vHelpCont+="<span class='tagtxt'>B2C</span>";          
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 130px;padding-left:2px;padding-right:2px;text-align:right'>";   
                if(arrEleValue[1]=='0')
                    vHelpCont+="<span class='tagtxt'>"+arrEleValue[4]+"</span>";          
                else if(arrEleValue[1]=='1')
                    vHelpCont+="<span class='tagtxt'>"+arrEleValue[6]+"</span>";                                        
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 50px;padding-left:2px;padding-right:2px;text-align:right'>";                                           
                vHelpCont+="</td>";
                vHelpCont+="</tr>";
                
                 vHelpCont+="<tr>";
                vHelpCont+="<td style='width: 20px;height:20px;padding-left:2px;padding-right:2px;text-align:left'>";   
                vHelpCont+="<span class='tagtxt'>B2B</span>";          
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 130px;padding-left:2px;padding-right:2px;text-align:right'>";   
                if(arrEleValue[1]=='0')
                    vHelpCont+="<span class='tagtxt'>"+arrEleValue[3]+"</span>";          
                else if(arrEleValue[1]=='1')
                    vHelpCont+="<span class='tagtxt'>"+arrEleValue[5]+"</span>";                  
                vHelpCont+="</td>";
                vHelpCont+="<td style='width: 50px;padding-left:2px;padding-right:2px;text-align:right'>";                                           
                vHelpCont+="<span class='tagtxt'>"+arrEleValue[9]+"% </span>";                    
                vHelpCont+="</td>";
                vHelpCont+="</tr>"; 
                
                vHelpCont+="<tr>";
                vHelpCont+="<td colspan='3' style='width: 200px;height:10px;padding-left:2px;padding-right:2px;text-align:justify'>";            
                vHelpCont+="<span class='tagtxt'>The above comparison is based on the actual retail b2c price. The margin % is the earning % against the b2b cost price.</span>";                    
                vHelpCont+="</td>";
                vHelpCont+="</tr>";         
            }               
            vHelpCont+="</table>";
            vElement.innerHTML = vHelpCont;
              
            vElement.style.display = "block";
        }
    }
    catch(e)
    {
        alert('@ funOnPopup');
    }
}

function funOffPopupHO(pElementId)
{
    try
    {
        var vElement = document.getElementById(pElementId);    
        if (vElement != null) 
        {
            vElement.style.display="none";
        }
    }
    catch(e)
    {
        alert('@ funOffPopup');
    }
}

//-----------------------------------------------------------------------------------------------------------------------
