//<![CDATA[

// - Sales_techniques.js

// -------------------------------------------------------------------
// -           Newsletter SignUp Cookie Code
// --------------------------------------------------------------------


// cookie code for newsletter signup for industrialego.com
// The way this works is that each time a new user comes to the
// site, on whatever page they enter on, they will get a popup
// encouraging them to sign up for the newsletter.  If they don't
// sign up then a cookie is set to wait for 6 hours before popping
// up the window again.  This makes it less annoying so that they
// can surf the site without a popup happening all the time
// If they do signup for the newsletter, then a long term cookie
// is set and they will not get the popup ever again (for 12 years)
	
var expDays = 5000; // number of days the signup cookie should last
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

var oneexpDays = .00001; // number of days the count cookie should last
var oneday = new Date(); 
oneday.setTime(oneday.getTime() + (oneexpDays*24*60*60*1000));			
	


function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) {    
	  var j = i + alen;    
	  if (document.cookie.substring(i, j) == arg)      
	    return getCookieVal (j);    
	  i = document.cookie.indexOf(" ", i) + 1;    
	  if (i == 0) break;   
	}  
	return null;
}

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	 
	var path = (argc > 2) ? argv[2] : null;  
	var domain = (argc > 3) ? argv[3] : null;  
	var expires = (argc > 4) ? argv[4] : null; 
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}
//this DeleteCookie function is not working I don't know why
function DeleteCookie (name) {  
var expnow = new Date(); 
alert('deleting the cookie' + name); 
expnow.setTime (expnow.getTime() - 1);  
alert('exp now is ' + expnow);
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + expnow.toGMTString();
}

function PopTheWin(URL, WIDTH, HEIGHT) {

windowprops = "resizable=yes,left=50,top=0,width=" + WIDTH + ",height=" + HEIGHT;
// preview = window.open(URL, "preview", windowprops);
window.open(URL, "front", windowprops);
}

function doPopup() {
url = "http://www.industrialego.com/shameless-sales-tips.htm";

width = 750;  // width of window in pixels
height = 780; // height of window in pixels
delay = 7;    // time in seconds before popup opens
timer = setTimeout("PopTheWin(url, width, height)", delay*1000);
}


// Hover Pop Code
function popWin(){
var ppl="popLayer";var objppl=findObj(ppl);
if (objppl==null){return;}// if the layer does not exist, do nothing.

var args=arguments,movetoX=parseInt(args[0]),movetoY=parseInt(args[1]),movespeed=parseInt(args[2]);
var cycle=10,pxl="";

if (allowpop != 0) {


if(!document.layers){objppl=objppl.style;}
if(objppl.tmofn!=null){clearTimeout(objppl.tmofn);}
var pplcoordX=parseInt(objppl.left),pplcoordY=parseInt(objppl.top);
var xX=movetoX,yY=movetoY;if((pplcoordX!=movetoX)||(pplcoordY!=movetoY)){
   var moveX=((movetoX-pplcoordX)/movespeed),moveY=((movetoY-pplcoordY)/movespeed);
   moveX=(moveX>0)?Math.ceil(moveX):Math.floor(moveX);movetoX=pplcoordX+moveX;
   moveY=(moveY>0)?Math.ceil(moveY):Math.floor(moveY);movetoY=pplcoordY+moveY;
   if((parseInt(navigator.appVersion)>4||navigator.userAgent.indexOf("MSIE")>-1) && (!window.opera)) {pxl="px";}
   if (moveX!=0){eval("objppl.left='" + movetoX + pxl + "'");}
   if (moveY != 0) {eval("objppl.top = '" + movetoY + pxl + "'");}
   var sFunction = "popWin(" + xX + "," + yY + "," + movespeed+ ")";
   objppl.visibility = "visible";

   objppl.tmofn = setTimeout(sFunction,cycle);
   }
 } // end of if allow pop
}

function findObj(theObj, theDoc){
var p, i, foundObj;
if(!theDoc) theDoc = document;
if((p = theObj.indexOf("?")) > 0 && parent.frames.length)
   {theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);}
if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
for (i=0; !foundObj && i < theDoc.forms.length; i++)
foundObj = theDoc.forms[i][theObj];
for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
foundObj = findObj(theObj,theDoc.layers[i].document);
if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
return foundObj;
}
// end Hover Pop Code



function checkForSignupPop() {

	var count = GetCookie('count');
	
	if (count == null) {
	  count=1;
	 // alert(' count is null');
	  SetCookie("count", count, "/", "industrialego.com", oneday);
	
	  
      var signup = GetCookie('signup');
      if (signup == null) {
        // alert(' on homepage they never signed up');
	      doPopup();
	  }
	else {

           // alert(' on homepage they already signed up');
           }

	}
	else {

	 // alert('  count is' + count);
	 // alert(' coockie expires on ' + oneday);
   }


// some pages call an additional pop under if the variable is defined
if ( typeof doRocket != "undefined" ) {
      if (doRocket) {
      // call other Rocket popup
      remotePop();
      }

}


}



