<!--

// ----------------------------------------------
// StyleSwitcher functions written by Paul Sowden
// http://www.idontsmoke.co.uk/ss/
// - - - - - - - - - - - - - - - - - - - - - - -
// For the details, visit ALA:
// http://www.alistapart.com/stories/alternate/

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(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;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

// Membership

function getCookie(Name) {
var search = Name + "="
if (document.cookie.length > 0) { // if there are any cookies
offset = document.cookie.indexOf(search) 
if (offset != -1) { // if cookie exists 
offset += search.length 
// set index of beginning of value
end = document.cookie.indexOf(";", offset) 
// set index of end of cookie value
if (end == -1) 
end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
} 
}
}

function showLogin(loginpage, whereami) {
  var cookie=getCookie("inc_firstname");
  if (cookie) {
    //var cookiep=getCookie("inc_perm");
    document.write('Hi '+cookie+'. <a href="http://www.inc.com/mbr/profile/inc/main?origin='+whereami+'">View Your Profile</a> | <a href="http://www.inc.com/mbr/logout/inc/main?origin='+whereami+'">Sign Off</a>');
  } else {
    document.write('<a href="http://www.inc.com/mbr/login/inc/main?origin='+whereami+'">Members sign in</a> | Not a member? <a href="http://www.inc.com/mbr/profile/inc/main">Sign up</a>');
  }
}

// Breadcrumb

function lastGuide() {
var last_guide = "last_guide="
if (document.cookie.length > 0) { // if there are any cookies
offset = document.cookie.indexOf(last_guide) 
if (offset != -1) { // if cookie exists 
offset += last_guide.length 
// set index of beginning of value
end = document.cookie.indexOf(";", offset) 
// set index of end of cookie value
if (end == -1) 
end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
} 
else { return ""; }
}
else { return ""; }
}

// Div toggle

function toggle( targetId ){
  if (document.getElementById){
  target = document.getElementById( targetId );
  if (target.style.display == "none"){
  target.style.display = "";
  } else {
  target.style.display = "none";
  }
  }
}

// Featured Services

function showFeatured() {
document.write('<ul>');
document.write('<li><strong>Web Hosting</strong> <a href="http://www.rackspace.com/promo/aprilreducedprice.php?CMP=inc_textlinks_383_ros" target="_new">Get the Rackspace Essential Server for $383 in April</a>!</li>');
document.write('<li><strong>Hyatt Gold Passport</strong> <a href="http://ad.doubleclick.net/clk;95258940;16583321;o?http://www.hyatt.com/hyatt/thenewmore/index.jsp" target="_new">Introducing two new brands. Join now and get a free night</a>.</li>');
document.write('<li><strong>Safe Email?</strong> <a href="http://www.mxlogic.com/emaildefense/idcwebinar.html?GCID=C16104x094" target="_new">Learn what you need to protect your email network Ð webinar. Click here!</a></li>');
document.write('<li><strong>Meineke</strong> <a href="http://trax.inc.com/k/w/textlink/meineke" target="_new">Get your career in gear! Learn about Meineke opportunities</a>.</li>');
document.write('<li><strong>FREE Trial</strong> <a href="http://trax.inc.com/k/w/quickbooks" target="_new">QuickBooksOnline.com puts you in control of your finances!</a>!</li>');
document.write('<li><strong>Vonage</strong> <a href="http://clk.atdmt.com/VON/go/fstcyvon0490000020von/direct/01/" target="_new">1st month free</a>!</li>');
document.write('<li><strong>GE Finance</strong> <a href="http://www.gecfo.com/" target="_new">Corporate financing</a> from GE to grow your business.</li>');
document.write('<li><strong>Incorporate.com</strong> <a href="http://trax.inc.com/k/w/companycorp/featuredservices" target="_new">Incorporate your company online quickly, easily, and affordably</a>.</li>');
document.write('<li><strong>Monster</strong> <a href="http://trax.inc.com/k/w/textlink/monster-05" target="_new">Monster Special offer - save $50 when you post a job</a>!</li>');
document.write('<li><strong>Free Trial</strong> <a href="http://trax.inc.com/k/w/textlink/smartonline" target="_new">Accelerate and Increase Sales by Conducting Presentations Online</a>.</li>');
document.write('<li><strong>DEAN</strong> <a href="http://www.imsearch.com/searches.html" target="_new">School of Technological Entrepreneurship, Northeastern Univ.</a></li>');
document.write('<li><strong>Small Business Intelligence Center</strong> <a href="http://trax.inc.com/k/w/partners/intel/promo/textlink" target="_new">Strategies for managing growth and achieving success</a>.</li>');
document.write('<li><strong>Microsoft</strong> <a href="http://ad.doubleclick.net/clk;21847500;11904905;z?http://www.microsoft.com/smallbusiness/products/server/connect-with-customers.mspx?xid=A0602001BB0000254810" target="_new">Learn to stay connected. Free guide here.</a>.</li>');
document.write('<li><strong>Network Solutions Online Marketing Toolbox</strong> <a href="http://ad.doubleclick.net/clk;21957941;11960682;o?http://www.inc.com/partners/networksolutions" target="_new">Reel in customers online with strategies from successful entrepreneurs</a>.</li>');
document.write('<li><strong>IKEA Small Biz Network</strong> <a href="http://trax.inc.com/k/w/textlink/ikea" target="_new">Join now for inspiring ideas, free planning tools and special offers</a>.</li>');
document.write('<li><strong>Step Bots!</strong> <a href="http://trax.inc.com/k/w/textlink/mxlogic" target="_new">Protect your email network from bots & rootkits. Free white paper</a>!</li>');
document.write('<li><strong>SMB DATA</strong> <a href="http://trax.inc.com/k/w/textlink/smbdata" target="_new">Click freesmbreports.com now for 5 FREE  business reports</a>.</li>');
document.write('<li><strong>Use EFTPS</strong> <a href="http://trax.inc.com/k/w/textlink/eftps" target="_new">Save time &amp; effort--pay your taxes electronically</a>.</li>');
document.write('<li><strong>Rackspace</strong> <a href="http://www.rackspace.com/index.php?CMP=IncTxTLNK" target="_new">Move and save: get 1 month of FREE managed hosting. Click here today</a>!</li>');
document.write('<li><strong>Biz Taxes</strong> <a href="http://trax.inc.com/k/w/textlink/turbotax" target="_new">Turn to TurboTax Business: guidance, tax laws, tax savings</a>.</li>');
document.write('<li><strong>Business Filings</strong> <a href="http://trax.inc.com/k/w/textlink/bizfilings" target="_new">Incorporate or form an LLC to protect your business</a>.</li>');
document.write('</ul>');
}


// BucketPromo

function showBucketPromo() {
document.write('<h3>Sponsored Sections</h3>');
document.write('<div><p><a href="http://trax.inc.com/k/w/partners/intel/promo/articles"><img src="http://images.inc.com/partners/intel05/artpromo_intel.gif" alt="Small Business Intelligence Center" border="0" /></a></p></div>');
document.write('<div><p><a href="http://trax.inc.com/k/w/hiringcenter/monster/promo-box"><img src="http://images.inc.com/hiringcenter05/artpromo_monster.gif" alt="Hiring Center" border="0" /></a></p></div>');
}

// SBC TOOL PANEL

function validForm(BeFreeBannerAd) {
 if (BeFreeBannerAd.telephonenumber.value == ""){
 alert("Sorry, this number is not valid. \nPlease enter area code and phone number (123-345-7890).");
 BeFreeBannerAd.telephonenumber.focus();
 return false;
 }
 if (VerifyPhone(Verify(BeFreeBannerAd.telephonenumber.value)) == false)    {
 alert("Sorry, this number is not valid. \nPlease enter area code and phone number (123-345-7890).");
 BeFreeBannerAd.telephonenumber.focus();
 return false;
 }
 return true;
 }

function Verify(number) {
 var textok = "0123456789";
 var newtext = ""
 for (i = 0;  i < number.length;  i++) {
   if(textok.indexOf(number.charAt(i)) != "-1")   {
        ch = number.charAt(i);
        newtext += ch
    }
  }
return newtext;
}

function VerifyPhone(number){
var ValidFormat = /^\d{10}$/;
var ValidFormat2 = /^\d{12}$/;
if (number.match(ValidFormat)||number.match(ValidFormat2)){
    if(number.substring(0,1).match("1")||number.substring(0,1).match("0")){
    return false;
    } else{
    return true;
    }
}else{
     return false;
}
}

function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
result = true;
  }
  return result;
}

