var allLImagesOn3 = new Array("../Assets/Images/value_kits_on.jpg","../Assets/Images/accessories_on.jpg","../Assets/Images/description_on.jpg","../Assets/Images/box_content_on.jpg","../Assets/Images/reviews_on.jpg", "../Assets/Images/ImgGallery_on.jpg", "../Assets/Images/promotions_tab_on.jpg", "../Assets/Images/KitIncludes_on.jpg", "../Assets/Images/MoreBuyingOptions_on.jpg");
var allLImagesOff3 = new Array("../Assets/Images/value_kits_off.jpg","../Assets/Images/accessories_off.jpg","../Assets/Images/description_off.jpg","../Assets/Images/box_content_off.jpg","../Assets/Images/reviews_off.jpg", "../Assets/Images/ImgGallery_off.jpg", "../Assets/Images/promotions_tab_off.jpg", "../Assets/Images/KitIncludes_off.jpg", "../Assets/Images/MoreBuyingOptions_off.jpg");
var allLImagesOffC3 = new Array("../Assets/Images/value_kits_on.jpg","../Assets/Images/accessories_on.jpg","../Assets/Images/description_on.jpg","../Assets/Images/box_content_on.jpg","../Assets/Images/reviews_on.jpg", "../Assets/Images/ImgGallery_on.jpg","../Assets/Images/promotions_tab_on.jpg",  "../Assets/Images/KitIncludes_on.jpg", "../Assets/Images/MoreBuyingOptions_on.jpg");

var ObjLImg_on3 = new Array();
var ObjLImg_off3 = new Array();
var ObjLImg_offC3 = new Array();
var tab;

PreloadImages3();

// Preloading all the roll-over images in the document:
function PreloadImages3() {
    for (var i=0; i<allLImagesOn3.length ; i++){
        ObjLImg_on3[i] = new Image();
        ObjLImg_on3[i].src = allLImagesOn3[i];
        ObjLImg_off3[i] = new Image();
        ObjLImg_off3[i].src = allLImagesOff3[i];
        ObjLImg_offC3[i] = new Image();
        ObjLImg_offC3[i].src = allLImagesOffC3[i];	
    }
}

function swap3(name,index,state) {
    if(index==tab)
    {}
    else
    {eval("document.images['" + name + "'].src = ObjLImg_" + state + "3["+index+"].src");}
}

function swap33(name,index,state) {	
    eval("document.images['" + name + "'].src = ObjLImg_" + state + "3["+index+"].src");
}

function SetActiveTab(index){
    for (i=0; i<allLImagesOffC3.length ; i++){	
        if(document.images["img_tab" + i]){
	        if (i==index){eval("document.images['img_tab" + index + "'].src = ObjLImg_offC3["+index+"].src");tab=i;}
	        else {eval("document.images['img_tab" + i + "'].src = ObjLImg_off3["+i+"].src"); }
        }
    }
}

function ShowHideLayer(p_LayerName,p_Status){
    if(p_Status=='none'){
        if(document.getElementById(p_LayerName)){
	        document.getElementById(p_LayerName).style.display = p_Status;	
        }
    }	
	
    if(p_Status=='block'){
        if(document.getElementById(p_LayerName)){
	        if (document.getElementById(p_LayerName).style.display == 'block' ) {
		        if (p_LayerName=='savemoney_box'){
			        document.getElementById(p_LayerName).style.display = "none"
		        }
	        } else {
		        document.getElementById(p_LayerName).style.display = "block"
	        }
        }
    }
}

