/*
Script pour fnac
*/
var IS_IE = document.all && window.print && !window.opera && /MSIE [56]/.test(navigator.userAgent);
var IS_IE_ALL = document.all && window.print && !window.opera && /MSIE/.test(navigator.userAgent);
var IE_W3C = IS_IE && /MSIE [789]/.test(navigator.userAgent);
var IS_Webkit = /Konqueror|Safari|KHTML/.test(navigator.userAgent);
var heightPropertyToUse = IS_IE ? "height" : "minHeight";

/* ecrit les classes dans le tag HTML, pas besoin d'attendre le chargement du body */
document.documentElement.className+=" hasJS"; //cette classe rajoute une classe CSS qui permet des actions afin de cacher ou afficher des elements seulement pour les visiteurs qui ont le Javascript active sur leur navigateur. (exemple le hidesubmit)
if (IS_IE) document.documentElement.className+=" IS_IE"; //cette classe permet d'utiliser des hacks CSS/JS seulement pour IE6 et versions inferieures.
var ifrlayer = {
	make:function(obj) {
		if(!obj) return; obj = (typeof(obj)=="string") ? document.getElementById(obj) : obj; if(!obj) return;
		if(document.all && !window.opera && document.getElementById) {
			if(obj.parentNode && !obj.iframelayer) {
			    var ifr = obj.parentNode.insertBefore(document.createElement('<iframe src="javascript:false"></iframe>'), obj);
			    if(obj.currentStyle.zIndex != "" && parseInt(obj.currentStyle.zIndex)>1 ) {
				    ifr.style.zIndex = parseInt(obj.currentStyle.zIndex)-1;
			    }
			    with(ifr.style) {
				    filter = "mask()";
				    position = "absolute";
			    }
                obj.iframelayer = ifr;
            }
		}
		if(obj.iframelayer) {
		    obj.iframelayer.style.visibility="visible";
            ifrlayer.resize(obj);
            ifrlayer.move(obj)
        }
        	},
	hide:function(obj) {
		if(!obj) return; obj = typeof(obj)=="string" ? document.getElementById(obj) : obj; if (!obj) return;
		var ifr = obj.iframelayer;
		if(ifr) {
			ifr.style.visibility="hidden";
		}
	},
	move:function(obj) {
		if(obj && obj.iframelayer) {
		    with(obj.iframelayer.style) {
			    top = obj.offsetTop+"px";
			    left = obj.offsetLeft+"px"
		    }
		}
	},
	resize:function(obj) {
	    if(obj && obj.iframelayer) {
	        with(obj.iframelayer.style) {
	            width =  obj.offsetWidth+"px";
		        height =  obj.offsetHeight+"px";
		    }
		}
	}
}
function addHover(elm) {
	elm.style.behavior = " ";
	elm.onmouseenter = function() {
		this.className+= ' hover';
	}
	elm.onmouseleave = function() {
		this.className = this.className.replace(/\bhover\b/,"");
	}
}
/*  menu deroulant - simulation du hover facon F6
*****/
function sousMenuAddHover(elm, position) {
  elm.style.behavior = " ";
  var menu = elm.getElementsByTagName("ul");
  if (menu.length>0) {
    elm.theUl = menu[0];
    ifrlayer.make(elm.theUl);
    elm.onmouseenter = function() {
      this.className+= ' currentJs';
      ifrlayer.make(elm.theUl);
    }
    elm.onmouseleave = function() {
      this.className = this.className.replace(/\b(right)?currentJs\b/,"");
      ifrlayer.hide(this.theUl);
    }
  }
}

function setTrck(name, value) {
	document.cookie = name + "=" + escape(value);
}

function getTrck(name) {
	var start = document.cookie.indexOf(name+"=");
	var len = start + name.length + 1;
	if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
	if (start == -1) return null;
	var end = document.cookie.indexOf(";",len);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len, end));
}

function scrshtPreview(sLink) {
	p = "height=300,width=300,left=100,top=100,toolbar=no,directories=no,status=no,scrollbars=auto,resizable=no,menubar=no";
	hWnd = window.open(sLink, "Hwnd", p);
	hWnd.focus();
}


function siteSearch() {
	formOK = true;
	f = document.forms['fFind'];
	if (formOK == true && f.selectCat.value == '') {
		alert("'Vous devez choisir une catégorie!'");
		formOK = false;
	}
	if (formOK == true && f.keyWord.value == '') {
		alert("'Vous devez entrer un mot cle!'");
		formOK = false;
	}
	if (formOK == true) {
		var loc=new String();
		loc = '40swk1-kwq.html';
		loc = loc.replace(/(kwq)/, escape(f.keyWord.value));
		loc = loc.replace(/(swk)/, escape(f.selectCat.value));
		self.location = loc;
	}
}

function mKp() {
	if (window.event.keyCode == 13) { siteSearch(); }
	return false;
}

function dlWnd(sDlLink) {
	p = "height=310,width=396,left=100,top=100,toolbar=no,directories=no,status=no,scrollbars=auto,resizable=no,menubar=no";
	sDlLink = sDlLink + "&trck=" + getTrck("trck");
	hWnd = window.open(sDlLink, "Hwnd", p);
	hWnd.focus();
}