function FormValidator(theForm)
{

  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"email\" field.");
    theForm.email.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.email.value))
  {
    alert("Please enter a complete email address in the form: yourname@yourdomain.com");
    theForm.email.focus();
    return (false);
  }
   
  if (theForm.email.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"email\" field.");
    theForm.email.focus();
    return (false);
  }
  return (true);
}



// START-UP Resource Center Webinar Popups

function OpenWinSize(zPageName, width, height) {

var myBars = "directories=no,location=no,menubar=no,status=no";
myBars += ",titlebar=no,toolbar=no";

var myOptions = "scrollbars=no,width=" + width + ",height=" + height + ",resizeable=no";
var myFeatures = myBars + "," + myOptions;
var Win = open(zPageName, "hndwindow", myFeatures);
Win.focus();
}

function OpenWebinar(zPageName, width, height) {

var myBars = "directories=no,location=no,menubar=no,status=no";
myBars += ",titlebar=no,toolbar=no";

var myOptions = "scrollbars=yes,width=" + width + ",height=" + height + ",resizeable=yes";
var myFeatures = myBars + "," + myOptions;
var Win = open(zPageName, "hndwindow", myFeatures);
Win.focus();
}

function formHandler(amex) {
var windowprops = "height=590,width=800,location=no," + "scrollbars=0,menubars=no,toolbars=no,resizable=yes";
var URL = amex.amexselect.options[amex.amexselect.selectedIndex].value;
popup = window.open(URL,"MenuPopup",windowprops);
}

function USPSformHandler(USPS) {
var windowprops = "height=590,width=800,location=no," + "scrollbars=1,menubars=no,toolbars=no,resizable=yes";
var URL = USPS.USPSselect.options[USPS.USPSselect.selectedIndex].value;
popup = window.open(URL,"USPS",windowprops);
}

function OpenWinSizeWithScroll(zPageName, width, height) {
var myBars = "directories=no,location=no,menubar=no,status=no";
myBars += ",titlebar=no,toolbar=no";
var myOptions = "scrollbars=yes,width=" + width + ",height=" + height + ",resizeable=no";
var myFeatures = myBars + "," + myOptions;
var Win = open(zPageName, "hndwindow", myFeatures);
Win.focus();
}

// Browser window pop-up and size
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//

function inlinePopUp(strURL,strType,strHeight,strWidth) {
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
window.open(strURL, 'newWin', strOptions);
}