function client_login(){
	document.getElementById('errr').innerHTML = "Oops, you've entered incorrect info!<br/>Please try again.";
}

function check_email(e) {
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++){
	if(ok.indexOf(e.charAt(i))<0){ 
	return (false);
	}	
	} 
	if (document.images) {
	re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
	re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
	if (!e.match(re) && e.match(re_two)) {
	return (-1);		
	} 
	}
}

function getPageSize(){	
	var xScroll, yScroll;	
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}		
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight*3;
	} else { 
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}


function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

function submit_wsh_quote() {
	var notes = $F('wsh_quote_notes');	
	var totalprods = $F('wshq_total_prods');
  var url = 'ajax_quote_shipp_submit.php';
  var pars = 'notes=' + notes + '&totalprods=' + totalprods;
  var myAjax = new Ajax.Updater({success: 'tmphid'},url,
    {
      method:'post',
      parameters: pars, 
      onFailure: reportError
    });  
    
   arrayPageSize = getPageSize();
		marginThisLeft2 = (arrayPageSize[0] - 576) / 2;
		document.getElementById('quote_popup_ty').style.marginLeft = marginThisLeft2;
		document.getElementById('quote_popup_ty').style.marginTop = 20 + document.body.scrollTop;
		document.getElementById('quote_popup').style.visibility='hidden';
		document.getElementById('quote_popup_ty').style.visibility='visible';
		document.getElementById('quote_popup_ty').style.visibility = 'visible';	
		document.getElementById('overlay_quote_popup_ty').style.width = 0 +"px";
		document.getElementById('overlay_quote_popup_ty').style.height = 0 +"px";	
		trackit('wshl', 'quote_submitted');
}

function reportError(request){}

function show_slick_quote_popup(){
	arrayPageSize = getPageSize();
	marginThisLeft2 = (arrayPageSize[0] - 576) / 2;
	document.getElementById('quote_popup').style.marginLeft = marginThisLeft2;
	document.getElementById('quote_popup').style.marginTop = 20 + document.body.scrollTop;
	document.getElementById('quote_popup').style.visibility='visible';
	document.getElementById('overlay_quote_popup').style.visibility='visible';
	document.getElementById('overlay_quote_popup').style.width = arrayPageSize[0] +"px";
	document.getElementById('overlay_quote_popup').style.height = arrayPageSize[1] +"px";
	opacity('overlay_quote_popup', 0, 70, 1000);	
	trackit('wshl', 'quote_popup');
}