/* PLAYER */

var ie=document.all;
var nn6=document.getElementById&&!document.all;




function gid(id) {
    return document.getElementById(id);
}

function playFile(type, id, name, name2, file, urltogo) { 
    playFileR2(type, name,name2,  file, urltogo, '');
    /*   
    rnd = Math.random();
    filename = file.split('.');
    tocall = "http://pics.mediaplazza.com/html.mediaplazza.com/fnac_player.swf?sType="+type+"&file="+filename[0]+"&go=true&tref="+rnd;
    gid('insidePlayer').innerHTML = '<div class="titleN">En Ã©coute</div>'
                                    +'<div class="titleSong">'+name+'</div>'
                                    +'<a class="urltogo" href="'+urltogo+'">TÃ©lÃ©charger</a>';
    gid('insidePlayerFlash').innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="115" height="18" id="player" align="middle">'
                                        +'<param name="movie" value="'+tocall+'">'
                                        +'<param name="quality" value="high" />'
                                        +'<param name="wmode" value="transparent" />'
                                        +'<param name="menu" value="false" />'
                                        +'<embed name="player" src="'+tocall+'" quality="high" autostart="true" bgcolor="#ffffff" width="115" height="18" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
                                        +'</object>';
    gid('divPlayer').style.visibility   = 'visible';
    gid('divPlayer').style.display      = 'block';
    gid('divPlayer').style.left         = x-80;
    gid('divPlayer').style.top          = y-40;
    */
}

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}
 
