

//$(document).ready(function(){
//$('.warning').remove();
//$.get("token.php",function(txt){
//  $(".secure").append('<input type="hidden" name="ts" value="'+txt+'" />');
//});
//});
//
//var Taftxt = '';
//function getPop()
//{
//	$.get("taf.php",
//  function(data){
//    alert("Data Loaded: " + data);
//  });
//
//	//Taftxt = data; 
//	//alert(data);   
//}                
//getPop();
var Taftxt = '';
Taftxt += '<div class="style2">';
Taftxt += '<form action="/Tell_a_Friend.php" target="data" name="taf" id="taf" method="post" ONSUBMIT="return validateTaf(this)"> ';
Taftxt += '                               ';
Taftxt += '<table width="650" border="0" cellspacing="2" cellpadding="2" class="style1"> ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td><br>Complete this short form to share the Simplicity Sofas Website with a friend.<br>(* indicates required)</td>            ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>&nbsp;</td>';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>Your friend\'s name: *  ';
Taftxt += '      </td>                    ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td><input type="text" id="taf_friendName" name="friendName"></td> ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>Your friend\'s email: *</td> ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td><input type="text" id="taf_friendEmail" name="friendEmail"></td> ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>&nbsp;</td>            ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>The email you send will say:</td> ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>&nbsp;</td>            ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td><p>Subject: Look what I found at simplicitysofas.com. </p>';
Taftxt += '<p>                                                                               ';
Taftxt += ' Body:</p><p>                                                                     ';
Taftxt += ' Your Friend\'s Name<br>                                                          ';
Taftxt += '  I thought you might be interested in a Website that specializes in selling custom built furniture that fits ';
Taftxt += ' in small spaces and easily passes through even the narrowest doors, stairways, and elevators.';
Taftxt += ' These collections are available in small-scale sofas, loveseats or ';
Taftxt += ' chairs for your studio or apartment or full-size sofas, chairs and ';
Taftxt += ' a half and storage ottomans for living rooms and family rooms. There ';
Taftxt += ' are lots of options, too, including slip covers, down-blend cushions, ';
Taftxt += ' sleeper systems, and more than 50 fabrics to choose from.  All items ';
Taftxt += ' are built with solid oak frames that include a lifetime warranty. ';
Taftxt += '<br>                                                                              ';
Taftxt += ' Your Name                                                                        ';
Taftxt += '</p><p>                                                                                                    ';
Taftxt += ' The URL is <a href="http://www.simplicitysofas.com/." target="_blank">http://www.simplicitysofas.com/.</a>';
Taftxt += '</p></td>    ';
Taftxt += '  </tr>                        ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>&nbsp;</td>            ';
Taftxt += '  </tr>                        ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>Please Enter your first name: *</td> ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td><input type="text" id="taf_fname" name="fname"></td> ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>Your Last name: *</td>   ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td><input type="text" id="taf_lname" name="lname"></td> ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>Your email address: *</td> ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td><input type="text" id="taf_email" name="email"></td> ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td><div class="form-item"> ';
Taftxt += '<input type="checkbox" name="taf_user_newsletter" id="user_newsletter" value="Y" ';
Taftxt += 'class="form-checkbox" /> Check this box if you would like to subscribe to our e-newsletter, Sofa Studio. We will provide you with up-to-date information on small apartment living, space planning, color coordination and complimentary design advice.  </div>       ';
Taftxt += '<div>                          ';
Taftxt += '      </td>                    ';
Taftxt += '    </tr>                      ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td>&nbsp;</td>            ';
Taftxt += '  </tr>                        ';
Taftxt += '  <tr>                         ';
Taftxt += '    <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> ';
Taftxt += '      <tr>                     ';
Taftxt += '        <td><input type="submit" name="op" id="edit-submit" value="Submit"></td> ';
Taftxt += '        <td><a href="/Privacy_Policy.php">Privacy Policy</a></td> ';
Taftxt += '      </tr>                    ';
Taftxt += '    </table></td>              ';
Taftxt += '  </tr>                        ';
Taftxt += '</table>                       ';
Taftxt += '</form>                        ';
Taftxt += '</div>                         ';