function checkForSignupHoverPop() {

	var count = GetCookie('count');
	
	if (count == null) {
	  count=1;
	 // alert(' count is null');
	  SetCookie("count", count, "/", "industrialego.com", oneday);
	
	  
      var signup = GetCookie('signup');
      if (signup == null) {
        // alert(' on homepage they never signed up');
	     // doPopup();
		  
		// start the hover pop
		setTimeout('popWin(10,110,20)',5000);
	  }
	  else {
           // alert(' on homepage they already signed up');
           }

	} // end of if count is null
	else {

	 // alert('  count is' + count);
	 // alert(' coockie expires on ' + oneday);
    }
}




function setSignupCookie() {

	var signup = GetCookie('signup');
	if (signup == null) {
	  signup=1;
	 // alert(' they never signed up');
	  SetCookie("signup", signup, "/", "industrialego.com", exp);
	// alert(' exp is ' + exp);

	}
	else {
	 
	
	 // alert('they already signed up ');
   }
   return true;
}

// Subscription Rocket Stuff



function remotePop() {
   var srl33t_id = "942";

	// fixing to avoid conflicts with other services
	// using the id tag
	
	if ( typeof srl33t_id != "undefined" ) {
	
		this_id = srl33t_id;

	}
	else {
	
		this_id = id;
	
	}

	//URL of Script
	var display="http://www.SubscriptionRocket.com/perl-bin/echo?CID=" + this_id;

	//Prevent Multiple Popups
	var expiration = 3600;

	//Cookie to set
	var pop_cookie = "CID=" + this_id;
	
	//Centering Stuff
   	if (document.all) {
        	var xMax = screen.width, yMax = screen.height;
   	}
   	else 
   	if (document.layers) {
            var xMax = window.outerWidth, yMax = window.outerHeight;
        }
        else {
            var xMax = 640, yMax=480;
	}
    	var xOffset = (xMax - 520)*0.5, yOffset = (yMax - 410)*0.1;
	

	if (document.cookie.search(new RegExp(pop_cookie)) == -1) {
		var cDate = new Date();
		cDate.setSeconds(cDate.getSeconds()+expiration);
		document.cookie = pop_cookie + "; expires="+cDate.toGMTString();

		var win2=window.open(display,'PUW','left=1,right=1,top=0,width=520,height=410,toolbar=no,menubar=no,scrollbars=no,status=no,resizable=no,location=no,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
		win2.blur();window.focus();
	}
}

// -------------------------------------------------------------------
// -           Menu Flyouts Code
// --------------------------------------------------------------------


var activeSub=0;
var SubNum=0;

function reDo(){ window.location.reload() }
/* don't reload now
window.onresize = reDo;
*/

    //Define global variables

	    var timerID = null;
		var timerOn = false;
		var timecount = 1000;
		var what = null;
		var newbrowser = true;
		var check = false;

function initFlyouts(){
    	// alert ("Running Init");
          if (document.layers) {
                      //  alert ("Running Netscape 4");
                        layerRef="document.layers";
                        styleSwitch="";
                        visibleVar="show";
			screenSize = window.innerWidth;
			what ="ns4";


          }else if(document.all){
                      //  alert ("Running IE");
                        layerRef="document.all";
                        styleSwitch=".style";
                        visibleVar="visible";
			screenSize = document.body.clientWidth + 18;
			what ="ie";

		  }else if(document.getElementById){
                      //  alert ("Running Netscape 6");
                        layerRef="document.getElementByID";
                        styleSwitch=".style";
                        visibleVar="visible";
			what="moz";
		  
		  }else{
		  	//alert("Older than 4.0 browser.");
			what="none";
			newbrowser = false;
		  }
		  
 
		window.status='Industrial Ego Sales';
		check = true;
}

	// Turns the layers on and off
function showLayer(layerName){
        	if(check){
        		if (what =="none"){
        			return;
        			}
	        	else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="visible";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
                  }
		 }
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
}

function hideLayer(layerName){
        	if(check){
        		if (what =="none"){
        			return;
        			}
        		else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="hidden";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
				}
        
        	}
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
}


function hideAll(){
				hideLayer('flyoutMenu4');
				/* don't do the newsletter flyout
				 hideLayer('flyoutMenu5');
				 */
				}

function startTime() {
	        if (timerOn == false) {
                timerID=setTimeout( "hideAll()" , timecount);
                timerOn = true;

	        }

		}


function stopTime() {
	        if (timerOn) {
    	        clearTimeout(timerID);
                timerID = null;
                timerOn = false;
	        }
		}

