/**
 * Fonction javascript Météorage
 *
 * 2007 E64 - Stéphane pailha
 * http://www.meteorage.fr
 *
 */
// Paiement en ligne internetplus et kiosque maligne  
self.name='MerchantWindow';
function paynavigation(method, params){
	if (!isFlashOK){
		alert('Votre version du plugin flash est obsolète, veuillez d\'abord la mettre à jour');
		page ="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
		window.open(page,"getFlashPlayer","menubar=yes, status=yes, scrollbars=yes, menubar=yes, width=800, height=600");
	}else{
		switch(method){
			case 'authorize':
			authorize(params);
			break;
			case 'authorizeInternetPlus':
			authorizeInternetPlus(params);
			break;
			case 'authorizeKML':
			authorizeKML(params);
			break;
			case 'navigation':
			// prend en compte les trois cas : 3min 6 min et à la durée
			window.location.href =params;
			break;
			
			}
	}
	}
// fontion pour internetplus  
function authorizeOffer(offerId) {
   var url = '/bundletp/pos_bundle?action=authorizeOffer&promo=promo&cur=EUR&url=https://route.w-ha.com/app-bundlepurchase/node&amt=0.0&oid=' + offerId;
   openPanel(url);
   }

function purchaseListOffer(productId) {
	var url = '/bundletp/pos_bundle?action=purchaseListOffer&url=https://route.w-ha.com/app-purchase-product/node&pid=' + productId;
	openPanel(url);
	}
function authorizeInternetPlus(productId) {
	window.location.href='/bundletp/pos_init?action=authorize&pid=' + productId+'&wha_desc2=current';
	}
function authorize(productId) { 
	var url = '/bundletp/pos_init?action=authorize&pid=' + productId ;
	openPanel(url);
    }
// fontion pour kiosque maligne
function authorizeOfferKML(offerId) {
	var url = '/bundletpKML/pos_bundle?action=authorizeOffer&promo=promo&cur=EUR&url=https://route.w-ha.com/app-bundlepurchase/node&amt=0.0&oid=' + offerId;
    openPanel(url);
    }

function purchaseListOfferKML(productId) {
	var url = '/bundletpKML/pos_bundle?action=purchaseListOffer&url=https://route.w-ha.com/app-purchase-product/node&pid=' + productId;
	openPanel(url);
	}

function authorizeKML(productId) { 
	var url = '/bundletpKML/pos_init?action=authorize&pid=' + productId ;
	openPanel(url);
    }
// fonctions générales pour tout le site
// Aficher/masquer un élément
function elementAppear(elt) {
	Element.setStyle(elt, {'display':'block'} );
	}
function elementHide(elt) {
	Element.setStyle(elt, {'display':'none'} );
	}
//Fonction pour les roll over de couleurs dans la page service navigation sur les descriptif des moyens de paiements (nécessite prototype.js)
function swapColor(rubId) {
	Element.setStyle(rubId, {'background-color':'#6e8cbd'} );
	}

function unswapColor(rubId) {
	Element.setStyle(rubId, {'background-color':'#40629a'} );
	}
	

/**********************/
/*   Sélection ville/commune   */
/*********************/
function choixDpt_Commune(cx) {
	if (cx =="commune"){
		Element.setStyle("choixCommune", {'background-color':'green'});
		Element.setStyle("choixDpt", {'background-color':'#aaaaaa'});
			Element.setStyle("blocCommune", {'display':'block'});
		Element.setStyle("blocDepartement", {'display':'none'});
		Element.setStyle("blocChoix", {'display':'none'});

	}else{
		Element.setStyle("choixDpt", {'background-color':'green'});
		Element.setStyle("choixCommune", {'background-color':'#aaaaaa'});
		Element.setStyle("blocDepartement", {'display':'block'});
		Element.setStyle("blocCommune", {'display':'none'});
		Element.setStyle("blocChoix", {'display':'none'});
	}

}
function aff_loading(cx) {
	Element.setStyle("loading", {'display':'block'});
}