// JavaScript Document

/*
CSS Browser Selector v0.2.7
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/


/*
    * ie - Internet Explorer (All versions)
    * ie8 - Internet Explorer 8.x
    * ie7 - Internet Explorer 7.x
    * ie6 - Internet Explorer 6.x
    * ie5 - Internet Explorer 5.x
    * gecko - Mozilla, Firefox (all versions), Camino
    * ff2 - Firefox 2
    * ff3 - Firefox 3
    * opera - Opera (All versions)
    * opera8 - Opera 8.x
    * opera9 - Opera 9.x
    * konqueror - Konqueror
    * webkit or safari - Safari, NetNewsWire, OmniWeb, Shiira

*/

var css_browser_selector = function() {var ua=navigator.userAgent.toLowerCase(),is=function(t){return ua.indexOf(t) != -1;},h=document.getElementsByTagName('html')[0],b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?'gecko ff2':is('firefox/3')?'gecko ff3':is('gecko/')?'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';var c=b+os+' js'; h.className += h.className?' '+c:c;}();



window.onload=function() {
	 fillContent();
	 if(document.getElementById('ticker')){
		 MM_timelinePlay('scrollTicker');
	 }
	 if(document.getElementById('quotes')){
		 MM_timelinePlay('rotQuot');
	 }
}

var siteContent = new Array();
	/* footer content */
	siteContent[0]='<div class="footerLinks">'+ 
			'<a href="/index.html" id="footerHome">Home</a>'+
			'<a href="/html/aboutUs.html" id="footerAboutUs">About Us</a>'+
			'<a href="/html/affiliates.html" id="footerAffiliates">Affiliates/Partners</a>'+
			'<a href="/html/policies.html" id="footerPolicies">Privacy Policy</a>'+
			'<a href="/html/terms.html" id="footerTerms">Terms of Use</a>'+
			'<a href="/html/contactUs.html" id="footerContactUs">Contact Us</a>'+
			'</div>'+
			'<div class="copyRight">&copy; 2009 ShiftHound, Inc. Web-based Workforce Management (WFM) Software-as-a-Service (SaaS). All Rights Reserved.</div>';
			
	/* Businesses content */
	siteContent[1]='<li>Fill open shifts and schedule your workforce online and real time</li>'+
				'<li>Reduce overtime and temporary labor costs</li>'+
				'<li>Save money and time lost to managerial hours spent scheduling</li>'+
				'<li>Increase competitiveness, empower and retain the best people, and let them help you fill your open shifts</li>'+
				'<li>Profit from more efficient multi-location scheduling, borrowing and sharing employees to fill open shifts</li>'+
				'<li>Enable effective decision-making with instant visibility of locations, shifts &amp; schedules, employees, risk areas and budget/cost impacts</li>'+
				'<li>Easy to implement and use, leading to greater adoption and return on investment</li>';
				
	/* Employees content */
	siteContent[2]='<li>Accessible to all of your employees via the web 24/7</li>'+
				'<li>Empower employees with online tools to request when and where they work to	fill open shifts</li>'+
				'<li>Improve employee satisfaction with a level playing field, as all employees are notified of shifts equally via email and text messages</li>'+
				'<li>Ease the burden on managers and increase job satisfaction</li>'+
				'<li>Easy and fun to use, including open shift requesting, PTO and shift swapping</li>';

var siteTags = new Array();
	siteTags[0]='footerContent';
	siteTags[1]='businessesContent';
	siteTags[2]='employeesContent';

function fillContent() {
	for(i=0;i<siteTags.length;i++) {
		if(document.getElementById(siteTags[i])) {
			var myDiv = document.getElementById(siteTags[i]);
			myDiv.innerHTML=siteContent[i];
		}
	}
}


function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('Please correct the following:\n'+errors);
    document.MM_returnValue = (errors == '');
} }

function showReferrerOption(obj) {
	var myLabel=document.getElementById('referrerOptionLabel');
	var myValue=document.getElementById('referrerOptionValue');
	myLabel.innerHTML='&nbsp;';
	myValue.innerHTML='&nbsp;';
	if(obj.value=='Search engine') {
		myLabel.innerHTML='Which one?';
		myValue.innerHTML='<select id="Search Engine" name="Search Engine">'+
		'<option value="" selected="selected">-- Select One --</option>'+
		'<option value="AOL" >AOL</option>'+
		'<option value="Ask.com" >Ask.com</option>'+
		'<option value="CNET/Search.com" >CNET/Search.com</option>'+
		'<option value="Cuil" >Cuil</option>'+
		'<option value="Google" >Google</option>'+
		'<option value="Live Search" >Live Search</option>'+
		'<option value="MSN Search" >MSN Search</option>'+
		'<option value="Yahoo Search" >Yahoo Search</option>'+
		'</select>';
	}
	else if(obj.value=='Referred by a contact') {
		myLabel.innerHTML='Who?';
		myValue.innerHTML='<input type="text" id="Who" name="Who" value="" />';
	}
	else if(obj.value=='One of your customers') {
		myLabel.innerHTML='Which one?';
		myValue.innerHTML='<input type="text" id="Which customer" name="Which customer" value="" />';
	}
	else if(obj.value=='A newspaper or magazine article') {
		myLabel.innerHTML='Which one?';
		myValue.innerHTML='<input type="text" id="Which article" name="Which article" value="" />';
	}
	else if(obj.value=='A conference or trade show') {
		myLabel.innerHTML='Which one?';
		myValue.innerHTML='<input type="text" id="Which conference" name="Which conference" value="" />';
	}
	else if(obj.value=='Another website') {
		myLabel.innerHTML='Which one?';
		myValue.innerHTML='<input type="text" id="Which site" name="Which site" value="" />';
	}
	else if(obj.value=='Other') {
		myLabel.innerHTML='Please specify:';
		myValue.innerHTML='<input type="text" id="Other" name="Other" value="" />';
	}
}



// Append UMS tracking info on landing pages that come from UMS
function tagUMS(){
	if(window.location.href.indexOf('UMS')>=0){
		document.myLandingForm.description.value+=' UMS';
		var myLeadSource=document.createElement('input');
		myLeadSource.setAttribute('type','hidden');
		myLeadSource.setAttribute('name','lead_source');
		myLeadSource.setAttribute('id','lead_source');
		myLeadSource.setAttribute('value','SP - UMS / Wilson');
		document.myLandingForm.appendChild(myLeadSource);
	}
}