/* why is this here ???
function onLoad(){
			init();
			
			}
*/
		
// -------------------------------------------------------------------
// -           External Functions Code
// --------------------------------------------------------------------
	
			
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);


// -------------------------------------------------------------------
// -           Xtina External Functions Code
// --------------------------------------------------------------------

function xtinatemp() {
document.write('<a href="http://www.industrialego.com/" title="Sales Training Home Page" onMouseover="window.status=\'Sales Training Home Page\'; return true;" "onMouseout="window.status=\'\'; return true;">Home</a>');
}

// set up the div tags for the flyout menus
function make_divFlyouts() {

// put in all window.status messages

document.writeln(' <div id="flyoutMenu4"> <ul>');
document.writeln(' <li> <a href="http://sales-tips.industrialego.com/persuasion-sales-tips/index.htm" onMouseOver="stopTime(); window.status=\'Persuasion Tips\';return true;" onMouseOut="startTime(); window.status=\' \';return true;">Persuasion Tips</a></li>');

document.writeln(' <li> <a href="http://sales-tips.industrialego.com/cold-calling-tips/index.htm" onMouseOver="stopTime(); window.status=\'Cold Calling Tips\';return true;" onMouseOut="startTime(); window.status=\' \';return true;">Cold Calling Tips</a></li>');

document.writeln(' <li> <a href="http://sales-tips.industrialego.com/presentation-sales-tips/index.htm" onMouseOver="stopTime(); window.status=\'Sales Presentation Tips\';return true;" onMouseOut="startTime(); window.status=\' \';return true;">Sales Presentation Tips</a></li> ');

document.writeln(' <li> <a href="http://sales-tips.industrialego.com/motivational-sales-tips/index.htm" onMouseOver="stopTime(); window.status=\'Motivation Sales Tips\';return true;" onMouseOut="startTime(); window.status=\' \';return true;">Motivation Sales Tips</a></li>');

document.writeln(' <li> <a href="http://sales-tips.industrialego.com/executive-selling-tips/index.htm" onMouseOver="stopTime();window.status=\'Executive Selling Tips\';return true;" onMouseOut="startTime(); window.status=\' \';return true;">Executive Selling Tips</a></li>');

document.writeln(' <li> <a class="last" href="http://sales-tips.industrialego.com/competitive-selling-tips/index.htm" onMouseOver="stopTime(); window.status=\'Competitive Selling Tips\';return true;" onMouseOut="startTime(); window.status=\' \';return true;">Competitive Selling Tips</a></li>');

document.writeln('</ul> </div>');

 

 
 
 }
 // ----------------------------------------------------------------------------------
 
 // make the top navigation bar
function make_navBar(adtracker) {

// this is for sales-techniques

document.writeln('<ul>');

// Home
document.writeln(' <li><a href="http://www.industrialego.com/index.html" onMouseOver="hideAll();window.status=\'Sales Training Home Page\';return true ;" onMouseout="window.status=\'\'; return true;">Home</a></li>');

// Sales Skills
if (adtracker != 0)
   {
   /* send them to the sales letter tracking the click */
   document.writeln(' <li><a href="http://www.kickstartcart.com/app/adtrack.asp?AdID=' + adtracker + '" onMouseOver="hideAll(); window.status=\'Learn Persuasive Selling Skills\';return true; " onMouseout="window.status=\'\'; return true;">Sales Skills</a></li>');
   }
   else {
   document.writeln(' <li><a href="http://www.industrialego.com/sales-training-courses/persuasive-selling.htm" onMouseOver="hideAll(); window.status=\'Learn Persuasive Selling Skills\';return true; " onMouseout="window.status=\'\'; return true;">Sales Skills</a></li>');
   }

// Shameless Blog
document.writeln(' <li><a href="http://sales-blog.industrialego.com/" onMouseOver="hideAll();window.status=\'Shameless Sales Blog \';return true ;" onMouseout="window.status=\'\'; return true;">Shameless Blog</a></li> ');

// Sales Tips  
document.writeln(' <li><a href="http://sales-tips.industrialego.com/" onMouseOver="hideAll();window.status=\'Dozens of Articles to Help Increase Your Sales\' ; showLayer(\'flyoutMenu4\'); stopTime();return true;" onMouseOut="startTime(); window.status=\'\'; return true;"> Sales Tips</a></li>');
     
// Newsletter
document.writeln(' <li><a href="http://sales-tips.industrialego.com/sales-newsletter/" onMouseOver="hideAll();window.status=\'Free EGOPOWER Sales Tips Newsletter \';return true; " onMouseout="window.status=\'\'; return true;">Newsletter</a></li>');

// Contact
document.writeln(' <li><a href="http://sales-techniques.industrialego.com/contactinfo.htm" onMouseOver="hideAll();window.status=\'How to Contact Industrial Ego Sales Training\';return true; " onMouseout="window.status=\'\'; return true;">Contact</a></li>');

document.writeln('</ul>');
 }

 // ----------------------------------------------------------------------------------

 // make the bottom footer
