if (document.images){
     mapon= new Image(131,24);
     mapon.src="/images/map-over.gif";  
     mapoff= new Image(131,24);
     mapoff.src="/images/map.gif";
	 
	 contacton= new Image(96,26);
     contacton.src="/images/contact.gif";  
     contactoff= new Image(96,26);
     contactoff.src="/images/contact-over.gif";
	 
	 oStoreon= new Image(189,19);
     oStoreon.src="/imagesV2/home-store-over.gif";  
     oStoreoff= new Image(189,19);
     oStoreoff.src="/imagesV2/home-store.gif";
	 
	 oStore2on= new Image(189,19);
     oStore2on.src="/imagesV2/home-store-2-over.gif";  
     oStore2off= new Image(189,19);
     oStore2off.src="/imagesV2/home-store-2.gif";
	 
	 oColon= new Image(284,19);
     oColon.src="/imagesV2/home-collection-over.gif";  
     oColoff= new Image(284,19);
     oColoff.src="/imagesV2/home-collection.gif";
	 
	 oCol2on= new Image(284,19);
     oCol2on.src="/imagesV2/home-collection-2-over.gif";  
     oCol2off= new Image(284,19);
     oCol2off.src="/imagesV2/home-collection-2.gif";
	 
	 oProjecton= new Image(297,19);
     oProjecton.src="/imagesV2/home-project-over.gif";  
     oProjectoff= new Image(297,19);
     oProjectoff.src="/imagesV2/home-project.gif";
	 
	 oProject2on= new Image(297,19);
     oProject2on.src="/imagesV2/home-project-2-over.gif";  
     oProject2off= new Image(297,19);
     oProject2off.src="/imagesV2/home-project-2.gif";
	 
	 
	 
	 dis1on= new Image(233,233);
     dis1on.src="/imagesV3/over2-product-gallery.gif";  
     dis1off= new Image(233,233);
     dis1off.src="/imagesV3/home-product-gallery.gif";
	 
	 dis2on= new Image(233,233);
     dis2on.src="/imagesV3/over2-tell-us.gif";  
     dis2off= new Image(233,233);
     dis2off.src="/imagesV3/home-tell-us.gif";
	 
	 dis3on= new Image(233,233);
     dis3on.src="/imagesV3/over-about.gif";  
     dis3off= new Image(233,233);
     dis3off.src="/imagesV3/home-about.gif";
	 
	 dis4on= new Image(162,14);
     dis4on.src="/imagesV3/tell-us-over.gif";  
     dis4off= new Image(162,14);
     dis4off.src="/imagesV3/tell-us.gif";
	 
   }
   
function lightup(imgName){
	if (document.images){
		imgOn = eval(imgName + "on.src");
		document[imgName].src= imgOn;
		}
	}
   
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_findObj(n, d) { //v3.0
  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=MM_findObj(n,d.layers[i].document); return x;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



function turnoff(imgName){
	if(document.images){
		imgOff=eval(imgName + "off.src");
		document[imgName].src= imgOff;
		}
	}
 
 function hideLayer(whichLayer) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "hidden";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "hidden";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "hidden";
}

}

function showLayer(whichLayer) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "visible";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "visible";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "visible";
}

}

function handleClick(whichClick,theLayer) {

if (whichClick == "hide it") {
// then the user wants to hide the layer
hideLayer(theLayer);

}
else if (whichClick == "show it") {
// then the user wants to show the layer
showLayer(theLayer);
}

}


function putMessage(error_message){
        alert(error_message);
        return false;   
}

function checkEmail(email){
        var email_string = email.value; 
        var at_position = email_string.indexOf('@'); 
        var dot_position = email_string.indexOf('.', at_position); 
        var extension = email_string.substring(dot_position+1,email_string.length); 
        
        if(at_position<0){
                return false; 
        } else if (dot_position<0){
                return false; 
        } else if (extension.length<=0){
                return false; 
        } 
        return true; 
}