var Sutxt = '';
Sutxt += '<div class="style1"> <p class="style1"><br>Subscribe to our e-newsletter, Sofa Studio, where we will provide you with up-to-date information on small apartment living, space planning, color coordination and complimentary design advice. (* required)</p> ';
Sutxt += '<form action="/News_Letter.php" target="data" name="sup" id="sup" method="post" ONSUBMIT="return validateSup(this)"> ';
Sutxt += '                               ';
Sutxt += '<table width="300" border="0" cellspacing="2" cellpadding="2" class="style1"> ';
Sutxt += '  <tr>                         ';
Sutxt += '    <td>&nbsp;</td>            ';
Sutxt += '    </tr>                      ';
Sutxt += '  <tr>                         ';
Sutxt += '    <td>Your first name: *  ';
Sutxt += '      </td>                    ';
Sutxt += '    </tr>                      ';
Sutxt += '  <tr>                         ';
Sutxt += '    <td><input type="text" id="sup_fname" name="fname"></td> ';
Sutxt += '    </tr>                      ';
Sutxt += '  <tr>                         ';
Sutxt += '  <tr>                         ';
Sutxt += '    <td>Your last name: *  ';
Sutxt += '      </td>                    ';
Sutxt += '    </tr>                      ';
Sutxt += '  <tr>                         ';
Sutxt += '    <td><input type="text" id="sup_lname" name="lname"></td> ';
Sutxt += '    </tr>                      ';
Sutxt += '  <tr>                         ';
Sutxt += '    <td>Your email: *</td> ';
Sutxt += '    </tr>                      ';
Sutxt += '  <tr>                         ';
Sutxt += '    <td><input type="text" id="sup_email" name="email"></td> ';
Sutxt += '    </tr>                      ';
Sutxt += '  <tr>                         ';
Sutxt += '    <td>&nbsp;</td>            ';
Sutxt += '    </tr>                      ';
Sutxt += '  <tr>                         ';
Sutxt += '    <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> ';
Sutxt += '      <tr>                     ';
Sutxt += '        <td><input type="submit" name="op" id="edit-submit" value="Submit"></td> ';
Sutxt += '        <td><a href="/Privacy_Policy.php">Privacy Policy</a></td> ';
Sutxt += '      </tr>                    ';
Sutxt += '    </table></td>              ';
Sutxt += '  </tr>                        ';
Sutxt += '</table>                       ';
Sutxt += '</form>                        ';
Sutxt += '</div>                         ';
var closeimg =
  '<img src="/images/ov/exit.gif" alt="Click to Close" '
 +'width="12" height="11" border="0">';
 var closeimgBlue =
  '<img src="/images/ov/exit_blue.gif" alt="Close" width="14" height="15" border="0" '
 +'name="blueExit" id="blueExit" '
 +'onmouseover="document.blueExit.src=myExitMetallic.src" '
 +'onmouseout="document.blueExit.src=myExitMetallic.src">';
 