function make_footer() {

/*document.writeln('<a href="#">Terms and Conditions of Use</a> |  <a href="#">Earnings Disclaimer</a>  | <a href="#">Privacy Policy</a> ');*/
		
document.writeln('<p>Copyright \&copy; 1999-2012. All Rights Reserved.<br>');
document.writeln('Shamus Brown, Industrial EGO Sales<br>');
document.writeln('302 Washington Street, #125<br>');
document.writeln('San Diego, CA 92103 USA<br>');
document.writeln('www.IndustrialEGO.com</p>');

}
 // ----------------------------------------------------------------------------------

function PrintPage(){
   if (window.print) 
    {
       window.print();
    }
    else
    {
       alert("I'm sorry, Your Web Browser does not support this print method. To print, close this window and select File>Print from your drop down menus.");
    }
}

function PrintThisPage(){

  document.writeln(' <font size="4" face="wingdings 2">&#054;</font><b> <a href="javascript:PrintPage()">Print This Page</b></a><br> ');
  }
  
function EmailThisPage() {

 document.writeln(' <font size="4" face="wingdings">&#042;</font>&nbsp; <b>');
 document.writeln( '<A HREF=\'mailto:?Subject=Your Friend Reccomended this Article from IndustrialEgo.com&body=A friend of yours highly recommend you read this: ' +document.URL+ '. This page comes from http://www.IndustrialEGO.com, the best place for sales training information.\'>E-mail  to a Friend</A></b><br>');
}
 // ----------------------------------------------------------------------------------


function newsletterSignupCode(mystring) {

/* if nothing was passed in */
if (mystring == 0 ) {
  /* alert('mystring is 0'); */
  mystring = "sales techniques page";
  } 
  /* else we pass the string to aweber to log where this user is
  coming from */


// put this here so that we can easily change it across all pages

document.writeln( '<CENTER><FORM METHOD="POST" onSubmit="return setSignupCookie();"');
document.writeln( 'ACTION="http://secure.aweber.com/scripts/addlead.pl">');
document.writeln( '<input type="hidden" name="unit" value="egopower">');
document.writeln( '<input type="hidden" name="redirect" value="http://sales-tips.industrialego.com/sales-newsletter/thankyou.htm">');
document.writeln( '<input type="hidden" name="aweber_adtracking" value="' + mystring + '">');
document.writeln( '<input type="hidden" name="aweber_message" value="1">');
document.writeln( '<input type="hidden" name="aweber_required" value="from">');
document.writeln( '<input type="hidden" name="aweber_forward_vars" value="1">');

document.writeln( '<table align="center" width="90%" border="1" cellpadding="3" cellspacing="0" bordercolor="#999999"><tr><td>');
document.writeln( '<p align="center"><b>Join The FREE EGOPOWER Sales Tips Newsletter</b></p>');
document.writeln( '<p align="center"><b><font color="#000099">Enter Your Email & Click The Button Now!</font></b></p>');
document.writeln( '<TABLE align="center">');
document.writeln( '<TR><TD align="right" class="small">Name:</TD><TD><input TYPE="text" name="name" size="12"></TD></TR>');
document.writeln( '<TR><TD align="right" class="small">Email:</TD><TD><input TYPE="text" name="from" size="12"></TD></TR>');
document.writeln( '<TR><TD colspan="2"><button TYPE="SUBMIT" NAME="submit"><b>FREE</b> Sales Tips</button></TD></TR>');
document.writeln( '</TABLE>');
document.writeln( '<p align="center">Join now and you\'ll get Shamus Brown\'s original sales articles sent every week straight to your email inbox.<br>');
document.writeln( '<a href="http://sales-tips.industrialego.com/sales-newsletter/" onMouseover="window.status=\'Click for details about the EGOPOWER Sales Newsletter\'; return true;" onMouseout="window.status=\'\'; return true;">More Info... </a>');
document.writeln( '</p></td></tr></table></FORM></CENTER>');
}

 // ----------------------------------------------------------------------------------

/*
Disable right mouse click Script 
*/

var message ="\n         © Copyright 1999-2010 by Shamus Brown. All Rights Reserved.\n\nMaterial on this website is Copyrighted and may not be used without permission.       \n";
function click(e) {
  if (document.all) {
    if (event.button == 2) {
      alert(message);
      return false;
    }
  }
  if(document.layers) {
    if (e.which == 3) {
     alert(message);
     return false;
     }
    }
} 

if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
}

document.onmousedown=click;





//]]>