function hasValue(obj, obj_type){
    if (obj_type == "TEXT" || obj_type == "PASSWORD"){
        if (obj.value.length == 0) 
                return false;
        else 
                return true;
    } else if (obj_type == "SINGLE_VALUE_RADIO" || obj_type == "SINGLE_VALUE_CHECKBOX") {
                if (obj.checked)
                        return true;
                else
                return false;   
        } else if (obj_type == "RADIO" || obj_type == "CHECKBOX") {
                for (i=0; i < obj.length; i++){
                        if (obj[i].checked)
                                return true;
                }
                return false;   
        } else  if (obj_type == "SELECT") {
                if (obj.selectedIndex == 0)
                        return false;
                else
                        return true;
        }
}

function hasValue2(obj1, obj2, obj3, obj4, obj5, obj6){
        var flag = 0;
        for (i=1; i < 7; i++){
                if (obj[i].checked)
                        flag = i;
                }
        if (flag == 0)
                return false;
        else
                return true;
}

function  checkFormQTY(this_form){
    if  (!hasValue(this_form.qty, "TEXT" )) {
                if  (!putMessage("Please enter a quantity")){
                        return false; 
                }
        }
}

function  checkFormContact(this_form){
    if  (!hasValue(this_form.Name, "TEXT" )) {
                if  (!putMessage("Please enter your name")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.Title, "TEXT" )) {
                if  (!putMessage("Please enter your title")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.Phone, "TEXT" )) {
                if  (!putMessage("Please enter your phone")){
                        return false; 
                }
        }
    if  (!hasValue(this_form.Email, "TEXT" )) {
                if  (!putMessage("Please enter your email address")){
                        return false; 
                }
        } else {
                if (!checkEmail(this_form.Email)){
                        if  (!putMessage("Please enter valid email address")){
                                return false; 
                        }
                }
        }
	if  (!hasValue(this_form.Company, "TEXT" )) {
                if  (!putMessage("Please enter your company name")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.Address, "TEXT" )) {
                if  (!putMessage("Please enter your address")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.City, "TEXT" )) {
                if  (!putMessage("Please enter your city")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.State, "TEXT" )) {
                if  (!putMessage("Please enter your state")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.Postal, "TEXT" )) {
                if  (!putMessage("Please enter your postal code")){
                        return false; 
                }
        }
	
	if  (!hasValue(this_form.furnitureBY, "TEXT" )) {
                if  (!putMessage("What date do you need your furniture by?")){
                        return false; 
                }
        }
		
		
	if  (!hasValue(this_form.Describe, "TEXT" )) {
                if  (!putMessage("Please describe your project and furniture requirements.")){
                        return false; 
                }
        }
        
        return true;    
}

function  checkFormLease(this_form){
	if  (!hasValue(this_form.email, "TEXT" )) {
                if  (!putMessage("Please enter your email address")){
                        return false; 
                }
        } else {
                if (!checkEmail(this_form.email)){
                        if  (!putMessage("Please enter valid email address")){
                                return false; 
                        }
                }
        }
    if  (!hasValue(this_form.company_name, "TEXT" )) {
                if  (!putMessage("Please enter your company name")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.dba, "TEXT" )) {
                if  (!putMessage("Please enter your DBA")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.tax_id, "TEXT" )) {
                if  (!putMessage("Please enter your tax ID")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.billing_address, "TEXT" )) {
                if  (!putMessage("Please enter your billing address")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.billing_city, "TEXT" )) {
                if  (!putMessage("Please enter your billing city")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.billing_state, "TEXT" )) {
                if  (!putMessage("Please enter your billing state")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.billing_zip, "TEXT" )) {
                if  (!putMessage("Please enter your billing zip")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.nature_business, "TEXT" )) {
                if  (!putMessage("Please state the nature of your business.")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.billing_phone, "TEXT" )) {
                if  (!putMessage("Please enter your billing phone")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.years_business, "TEXT" )) {
                if  (!putMessage("Please enter the number of years in business")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.business_type, "RADIO" )) {
                if  (!putMessage("Please enter your business type")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.employee_number, "TEXT" )) {
                if  (!putMessage("Please enter the number of employees")){
                        return false; 
                }
        }
	
	if  (!hasValue(this_form.personal_name_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer name")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_title_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer title")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_ssn_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer SSN")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_ownership_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer % ownership")){
                        return false; 
                }
        }
	
	if  (!hasValue(this_form.personal_address_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer billing address")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_city_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer billing city")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_state_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer billing state")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_zip_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer billing zip")){
                        return false; 
                }
        }
		
	if  (!hasValue(this_form.equipment_city, "TEXT" )) {
                if  (!putMessage("Please enter the destination city")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.equipment_state, "TEXT" )) {
                if  (!putMessage("Please enter the destination state")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.equipment_cost, "TEXT" )) {
                if  (!putMessage("Please enter the furniture cost")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.equipment_description, "TEXT" )) {
                if  (!putMessage("Please enter the furniture description")){
                        return false; 
                }
        }
       
        return true;    
}

