//Cookie Creation
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 var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

//Cookie Check
function checkCookies() {
	if (document.cookie.indexOf("iasPoll")!=-1) {
		document.getElementById('poll-container').innerHTML="<h1>latest poll question</h1><div class='ss-q-title'><p class='ss-q-paragraph'>You have already participated in the latest poll. Check back soon for results and future poll questions.</p><p class='ss-q-paragraph'><a href=''>Click here for previous poll results.</a></p></div>";
		}
}

//Search Section
function searchLeave() {
	if(document.searcher.q.value == '') { document.searcher.q.value='Search IAS Training'}
}

function searchSelect() {
	if (document.searcher.q.value == 'Search IAS Training') {document.searcher.q.value=''}
}


//Announcement
function announceClose(){
document.getElementById('announceOpen').style.display = 'none';
}

//Testimonial Section
var testimonial = new Array();
testimonial[0] = "<p class='testquote'><img src='images/start-quote.gif' /> Today, as a retail store owner, I use Brad's training materials every minute, every hour, every day of the week. It's an arsenal I can't be without especially in a challenging economy. It is the single most important tool in sustaining and growing my business. <img src='images/end-quote.gif' /><br /><br />Ara Darakjian - <a href='http://www.darakjian.com/' target='_blank'>Darakjian Jewelers</a></p>";
testimonial[1] = "<p class='testquote'><img src='images/start-quote.gif' /> We have been working with IAS Training and Brad Huisken for the years. During that time our sales have tripled from 3.5 million to nearly 10 million. The Sales Training and Sales Management Systems that IAS Training offers have been instrumental in our success. I would highly recommend IAS Training to anyone serious about sales and profitability. <img src='images/end-quote.gif' /><br /><br />Woody Justice - <a href='http://www.justicejewelers.com/' target='_blank'>Justice Jewelers</a></p>";
testimonial[2] = "<p class='testquote'><img src='images/start-quote.gif' /> IAS Training's Weekly Sales Training Program is fantastic. I love the versatility  and the fact that all the materials are already prepared makes it so easy. The leaders guide is phenomenal, and the participants worksheets really drive home the points. The retention and application is like no other program that I have seen. Thank you and well done. <img src='images/end-quote.gif' /><br /><br />Luisa Graff - <a href='http://www.luisagraffjewelers.com/' target='_blank'>Luisa Graff Jewelers</a></p>";

var nextQuote = 0;

function showTestimonial(){
document.getElementById('testimonial').innerHTML = testimonial[0];
}

function changeQuote(){
  if (nextQuote == testimonial.length-1){
   	nextQuote = 0;
  }

  else {
	nextQuote++;
  }
document.getElementById('testimonial').innerHTML = testimonial[nextQuote];
}

function lastQuote(){
  if (nextQuote == 0){
   nextQuote = testimonial.length-1;
  }
else {
	nextQuote--;
  }
document.getElementById('testimonial').innerHTML = testimonial[nextQuote];
}


//Sidebar boxes
var r_sideBox1 = new Array ();

r_sideBox1[0] = "<div style='display:none;' id='poll-container'></div><div><p class='videoTitle'>video spotlight</p></div><div class='videoContainer'><object width='298' height='224'><param name='movie' value='http://www.youtube.com/v/mxE_yogFMkI&hl=en&fs=1&rel=0&color1=0x5d1719&color2=0xcd311b'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/mxE_yogFMkI&hl=en&fs=1&rel=0&color1=0x5d1719&color2=0xcd311b' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='298' height='224'></embed></object></div>";
r_sideBox1[1] = "<div style='display:none;' id='poll-container'></div><div><p class='videoTitle'>video spotlight</p></div><div class='videoContainer'><object width='298' height='224'><param name='movie' value='http://www.youtube.com/v/uJ5IvkFqft4&hl=en&fs=1&rel=0&color1=0x5d1719&color2=0xcd311b'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/uJ5IvkFqft4&hl=en&fs=1&rel=0&color1=0x5d1719&color2=0xcd311b' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='298' height='224'></embed></object></div>";
r_sideBox1[2] = "<div style='display:none;' id='poll-container'></div><div class='sidebarContainer'><h1>ask brad huisken</h1><a href='ask.html'><img src='images/ask_brad.jpg' /></a><p>Get answers to your Retail Sales related questions straight from the industry expert Brad Huisken. See Brad's answers to others questions.</p><p><a href='ask.html'>Click here for more information.</a></p></div>";
r_sideBox1[3] = "<div style='display:none;' id='poll-container'></div><div class='sidebarContainer'><h1>latest poll question</h1><a href='poll.html'><img src='images/latest_poll.jpg' /></a><p>Gain insight into what is happening in the retail sales world. With your participation, Brad can provide valuable analysis on the results.</p><p><a href='poll.html'>Click here for more information.</a></p></div>";

var j = Math.floor(4*Math.random())