function showForm(Taftxt)
{
	return overlib(Taftxt,STICKY,SHADOW,SHADOWOPACITY,60,CAPTION,'Tell a Friend', CAPTIONPADDING,4, TEXTPADDING,8,
 CLOSETEXT,closeimg, CLOSECLICK, CLOSETITLE,'Close',
 CAPTIONFONTCLASS,'olcap', FGCOLOR,'#ffffff', TEXTFONTCLASS,'oltxt',
 MIDX,0, MIDY,0, WRAP, BASE,2);
//	return overlib(Taftxt,STICKY,LEFT,SHADOW,SHADOWOPACITY,60,MIDX,0, MIDY,0,
//CLOSECLICK,
//HEIGHT,400,
//WIDTH,670,
//TEXTCOLOR,"#000000",
//BGCOLOR,"#8CAC85",
//FGCOLOR,"#ffffff",
//STICKY,
//CLOSESIZE, '12px',
//CLOSECOLOR,"#ffffff",
//CLOSETEXT,'CLOSE',CAPTION,'Tell a Friend');

}
function showSignUp(Sutxt)
{
	return overlib(Sutxt,WIDTH,310,
	STICKY,SHADOW,SHADOWOPACITY,60,BGCOLOR,"#8CBC85",CGCOLOR,"#8CAC85",
	CAPTION,'e-Newsletter Sign up', CAPTIONPADDING,4, TEXTPADDING,8,
  CLOSETEXT,closeimg, CLOSECLICK, CLOSETITLE,'Close',
 CAPTIONFONTCLASS,'olcap', FGCOLOR,'#ffffff', TEXTFONTCLASS,'oltxt',
 MIDX,0, MIDY,0,BASE,2);
//	return overlib(Sutxt,
//LEFT,
//SHADOW,
//SHADOWOPACITY,60,
//STICKY,
//FIXY,20,
//CLOSECLICK,
//HEIGHT,350,
//WIDTH,310,
//OFFSETY,18,
//TEXTCOLOR,"#000000",
//BGCOLOR,"#8CAC85",
//FGCOLOR,"#ffffff",
//STICKY,
//CLOSESIZE, '12px',
//CLOSECOLOR,"#ffffff",
//CLOSETEXT,'CLOSE',
//CAPTION,'Newsleter Signup');

}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);
function popwin(url,ht,wd) {
	newwindow=window.open(url,'name','height=700,width=700, scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}
function popccv() {
	newwindow=window.open('/ccv.php','CCV','height=270,width=400, scrollbars=no');
	if (window.focus) {newwindow.focus()}
	return false;
}
function showFabric(fImage,fName,fGrade)
{
 var iPath = '<div><div style="padding: 3px; float: left; width: 100 px;">';
 iPath += '<img src="/img/medTiles/' + fImage + '" ></div><div style="color: #000000;';
 iPath += ' padding: 3px; float: left; width: 200px;">' + fName + '<br />Grade ' + fGrade + '</div>';
 iPath += ' <div>' ;
 return overlib(iPath,
 VAUTO,
 CENTER, 
 HEIGHT,100, 
 WIDTH, 200, 
 OFFSETY,18,
 CAPTION,fName,
 TEXTCOLOR,"#000000",
 BGCOLOR,"#7ba273", 
 FGCOLOR , "#ffffff",
 CAPTIONFONTCLASS,'olcap', 
 TEXTFONTCLASS,'olfabtxt');



}
function validateProc(form)
{
	if (form.x_card_num.value == "")
	{
		alert("You must enter your credit card number.");
		form.x_card_num.focus();
		return false;
	}
	if (form.x_card_code.value == "")
	{
		alert("You must enter your CCV Code.");
		form.x_card_code.focus();
		return false;
	}
	if (form.exp_month.options[form.exp_month.selectedIndex].value == "")
	{
		alert("You must enter expiration month.");
		return false;
	}
	if (form.exp_year.options[form.exp_year.selectedIndex].value == "")
	{
		alert("You must enter expiration year.");
		return false;
	}
	
	
}
function validatePForm(form)
{

	if (form.productFabric.options[form.productFabric.selectedIndex].value == "")
	{
		alert("You must select a fabric.");
		return false;
	}

	if (form.SlipCovers.checked == true)
	{
		if (form.SlipCoversFabric.options[form.SlipCoversFabric.selectedIndex].value == "")
		{
		alert("You must select a Slip Cover fabric.");
		return false;
		}
	}
	if(document.getElementById('ThrowPillows'))
	{
		if (form.ThrowPillows.checked == true)
		{
			if (form.PillowFabric.options[form.PillowFabric.selectedIndex].value == "")
			{
			alert("You must select a Throw Pillow fabric.");
			return false;
			}
		}
	}
	if(document.getElementById('ThrowPillows'))
	{
		if (form.PillowFabric.options[form.PillowFabric.selectedIndex].value != "")
		{
			if (form.ThrowPillows.checked == false)
			{
			alert("You have selected a Throw Pillow fabric and have not checked Throw Pillows.");
			return false;
			}
		}
	}
	if (form.SlipCoversFabric.options[form.SlipCoversFabric.selectedIndex].value != "")
	{
		if (form.SlipCovers.checked == false)
		{
		alert("You have selected a Slip Cover fabric and have not checked Slip Covers.");
		return false;
		}
	}
	
	
}
function validateTaf(form)
{

if (form.fname.value == "")
{
	alert("You must enter your first name.");
	form.fname.focus();
	return false;
}
if (form.lname.value == "")
{
	alert("You must enter your last name.");
	form.lname.focus();
	return false;
}

var str = form.email.value;
var re = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9_\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!re.test(str)) 
	{
		alert("Please enter a valid email address.");
		form.email.focus();
		return false;
	}

if (form.friendName.value == "")
{
	alert("You must enter your friends name.");
	form.friendName.focus();
	return false;
}

var str = form.friendEmail.value;
var re = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9_\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!re.test(str)) 
	{
		alert("Please enter a valid email address.");
		form.friendEmail.focus();
		return false;
	}

}
function validateSup(form)
{

if (form.fname.value == "")
{
	alert("You must enter your first name.");
	form.fname.focus();
	return false;
}
if (form.lname.value == "")
{
	alert("You must enter your last name.");
	form.lname.focus();
	return false;
}

var str = form.email.value;
var re = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9_\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!re.test(str)) 
	{
		alert("Please enter a valid email address.");
		form.email.focus();
		return false;
	}
}
function updtShip()
{
	if(document.getElementById("BillTo").value == "Y")
	{ 
		document.getElementById("x_ship_to_first_name").value     = document.getElementById("x_first_name").value; 
		document.getElementById("x_ship_to_last_name").value      = document.getElementById("x_last_name").value;
		document.getElementById("x_ship_to_address").value        = document.getElementById("x_address").value;
		document.getElementById("x_ship_to_city").value           = document.getElementById("x_city").value;
		document.getElementById("x_ship_to_state").value          = document.getElementById("x_state").value;
		document.getElementById("x_ship_to_zip").value            = document.getElementById("x_zip").value;
		document.getElementById("x_ship_to_phone").value          = document.getElementById("x_phone").value;
		document.getElementById("x_ship_to_email").value          = document.getElementById("x_email").value;

	}
}

