<!--
//********************Add page specific javascript here**************************  
function lightUpMenu(menuID){
if (document.getElementById)
   {
var idVal = document.getElementById(menuID);
//alert(menuID)
idVal.style.backgroundColor='#f3f8ad';
 
}
}
   
function switchOffMenu(menuID){
if (document.getElementById)
   {
var idVal = document.getElementById(menuID);
//alert(idVal)
idVal.style.backgroundColor='#fdfef0';
 
}
}

function mixPic1(picName1){
var mixSpan1
var mixSpan2

mixSpan1 = document.getElementById('mixnmatch1')
mixSpan1.innerHTML = "background selected"
document.forms["transport"].mixPicBg.value = picName1
mixSpan2 = document.getElementById('mixnmatch2')
mixSpan2.innerHTML = "Select your graphic"
}

function mixPic2(picName2, picPath){
var mixSpan1
var mixSpan2
var picName1 = document.forms["transport"].mixPicBg.value

mixSpan1 = document.getElementById('mixnmatch1')
mixSpan2 = document.getElementById('mixnmatch2')

if(picName1.length > 0){ 
var secondLetter = picName2.charAt(picName2.length - 1)
var getPic = picPath + "combo/" + picName1 + secondLetter + ".jpg"
var activePic = document.getElementById('1-mn')
activePic.src = getPic
mixSpan1.innerHTML = "You chose " + picName1 + " and " + picName2

//mixSpan2.innerHTML = "<a href='bb_main.php?pageid=9&mixnmatch=" + picName1 + secondLetter +"'>Click me to order this combination now!</a>"
mixSpan2.innerHTML = "<a href='bb_order.php?pageid=9001&cookieId=" + getPic +"'>Click me to order this combination now!</a>"

document.forms["transport"].mixPicBg.value = picName1
document.forms["transport"].mixPicFg.value = picName2
}else{
mixSpan1.innerHTML = "You need to select a background FIRST."
mixSpan2.innerHTML = "&nbsp;"
}
}


function changePics(boxId, picPath, boxStyle, picSize, slideCount, imgName){
var i;
var i2;
var picName;
var thePic = new Array();
var theLetters = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r");
var box1Marker = document.forms["transport"].box1Marker;
//alert(box1Marker)
//alert(box1Marker.value + "  a  ")
if(parseInt(box1Marker.value)==0){
box1Marker.value=2;
}
//alert(box1Marker.value + "  b  ")
var box2Marker = document.forms["transport"].box2Marker
if(parseInt(box2Marker.value)==0){
box2Marker.value=2;
}
//get starting pic in 

//cycle through the images using boxstyle to set max image count

//alert(thePic[i].src)

switch(boxId){
case 1:
// load references to box images
for ( i = 0; i < boxStyle; i++ ){
thePic[i] = document.getElementById(imgName);
picName = thePic[i].id.split("-");

for( i2 = 0; i2 < 18; i2++){
if (picName[1]==theLetters[i2]){
imgName = picName[0] + "-" + theLetters[i2 + 1];
}	//end if
}	//end for(i2)

}	//end for(i)

//  replace src's based on boxMarker
for ( i = 0; i < boxStyle; i++ ){
picName = thePic[i].id.split("-");
//alert(picName);
if (parseInt(box1Marker.value) <= slideCount){
//alert(picName[0] + "  :  " + parseInt(box1Marker.value))
picName[0] = parseInt(box1Marker.value);
}else{
picName[0] = 1;
}
thePic[i].src = picPath + picName[0] + "-" + picName[1] + ".jpg";

}  // end for(i)
 //imcrement boxMarker
if (box1Marker.value < slideCount){
box1Marker.value = parseInt(box1Marker.value) + 1;
}else{
box1Marker.value = 1
}
break;

case 2: 
// load references to box images
for ( i = 0; i < boxStyle; i++ ){
thePic[i] = document.getElementById(imgName);
picName = thePic[i].id.split("-");

for( i2 = 0; i2 < 18; i2++){
if (picName[1]==theLetters[i2]){
imgName = picName[0] + "-" + theLetters[i2 + 1];
}	//end if
}	//end for(i2)

}	//end for(i)

//  replace src's based on boxMarker
for ( i = 0; i < boxStyle; i++ ){
picName = thePic[i].id.split("-");
//alert(box1Marker.value + " - " + slideCount)
if (parseInt(box2Marker.value) <= slideCount){
picName[0] = parseInt(box2Marker.value);
}else{
picName[0] = 1;
}
thePic[i].src = picPath + picName[0] + "-" + picName[1] + ".jpg";
//alert(thePic[i].src)
}  // end for(i)
 //imcrement boxMarker
if (box2Marker.value < slideCount){
box2Marker.value = parseInt(box2Marker.value) + 1;
}else{
box2Marker.value = 1
}
break;
break;
}	//end  


//increase the marker value for the next click
}

function changeStory(numOfPics, picPath, imgID){
var i;
var i2;
var theStory;
var picBase
var picNumber;
var picImage
var imgName
theStory = document.getElementById(imgID);
picImage = theStory.src;
i2 = picImage.indexOf("bb_stories");
if (i2 > -1){
i2 += 11;
imgName = picImage.substr(i2);
picBase = imgName.split("-");
picNumber = picBase[1].split(".")
if (picNumber[0] < 3){
picNumber[0] = parseInt(picNumber[0]) + 1;
}else{
picNumber[0] = 1;}
imgName = "story-"  + picNumber[0] + ".jpg";
theStory.src = picPath + imgName;
}
}

function whatSize(){
 alert(document.body.clientWidth + "********")
 }
 
function isEmpty(s)
{ 
return ((s.length == 0) || (s == null) || (s == " ")) 
}

function check_int(s)
{
var i;
var c;	
for ( i = 0; i < s.length; i++ ){
c = s.charAt(i);		
if (!isDigit(c)) {
return false;}	
}	
return true;	
}

function isDigit (c)
{
return ((c >= "0") && (c <= "9"))
}

function  holidayOver(id) {
var elem = document.getElementById(id)
elem.src="images/holiday-b.jpg"    
}
function  holidayOut(id) {
var elem = document.getElementById(id)
elem.src="images/holiday-a.jpg"    
}
//  -->