<!--
    var sDefaultControl = '';

    function openImage( sClass, nId, nWidth, nHeight )
    {
        var sUrl = '/image.aspx?ImageType=' + sClass + '&ImageId=' + nId + '&width=' + nWidth + '&height=' + nHeight;
        
        openWindow( sUrl, nId, nWidth, nHeight, false );
    }
    
    function openProductImage( sClass, nId, nWidth, nHeight )
    {
        var sUrl = '/productimages.aspx?ImageType=' + sClass + '&ImageId=' + nId + '&width=' + nWidth + '&height=' + nHeight;
        
        openWindow( sUrl, nId, nWidth, nHeight, false );
    }
    
    function openProductAttributeImage( sClass, nId, sAttribute, nAttributeId, nWidth, nHeight )
    {
        var sUrl = '/productimages.aspx?ImageType=' + sClass + '&ImageId=' + nId + '&' + sAttribute + '=' + nAttributeId + '&width=' + nWidth + '&height=' + nHeight;
        
        openWindow( sUrl, nId, nWidth, nHeight, false );
    }
    
    function openDetailImage( sClass, nId, nX, nY, nWidth, nHeight, nScaleWidth, nScaleHeight )
    {
        var sUrl = '/image.aspx?ImageType=' + sClass + '&ImageId=' + nId + '&x=' + nX + '&y=' + nY + '&width=' + nWidth + '&height=' + nHeight + '&scalewidth=' + nScaleHeight + '&scaleheight=' + nScaleHeight;
        
        openWindow( sUrl, nId, nWidth, nHeight, false );
    }
    
    function fnTrapKD(btnID, event)
    {
        btn = findObj(btnID);
        
        if (document.all)
        {
            if (event.keyCode == 13)
            {
                event.returnValue=false;
                event.cancel = true;
                btn.click();
            }
        }
        else if (document.getElementById)
        {
            if (event.which == 13)
            {
                event.returnValue=false;
                event.cancel = true;
                btn.focus();
                btn.click();
            }
        }
        else if(document.layers)
        {
            if(event.which == 13)
            {
                event.returnValue=false;
                event.cancel = true;
                btn.focus();
                btn.click();
            }
        }
    }
    
    function findObj(n, d)
    { 
        var p,i,x;  
        
        if(!d) 
            d=document; 
            
        if((p=n.indexOf("?"))>0 && parent.frames.length)
        {
            d=parent.frames[n.substring(p+1)].document; 
            n=n.substring(0,p);
        }
        
        if(!(x=d[n])&&d.all) 
            x=d.all[n]; 
            
        for (i=0;!x&&i<d.forms.length;i++) 
            x=d.forms[i][n];
            
        for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
            x=findObj(n,d.layers[i].document);
            
        if(!x && d.getElementById) 
            x=d.getElementById(n); 
            
        return x;
    }
    
    function setDefaultControl( sControl )
    {
        sDefaultControl = sControl;
    }
        
    function setFormFocus()
    {
        if( sDefaultControl != '' )
            for( var nFormIndex = 0; nFormIndex < document.forms.length; nFormIndex++ )
            {
                var sFormName = document.forms[ nFormIndex ].name;
                
                for( var nElementsIndex = 0; nElementsIndex < document.forms[ sFormName ].elements.length; nElementsIndex++ )
                    if( document.forms[ sFormName ].elements[ nElementsIndex ].name == sDefaultControl )
                        document.forms[ sFormName ].elements[ nElementsIndex ].focus();
            }
    }   
        
    function moveItems( oForm, sOptionList, sTargetList, sAdd, sHiddenField )
    {
        var oOptionList; 
        var oTargetList; 
        var oHiddenList = oForm.elements[ sTargetList ];

        // determine the polarity of this operation
        if( sAdd == 'True' )
        {
            oOptionList = oForm.elements[ sTargetList ];
            oTargetList = oForm.elements[ sOptionList ];
        }
        else
        {
            oOptionList = oForm.elements[ sOptionList ];
            oTargetList = oForm.elements[ sTargetList ];
        }
        

        // add the options to the target list
        var nOptions = oOptionList.options.length;
        for( var nOption = 0; nOption < nOptions; nOption++ )
        {
            var oOption = oOptionList.options[ nOption ];
            
            if( oOption.selected )
            {
                // add the option to the selected list
                oTargetOption = new Option( oOption.text, oOption.value, false, false );
                oTargetList.options.add( oTargetOption );                                                   
            }
        }
        
        // remove the options from option list
        for( var nOption = nOptions - 1; nOption >= 0; nOption-- )
        {
            if( oOptionList.options[ nOption ].selected )
            {
                oOptionList.options[ nOption ] = null;
            }
        }

        // update the hidden value which tracks the list of selected items
        var sHiddenValue = '';
        var nHiddenValues = oHiddenList.options.length;
        for( var nHiddenValue = 0; nHiddenValue < nHiddenValues; nHiddenValue++ )
        {
            if( sHiddenValue.length > 0 )
                sHiddenValue += ",";

            sHiddenValue += oHiddenList.options[ nHiddenValue ].value;
        }


        oForm.elements[ sHiddenField ].value = sHiddenValue;
    }

    
    function findFormControl( name )
    {
        for( var nFormIndex = 0; nFormIndex < document.forms.length; nFormIndex++ )
        {
            var sFormName = document.forms[ nFormIndex ].name;
            
            for( var nElementsIndex = 0; nElementsIndex < document.forms[ sFormName ].elements.length; nElementsIndex++ )
            {
                var sElementName = document.forms[ sFormName ].elements[ nElementsIndex ].name;

                if( sElementName == name )
                {
                    return document.forms[ sFormName ].elements[ nElementsIndex ];
                }
                else
                {
                    var aElementNamingArray = sElementName.split( ':' );
                    if( aElementNamingArray[ aElementNamingArray.length - 1 ] == name )
                    {
                        return document.forms[ sFormName ].elements[ nElementsIndex ];
                    }
                }
            }
        }   
        return null;
    }
    
    function openFlash( src, width, height )
    {
        var lWidth          = width;
        var lHeight         = height;
                
        var now = new Date();
        
        var oWindow = openPopup( '', 'EcardPreview' + now.getTime(), lWidth, lHeight );
        
        oWindow.focus();
            
        oWindow.document.writeln( '<html>');
        oWindow.document.writeln( ' <head>');
        oWindow.document.writeln( '     <title>Mekorma</title>');
        oWindow.document.writeln( '     <style>');
        oWindow.document.writeln( '     <!--');
        oWindow.document.writeln( '         .copyright');
        oWindow.document.writeln( '         {');
        oWindow.document.writeln( '             FONT-FAMILY: arial, helvetica, sans-serif;');
        oWindow.document.writeln( '             FONT-SIZE: 10px;');
        oWindow.document.writeln( '         }');
        oWindow.document.writeln( '     //-->');
        oWindow.document.writeln( '     </style>');
        oWindow.document.writeln( ' </head>');
        oWindow.document.writeln( ' <body bgcolor="#ffffff" marginheight="0" topmargin="0" marginwidth="0" leftmargin="0">');
        oWindow.document.writeln( ' <center>');
        oWindow.document.writeln( '     <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="100%" HEIGHT="100%" NAME="sw" ID="sw">');
        oWindow.document.writeln( '     <PARAM NAME="Play" VALUE="true">');
        oWindow.document.writeln( '     <PARAM NAME="Loop" VALUE="true">');
        oWindow.document.writeln( '     <param NAME="Quality" VALUE="high">');
        oWindow.document.writeln( '     <param NAME="scale" VALUE="showall">');
        oWindow.document.writeln( '     <PARAM NAME="MENU" VALUE="FALSE">');
        oWindow.document.writeln( '     <PARAM NAME="SRC" VALUE="' + src + '">');
        oWindow.document.writeln( '     <EMBED  SRC="' + src + '" MENU="FALSE" scale="showall" WIDTH="100%" HEIGHT="100%" type="application/x-shockwave-flash" movie="'+ src +'.swf" quality="best" play="true" loop="true"></embed>');
        oWindow.document.writeln( '     </OBJECT>');
        oWindow.document.writeln( '     <script language="javascript" src="/jscript/library.js"></script>' );
        oWindow.document.writeln( ' </body>');
        oWindow.document.writeln( '</html>');
    }
    
    function openWindow( url, name, width, height, center )
    {
        openPopup( url, name, width, height, center )
    }

    function openScrollingWindow( url, name, width, height, center )
    {
        openScrollingPopup( url, name, width, height, center )
    }

    function openPopup( url, name, width, height, center )
    {
        var oWindow;
                
        if( center )
        {
            oWindow = window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height + ',top=' + (( screen.height - height )/2) + ',left=' + (( screen.width - width )/2 ) );
        }
        else
        {
            oWindow = window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height );
        }
        
        return oWindow;
    }
    
    function openScrollingPopup( url, name, width, height, center )
    {
        var oWindow;
                
        if( center )
        {
            oWindow = window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + width + ',height=' + height + ',top=' + (( screen.height - height )/2) + ',left=' + (( screen.width - width )/2 ) );
        }
        else
        {
            oWindow = window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + width + ',height=' + height );
        }
        
        return oWindow;
    }
    
    function setBackground( id, color ) 
    {
        if (document.getElementById) 
            document.getElementById(id).style.backgroundColor = color;
        else if (document.layers) 
            document.layers[id].bgColor = color;
        else if (document.all) 
            document.all[id].style.backgroundColor = color;
    }

	function setCookie(name,value,days)
	{
		if (days)
		{
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}
	
	function getCookie(name)
	{
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++)
		{
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	
	function deleteCookie(name)
	{
		setCookie(name,"",-1);
	}
    
//-->
