function PrintHomePage(url,text) {
	if ((document.all)&&(document.getElementById)) { // teste si IE5 et +
		document.write(" - <a title=\"Faites de MosaiqueFM.net votre page de démarrage\" href=\"javascript:\" onclick=\"javascript:this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'"+url+"\')\">"+text+"</a>");
	}
}
function ManageSMSMarquee(MarqueeAction) { //v2.0
SMSMarquee = document.getElementById('MOSASMSMARQUEE');
if (!SMSMarquee){
return;
}
  if (MarqueeAction){
	  if (MarqueeAction == "Stop"){
	  	SMSMarquee.stop();
	  }
	  if (MarqueeAction == "Start"){
  		SMSMarquee.start();
	  }
	  if (MarqueeAction == "Left"){
	  	SMSMarquee.stop();
	  	SMSMarquee.direction = 'left';
  		SMSMarquee.start();
	  }
	  if (MarqueeAction == "Right"){
	  	SMSMarquee.stop();
	  	SMSMarquee.direction = 'right';
  		SMSMarquee.start();
	  }
	}
}
function OpenAbout(NAME){
	if (NAME){
		AboutURL = "/popup/";
		switch (NAME){
			case "Privacy":
			AboutURL = AboutURL + "vie_privee.html";
			break;
			case "Legal":
			AboutURL = AboutURL + "mentions_legales.html";
			break;
		}
		//openup
		ABOUTPOP =  window.open(AboutURL, "ABOUTPOP", "width=500,height=350,menubar=no,location=no,resizable=no,scrollbars=yes,status=no");
		ABOUTPOP.focus();
	}

}

function OpenCommentWin(Type, Itemz){
	
	CommentURL = "/popup/Commentaire.php?Type="+Type+"&Item="+Itemz;
	COMPOP =  window.open(CommentURL, "COMPOP", "width=350,height=300,menubar=no,left=300,top=150,location=no,resizable=no,scrollbars=no,status=no");
	COMPOP.focus();
	
}

if (navigator.appVersion.substring(0,1) >= 4)
	{
		var widChat = (screen.width-16);
		var heiChat = (screen.height-90);
		if (widChat > 1013) {var widChat = 1013;}
		if (heiChat > 690) {var heiChat = 690;}
		
	}
	else
	{
		var widChat = 620;
		var heiChat = 400;
	}
	
	
function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
function OpenChatWindow(){
	ChatURL = "http://chat.mosaiquefm.net/chat/";
	ChatDomain = '.mosaiquefm.net';
	Nick = document.getElementById("NickName").value;
	widChat = 796;
	heiChat = 548;

	setCookie("c_user_name", Nick, "", "/", ChatDomain, false);

	OBJCHAT =  window.open(ChatURL, "MOSACHAT", "width="+widChat+",height="+heiChat+",menubar=no,location=no,resizable=yes,scrollbars=auto,status=no");
	OBJCHAT.focus();
	return false;

}
function openBreakVideo(){
	where = "/popup/break.html";
	bw = 374;
	bh = 300;
	bwin = window.open(where,'bwin','width='+bw+',height='+bh+',top=260,left=300,menubar=no,location=no,resizable=no,scrollbars=no,status=no');
	bwin.focus();
}

function ToggleViewSearchOptions(elId, linkEl){
	
	searchOptionsEl = document.getElementById(elId);
	if (!searchOptionsEl) return;
	if (searchOptionsEl.style.display == "none"){
		searchOptionsEl.style.display = "";
		linkEl.innerHTML = '-';
	}
	else{
		searchOptionsEl.style.display = "none";
		linkEl.innerHTML = '+';
	}
		
	
	
}
//popup engine
function PopOpen(linkObj, popWidth, popHeight){
	if(!linkObj.href) return true;
	if(!popWidth) return true;
	if(!popHeight) return true;
	//they are all here
	//open popup win
	popWin = window.open(linkObj.href + '?Blank=1','popWin','width='+popWidth+',height='+popHeight+',top=100,left=140,scrollbars=yes,resizable=no');
	popWin.focus();
	return false;
}


window.name = "MainMosaWin";
window.focus();

