/* Skript zur Anpassung des Contents aufgrund des eingestellten HiDrive Pro-Spaces */
var iLauf = 0;
var iPacks_begin = 1;
var iPack_active = 1; /* Zahl = siehe aAllPacks-Index */
var sOrderUrl_01 ='https://www.strato.de/ordering?step=select_package&phase=Hosting&Department=STORAGE&Category=STORAGE&Group=STORAGE_PRO&Product=';
var sOrderUrl_02 ='';

var aAllPacks = new Array ();
aAllPacks[1] = new Array();
aAllPacks[1]['product_descr']         = 'Pro 1000';
aAllPacks[1]['id_hdl']      = 'pack_hdl';
aAllPacks[1]['id_list']     = 'pack_list_1000';
aAllPacks[1]['div_details_product'] = 'details_produkt';
aAllPacks[1]['div_details_group'] = 'details_gruppe';
aAllPacks[1]['src_price']   = 'pro_1000';
aAllPacks[1]['id_price']    = 'pack_price';
aAllPacks[1]['product_name'] = 'storage_pro1000';
aAllPacks[1]['id_details']  = 'lnk_details_produkt';
aAllPacks[1]['url_order']   = 'STORAGE_PRO1000&wfc=hidrive';
aAllPacks[1]['id_order']    = 'pack_order';
aAllPacks[1]['id_order_2']  = 'pack_order_img';
aAllPacks[1]['action_text']  = '50% Rabatt-Aktion<br />bis 30.09.2010!';
aAllPacks[1]['id_action_text']  = 'pack_action_txt';


aAllPacks[2] = new Array();
aAllPacks[2]['product_descr']         = 'Pro 2500';
aAllPacks[2]['id_hdl']      = 'pack_hdl';
aAllPacks[2]['id_list']     = 'pack_list_2500';
aAllPacks[2]['div_details_product'] = 'details_produkt';
aAllPacks[2]['div_details_group'] = 'details_gruppe';
aAllPacks[2]['src_price']   = 'pro_2500';
aAllPacks[2]['id_price']    = 'pack_price';
aAllPacks[2]['product_name'] = 'storage_pro2500';
aAllPacks[2]['id_details']  = 'lnk_details_produkt';
aAllPacks[2]['url_order']   = 'STORAGE_PRO2500&wfc=hidrive';
aAllPacks[2]['id_order']    = 'pack_order';
aAllPacks[2]['id_order_2']  = 'pack_order_img';
aAllPacks[2]['action_text']  = '&nbsp;';
aAllPacks[2]['id_action_text']  = 'pack_action_txt';

aAllPacks[3] = new Array();
aAllPacks[3]['product_descr']         = 'Pro 5000';
aAllPacks[3]['id_hdl']      = 'pack_hdl';
aAllPacks[3]['id_list']     = 'pack_list_5000';
aAllPacks[3]['div_details_product'] = 'details_produkt';
aAllPacks[3]['div_details_group'] = 'details_gruppe';
aAllPacks[3]['src_price']   = 'pro_5000';
aAllPacks[3]['id_price']    = 'pack_price';
aAllPacks[3]['product_name'] = 'storage_pro5000';
aAllPacks[3]['id_details']  = 'lnk_details_produkt';
aAllPacks[3]['url_order']   = 'STORAGE_PRO5000&wfc=hidrive';
aAllPacks[3]['id_order']    = 'pack_order';
aAllPacks[3]['id_order_2']  = 'pack_order_img';
aAllPacks[3]['action_text']  = '&nbsp;';
aAllPacks[3]['id_action_text']  = 'pack_action_txt';


var iPacks_max = aAllPacks.length;

/* stellt den Content um */
function ContentChange(iPack_active){
	for(iLauf=iPacks_begin;iLauf<iPacks_max;iLauf++) {
		var sOptID = 'space'+iLauf;


		if (iLauf == iPack_active){
		  window.document.getElementById(sOptID).selected = true;
		  window.document.getElementById(aAllPacks[iLauf]['id_list']).style.display = 'block';
		  window.document.getElementById(aAllPacks[iLauf]['id_hdl']).innerHTML = aAllPacks[iLauf]['product_descr'];
		  window.document.getElementById(aAllPacks[iLauf]['id_price']).src = '/imperia/md/images/strato_de/preise/hidrive/preis_'+aAllPacks[iLauf]['src_price']+'.gif';
		  window.document.getElementById(aAllPacks[iLauf]['id_details']).href = '/hidrive/details_hidrive.html?category=storage&group=storage_pro&product='+aAllPacks[iLauf]['product_name'];
        window.document.getElementById(aAllPacks[iLauf]['id_details']).innerHTML = "Details von HiDrive "+aAllPacks[iLauf]['product_descr']+" anzeigen";
        window.document.getElementById(aAllPacks[iLauf]['id_action_text']).innerHTML = aAllPacks[iLauf]['action_text'];
        window.document.getElementById(aAllPacks[iLauf]['id_order']).href = sOrderUrl_01+aAllPacks[iLauf]['url_order']+sOrderUrl_02;
        window.document.getElementById(aAllPacks[iLauf]['id_order_2']).href = sOrderUrl_01+aAllPacks[iLauf]['url_order']+sOrderUrl_02;
		} else {
		  window.document.getElementById(aAllPacks[iLauf]['id_list']).style.display = 'none';
		}
	}
}

/* Voreinstellung des Seitencontents */
$(document).ready(function(){
   $("#SpaceSelect").change(SelectChange);
	ContentChange(iPack_active);
});

/* Wertet gewechseltes Select aus und stellt den Content um */
function SelectChange(){
    var selected = $('#SpaceSelect option:selected');    

    if ((selected.val() != 0) && (selected.val() != 'redirect')){
       var iPack_active = selected.val();
       ContentChange(iPack_active);
    } else {
       window.location.href=('/hidrive/media/index.html');
    }
}