function  checkFormLeaseV3(this_form){
	if  (!hasValue(this_form.equipment_cost, "TEXT" )) {
                if  (!putMessage("Please enter the furniture cost")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.equipment_description, "TEXT" )) {
                if  (!putMessage("Please enter the furniture description")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.company_name, "TEXT" )) {
                if  (!putMessage("Please enter your company name")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.contact_name, "TEXT" )) {
                if  (!putMessage("Please enter your primary contact name")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.billing_address, "TEXT" )) {
                if  (!putMessage("Please enter your billing address")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.billing_city, "TEXT" )) {
                if  (!putMessage("Please enter your billing city")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.billing_state, "TEXT" )) {
                if  (!putMessage("Please enter your billing state")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.billing_zip, "TEXT" )) {
                if  (!putMessage("Please enter your billing zip")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.phone, "TEXT" )) {
                if  (!putMessage("Please enter your phone")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.fax, "TEXT" )) {
                if  (!putMessage("Please enter your fax")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.email, "TEXT" )) {
                if  (!putMessage("Please enter your email address")){
                        return false; 
                }
        } else {
                if (!checkEmail(this_form.email)){
                        if  (!putMessage("Please enter valid email address")){
                                return false; 
                        }
                }
        }
    if  (!hasValue(this_form.years_business, "TEXT" )) {
                if  (!putMessage("Please enter the number of years in business")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.account_rep, "TEXT" )) {
                if  (!putMessage("Please enter the number of years in account rep")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_name_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer name")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_address_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer billing address")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_city_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer billing city")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_state_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer billing state")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_zip_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer billing zip")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_ssn_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer SSN")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.personal_ownership_1, "TEXT" )) {
                if  (!putMessage("Please enter the officer % ownership")){
                        return false; 
                }
        }
	
       
        return true;
}

EditWishlist = function(){
	//alert($('#DescribeForm').attr('action'));	
	$('#DescribeForm').
		attr('action','/contemporary-office-furniture-space-planning-design.html?action=wishlist').
		submit();
	return false;
	}
	
SaveDForm = function(){
	$('#DescribeForm').
		attr('action','/contemporary-office-furniture-space-planning-design.html?action=save').
		submit();
	return false;
	}

DropWarning = function(){
	$(window).unbind('beforeunload');
	if(window.onbeforeunload){
		window.onbeforeunload = function(){}
		}
	return true;
	}

jQuery(function(){
	
	$(".poplink").fancybox({
		'type'				: 'iframe',
		'titleShow'			: false,
		'width'				: 800,
		'height'			: '95%',
		'padding'			: 2,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'centerOnScroll'	: true,
		'overlayOpacity'	: '0.4',
		'overlayColor'		: '#000'
		});
	
	
	$('a.lightup').
		addClass('touchedbyjquery').
		mouseover(function(){
			lightup($(this).attr('rel'));
			}).
		mouseout(function(){
			turnoff($(this).attr('rel'));
			});
	
	$('#DescribeForm').submit(
		function(){ DropWarning(); }
		)
		
	$('a.addOver').hover(
		function(){
			$$ = $(this).children('img');
			src = $$.attr('src').replace(/(.+?)(\.[A-z]{3})/,'$1-over$2');
			$$.attr('src',src);
			},
		function(){
			$$ = $(this).children('img');
			src = $$.attr('src').replace(/(.+?)-over(\.[A-z]{3})/,'$1$2');
			$$.attr('src',src);
			}
		)
	
	$('a.focal').
		addClass('touchedbyjquery').
		mouseover(function(){
			$(this).focus();
			}).
		mouseout(function(){
			$(this).focus();
			});
	});