function show_box(str) {
    if (str == 'ValueKits_box') {
        ShowHideLayer('ValueKits_box','block');
        ShowHideLayer('Accessories_box','none');
        ShowHideLayer('Description_box','none');
        ShowHideLayer('BoxContent_box','none');
        ShowHideLayer('Reviews_box','none');
        ShowHideLayer('Gallery_box','none');
        ShowHideLayer('Rebates_box','none');
        ShowHideLayer('KitIncludes_box','none');
        ShowHideLayer('MoreBuyingOptions_box','none');
        SetActiveTab(0);
        tab=0;
    }
    if (str == 'Accessories_box') {
        ShowHideLayer('ValueKits_box','none');
        ShowHideLayer('Accessories_box','block');
        ShowHideLayer('Description_box','none');
        ShowHideLayer('BoxContent_box','none');
        ShowHideLayer('Reviews_box','none');
        ShowHideLayer('Gallery_box','none');
        ShowHideLayer('Rebates_box','none');
        ShowHideLayer('KitIncludes_box','none');
        ShowHideLayer('MoreBuyingOptions_box','none');
        SetActiveTab(1);
        tab=1;
    }
    if (str == 'Description_box') {
        ShowHideLayer('ValueKits_box','none');
        ShowHideLayer('Accessories_box','none');
        ShowHideLayer('Description_box','block');
        ShowHideLayer('BoxContent_box','none');
        ShowHideLayer('Reviews_box','none');
        ShowHideLayer('Gallery_box','none');
        ShowHideLayer('Rebates_box','none');
        ShowHideLayer('KitIncludes_box','none');
        ShowHideLayer('MoreBuyingOptions_box','none');
        SetActiveTab(2);
        tab=2;
    }
    if (str == 'BoxContent_box') {
        ShowHideLayer('ValueKits_box','none');
        ShowHideLayer('Accessories_box','none');
        ShowHideLayer('Description_box','none');
        ShowHideLayer('BoxContent_box','block');
        ShowHideLayer('Reviews_box','none');
        ShowHideLayer('Gallery_box','none');
        ShowHideLayer('Rebates_box','none');
        ShowHideLayer('KitIncludes_box','none');
        ShowHideLayer('MoreBuyingOptions_box','none');
        SetActiveTab(3);
        tab=3;
    }
    if (str == 'Reviews_box') {
        ShowHideLayer('ValueKits_box','none');
        ShowHideLayer('Accessories_box','none');
        ShowHideLayer('Description_box','none');
        ShowHideLayer('BoxContent_box','none');
        ShowHideLayer('Reviews_box','block');
        ShowHideLayer('Gallery_box','none');
        ShowHideLayer('Rebates_box','none');
        ShowHideLayer('KitIncludes_box','none');
        ShowHideLayer('MoreBuyingOptions_box','none');
        SetActiveTab(4);
        tab=4;
    }
    if (str == 'Gallery_box') {
        ShowHideLayer('ValueKits_box','none');
        ShowHideLayer('Accessories_box','none');
        ShowHideLayer('Description_box','none');
        ShowHideLayer('BoxContent_box','none');
        ShowHideLayer('Reviews_box','none');
        ShowHideLayer('Gallery_box','block');
        ShowHideLayer('Rebates_box','none');
        ShowHideLayer('KitIncludes_box','none');
        ShowHideLayer('MoreBuyingOptions_box','none');
        SetActiveTab(5);
        tab=5;
    }
    if (str == 'Rebates_box') {
        ShowHideLayer('ValueKits_box','none');
        ShowHideLayer('Accessories_box','none');
        ShowHideLayer('Description_box','none');
        ShowHideLayer('BoxContent_box','none');
        ShowHideLayer('Reviews_box','none');
        ShowHideLayer('Gallery_box','none');
        ShowHideLayer('Rebates_box','block');
        ShowHideLayer('KitIncludes_box','none');
        ShowHideLayer('MoreBuyingOptions_box','none');
        SetActiveTab(6);
        tab=6;
    }
    if (str == 'KitIncludes_box') {
        ShowHideLayer('ValueKits_box','none');
        ShowHideLayer('Accessories_box','none');
        ShowHideLayer('Description_box','none');
        ShowHideLayer('BoxContent_box','none');
        ShowHideLayer('Reviews_box','none');
        ShowHideLayer('Gallery_box','none');
        ShowHideLayer('Rebates_box','none');
        ShowHideLayer('KitIncludes_box','block');
        ShowHideLayer('MoreBuyingOptions_box','none');
        SetActiveTab(7);
        tab=7;
    }
	
    if (str == 'MoreBuyingOptions_box') {
        ShowHideLayer('ValueKits_box','none');
        ShowHideLayer('Accessories_box','none');
        ShowHideLayer('Description_box','none');
        ShowHideLayer('BoxContent_box','none');
        ShowHideLayer('Reviews_box','none');
        ShowHideLayer('Gallery_box','none');
        ShowHideLayer('Rebates_box','none');
        ShowHideLayer('KitIncludes_box','none');
        ShowHideLayer('MoreBuyingOptions_box','block');
        SetActiveTab(8);
        tab=8;
    }
    return false;
}