function animgo(u) {
    window.location = u;
}
function animgo_popup(u){
    window.open(u, '', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,scrolling=no,overflow=no,resizable=0,resize=no,copyhistory=0,width=410,height=520,left=0,top=0,margin=0,marginwidth=0,marginheight=0');
}

function opop(u) {
	p = "height=660,width=380,toolbar=no,directories=no,status=no,scrollbars=auto,resizable=no,menubar=no";
	hWndo = window.open (u, "Hwndo", p);
	hWndo.focus();
}


function playFileR2(type, name, name2, file, urltogo, sDownload) { 
    if(sDownload=='') sDownload = 'Download';    
    rnd = Math.random();
    filename = file.split('.');
    tocall = "http://pics.mediaplazza.com/html.mediaplazza.com/themes/default/01net_player.swf?rnd="+rnd+"&idType="+type+"&sFile="+filename[0]+"&sUrl="+urltogo+"&sDownload="+sDownload+"&lib="+name2+'&nbsp;'+name;
    document.getElementById('wl_univers').innerHTML = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '+
                                    'align="" WIDTH="184" HEIGHT="81" id="playerR2" ALIGN=""><PARAM NAME="movie" VALUE="'+tocall+'">'+
                                    '<PARAM NAME="quality" VALUE=high><PARAM NAME="wmode" VALUE="transparent"><embed src="'+tocall+'" quality="high" swliveconnect="true" wmode="transparent" WIDTH="184" HEIGHT="81" name="playerR2" ALIGN="" '+
                                     'TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></embed></OBJECT>'; 
    
        /*objFlash = getFlashMovieObject('playerR2');
         objFlash.SetVariable('idType', type);
        objFlash.SetVariable('sFile', filename[0]);
        objFlash.SetVariable('sUrl', urltogo);
        objFlash.SetVariable('sDownload', sDownload);
        objFlash.SetVariable('sAuthor', '');
        objFlash.SetVariable('lib', name);*/
    
}


function hidePlayer() {
    gid('divPlayer').style.visibility   = 'hidden';
    gid('divPlayer').style.display      = 'none';
    gid('insidePlayerFlash').innerHTML  = '';
    gid('insidePlayer').innerHTML       = '';
    document.onmousemove = position;
}

/* SCROLL */

container_size = 380;
offset_min = -container_size;
offset_max = 0;
current_offset = 0;
global_sens = 'l';
vitesse = 10;
decal = 25;

function scd(sens) {
    global_sens = sens;
    slide();
}

function getStyle(id) {
    return gid(id).style;
}

function slide() {
    if(global_sens == 'l') {
        if(current_offset < offset_max) {
            getStyle('content').marginLeft = current_offset+decal;
            current_offset = current_offset+decal;
            if(current_offset < offset_max) {
                window.setTimeout("slide()", vitesse);    
            }
        }else{
            scd('r');
        }
    }else{
        if(current_offset > offset_min) {
            getStyle('content').marginLeft = current_offset-decal;
            current_offset = current_offset-decal;
            if(current_offset > offset_min) {
                window.setTimeout("slide()", vitesse);
            }
        }else{
            scd('l');
        }        
    }
}

function newsletter(l,c) {
    window.open("http://www.sonnerie.net/popup_newsletter.php?l=" + l + "&c=" + c + "", "", "toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=349, height=220, left=0, top=0");
}

function infoedit(l,c,v) {
    window.open("http://www.sonnerie.net/external/DrtTop/info/infoedit.php?l=" + l + "&c=" + c + "&a=" +v, "", "toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=300, height=150, left=0, top=0");
}


function conditions()
{
	 window.open("http://orderpopup.sonnerie.net/external/DrtTop/cgv/text_fr.php?lang=FR&a=01net&pays=FR", "", "toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=600, height=400, left=0, top=0");
}
function bookmark(name, url) {
    var NSstring = "Click [Ctrl + D] ";
    var OPstring = "Click [Ctrl + T]";

    var agt = navigator.userAgent.toLowerCase();
    var app = navigator.appName.toLowerCase();
    var ieAgent = agt.indexOf('msie');
    var nsAgent = app.indexOf('netscape');
    var opAgent = app.indexOf('opera');
    if (ieAgent!= -1) { 
        window.external.addFavorite(window.location.href,document.title) 
    } else if (nsAgent!= -1){ 
        alert(NSstring); 
    } else if (opAgent!= -1){
        alert(OPstring); 
    }
}

/* XITI */

var xtdr = 30;
var xw = window;
var xd = document;     //cette ligne ne doit surtout pas Ãªtre changÃ©e
xtnv = (xw.xtnv!=null) ? xw.xtnv : xd ;    //remplacer xd par parent.document si la page est dans une frame
xtsd = (xw.xtsd!=null) ? xw.xtsd : "http://www" ;
xtsite = (xw.xtsite!=null) ? xw.xtsite : 0;
xtn2 = (xw.xtn2!=null) ? "&s2="+xw.xtn2 : "";
xtp = (xw.xtpage!=null) ? xw.xtpage : "";
xtdi = (xw.xtdi!=null) ? "&di=" + xw.xtdi : "";
xtdmc = (xw.xtdmc!=null) ? ";domain=" + xw.xtdmc  : "" ;
xtrd = (xtsite=="redirect") ? true : false;
xtprm = (xw.xtprm!=null) ? xw.xtprm : "";
xts = screen;
var xtxp = new Date();
xtxp.setTime(xtxp.getTime()+(xtdr*1000));
var xtdate = new Date();

function Getxtorcookie(nom)
{
    var arg = nom + "=";
    var i = 0 ;
    while (i<xd.cookie.length)
    {
        var j = i + arg.length;
        if (xd.cookie.substring(i,j) == arg) {return valeurxtorcook(j);}
        i = xd.cookie.indexOf(" ",i) + 1;
        if (i==0) {break;}
    }
    return null;
}

function valeurxtorcook(index)
{
        var fin = xd.cookie.indexOf(";",index);
        if (fin==-1) {fin=xd.cookie.length;};
        return unescape(xd.cookie.substring(index,fin));
}

function recupxtor(param)
{
        var xturl = xtnv.location.search;
        xtpos = xturl.indexOf(param);
        if (xtpos > 0)
        {
            chq = xturl.substring(1, xturl.length);
            mq = chq.substring(chq.indexOf(param), chq.length);
            pos3 = mq.indexOf("&");
            if (pos3 == -1) pos3 = mq.indexOf("%26")
            if (pos3 == -1) pos3 = mq.length;
            return mq.substring(mq.indexOf("=")+1, pos3);
        }
        else
        {    return null; }
}

function xt_med(type,section,page,x1,x2,x3,x4,x5)
{
    xt_img = new Image();
    xt_ajout = (type=="F") ? "" : (type=="M") ? "&a="+x1+"&m1="+x2+"&m2="+x3+"&m3="+x4+"&m4="+x5 : "&clic="+x1;
    Xt_im = xtsd+'.xiti.com/hit.xiti?s='+xtsite+'&s2='+section;
    Xt_im += '&p='+page+xt_ajout+'&hl=' + xtdate.getHours() + 'x' + xtdate.getMinutes() + 'x' + xtdate.getSeconds();
    if(parseFloat(navigator.appVersion)>=4)
    {Xt_im += '&r=' + xts.width + 'x' + xts.height + 'x' + xts.pixelDepth + 'x' + xts.colorDepth;}
    xt_img.src = Xt_im;
    if ((x2 != null)&&(x2!=undefined)&&(type=="C"))
    { if ((x3=='')||(x3==null)) { document.location = x2} else {xfen = window.open(x2,'xfen',''); xfen.focus();}}
    else
    {return;}
}

if((xtsite!=0)||(xtrd))
{
        xtourl_rf = recupxtor("xtref");
        if (!xtrd)
        {    
            var xtnav = navigator.appName+" "+navigator.appVersion;
            var xtIE = (xtnav.indexOf('MSIE'));
            if (xtIE>=0) {xtvers = parseInt(xtnav.substr(xtIE+5));xtIE=true;}
            else {xtvers = parseFloat(navigator.appVersion);xtIE=false;}
            var xtnet=(xtnav.indexOf('Netscape') >=0);
            var xtmac=(xtnav.indexOf('Mac') >=0);
            var xtOP=(navigator.userAgent.indexOf('Opera') >=0);
            if((xtIE)&&(xtvers >=5)&&(!xtmac)&&(!xtOP)&&(!xtrd))
             {
                xd.body.addBehavior("#default#clientCaps");
                xtconn = '&cn=' + xd.body.connectionType;
                xd.body.addBehavior("#default#homePage");
                xthome = (xd.body.isHomePage(location.href))? '&hm=1': '&hm=0';
                xtresr = '&re='+xd.body.offsetWidth+'x'+xd.body.offsetHeight;
             }
            else
             {xtconn = ''; xthome='';if(xtvers >=5){xtresr = '&re='+xw.innerWidth+'x'+xw.innerHeight;}else{xtresr =''};}
            if((xtnet)&&(xtvers >=4)||(xtOP)){var xtlang = '&lng=' + navigator.language;}
            else {if((xtIE)&&(xtvers >=4)&&(!xtOP)){var xtlang = '&lng=' +navigator.userLanguage;} else {xtlang = '';}}
        
            Xt_r = (xtourl_rf!=null) ? xtourl_rf.replace(/[<>]/g, '') : xtnv.referrer.replace(/[<>]/g, '') ;
            if(Xt_r=="")    {    Xt_r = Getxtorcookie("xtref");    Xt_r = (Xt_r==null) ? "" : Xt_r;    }
            
            Xt_param = 's='+xtsite+xtn2+'&p='+xtp+'&hl='+xtdate.getHours()+'x'+xtdate.getMinutes()+'x'+xtdate.getSeconds();
            Xt_param += xtdi+xtprm+xtconn+xthome+xtlang;
            Xt_i = '<img width="1" height="1" src="'+xtsd+'.xiti.com/hit.xiti?'+Xt_param;
            if(xtvers >=4)
            {Xt_i += '&r=' + xts.width + 'x' + xts.height + 'x' + xts.pixelDepth + 'x' + xts.colorDepth;}
            xd.write(Xt_i + xtresr + '&ref='+Xt_r.replace(/&/g, '$') + '">');
        }
        else
        {
            if(xtourl_rf==null)
            {
                xtref = xtnv.referrer.replace(/[<>]/g, '').replace(/&/g, '$');
                xd.cookie = "xtref=" + xtref + " ;expires=" + xtxp.toGMTString() + " ;path=/;"+xtdmc;
            }
        }
}


/*	Unobtrusive Flash Objects (UFO) v3.02 <http://www.bobbyvandersluis.com/ufo/>
	Copyright 2005, 2006 Bobby van der Sluis
	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/

var UFO = {
	requiredAttrParams: ["movie", "width", "height", "majorversion", "build"],
	optionalAttrEmb: ["name", "swliveconnect", "align"],
	optionalAttrObj: ["id", "align"],
	optionalAttrParams: ["play", "loop", "menu", "quality", "scale", "salign", "wmode", "bgcolor", "base", "flashvars", "devicefont", "allowscriptaccess"],
	ximovie: "ufo.swf",
	xiwidth: "215",
	xiheight: "138",
	
	is_w3cdom: (typeof document.getElementById != "undefined" && typeof document.getElementsByTagName != "undefined" && (typeof document.createElement != "undefined" || typeof document.createElementNS != "undefined")),
	is_ie: (navigator.userAgent.toLowerCase().indexOf("msie") != -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1),
	is_safari: (navigator.userAgent.toLowerCase().indexOf("safari") != -1),
	is_win: (navigator.userAgent.toLowerCase().indexOf("win") != -1),
	is_mac: (navigator.userAgent.toLowerCase().indexOf("mac") != -1),
	is_XML: (typeof document.contentType != "undefined" && document.contentType.indexOf("xml") > -1),
	
	foList: [],
		
	create: function(FO, id) {
		if (!UFO.is_w3cdom) return;
		UFO.foList[id] = UFO.updateFO(FO);
		UFO.createStyleRule("#" + id, "visibility:hidden;");
		UFO.domLoad(id);
	},

	updateFO: function(FO) {
		if (typeof FO.xi != "undefined" && FO.xi == "true") {
			if (typeof FO.ximovie == "undefined") FO.ximovie = UFO.ximovie;
			if (typeof FO.xiwidth == "undefined") FO.xiwidth = UFO.xiwidth;
			if (typeof FO.xiheight == "undefined") FO.xiheight = UFO.xiheight;
		}
		else {
			FO.xi = false;
		}
		FO.domLoaded = false;
		return FO;
	},

	domLoad: function(id) {
		var timer = setInterval(function() { // doesn't work in IE/Mac
			if((document.getElementsByTagName("body")[0] != null || document.body != null) &&  document.getElementById(id) != null) {
				UFO.main(id);
				clearInterval(timer);
			}
		}, 250);
		if (typeof document.addEventListener != "undefined") {
			document.addEventListener("DOMContentLoaded", function() { UFO.main(id); clearInterval(timer); } , null); // Mozilla only
		}
	},

	main: function(id) {
		var FO = UFO.foList[id];
		if (FO.domLoaded) return; // for Mozilla, only execute once
		UFO.foList[id].domLoaded = true;
		document.getElementById(id).style.visibility = "hidden";
		if (UFO.hasRequiredAttrParams(id)) {
			if (UFO.hasFlashVersion(FO.majorversion, FO.build)) {
				UFO.writeFlashObject(id);
			}
			else if (FO.xi && UFO.hasFlashVersion("6", "65")) {
				UFO.createModalDialog(id);
			}
		}
		document.getElementById(id).style.visibility = "visible";
	},
	
	createStyleRule: function(selector, declaration) {
		if (UFO.is_ie && UFO.is_mac) return; // bugs in IE/Mac
		var head = document.getElementsByTagName("head")[0]; 
		var style = UFO.createElement("style");
		if (!(UFO.is_ie && UFO.is_win)) {
			var styleRule = document.createTextNode(selector + " {" + declaration + "}");
			style.appendChild(styleRule); // bugs in IE/Win
		}
		style.setAttribute("type", "text/css");
		style.setAttribute("media", "screen"); 
		head.appendChild(style);
		if (UFO.is_safari && UFO.is_XML) { head.innerHTML += ""; } // force Safari repaint for MIME type application/xhtml+xml
		if (UFO.is_ie && UFO.is_win && document.styleSheets && document.styleSheets.length > 0) {
			var lastStyle = document.styleSheets[document.styleSheets.length - 1];
			if (typeof lastStyle.addRule == "object") {
				lastStyle.addRule(selector, declaration);
			}
		}
	},

	createElement: function(el) {
		return (typeof document.createElementNS != "undefined") ?  document.createElementNS("http://www.w3.org/1999/xhtml", el) : document.createElement(el);
	},

	hasRequiredAttrParams: function(id) {
		var FO = UFO.foList[id];
		for (var i = 0; i < UFO.requiredAttrParams.length; i++) {
			if (typeof FO[UFO.requiredAttrParams[i]] == "undefined") return false;
		}
		return true;
	},
	
	hasFlashVersion: function(majorVersion, buildVersion) {
		var reqVersion = parseFloat(majorVersion + "." + buildVersion);
		if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object") {
			var desc = navigator.plugins["Shockwave Flash"].description;
			if (desc) {
				var versionStr = desc.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				var major = parseInt(versionStr.replace(/^(.*)\..*$/, "$1"));
				var build = parseInt(versionStr.replace(/^.*r(.*)$/, "$1"));
				var flashVersion = parseFloat(major + "." + build);
			}
		}
		else if (window.ActiveXObject) {
			try {
				var flashObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				var desc = flashObj.GetVariable("$version");
				if (desc) {
					var versionArr = desc.replace(/^\S+\s+(.*)$/, "$1").split(",");
					var major = parseInt(versionArr[0]);
					var build = parseInt(versionArr[2]);
					var flashVersion = parseFloat(major + "." + build);
				}
			}
			catch(e) {}
		}
		if (typeof flashVersion != "undefined"){
			return (flashVersion >= reqVersion ? true : false); 
		}
		return false;
	},

	writeFlashObject: function(id) {
		var el = document.getElementById(id);
		if (typeof el.innerHTML == "undefined") return;
		var FO = UFO.foList[id];
		if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object") {
			try	{ // older versions of Gecko only support innerHTML get and not set
				el.innerHTML = "ufo-test";
			}
			catch (e) {}
			if (el.innerHTML != "ufo-test") {
				while(el.hasChildNodes()) {
					el.removeChild(el.firstChild);
				}
				var embed = UFO.createElement("embed");
				embed.setAttribute("type", "application/x-shockwave-flash");
				embed.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
				embed.setAttribute("src", FO.movie);
				embed.setAttribute("width", FO.width);
				embed.setAttribute("height", FO.height);
				for (var i = 0; i < UFO.optionalAttrEmb.length; i++) {
					if (typeof FO[UFO.optionalAttrEmb[i]] != "undefined") {
						embed.setAttribute(UFO.optionalAttrEmb[i], FO[UFO.optionalAttrEmb[i]]);
					}
				}
				for (var i = 0; i < UFO.optionalAttrParams.length; i++) {
					if (typeof FO[UFO.optionalAttrParams[i]] != "undefined") {
						embed.setAttribute(UFO.optionalAttrParams[i], FO[UFO.optionalAttrParams[i]]);
					}
				}	
				el.appendChild(embed);
			}
			else {
				var embHTML = "";
				for (var i = 0; i < UFO.optionalAttrEmb.length; i++) {
					if (typeof FO[UFO.optionalAttrEmb[i]] != "undefined") {
						embHTML += ' ' + UFO.optionalAttrEmb[i] + '="' + FO[UFO.optionalAttrEmb[i]] + '"';
					}
				}
				for (var i = 0; i < UFO.optionalAttrParams.length; i++) {
					if (typeof FO[UFO.optionalAttrParams[i]] != "undefined") {
						embHTML += ' ' + UFO.optionalAttrParams[i] + '="' + FO[UFO.optionalAttrParams[i]] + '"';
					}
				}
				el.innerHTML = '<embed type="application/x-shockwave-flash" src="' + FO.movie + '" width="' + FO.width + '" height="' + FO.height + '" pluginspage="http://www.macromedia.com/go/getflashplayer"' + embHTML + '></embed>';
			}
		}
		else {
			var objAttrHTML = "";
			for (var i = 0; i < UFO.optionalAttrObj.length; i++) {
				if (typeof FO[UFO.optionalAttrObj[i]] != "undefined") {
					objAttrHTML += ' ' + UFO.optionalAttrObj[i] + '="' + FO[UFO.optionalAttrObj[i]] + '"';
				}
			}
			var objParamHTML = "";
			for (var i = 0; i < UFO.optionalAttrParams.length; i++) {
				if (typeof FO[UFO.optionalAttrParams[i]] != "undefined") {
					objParamHTML += '<param name="' + UFO.optionalAttrParams[i] + '" value="' + FO[UFO.optionalAttrParams[i]] + '" />';
				}
			}
			var protocol = (window.location.protocol == "https:" ? "https:" : "http:");
			el.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + objAttrHTML + ' width="' + FO.width + '" height="' + FO.height + '" codebase="' + protocol + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + FO.majorversion + ',0,' + FO.build + ',0"><param name="movie" value="' + FO.movie + '" />' + objParamHTML + '</object>';
		}
	},

	createModalDialog: function(id) {
		var FO = UFO.foList[id];
		UFO.createStyleRule("html", "height:100%; overflow:hidden;");
		UFO.createStyleRule("body", "height:100%; overflow:hidden;");
		UFO.createStyleRule("#xi-con", "position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#333; filter:alpha(opacity:50); -khtml-opacity:0.5; -moz-opacity:0.5; opacity:0.5;");
		UFO.createStyleRule("#xi-mod", "position:absolute; left:50%; top:50%; margin-left: -" + (parseInt(FO.xiwidth)/2) + "px; margin-top: -" + (parseInt(FO.xiheight)/2) + "px; width:" + FO.xiwidth + "px; height:" + FO.xiheight + "px;");
		var body = document.getElementsByTagName("body")[0];
		var container = UFO.createElement("div");
		container.setAttribute("id", "xi-con");
		var dialog = UFO.createElement("div");
		dialog.setAttribute("id", "xi-mod");
		container.appendChild(dialog);
		body.appendChild(container);
		var MMredirectURL = window.location; // MM code
		document.title = document.title.slice(0, 47) + " - Flash Player Installation"; // MM code
		var MMdoctitle = document.title; // MM code
		if (UFO.is_ie && UFO.is_win) {
			var xiFO = { movie:FO.ximovie, width:FO.xiwidth, height:FO.xiheight, majorversion:"6", build:"65", flashvars:"MMredirectURL=" + MMredirectURL + "&amp;MMplayerType=ActiveX&amp;MMdoctitle=" + MMdoctitle };
		}
		else {
			var xiFO = { movie:FO.ximovie, width:FO.xiwidth, height:FO.xiheight, majorversion:"6", build:"65", flashvars:"MMredirectURL=" + MMredirectURL + "&amp;MMplayerType=PlugIn&amp;MMdoctitle=" + MMdoctitle };
		}
		UFO.foList["xi-mod"] = xiFO;
		UFO.writeFlashObject("xi-mod");
	},

	expressInstallCallback: function() {
		var body = document.getElementsByTagName("body")[0];
		var dialog = document.getElementById("xi-con");
	    body.removeChild(dialog);
		UFO.createStyleRule("body", "height:auto; overflow:auto;");
		UFO.createStyleRule("html", "height:auto; overflow:auto;");
	}

};









/* SpryTabbedPanels.js - Revision: Spry Preview Release 1.4 */

// Copyright (c) 2006. Adobe Systems Incorporated.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//   * Redistributions of source code must retain the above copyright notice,
//     this list of conditions and the following disclaimer.
//   * Redistributions in binary form must reproduce the above copyright notice,
//     this list of conditions and the following disclaimer in the documentation
//     and/or other materials provided with the distribution.
//   * Neither the name of Adobe Systems Incorporated nor the names of its
//     contributors may be used to endorse or promote products derived from this
//     software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

var Spry;
if (!Spry) Spry = {};
if (!Spry.Widget) Spry.Widget = {};

Spry.Widget.TabbedPanels = function(element, opts)
{
	this.element = this.getElement(element);
	this.defaultTab = 0; // Show the first panel by default.
	this.bindings = [];
	this.tabSelectedClass = "TabbedPanelsTabSelected";
	this.tabHoverClass = "TabbedPanelsTabHover";
	this.tabFocusedClass = "TabbedPanelsTabFocused";
	this.panelVisibleClass = "TabbedPanelsContentVisible";
	this.focusElement = null;
	this.hasFocus = false;
	this.currentTabIndex = 0;
	this.enableKeyboardNavigation = true;

	Spry.Widget.TabbedPanels.setOptions(this, opts);

	// If the defaultTab is expressed as a number/index, convert
	// it to an element.

	if (typeof (this.defaultTab) == "number")
	{
		if (this.defaultTab < 0)
			this.defaultTab = 0;
		else
		{
			var count = this.getTabbedPanelCount();
			if (this.defaultTab >= count)
				this.defaultTab = (count > 1) ? (count - 1) : 0;
		}

		this.defaultTab = this.getTabs()[this.defaultTab];
	}

	// The defaultTab property is supposed to be the tab element for the tab content
	// to show by default. The caller is allowed to pass in the element itself or the
	// element's id, so we need to convert the current value to an element if necessary.

	if (this.defaultTab)
		this.defaultTab = this.getElement(this.defaultTab);

	this.attachBehaviors();
};

Spry.Widget.TabbedPanels.prototype.getElement = function(ele)
{
	if (ele && typeof ele == "string")
		return document.getElementById(ele);
	return ele;
}

Spry.Widget.TabbedPanels.prototype.getElementChildren = function(element)
{
	var children = [];
	var child = element.firstChild;
	while (child)
	{
		if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
			children.push(child);
		child = child.nextSibling;
	}
	return children;
};

Spry.Widget.TabbedPanels.prototype.addClassName = function(ele, className)
{
	if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
		return;
	ele.className += (ele.className ? " " : "") + className;
};

Spry.Widget.TabbedPanels.prototype.removeClassName = function(ele, className)
{
	if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
		return;
	ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
};

Spry.Widget.TabbedPanels.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
{
	if (!optionsObj)
		return;
	for (var optionName in optionsObj)
	{
		if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
			continue;
		obj[optionName] = optionsObj[optionName];
	}
};

Spry.Widget.TabbedPanels.prototype.getTabGroup = function()
{
	if (this.element)
	{
		var children = this.getElementChildren(this.element);
		if (children.length)
			return children[0];
	}
	return null;
};

Spry.Widget.TabbedPanels.prototype.getTabs = function()
{
	var tabs = [];
	var tg = this.getTabGroup();
	if (tg)
		tabs = this.getElementChildren(tg);
	return tabs;
};

Spry.Widget.TabbedPanels.prototype.getContentPanelGroup = function()
{
	if (this.element)
	{
		var children = this.getElementChildren(this.element);
		if (children.length > 1)
			return children[1];
	}
	return null;
};

Spry.Widget.TabbedPanels.prototype.getContentPanels = function()
{
	var panels = [];
	var pg = this.getContentPanelGroup();
	if (pg)
		panels = this.getElementChildren(pg);
	return panels;
};

Spry.Widget.TabbedPanels.prototype.getIndex = function(ele, arr)
{
	ele = this.getElement(ele);
	if (ele && arr && arr.length)
	{
		for (var i = 0; i < arr.length; i++)
		{
			if (ele == arr[i])
				return i;
		}
	}
	return -1;
};

Spry.Widget.TabbedPanels.prototype.getTabIndex = function(ele)
{
	var i = this.getIndex(ele, this.getTabs());
	if (i < 0)
		i = this.getIndex(ele, this.getContentPanels());
	return i;
};

Spry.Widget.TabbedPanels.prototype.getCurrentTabIndex = function()
{
	return this.currentTabIndex;
};

Spry.Widget.TabbedPanels.prototype.getTabbedPanelCount = function(ele)
{
	return Math.min(this.getTabs().length, this.getContentPanels().length);
};

Spry.Widget.TabbedPanels.addEventListener = function(element, eventType, handler, capture)
{
	try
	{
		if (element.addEventListener)
			element.addEventListener(eventType, handler, capture);
		else if (element.attachEvent)
			element.attachEvent("on" + eventType, handler);
	}
	catch (e) {}
};

Spry.Widget.TabbedPanels.prototype.onTabClick = function(e, tab)
{
	this.showPanel(tab);
};

Spry.Widget.TabbedPanels.prototype.onTabMouseOver = function(e, tab)
{
	this.addClassName(tab, this.tabHoverClass);
};

Spry.Widget.TabbedPanels.prototype.onTabMouseOut = function(e, tab)
{
	this.removeClassName(tab, this.tabHoverClass);
};

Spry.Widget.TabbedPanels.prototype.onTabFocus = function(e, tab)
{
	this.hasFocus = true;
	this.addClassName(this.element, this.tabFocusedClass);
};

Spry.Widget.TabbedPanels.prototype.onTabBlur = function(e, tab)
{
	this.hasFocus = false;
	this.removeClassName(this.element, this.tabFocusedClass);
};

Spry.Widget.TabbedPanels.ENTER_KEY = 13;
Spry.Widget.TabbedPanels.SPACE_KEY = 32;

Spry.Widget.TabbedPanels.prototype.onTabKeyDown = function(e, tab)
{
	var key = e.keyCode;
	if (!this.hasFocus || (key != Spry.Widget.TabbedPanels.ENTER_KEY && key != Spry.Widget.TabbedPanels.SPACE_KEY))
		return true;

	this.showPanel(tab);

	if (e.stopPropagation)
		e.stopPropagation();
	if (e.preventDefault)
		e.preventDefault();

	return false;
};

Spry.Widget.TabbedPanels.prototype.preorderTraversal = function(root, func)
{
	var stopTraversal = false;
	if (root)
	{
		stopTraversal = func(root);
		if (root.hasChildNodes())
		{
			var child = root.firstChild;
			while (!stopTraversal && child)
			{
				stopTraversal = this.preorderTraversal(child, func);
				try { child = child.nextSibling; } catch (e) { child = null; }
			}
		}
	}
	return stopTraversal;
};

Spry.Widget.TabbedPanels.prototype.addPanelEventListeners = function(tab, panel)
{
	var self = this;
	Spry.Widget.TabbedPanels.addEventListener(tab, "click", function(e) { return self.onTabClick(e, tab); }, false);
	Spry.Widget.TabbedPanels.addEventListener(tab, "mouseover", function(e) { return self.onTabMouseOver(e, tab); }, false);
	Spry.Widget.TabbedPanels.addEventListener(tab, "mouseout", function(e) { return self.onTabMouseOut(e, tab); }, false);

	if (this.enableKeyboardNavigation)
	{
		// XXX: IE doesn't allow the setting of tabindex dynamically. This means we can't
		// rely on adding the tabindex attribute if it is missing to enable keyboard navigation
		// by default.

		// Find the first element within the tab container that has a tabindex or the first
		// anchor tag.
		
		var tabIndexEle = null;
		var tabAnchorEle = null;

		this.preorderTraversal(tab, function(node) {
			if (node.nodeType == 1 /* NODE.ELEMENT_NODE */)
			{
				var tabIndexAttr = tab.attributes.getNamedItem("tabindex");
				if (tabIndexAttr)
				{
					tabIndexEle = node;
					return true;
				}
				if (!tabAnchorEle && node.nodeName.toLowerCase() == "a")
					tabAnchorEle = node;
			}
			return false;
		});

		if (tabIndexEle)
			this.focusElement = tabIndexEle;
		else if (tabAnchorEle)
			this.focusElement = tabAnchorEle;

		if (this.focusElement)
		{
			Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "focus", function(e) { return self.onTabFocus(e, tab); }, false);
			Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "blur", function(e) { return self.onTabBlur(e, tab); }, false);
			Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "keydown", function(e) { return self.onTabKeyDown(e, tab); }, false);
		}
	}
};

