/**
 * 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;
			
			}
	}
	}
function payanimation(method, params){
	switch(method){
		case 'carte':
		// prend en compte le cas : carte 0.56€
		window.location.href =params;
		break;
		}
	}
// fontion pour internetplus  
function authorizeOffer(offerId) {
   var url = '/bundle/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 = '/bundle/pos_bundle?action=purchaseListOffer&url=https://route.w-ha.com/app-purchase-product/node&pid=' + productId;
	openPanel(url);
	}

function authorize(productId) {
	var url = '/bundle/pos_init?action=authorize&pid=' + productId ;
	openPanel(url);
    }
function authorizeInternetPlus(productId) {
	window.location.href='/bundle/pos_init?action=authorize&pid=' + productId+'&wha_desc2=current';
	}
// fontion pour kiosque maligne
function authorizeOfferKML(offerId) {
	var url = '/bundleKML/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 = '/bundleKML/pos_bundle?action=purchaseListOffer&url=https://route.w-ha.com/app-purchase-product/node&pid=' + productId;
	openPanel(url);
	}

function authorizeKML(productId) { 
	var url = '/bundleKML/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':'#2a508f'} );
	}