function OuvrirCinema(Adresse, v_height, v_width) {
	window.open(Adresse,"cinema","resizable=no,left=15,screenX=15,top=15,screenY=15,height=" + v_height + ",width=" + v_width + ",scrollbars=yes,menubar=yes,alwaysraised=yes");
}

function MM_openBrWindow(theURL,winName,features) {
  var v_window = window.open(theURL,winName,features);
}

function EcouteEnDirect (station) {
	var ecoute_popup;
	ecoute_popup = window.open ("http://www.rockdetente.com/lecteur/player.php?Station=" + station + "","ecoute_en_direct","toolbar=no,location=no,directories=no,titlebar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1025,height=730,top=20,left=20"); 
	ecoute_popup.focus();	
}

function openplayerMP3Window(file, titre) {
	sv_window = window.open("http://www.rockdetente.com/lecteur/lecteur_general/default.php?audio=" + file + "&titre=" + titre , "lecteur", "width=350,height=200,left=100,top=200");
	sv_window.focus();
}

function OuvrirSMS () {
	window.open('http://www.rockdetente.com/mobile/chat/index.php', '_blank', 'width=400,height=350,toolbar=no');
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function adjustSize() {
  v_document_name = document.URL;
  v_document_name_indexOf = v_document_name.indexOf("principal");

  if (v_document_name_indexOf == -1) {
  	v_site_width = 778;
  }else{
  	v_site_width = 941;
  }
  v_availWidth = 630;
  if (parseInt(navigator.appVersion)>3) {
    if (navigator.appName=="Netscape") {
      v_availWidth = window.innerWidth;
     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
       v_availWidth = document.body.offsetWidth;
     }
  }

  v_tempWidth = (v_availWidth - v_site_width - 22) / 2;
	if (v_tempWidth < 0) v_tempWidth = 0;
}

//////////////////////////////////////////
// Google search engine box //////////////
//////////////////////////////////////////
function GetRadioValue(rArray) {
		for (var i=0;i<rArray.length;i++) {
			if (rArray[i].checked)
				return rArray[i].value;
		}
	
		return null;
	}

	function searchGoogle(station) {
		var searchType = GetRadioValue(document.recherche.sitesearch);
		var searchStr = escape(document.recherche.q.value);
		if (searchType == '') {
			// Recherche Web Google
			window.open('http://www.google.ca/custom?q='+searchStr+'&client=pub-0339669993168349&domains=www.rockdetente.com&forid=1&hl=fr&ie=ISO-8859-1&oe=ISO-8859-1&cof='+escape('GALT:#3399FF;GL:1;DIV:#666666;VLC:000000;AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:000000;LC:000000;T:000000;GFNT:000000;GIMP:000000;LH:60;LW:114;L:http://www.rockdetente.com/images/google_rockdetente_100x100.jpg;S:http://www.rockdetente.com;LP:1;FORID:1;'), 'google_window');
		}
		else {
			// Recherche du site
			document.location.href = 'http://google.rockdetente.com/search?q='+searchStr+'&btnG=Recherche&restrict=rockdetente&ie=&site=AstralMediaRadio&output=xml_no_dtd&client=AstralMediaRadio&lr=lang_fr&proxystylesheet=http%3A%2F%2Fwww.rockdetente.com%2Fasp%2Fgoogle%2Fgoogle.asp%3Fstation%3D'+station;
		}
		return false;
	}
//////////////////////////////////////////