function UpdateFileUpload(fieldid,fileFieldVal)
{
document.uniForm[fieldid].value = fileFieldVal;
}
function preloadImages()
{
var d=document; if(d.images){ if(!d.p) d.p=new Array();
var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
function findObj(n, d)
{
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function swapImage()
{
var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function swapImgRestore()
{
var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function spawnWindow(theURL,winName,features,posX,posY)
{
myWindow=window.open(theURL,winName,features);
if (!myWindow.opener) myWindow.opener = self;
myWindow.focus();
if(posX || posY)
{
myWindow.moveTo(posX,posY);
}
}
function getWinSize()
{
if ((document.layers||document.getElementById)&&(!document.all))
{
winWidth = innerWidth;
winHeight = innerHeight;
}
if (document.all)
{
winWidth = document.body.clientWidth;
winHeight = document.body.clientHeight-3;
}
}
function setCookie(name, value, expires, path, domain, secure)
{
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;
}
function getCookie(name)
{
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1)
{
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else
{
begin += 2;
var end = document.cookie.indexOf(";", begin);
if (end == -1)
end = dc.length;
return unescape(dc.substring(begin + prefix.length, end));
}
}
function deleteCookie(name, path, domain)
{
if (getCookie(name))
{
document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}highZ = 1;function showHide(el,showonly,hideonly)
{
var elObj = document.getElementById(el);
if(elObj.style.display == "none")
{
elObj.style.display = "";
highZ++;
elObj.style.zIndex = highZ;
}
else
{
elObj.style.display = "none";
}
if(showonly)
{
elObj.style.display = "";
highZ++;
elObj.style.zIndex = highZ;
}
if(hideonly)
{
elObj.style.display = "none";
}
}
function addEvent(obj, evType, fn)
{
if (obj.addEventListener)
{
obj.addEventListener(evType, fn, false);
return true;
}
else if (obj.attachEvent)
{
var r = obj.attachEvent("on"+evType, fn);
return r;
}
else
{
return false;
}
}var NavMenus = new Array('Ticks', 'Sched', 'Photo', 'Store', 'Stats', 'Media', 'Infor', 'Kzone');
var LastViewed = '';function ShowNav(picked)
{
var ShowMe = document.getElementById('sN_' + picked);
for (i=0;i<NavMenus.length;i++)
{
if (document.getElementById('sN_' + NavMenus[i]).style.display != 'none' && NavMenus[i] != picked)
{
document.getElementById('sN_' + NavMenus[i]).style.display = 'none';
}
}
if (LastViewed != picked)
{
ShowMe.style.display = 'inline';
}
clearInterval(checkOpen);
}function HideNav()
{
for (i=0;i<NavMenus.length;i++)
{
document.getElementById('sN_' + NavMenus[i]).style.display = 'none';
}
clearInterval(checkOpen);
}
function whatClicked(obj)
{
var targ
if(!obj)
{
var obj = window.event
}
if(obj.target)
{
targ = obj.target
}
else if(obj.srcElement)
{
targ = obj.srcElement
}
if (targ.nodeType == 3)
{
targ = targ.parentNode
}if(targ.tagName == 'TD' && targ.id == '')
{
targ = targ.parentNode
}
var result = new Array();
result[0] = targ.tagName;
result[1] = targ.id;
if(targ.getAttribute('rel'))
{
result[2] = targ.getAttribute('rel');
}
if(targ.getAttribute('tt'))
{
result[3] = targ.getAttribute('tt');
}
return result;
}
var elObj = false;
var elID = false;
var elRel = false;
var checkOpen = false;function menuMouseActions(event)
{
click = whatClicked(event);elObj = click[0];
elID = click[1];
elRel = click[2];if(elID.substring(0,2) == 'sN' || elID.substring(0,2) == 'mN')
{
clearInterval(checkOpen);
} else {
clearInterval(checkOpen);
checkOpen = setInterval('HideNav()',1000);
}
return elID;
}
function srslyWTF(){
alert('Seriously dude, WTF!');
}function swapMenuBG(action, divID){switch(action){
case "over":
$(divID).setStyle({
'background': "url('/images/misBG.gif') top center no-repeat"
});
break;
case "out":
$(divID).setStyle({
'background': "url('/images/miBG.gif') top center repeat-y"
});
break;
}
}function catPointer(action, imgID){
switch(action){
case "over":
$('mcat'+imgID).setStyle({
'background': "url('/images/mcArrow.gif') center left no-repeat"
});
$('mcl'+imgID).setStyle({
'color': "#ffffff"
});
break;
case "out":
$('mcat'+imgID).setStyle({
'background': "url('/images/mcArrow_s.gif') center left no-repeat"
});
$('mcl'+imgID).setStyle({
'color': "#f0735d"
});
break;
}
}function alterShipMask(){if(document.getElementById('multipleShip').checked == false){
document.getElementById('shipMask').innerHTML = '';
if(document.getElementById('USER2').checked != false){
switch(document.getElementById('shipMask').style.display){
case 'inline':
document.getElementById('shipMask').style.display = 'none';
break;
case 'none':
document.getElementById('shipMask').style.display = 'inline';
break;
}
}
}
else{
document.getElementById('shipMask').style.display = 'inline';
document.getElementById('shipMask').innerHTML = 'You will be able to fill out the Shipping Addresses on the next screen.';
}}function calcGCCost(){
var totalQtyArr = [];fives = (!isNaN($('q_5').value) && $('q_5').value.length!=0 ? $('q_5').value : 0);
tens = (!isNaN($('q_10').value) && $('q_10').value.length!=0 ? $('q_10').value : 0);
fifteens = (!isNaN($('q_15').value) && $('q_15').value.length!=0 ? $('q_15').value : 0);
twenties = (!isNaN($('q_20').value) && $('q_20').value.length!=0 ? $('q_20').value : 0);
twenetyfives = (!isNaN($('q_25').value) && $('q_25').value.length!=0 ? $('q_25').value : 0);
thirties = (!isNaN($('q_30').value) && $('q_30').value.length!=0 ? $('q_30').value : 0);
fourties = (!isNaN($('q_40').value) && $('q_40').value.length!=0 ? $('q_40').value : 0);
fifties = (!isNaN($('q_50').value) && $('q_50').value.length!=0 ? $('q_50').value : 0);$('q_5_total').innerHTML = '$'+(fives*5)+'.00';
$('q_10_total').innerHTML = '$'+(tens*10)+'.00';
$('q_15_total').innerHTML = '$'+(fifteens*15)+'.00';
$('q_20_total').innerHTML = '$'+(twenties*20)+'.00';
$('q_25_total').innerHTML = '$'+(twenetyfives*25)+'.00';
$('q_30_total').innerHTML = '$'+(thirties*30)+'.00';
$('q_40_total').innerHTML = '$'+(fourties*40)+'.00';
$('q_50_total').innerHTML = '$'+(fifties*50)+'.00';totalQtyArr[0] = fives;
totalQtyArr[1] = tens;
totalQtyArr[2] = fifteens;
totalQtyArr[3] = twenties;
totalQtyArr[4] = twenetyfives;
totalQtyArr[5] = thirties;
totalQtyArr[6] = fourties;
totalQtyArr[7] = fifties;
$('totalqty').value = totalQtyArr;theSubtotal = (fives*5)+(tens*10)+(fifteens*15)+(twenties*20)+(twenetyfives*25)+(thirties*30)+(fourties*40)+(fifties*50);
$('v_subtotal').innerHTML = '$'+( theSubtotal )+'.00';
$('subtotal').value = theSubtotal;shippingCost = 0;
switch($('whichship').value){
case '0':
shippingCost = 0;
break;
case '5':
shippingCost = 5;
}
$('shipping').innerHTML = '$'+(shippingCost)+'.00';fulltotal = (fives*5)+(tens*10)+(fifteens*15)+(twenties*20)+(twenetyfives*25)+(thirties*30)+(fourties*40)+(fifties*50)+(shippingCost);
$('v_total').innerHTML = '$'+(fulltotal)+'.00';
$('total').value = fulltotal;}

function calcGCCost_b5g1(){
var totalQtyArr = [];

fives = (!isNaN($('q_5').value) && $('q_5').value.length!=0 ? $('q_5').value : 0);
tens = (!isNaN($('q_10').value) && $('q_10').value.length!=0 ? $('q_10').value : 0);
fifteens = (!isNaN($('q_15').value) && $('q_15').value.length!=0 ? $('q_15').value : 0);
twenties = (!isNaN($('q_20').value) && $('q_20').value.length!=0 ? $('q_20').value : 0);
twenetyfives = (!isNaN($('q_25').value) && $('q_25').value.length!=0 ? $('q_25').value : 0);
thirties = (!isNaN($('q_30').value) && $('q_30').value.length!=0 ? $('q_30').value : 0);
fourties = (!isNaN($('q_40').value) && $('q_40').value.length!=0 ? $('q_40').value : 0);
fifties = (!isNaN($('q_50').value) && $('q_50').value.length!=0 ? $('q_50').value : 0);

$('q_5_total').innerHTML = '$'+(fives*5)+'.00';
$('q_10_total').innerHTML = '$'+(tens*10)+'.00';
$('q_15_total').innerHTML = '$'+(fifteens*15)+'.00';
$('q_20_total').innerHTML = '$'+(twenties*20)+'.00';
$('q_25_total').innerHTML = '$'+(twenetyfives*25)+'.00';
$('q_30_total').innerHTML = '$'+(thirties*30)+'.00';
$('q_40_total').innerHTML = '$'+(fourties*40)+'.00';
$('q_50_total').innerHTML = '$'+(fifties*50)+'.00';

totalQtyArr[0] = fives;
totalQtyArr[1] = tens;
totalQtyArr[2] = fifteens;
totalQtyArr[3] = twenties;
totalQtyArr[4] = twenetyfives;
totalQtyArr[5] = thirties;
totalQtyArr[6] = fourties;
totalQtyArr[7] = fifties;
$('totalqty').value = totalQtyArr;

theSubtotal = (fives*5)+(tens*10)+(fifteens*15)+(twenties*20)+(twenetyfives*25)+(thirties*30)+(fourties*40)+(fifties*50);
$('v_subtotal').innerHTML = '$'+( theSubtotal )+'.00';
$('subtotal').value = theSubtotal;

shippingCost = 0;
switch($('whichship').value){
case '0':
shippingCost = 0;
break;
case '5':
shippingCost = 5;
}
$('shipping').innerHTML = '$'+(shippingCost)+'.00';

fulltotal = (fives*5)+(tens*10)+(fifteens*15)+(twenties*20)+(twenetyfives*25)+(thirties*30)+(fourties*40)+(fifties*50)+(shippingCost);
$('v_total').innerHTML = '$'+(fulltotal)+'.00';
$('total').value = fulltotal;

bfivetotal = (theSubtotal/5);
if(bfivetotal != 0){
$('b5g1_output').innerHTML = 'You will receive an additional<br /><span style="font-weight:bold;font-size:12px;">$'+bfivetotal+'.00</span><br />in complimentary gift certificates.';
$('b5g1_free').value = bfivetotal;
}
else{
$('b5g1_output').innerHTML = '';
$('b5g1_free').value = bfivetotal;
}
}function validQTY(){GCFORM = document.step2;
if(isNaN(GCFORM.CARD5.value) || isNaN(GCFORM.CARD10.value) || isNaN(GCFORM.CARD15.value) || isNaN(GCFORM.CARD20.value) || isNaN(GCFORM.CARD25.value) || isNaN(GCFORM.CARD30.value) || isNaN(GCFORM.CARD40.value) || isNaN(GCFORM.CARD50.value)){
alert('Invalid Gift Certificate Quantity Detected.');
return false;
}
return true;}function diffAdd(target){
targetDiv = document.getElementById(target+"_daf");
sbox = document.getElementById(target+"_da");
fFName = document.getElementById(target+"_daf_fname");
fLName = document.getElementById(target+"_daf_lname");
fPhone = document.getElementById(target+"_daf_phone");
fStreet = document.getElementById(target+"_daf_street");
fCity = document.getElementById(target+"_daf_city");
fState = document.getElementById(target+"_daf_state");
fZip = document.getElementById(target+"_daf_zip");switch(sbox.value){
case 'different':
targetDiv.style.display = 'inline';
fFName.value = '';
fLName.value = '';
fPhone.value = '';
fStreet.value = '';
fCity.value = '';
fState.selectedIndex = 0;
fState.value = '';
fZip.value = '';
break;
default:
targetDiv.style.display = 'none';
fFName.value = '';
fLName.value = '';
fPhone.value = '';
fStreet.value = '';
fCity.value = '';
fState.selectedIndex = 0;
fState.value = '';
fZip.value = '';
break;
}
}

function diffAdd_b5g1(target){
targetDiv = document.getElementById(target+"_daf");
sbox = document.getElementById(target+"_da");
fFName = document.getElementById(target+"_daf_fname");
fLName = document.getElementById(target+"_daf_lname");
fPhone = document.getElementById(target+"_daf_phone");
fStreet = document.getElementById(target+"_daf_street");
fCity = document.getElementById(target+"_daf_city");
fState = document.getElementById(target+"_daf_state");
fZip = document.getElementById(target+"_daf_zip");
fComp = document.getElementById(target+"_comp");

switch(sbox.value){
case 'different':
targetDiv.style.display = 'inline';
fFName.value = '';
fLName.value = '';
fPhone.value = '';
fStreet.value = '';
fCity.value = '';
fState.selectedIndex = 0;
fState.value = '';
fZip.value = '';
fComp.selectedIndex = 0;
break;
default:
targetDiv.style.display = 'none';
fFName.value = '';
fLName.value = '';
fPhone.value = '';
fStreet.value = '';
fCity.value = '';
fState.selectedIndex = 0;
fState.value = '';
fZip.value = '';
fComp.selectedIndex = 1;
break;
}
}function vPaybacks(form){
if (!checkString(form.fn, "First Name"))
        return false;
       
    if (!checkString(form.ln, "Last Name"))
        return false;    if (!checkString(form.ad, "Address"))
        return false;
        
    if (!checkString(form.ct, "City"))
        return false;if (!isStateCode(getComboValue(form.st), false)) 
{
    form.st.focus();
    alert("This field must be a valid U.S. state. Please select it now.");
    return false;
    }    if (!checkZIPCode(form.zp))
        return false;    if (!checkUSPhone(form.hp))
        return false;    if (!checkEmail(form.em))
        return false;
        
if (!getComboValue(form.bdm))
{
    form.bdm.focus();
    alert("This field must be a valid month. Please select it now.");
    return false;
    }
        
if (!getComboValue(form.bdd))
{
    form.bdd.focus();
    alert("This field must be a valid day. Please select it now.");
    return false;
    }
        
if (!getComboValue(form.bdy)) 
{
    form.bdy.focus();
    alert("This field must be a valid year. Please select it now.");
    return false;
    }
    
    form.submit();
}function clearSearchBox(){
if($('searchq').value=='Search...'){
$('searchq').value='';
}
}function showEvent(divID){
targetDiv = document.getElementById(divID);targetDiv.style.display = 'inline';
}function hideEvent(divID){
targetDiv = document.getElementById(divID);targetDiv.style.display = 'none';
}function maxLen(formEle){if(formEle.value.length >= 50){
formEle.value = formEle.value.substr(0, 50);
}
}function paybacksHeard(value){
if(value == 'Radio Commercial'){
document.getElementById('station').style.display='inline';
}
else{
document.getElementById('station').style.display='none';
}
}