Spry.Widget.TabbedPanels.prototype.showPanel = function(elementOrIndex)
{
	var tpIndex = -1;
	
	if (typeof elementOrIndex == "number")
		tpIndex = elementOrIndex;
	else // Must be the element for the tab or content panel.
		tpIndex = this.getTabIndex(elementOrIndex);
	
	if (!tpIndex < 0 || tpIndex >= this.getTabbedPanelCount())
		return;

	var tabs = this.getTabs();
	var panels = this.getContentPanels();

	var numTabbedPanels = Math.max(tabs.length, panels.length);

	for (var i = 0; i < numTabbedPanels; i++)
	{
		if (i != tpIndex)
		{
			if (tabs[i])
				this.removeClassName(tabs[i], this.tabSelectedClass);
			if (panels[i])
			{
				this.removeClassName(panels[i], this.panelVisibleClass);
				panels[i].style.display = "none";
			}
		}
	}

	this.addClassName(tabs[tpIndex], this.tabSelectedClass);
	this.addClassName(panels[tpIndex], this.panelVisibleClass);
	panels[tpIndex].style.display = "block";

	this.currentTabIndex = tpIndex;
};

Spry.Widget.TabbedPanels.prototype.attachBehaviors = function(element)
{
	var tabs = this.getTabs();
	var panels = this.getContentPanels();
	var panelCount = this.getTabbedPanelCount();

	for (var i = 0; i < panelCount; i++)
		this.addPanelEventListeners(tabs[i], panels[i]);

	this.showPanel(this.defaultTab);
};












