
function openWiz(url, redirect)
{
	var oLink = {href: "",name: "",title: null,target: null,className: null,style: null};
	width = 700;
	height = 575;
	//alert("wbservice");
	if (url.indexOf("http:") == -1)
	{
		url = "http://" + url;
	}

	if (redirect == "true")
	{
		location.href = url;	
	} else {
		str = window.showModalDialog(url + "&WebbyzzLoggedIn=6144","", "status:no; center:yes; help:no; minimize:no; maximize:no; scroll:no; border:thin; statusbar:no; dialogWidth:" + width + "px; dialogHeight:" + height + "px");
//	alert(oLink.href)
		if (str != "" && str != undefined)
			{
			location.href = str;
			}
		}
	
}

function WBPrint() {
	window.focus();
	if(window.print)
		window.print();

}

function WBLogUrlRequest(strUrl) {
	window.open('/_system/services/logUrlRequest.asp?page='+strUrl,'','toolbar=no,status=no,titlebar=no,menubar=no,resizable=yes,scrollbars=yes,width=1,height=1,left=0,top=0')	
}

function golien(intNoLien) {
	window.open("/lien/lien-redirect.asp?xnolien="+intNoLien);
}

function gotoshow(){
	window.open('http://delson.webbyzz.com/_system/baniere/adclick2.asp?adresse='+slidelinks[whichlink],'stat')
}

function WBGoLien(intNoLien, intNoType, strUrl) {
//********************************************************
// Modifie le lien selon son type
//********************************************************	

// Variable du no de site pour les statistiques
//page interne
	if((intNoType==11) && (intNoLien==0)){
		if (!(strUrl.indexOf("ttp://") > 0 || strUrl.indexOf("ttps://") > 0))
		{
				strUrl = "http://" + strUrl;
		}
		location.href = strUrl
		//parent.location.href = "http://director.marigny.com/d-click.php?aid="+strIDSite+"&url="+strUrl;

	
	}else{
//page externe
		if ((intNoType==13) || (intNoType==12)){
			//WBLogUrlRequest(strUrl)
			if (!((strUrl.indexOf("ttp://") > 0) || (strUrl.indexOf("ww.") > 0) || (strUrl.indexOf("ttps://") > 0))){
					strUrl = "http://delson.webbyzz.com" + strUrl;
			}
			if (intNoType==13) 
			{
				window.open(strUrl);
			}
			else
			{
				location.href = strUrl;
			}
			//window.open("http://director.marigny.com/d-click.php?aid="+strIDSite+"&url="+strUrl);
		}else{
//image						
			if ((intNoType==10) && (strUrl.indexOf(".htm") > 0))
			{
				strUrl = "http://delson.webbyzz.com" + strUrl
				//window.open("http://director.marigny.com/d-click.php?aid="+strIDSite+"&url="+strUrl);
				location.href = strUrl
			}else{
				window.open(strUrl);
			}
		}
	}
}


function WBSendPage() {
	window.open('/_system/services/sendpage.asp?page='+location.pathname,'','toolbar=no,status=no,titlebar=no,menubar=no,resizable=yes,scrollbars=yes,width=650,height=440,left=0,top=0')	
}


function WBPrintPage() {
	window.open('/_system/services/printpage.asp?page='+location.pathname,'','toolbar=no,status=no,titlebar=no,menubar=no,resizable=yes,scrollbars=yes,width=620,height=740,left=0,top=0')
}

function WBPrintPageTheme() {
	window.open('/_system/services/printpage.asp?theme='+document.all.xthemecourant.value,'','toolbar=no,status=no,titlebar=no,menubar=no,resizable=yes,scrollbars=yes,width=620,height=740,left=0,top=0')
}



function ValiderLogin(pUser, pPwd)
{
	var strMessage = "";
	//alert(pUser + " " + pPwd);
	if (pUser != "") {
		if (document.getElementById("xcodeuser").value == "") {
			strMessage = strMessage + "Vous devez entrer un nom d'usager\n";
		}
	}
	
	if (pPwd != "") {
		if (document.getElementById("xpassword").value == "") {
			strMessage = strMessage + "Vous devez entrer un mot de passe\n";
		}
	}

	if (strMessage != "") {
		alert(strMessage);
		return false;
	}

	return true;
}