function validateCkForm(form)
{

if(document.getElementById("x_first_name").value           == ""){ alert('Billing first name must not be blank'); return false; }        
if(document.getElementById("x_last_name").value            == ""){ alert('Billing last name must not be blank'); return false; }         
if(document.getElementById("x_address").value              == ""){ alert('Billing address must not be blank'); return false; }           
if(document.getElementById("x_city").value                 == ""){ alert('Billing city must not be blank'); return false; }              
if(document.getElementById("x_state").value                == ""){ alert('Billing state must not be blank'); return false; }             
if(document.getElementById("x_zip").value                  == ""){ alert('Billing zip must not be blank'); return false; }               
if(document.getElementById("x_phone").value                == ""){ alert('Billing phone must not be blank'); return false; }             
if(document.getElementById("x_email").value                == ""){ alert('Billing email must not be blank'); return false; }             
var str = form.x_email.value;
var re = /^([a-zA-Z0-9_\.\-])+\@[a-zA-Z0-9_\-\.]+([a-zA-Z]{2,4})+$/;
	//if (!re.test(str)) 
	//{
	//	alert("Please enter a valid email address.");
	//	form.x_email.focus();
	//	return false;
	//}
if(document.getElementById("x_ship_to_first_name").value   == ""){ alert('Shipping first name must not be blank'); return false; }   
if(document.getElementById("x_ship_to_last_name").value    == ""){ alert('Shipping last name must not be blank'); return false; }   
if(document.getElementById("x_ship_to_address").value      == ""){ alert('Shipping address must not be blank'); return false; }     
if(document.getElementById("x_ship_to_city").value         == ""){ alert('Shipping city must not be blank'); return false; }        
if(document.getElementById("x_ship_to_state").value        == ""){ alert('Shipping state must not be blank'); return false; }       
if(document.getElementById("x_ship_to_zip").value          == ""){ alert('Shipping zip must not be blank'); return false; }         
}
function validateRAC(form)
{

if((document.getElementById('SendCatalog').checked == false) &&
   (document.getElementById('SalesCall').checked == false))
{
	alert("You must let us know.");
	return false;
}

if (form.fname.value == "")
{
	alert("You must enter first name.");
	form.fname.focus();
	return false;
}

if (form.lname.value == "")
{
	alert("You must enter last name.");
	form.lname.focus();
	return false;
}

if (form.addr1.value == "")
{
	alert("You must enter address.");
	form.addr1.focus();
	return false;
}

if (form.city.value == "")
{
	alert("You must enter city.");
	form.city.focus();
	return false;
}

if (form.state.options[form.state.selectedIndex].value == "")
{
	alert("You must enter state.");
	return false;
}

if (form.zip.value == "")
{
	alert("You must enter zip.");
	form.zip.focus();
	return false;
}

	var str = form.email.value;
	var re = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	if (form.email.value == "") 
	{
		alert("Please enter your email address.");
		form.email.focus();
		return false;
	}

	if (!re.test(str)) 
	{
		alert("Please enter a valid email address.");
		form.email.focus();
		return false;
	}

if (form.email.value == "")
{
	alert("You must enter email.");
	form.email.focus();
	return false;
}

}