function CheckTabs(p_showValueKitsTab,p_showAccessoriesTab,p_showDescriptionTab,p_showBoxContentTab,p_showReviewsTab, p_showImgGalleryTab, p_showKitIncludesTab, p_showRebatesTab, p_showMoreBuyingOptionsTab, show){
    if(show == "prev"){
        show_box('Reviews_box');
    }
    else if(show == "accessories"){
        show_box('Accessories_box');
    }
    else if(show == "kits"){
        show_box('ValueKits_box');
    }
    else if (show == "rebates"){
        show_box('Rebates_box');
    }		
    else{
        if(p_showKitIncludesTab==1)
	        {														
		        document.getElementById('KitIncludes_box').style.display ="block";
		        show_box('KitIncludes_box');
		        tab=7;
		        SetActiveTab(7);
	        }
        else 
	        if(p_showValueKitsTab==1)
	        {
		        document.getElementById('ValueKits_box').style.display ="block";
		        tab=0;
		        SetActiveTab(0);
	        }
	        else
		        if(p_showAccessoriesTab==1)
			        {	
				        document.getElementById('Accessories_box').style.display="block";
				        tab=1;
				        SetActiveTab(1);
			        }
			        else
				        if(p_showDescriptionTab==1)
				        {
					        document.getElementById('Description_box').style.display ="block";
					        tab=2;
					        SetActiveTab(2);
				        }
				        else
					        if(p_showBoxContentTab==1)
					        {
						        document.getElementById('BoxContent_box').style.display="block";
						        tab=3;
						        SetActiveTab(3);
					        }
					        else
						        if(p_showReviewsTab==1)
							        {
								        document.getElementById('Reviews_box').style.display ="block";
								        tab=4;
								        SetActiveTab(4);
							        }
						        else
							        if(p_showImgGalleryTab==1)
								        {
									        document.getElementById('Gallery_box').style.display ="block";
									        tab=5;
									        SetActiveTab(5);
								        }
							        else
								        if(p_showRebatesTab==1)
									        {
										        document.getElementById('Rebates_box').style.display ="block";
										        tab=6;
										        SetActiveTab(6);
									        }
								        else 
									        if (p_showMoreBuyingOptionsTab==1)
										        {
											        document.getElementById('MoreBuyingOptions_box').style.display ="block";
											        tab=8;
											        SetActiveTab(8);
										        }
											
    }
}

function OpenWnd(p_strPage){
  var strFeatures;
  strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=710,height=400";
  oWindow = window.open(p_strPage, "RebateInfo", strFeatures);
  oWindow.focus();
}

function BigPicture(p_ImgSource,p_width, p_height){
  var p_temp;
  if(p_width>500){
  p_temp = 500/p_width;
  p_width = 500;
  p_height = p_height*p_temp;
  }
  
  if(p_height>500){
  p_temp = 500/p_height;
  p_height = 500;
  p_width = p_width*p_temp;
  }
  
  if(screen.width){
        var winl = (screen.width-p_width)/2;
        var wint = (screen.height-p_height)/2;
  }else{winl = 0;wint =0;}
  
  var strFeatures;
  strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width="+p_width+",height="+p_height+",top="+wint+",left="+winl+"";
  oWindow = window.open('','BuyDig', strFeatures);
  oWindow.document.open();  
  oWindow.document.write('<img src="'+p_ImgSource+'" width='+p_width+' height='+p_height+'>'); 
  oWindow.document.close();
  oWindow.focus();
}

function ShowPicture(p_height, productID){
    p_height = parseInt(p_height) + 130;
    window.open("ShowPicture.aspx?sku="+productID, "_blank", "status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=800,height="+p_height);
    return false;
}

function openFreeShippingDesc(){
    window.open("../Assets/ContentFiles/freeshippingitem.htm","Shipping", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=400,height=205"); 
    return false;
}
function OpenShipping(p_strPage){
    window.open(p_strPage,"Shipping", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=370,height=240"); 
    return false;
}


function Open30DaysPolicy(p_strPage){
  var strFeatures;
  var p_strPage;
  strFeatures = "status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=800,height=400";
  oWindow = window.open(p_strPage, "ReturnPolicy", strFeatures);
  oWindow.focus();
}

function openCred(p_strPage){
  var strFeatures;
  var p_strPage;
  strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=710,height=400";
  oWindow = window.open(p_strPage, "FreeShipping", strFeatures);
  oWindow.focus();
  return false;
}

function OpenDealer(p_strPage){
  var strFeatures;
  var p_strPage;
  strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=710,height=470";
  oWindow = window.open(p_strPage, "AuthorizedDealer", strFeatures);
  oWindow.focus();
  return false;
}


/*
'**************************************************************************************************************
 Function:		Popup(imgSource,widthPopup, heightPopup)
 Description:		popup that displays image gallery of the product
 Arguments:		[imgSource] - complete page name with path
		        [widthPopup] - numeric that represents the width of the popup
		        [heightPopup] - numeric that represents the height of the popup
 Returns:		void
 Date:			01.06.2006
 Author:		Mihai Bati
 Version :		Current version (1.0.0)
 Last modify :		
 Modify By :		

'**************************************************************************************************************
*/
function Popup(imgSource,widthPopup, heightPopup)
{
    if(screen.width)
    {
        var winl = (screen.width-widthPopup)/2;
        var wint = (screen.height-heightPopup)/2;
    }
    else
    {
        winl = 0;wint =0;
    }

    var strFeatures;
    strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width="+widthPopup+",height="+heightPopup+",top="+wint+",left="+winl+"";
    oWindow = window.open(imgSource, 'BuyDig', strFeatures);
    oWindow.focus();
    return false;
}

function OpenWhy(p_strPage){
  var strFeatures;
  var p_strPage;
  strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=417,height=228";
  oWindow = window.open(p_strPage, "FreeShipping", strFeatures);
  oWindow.focus();
  return false;
}