function siteSearch() {
	formOK = true;
	f = document.forms['fFind'];
	if (formOK == true && f.selectCat.value == '') {
		alert("Vous devez sélectionner une catégorie!");
		formOK = false;
	}
	if (formOK == true && f.keyWord.value == '') {
		alert("Vous devez entrer un mot clé!");
		formOK = false;
	}
	if (formOK == true) {
		loc = f.selectCat.value + '?q=' + f.keyWord.value;
		self.location = loc;
		
	
		var url = new String();
		
		url = '4twq1-kwq.html';
		url = url.replace(/(twq)/, escape(f.selectCat.value));
		url = url.replace(/(kwq)/, escape(f.keyWord.value));
		self.location = url;
	}
}
function mKp() {
	if (window.event.keyCode == 13) { siteSearch(); }
	return false;
}


function changeTo(id)
{ 
	document.getElementById("selectCat").value = id;
	switch(id) {
		case '024' :
			document.getElementById("mp_keyWord").value = "Rechercher un logo animé";
			break;
		case '052' :
			document.getElementById("mp_keyWord").value = "Rechercher une sonnerie";
			break;
		case '015' :
			document.getElementById("mp_keyWord").value = "Rechercher un logo";
			break;
		case '026' :
			document.getElementById("mp_keyWord").value = "Rechercher un jeu";
			break;
		case '047' :
			document.getElementById("mp_keyWord").value = "Rechercher une vidéo";
			break;
		case '025' :
			document.getElementById("mp_keyWord").value = "Rechercher une sonnerie délire";
			break;
	}
}


function changeClass(id)
{ 
	document.getElementById("logo").value = id; 
 
}



function support() {
	sDlLink = "http://www.sonnerie.net/external/DrtTop/aide/service_tech.php?la=fr";
	p = "width=396,height=310,left=20,top=20,toolbar=no,directories=no,status=no,scrollbars=auto,resizable=no,menubar=no";
	hWnd = window.open(sDlLink, "Hwnd", p);
	hWnd.focus();
}



