<!--

// 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/profile/inc/main">Register Now</a> | <a href="http://www.inc.com/mbr/login/inc/main?origin='+whereami+'">Sign in</a>');
  }
}

// Welcome Ad Trigger

function callWelcomeAd() {
if ((document.cookie.indexOf('interstitial=welcome')==-1) &&
(navigator.userAgent.indexOf("IE")>-1) &&
(this.location.host.indexOf("inc.com")!=-1) &&
(this.location.search.indexOf("partner")==-1) &&
(this.location.search.indexOf('nowelcome')==-1)) {
 
var tomorrow = new Date();
var nowPlus =  tomorrow.getTime() + (24*60*60*1000);
tomorrow.setTime(nowPlus);
document.cookie = 'interstitial=welcome; path=/; domain=.inc.com; expires=' + tomorrow.toGMTString();
	 
if (document.cookie.indexOf('interstitial=welcome')!=-1){
	this.location.href='http://www.inc.com/welcome.html';
	}
  }
}

// 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('<dl id="select_services">');
document.write('<dt><a href="http://ad.doubleclick.net/clk;133945556;19886347;a?http://www.brother-usa.com/planb" target="_new">Brother:</a></dt><dd>The Better Choice in Color Laser Printing.</dd>');
document.write('</dl>');
}


// BucketPromo

function showBucketPromo() {
document.write('<div id="BucketPromo">');
document.write('<div class="h2_wrapper">');
document.write('<h2 class="orange">Special Sections</h2>');
document.write('<div class="whats_this"><a href="http://www.inc.com/partners/about.html" target="_new">(What is this?)</a></div>');
document.write('</div>');
document.write('<div class="content_box2"><img src="http://images.inc.com/special/gotomeeting/sales.jpg" alt="" width="50" height="50" class="img_left" />');
document.write('<p class="nopad"><span class="orange_link"><a href="http://trax.inc.com/k/w/microsite/gotomeeting/20060719">Communications Strategy Center</a></span><br /><span class="smallest">Sponsored by <strong>GoToMeeting</strong></span></p>');
document.write('<ul class="arrow_list3_float">');
document.write('<li><a href="http://www.inc.com/partners/gotomeeting/articles/20061101/hirshberg.html">How To Star in a TV Ad</a></li>');
document.write('<li><a href="https://www.gotomeeting.com/en_US/island/webinar/provideEmail.tmpl?_sid=27926878%3ABC68197959EC0AA&Action=rgoto&_sf=2" target"_blank"=>Webinar: Increase Your Revenue, Decrease Your Sales Cycle</a></li>');
document.write('<li><a href="http://www.inc.com/partners/gotomeeting/assets/video.html?clip=20060714">Video: Web Collaboration on the Front Line</a></li>');
document.write('</ul>');
document.write('</div>');
document.write('<div class="content_box2"><img src="http://images.inc.com/special/hiring/developcareer.jpg" alt="" width="50" height="50" class="img_left" />');
document.write('<p class="nopad"><span class="orange_link"><a href="http://trax.inc.com/k/w/hiringcenter/monster/promo-box">Hiring Center</a></span><br /><span class="smallest">Sponsored by <strong>Monster</strong></span></p>');
document.write('<ul class="arrow_list3_float">');
document.write('<li><a href="http://hiring.inc.com/columns/whelmlinger/20061031.html">Re-Recruit Your Employees</a></li>');
document.write('<li><a href="http://images.gjbig.com/hiringcenter/download/employee_manual.pdf" target="_blank">White Paper: Writing An Employee Manual</a></li>');
document.write('<li><a href="http://hiring.inc.com/">Hot Tip: Controlling the Interview</a></li>');
document.write('</ul>');
document.write('</div>');
document.write('</div>');
}

// DirectoryM (bottom of page)

function showDirectoryM() {
document.write('<!-- hold -->');
}


