var cartText = "";
if(cartQuantity && cartQuantity > 0){
    cartText = "<b>" + cartQuantity + "</b> item\(s\) / <b>$" + cartTotal + "</b>";
   // cartText = "Your Cart: <b>" + cartQuantity + "</b> item\(s\)<br> Subtotal: <b>$" + cartTotal + "</b>";
}
else{
    cartText = "Your Cart: <b>0</b> items(s)";
}
var cartShip = "";
if(cartQuantity && cartQuantity > 0){
    cartText = "<b>" + cartQuantity + "</b> item\(s\) / <b>$" + cartTotal + "</b>";
  cartShip = cartMsg2;
}
else{
}

function Rcertify() 

{

popupWin = window.open('http://www.bbbonline.org/cks.asp?id=10310021342836004', 'Participant','location=yes,scrollbars=yes,width=450,height=300'); 

window.name = 'opener';

}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=310,left =300,top =200');");
} 

function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=425,left =300,top =200');");
} 

function viewCart(command){

var scriptName = "quikstore.cgi";
var linkURL = "http://www.hairvitamins.net/cgi-bin/quikstore.cgi";
var task = "?view_cart=yes"
if(command == "checkout"){
     task = "?checkout=yes"
}
linkURL += task;

	var myLocation = unescape(document.location);
	myLocation = myLocation.substring(1).split('/');

     if(myLocation[myLocation.length - 1].substring(0,scriptName.length) == scriptName){

          // GET Requests
		var qsQuery = unescape(document.location.search.replace(/\+/g,' '));
        qsQuery = qsQuery.replace('?','&');
        qsQuery = qsQuery.replace("checkout=yes&",'');
        qsQuery = qsQuery.replace("view_cart=yes&",'');

          if(qsQuery.length > 1){
     		linkURL += qsQuery;
          }
          else{
               for(i = 0; i < document.forms[0].elements.length; i++){
                    var inType = document.forms[0].elements[i].type;
                    if(inType == "hidden"){
                         var fieldName = document.forms[0].elements[i].name;
                         var fieldValue = document.forms[0].elements[i].value;
                         if(fieldName == "view_cart"){
                            continue;
                         }
                         if(fieldName == "checkout"){
                            continue;
                         }
                         if(fieldValue != "shipping.html"){
                              qsQuery += "&" + fieldName + "=" + fieldValue;
                         }
                    }
               }
               linkURL += qsQuery;
          }
     }
     else{
          var PAGE = myLocation[myLocation.length - 1];
          linkURL += "&page=" + PAGE + "&store_type=html";
     }

document.location = linkURL;
}


function goToPage(dd) {
var ind = dd.selectedIndex;
if (ind == 0) { return; }
var url = dd.options[ind].value
document.location=url;
}





//User defined variables - change these variables to alter the behaviour of the script
var ImageFolder = "images"; //Folder name containing the images
var ImageFileNames = new Array('giftflip_mr.jpg', 'giftflip_mf.jpg', 'giftflip_lp.jpg', 'giftflip_fl.jpg' ); //List of images to use
var ImageURLs = new Array('http://www.salonweb.com/michelle_roy/', 'http://www.salonweb.com/mei_fa/', 'http://www.salonweb.com/linea-pro/', 'http://www.salonweb.com/swarovski_accessory.htm'); //List of hyperlinks associated with the list of images
var DefaultURL = 'http://www.salonweb.com/gifts.htm'; //Default hyperlink for the Banner Ad
var DisplayInterval = 4; //Number of seconds to wait before the next image is displayed
var TargetFrame = ""; //Name of the frame to open the hyperlink into

//Internal variables (do not change these unless you know what you are doing)
var IsValidBrowser = false;
var BannerAdCode = 0;
var BannerAdImages = new Array(NumberOfImages);
var DisplayInterval = DisplayInterval * 1000;
var NumberOfImages = ImageFileNames.length;

//Add a trailing forward slash to the ImageFolder variable if it does not already have one
if (ImageFolder.substr(ImageFolder.length - 1, ImageFolder.length) != "/" && ImageFolder != "") { ImageFolder += "/";
}

if (TargetFrame == '') {
var FramesObject = null;
} else {
var FramesObject = eval('parent.' + TargetFrame);
}

//Function runs when this page has been loaded and does the following:
//1. Determine the browser name and version  (since the script will only work on Netscape 3+ and Internet Explorer 4+).
//2. Start the timer object that will periodically change the image displayed by the Banner Ad.
//3. Preload the images used by the Banner Ad rotator script
function InitialiseBannerAdRotator() {

//Determine the browser name and version
//The script will only work on Netscape 3+ and Internet Explorer 4+
var BrowserType = navigator.appName;
var BrowserVersion = parseInt(navigator.appVersion);

if (BrowserType == "Netscape" && (BrowserVersion >= 3)) {
IsValidBrowser = true;
}

if (BrowserType == "Microsoft Internet Explorer" && (BrowserVersion >= 4)) {
IsValidBrowser = true;
}

if (IsValidBrowser) {
TimerObject = setTimeout("ChangeImage()", DisplayInterval);
BannerAdCode = 0;

for (i = 0; i < NumberOfImages; i++) {
BannerAdImages[i] = new Image();
BannerAdImages[i].src = ' ' + ImageFolder + ImageFileNames[i];
}

}

}

//Function to change the src of the Banner Ad image
function ChangeImage() {

if (IsValidBrowser) {
BannerAdCode = BannerAdCode + 1;

if (BannerAdCode == NumberOfImages) {
BannerAdCode = 0;
}

window.document.bannerad.src = BannerAdImages[BannerAdCode].src;
TimerObject = setTimeout("ChangeImage()", DisplayInterval);
}
}

//Function to redirect the browser window/frame to a new location,
//depending on which image is currently being displayed by the Banner Ad.
//If Banner Ad is being displayed on an old browser then the DefaultURL is displayed
function ChangePage() {

if (IsValidBrowser) {

if (TargetFrame != '' && (FramesObject)) {
FramesObject.location.href = ImageURLs[BannerAdCode];
} else {
document.location = ImageURLs[BannerAdCode];
}

} else if (!IsValidBrowser) {
document.location = DefaultURL;
}

}
