	
    function SubmitLastMinuteProduct(frm){
        frm.action="../cart/cart_cart.asp";
    }
	function cartridgeUpdate(val)
    {   
        if(val != ''){            
            document.forms['search_form'].action  = val;
        }
        document.forms['search_form'].submit();
    }
        
    function cartridgeLink()
    {   
        document.forms['search_form'].action  = document.getElementById('cartridgeBrand').value;
        document.forms['search_form'].submit();
    }
        
    function LeftFormCheck(sURL)
    {
        document.forms.local_nav_form.action  = sURL;
        document.forms.local_nav_form.submit();
    }
        
    function LeftFormCheckForgottenPassword(sURL)
    {   var sUrl2;
        sUrl2 = ""
        if (document.getElementsByName("acct_login_txtEmail")[0]){
            sUrl2 = "?";
            if (sURL.indexOf("?") > 0){
                sUrl2 = "&";            
            }
            sUrl2 = sUrl2 + "passwordForgotten=true";           
        }
        sURL = sURL + sUrl2;
        LeftFormCheck(sURL);
    }
        
    function updateTextBox_onfocus(field,defaultValue)
    {
        if (field.value == defaultValue)
        {
            field.value="";
        }
    }

    function updateTextBox_onblur(field,defaultValue)
    {      
        if (field.value == '')
        {
            field.value=defaultValue;
        }
    }
    
    function enterPress(evt,element,action)
    { 
        flag=0;
        if (!evt) var evt = window.event; 

        if (evt.which){
            code = evt.which ;
            flag=1;
        }else{
            code = evt.keyCode;   
        }            				
				
		if (code == 13)
		{  		   
            if(action == 'focus') element.focus();
            if(action == 'click') element.click();
		    if(action == 'submit') element.submit();	  
		    
		    if (flag == 0){ 
		        evt.returnValue = false;  		       
            }
            else{      
                evt.preventDefault();    
            } 		      
		}		
	}
	


var spaceBorder = 13;
var heightPopup = 150;
var widthPopup = 313;
var topPopup = (screen.height-heightPopup)/2 - (heightPopup/2);
var leftPopup= (screen.width-widthPopup)/2;

var bgColor = "#FFFFFF";

var fontFamily = "Arial";
var fontSize = "12";
var fontColor = "#000000";

var Ombre = 1;

var clic = false;
function clicDown(tab) {
	abscisse = abs-leftPopup;
	ordonne = ord-topPopup;
	clic=true;
}
function clicUp() {
		clic=false;
}
function closePopup(popupID) {
	document.getElementById(popupID).style.visibility="hidden";
}

function hidePopup()
{
	document.getElementById('wait').style.display = 'none';
}

function showPopup(popupID) {
    var scrOfX = 0, scrOfY = 0;
    var scrOfW = 0, scrOfH = 0;
    if( typeof( window.pageYOffset ) == 'number' ) {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
    } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
    } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
    }
    
    var oDiv = document.getElementById(popupID);
    scrOfW = oDiv.clientWidth;
    scrOfH = oDiv.clientHeight;
    oDiv.style.left = scrOfX + (screen.width-scrOfW)/2;
    oDiv.style.top = scrOfY + (screen.height-scrOfH)/2 - (scrOfH/2);
	oDiv.style.visibility="visible";
	
	setTimeout("hidePopup()",5000);
	
	return false;
}

function displayPopup(popupID,url)
{
	document.location.href = url;
	return showPopup(popupID);
}

function submitWithPopup(popupID,myForm)
{
	//document.forms[myForm].submit();
	showPopup(popupID);
	return true;
}

function popup(popupID,myText,width,height){
    heightPopup = height+13;
    widthPopup = width;
    topPopup = (screen.height-heightPopup)/2 - (heightPopup/2);
    leftPopup= (screen.width-widthPopup)/2;

	if (document.getElementById) {
		document.write('<style type="text/css">')
		document.write('table.popup {')
		document.write('	border: 1px solid #000000;}')
		document.write('td.corps {')
		document.write('	font-family: '+fontFamily+';')
		document.write('	font-size: '+fontSize+'px;')
		document.write('	color: '+fontColor+';}')
		document.write('</style>')
		document.write('<DIV id='+ popupID +' STYLE="position:absolute; top:'+topPopup+'px; left:'+leftPopup+'px;visibility:hidden;">')
	
		if (Ombre == 1 ) {
			document.write('<table width="'+widthPopup+'" height="'+heightPopup+'" border="0" cellspacing="0" cellpadding="0">')
			document.write('<tr> ')
			widthPopup -= 5
			heightPopup -= 5
			document.write('<td width="'+widthPopup+'"  height="'+heightPopup+'" colspan="2" rowspan="2" align="left" valign="top">')
		}
       
		document.write('<table width="'+widthPopup+'"  height="'+heightPopup+'" border="0" cellspacing="0" cellpadding="0" class="popup">')
		widthPopup -= spaceBorder
		heightPopup -= spaceBorder
		document.write('<tr valign="top">') 
		document.write('<td bgcolor="'+bgColor+'" width="'+widthPopup+'" height="'+heightPopup+'" class="corps">'+myText+'</td>')
		document.write('</tr>')
		document.write('</table>')
	
		if (Ombre == 1 ) {
			document.write('</td>')
			document.write('<td width="5" height="5" background="/global/images/popup/right.gif"></td>') 
			document.write('</tr>')
			document.write('<tr>')
			document.write('<td background="/global/images/popup/right2.gif" width="5" height="'+heightPopup+'"></td>')
			document.write('</tr>')
			document.write('<tr> ')
			document.write('<td height="5" width="5" background="/global/images/popup/bottom.gif"></td>')
			document.write('<td height="5" width="'+widthPopup+'" background="/global/images/popup/bottom2.gif"></td>')
			document.write('<td height="5" width="5" background="/global/images/popup/bottomRight.gif"></td>')
			document.write('</tr>')
  			document.write('</table>')
		}
		document.write('</div>')
	}
}