// Striped Table JS for Sound Off table
// Derived from 'Zebra Tables' by David F. Miller (http://www.alistapart.com/articles/zebratables/)
// Modified by Jop de Klein, february 2005, jop at validweb.nl, http://validweb.nl/artikelen/javascript/better-zebra-tables/

	var stripe = function() {
		var tables = document.getElementsByTagName("table");	

		for(var x=0;x!=tables.length;x++){
			var table = tables[x];
			if (! table) { return; }
			
			var tbodies = table.getElementsByTagName("tbody");
			
			for (var h = 0; h < tbodies.length; h++) {
				var even = true;
				var trs = tbodies[h].getElementsByTagName("tr");
				
				for (var i = 0; i < trs.length; i++) {
					if(even)
						trs[i].className += " even";
					
					even = !even;
				}
			}
		}
	}

	window.onload = stripe;

// 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();
}

// Dashboard Javascripts

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 FactivaFormHandler(Factiva) {
var windowprops = "height=590,width=800,location=no," + "scrollbars=1,menubars=no,toolbars=no,resizable=yes";
var URL = Factiva.FactivaSelect.options[Factiva.FactivaSelect.selectedIndex].value;
popup = window.open(URL,"Factiva",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);
}

// Inline Pop Up Window

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;
if (strType=="podcast") strOptions="resizable,height=440,width=728";
if (strType=="slideshow") strOptions="resizable,scrollbars=auto,height=700,width=820";
if (strType=="video") strOptions="resizable,height=615,width=750";
window.open(strURL, 'newWin', strOptions);
}

// random sub offers
function incSubOfferLink(text) {
    var links = new Array("http://trax.inc.com/k/w/sub/jun06pricetest/10",
                          "http://trax.inc.com/k/w/sub/jun06pricetest/997",
                          "http://trax.inc.com/k/w/sub/jun06pricetest/1097",
                          "http://trax.inc.com/k/w/sub/jun06pricetest/11");
	var rand = Math.floor(Math.random() * links.length);
        document.write("<a href='" + links[rand] + "' target='_blank'>" + text + "</a>");
}
function incSubOfferFormLink() {
	var flinks = new Array("https://w1.buysub.com/servlet/PrePopGateway?cds_mag_code=ICM&amp;cds_page_id=28626&cds_response_key=I6DSLPT3",
						   "https://w1.buysub.com/servlet/PrePopGateway?cds_mag_code=ICM&amp;cds_page_id=28627&cds_response_key=I6DSLPT1",
                     	   "https://w1.buysub.com/servlet/PrePopGateway?cds_mag_code=ICM&amp;cds_page_id=28628&cds_response_key=I6DSLPT2",
			"https://w1.buysub.com/servlet/PrePopGateway?cds_mag_code=ICM&amp;cds_page_id=17217&cds_response_key=I6DSLPTC");
	var rand = Math.floor(Math.random() * flinks.length);
	return flinks[rand];
}
function incWriteFormAction() {
	var formLink = incSubOfferFormLink();				
	document.write('<form action="' + formLink + '" method="post">');
}


<!-- Most Popular/Most Emailed box -->
function selecttab(tabName){

        if(tabName=="pop"){
                document.getElementById('pop').style.backgroundColor="#f0f0e7";
                document.getElementById('pop').style.borderBottom="0";  
                document.getElementById('emailTab').style.backgroundColor="#FFF";
                document.getElementById('emailTab').style.borderBottom="1px solid #CCC";

                document.getElementById('poplink').style.color="#aaa799";
                document.getElementById('emaillink').style.color="#6d6d6e";

                document.getElementById('popContent').style.display="";
                document.getElementById('emailContent').style.display="none";

        }else if (tabName=="email"){
                document.getElementById('emailTab').style.backgroundColor="#f0f0e7";
                document.getElementById('emailTab').style.borderBottom="0";
                document.getElementById('pop').style.backgroundColor="#FFF";
                document.getElementById('pop').style.borderBottom="1px solid #CCC";

                document.getElementById('emaillink').style.color="#aaa799";
                document.getElementById('poplink').style.color="#6d6d6e";

                document.getElementById('emailContent').style.display="";
                document.getElementById('popContent').style.display="none";

        }

        }









// Tab Nav Hover

<!--//--><![CDATA[//><!--

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]>