function randomSideBox1(){
document.write(r_sideBox1[j]);
}

var r_sideBox2 = new Array ();

r_sideBox2[0] = "<div class='sidebarContainer'><h1>product spotlight</h1><a href='mystery.html'><img src='images/mystery_small.jpg' /></a><h2>Mystery Shoppers Kit</h2><p>Solve the Service Problems that Are Eating at Your Bottom Line.<p><a href='mystery.html'>Click for more information</a></p></div>";
r_sideBox2[1] = "<div class='sidebarContainer'><h1>product spotlight</h1><a href='munchies.html'><img src='images/munchies_small.gif' /></a><h2>Munchies For Salespeople</h2><p>A book with sales tips you can sink your teeth into. Brad Huisken comes through again with his newest must read!</p><p><a href='munchies.html'>Click for more information</a></p></div>";
r_sideBox2[2] = "<div class='sidebarContainer'><h1>product spotlight</h1><a href='phd.html'><img src='images/ias_phd_small.jpg' /></a><h2>I'm A Salesman! Not A Ph.D.</h2><p>It isn't theory, it isn't philosophy, it isn't hypothetical. It is solid information you can use where it counts: in the sales presentation.</p><p><a href='phd.html'>Click for more information</a></p></div>";
r_sideBox2[3] = "<div class='sidebarContainer'><h1>product spotlight</h1><a href='pmsavid.html'><img src='images/pmsa_dvd_small.jpg' /></a><h2>PMSA Relationship Selling Video Program</h2><p>A live recording of one of Brad Huisken's 1-Day sales seminar.</p><p><a href='pmsavid.html'>Click for more information</a></p></div>";
r_sideBox2[4] = "<div class='sidebarContainer'><h1>product spotlight</h1><a href='pmsaaud.html'><img src='images/pmsa_audio_small.jpg' /></a><h2>PMSA Relationship Selling Audio Program</h2><p>A live recording of one of Brad Huisken's 1-Day sales seminar.</p><p><a href='pmsaaud.html'>Click for more information</a></p></div>";
r_sideBox2[5] = "<div class='sidebarContainer'><h1>product spotlight</h1><a href='psmcaud.html'><img src='images/psmc_audio_small.jpg' /></a><h2>PSMC Professional Sales Management Audio Program </h2><p>A live recording of one of Brad Huisken's 1-Day professional sales management seminars.</p><p><a href='psmcaud.html'>Click for more information</a></p></div>";
r_sideBox2[6] = "<div class='sidebarContainer'><h1>product spotlight</h1><a href='aptitude.html'><img src='images/aptitude_test.jpg' /></a><h2>Aptitude Tests for New <br />Hires</h2><p>IAS Training revolutionizes the way you look at hiring!</p><p><a href='aptitude.html'>Click for more information</a></p></div>";
r_sideBox2[7] = "<div class='sidebarContainer'><h1>product spotlight</h1><a href='proficiency.html'><img src='images/proficiency_exam.jpg' /></a><h2>Proficiency Exams for Current Staff</h2><p>IAS Training revolutionizes the way you look at training!</p><p><a href='proficiency.html'>Click for more information</a></p></div>";
r_sideBox2[8] = "<div class='sidebarContainer'><h1>product spotlight</h1><a href='weekly.html'><img src='images/weekly_dvd_small.jpg' /></a><h2>Weekly Sales Training Meeting Series</h2><p>This is the most complete and up to date professional sales training program ever developed for retail.</p><p><a href='weekly.html'>Click for more information</a></p></div>";
r_sideBox2[9] = "<div class='sidebarContainer'><h1>product spotlight</h1><a href='pandp.html'><img src='images/employee_handbook.jpg' /></a><h2>Employee Handbook / Policy and Procedures Guidelines Kit</h2><p>Provide discipline and structure within your organization.</p><p><a href='pandp.html'>Click for more information</a></p></div>";

var i = Math.floor(10*Math.random())

function randomSideBox2(){
document.write(r_sideBox2[i]);
}

//Poll Section
function pollmsg() {
  if(document.poll.entry_0.value=="Choose"){
    document.getElementById("question").innerHTML="<span style='color: #FF0000;'>Please make a selection before submitting.</span><br />Is traffic in your store up, down, or the same in the past year?";
    }
  else {
    document.getElementById("poll-message").style.display="";
    document.getElementById("poll-message").innerHTML="<h1>latest poll question</h1><div class='ss-q-title'><p class='ss-q-paragraph'>Thanks for your participation! Your answer(s) has been recorded. Check back soon for results and future poll questions.</p><p class='ss-q-paragraph'><a href=''>Click here for previous poll results.</a></p></div>";
    document.getElementById("poll-container").style.display="none";
    document.poll.action="http://spreadsheets.google.com/formResponse?formkey=ck1SbTRESjRNTHFsSUNqSGV5a1B6c3c6MA..";
    createCookie('iasPoll','user answered poll','14')
    }
}