function sendFabric(fid,fImage,fName,fGrade)
{
 var iPath = '<div><div style="color: #000000; padding: 3px; float: left; width: 200px;">';
 iPath += ' ' + fName + '<br><form method="post" action="addswatch.php" target="data" ';
 iPath += '><input type=hidden name="fid" value='+fid+'>';
 iPath += '<input type=submit name=order value="Add to Cart"></form></div>';
 iPath += '<div style="padding: 3px; float: left; width: 100 px;">';
 iPath += '<img src="/img/lgTiles/' + fImage + '" height=250 width=250></div> <div>' ;
 return overlib(iPath, CLOSETEXT,closeimg,STICKY,VAUTO,CLOSECLICK, HEIGHT,100, WIDTH, 200, OFFSETY,-58 ,CLOSECOLOR, 'white', ABOVE,CAPTION,fName,TEXTCOLOR,"#000000",BGCOLOR,"#8CAC85", FGCOLOR , "#ffffff",CAPTIONFONTCLASS,'olcap', TEXTFONTCLASS,'olfabtxt');

}
function dispFabs(content,em)
{
	document.getElementById("displayfabrics").innerHTML = content;
	
	if(em == 0)
	{
		document.getElementById("fabcart").innerHTML = '<form action="/fabric_cart.php"><input type=submit name=fabcartB value="Order"></form>';
	}
	var ch = nd();
}
function popitup(url) {
	newwindow=window.open(url,'name','height=550,width=760, scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

function validateCU(form)
{

if (form.fname.value == "")
{
	alert("You must enter first name.");
	form.fname.focus();
	return false;
}

if (form.lname.value == "")
{
	alert("You must enter last name.");
	form.lname.focus();
	return false;
}

if (form.addr1.value == "")
{
	alert("You must enter address.");
	form.addr1.focus();
	return false;
}

if (form.city.value == "")
{
	alert("You must enter city.");
	form.city.focus();
	return false;
}

if (form.state.options[form.state.selectedIndex].value == "")
{
	alert("You must enter state.");
	return false;
}

if (form.zip.value == "")
{
	alert("You must enter zip.");
	form.zip.focus();
	return false;
}

if (form.phone.value == "")
{
	alert("You must enter phone.");
	form.phone.focus();
	return false;
}
	var str = form.email.value;
	var re = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	if (form.email.value == "")
	{
		alert("Please enter your email address.");
		form.email.focus();
		return false;
	}

	if (!re.test(str))
	{
		alert("Please enter a valid email address.");
		form.email.focus();
		return false;
	}


}