
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://tourismecantons.qc.ca/_system/baniere/adclick2.asp?adresse='+slidelinks[whichlink],'stat')
}

function WBGoLien(intNoLien, intNoType, strUrl) {
	strIDSite = "d000572"
	if((intNoType==11) && (intNoLien==0)){
		if (!(strUrl.indexOf("ttp://") > 0))
		{
				strUrl = "http://" + strUrl;
		}
		location.href = strUrl
		//parent.location.href = "http://director.marigny.com/d-click.php?aid="+strIDSite+"&url="+strUrl;
	}else{
		if ((intNoType==13) || (intNoType==12)){
			//WBLogUrlRequest(strUrl)
			if (!((strUrl.indexOf("ttp://") > 0) || (strUrl.indexOf("ww.") > 0))){
					strUrl = "http://cld.lajemmerais.ca" + 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{
			if ((intNoType==10) && (strUrl.indexOf(".htm") > 0))
			{
				strUrl = "http://cld.lajemmerais.ca" + 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 NextPage(pstrNoPage, totalLiens, pageDecalage, pageQty, pageFin, pageGabarit, paramPagination, rechLangue)
	{
		//alert(pstrNoPage);

		var strUrl;
		var strMessage;
		var oMsg;
		
		oMsg = false;

		try {
			oMsg = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				oMsg = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				oMsg = false;
			}
		}

		if (!oMsg && typeof XMLHttpRequest!='undefined') {
			oMsg = new XMLHttpRequest();
		}

		strUrl = location.href.substring(location.href.lastIndexOf('?') + 1, location.href.length);

		strUrl = strUrl + "&pagination=1&pageCourante=" + pstrNoPage + "&totalLiens=" + totalLiens + "&pageDecalage=" + pageDecalage + "&pageQty=" + pageQty + "&pageFin=" + pageFin + "&pageGabarit=" + pageGabarit + "&paramPagination=" + paramPagination + "&rechLangue=" + rechLangue 

		if (strUrl != 0){	
		
			//alert(strUrl);
			oMsg.open("GET", "/_system/MRCLAJEMMERAIS/recherche/recherche.asp?" + strUrl, false)
			oMsg.setRequestHeader("MethodName", "enterOrder")
			oMsg.setRequestHeader("MessageType", "Call")
			oMsg.setRequestHeader("Content-Type", "text/xml-SOAP")

			oMsg.send(null)

			strMessage = oMsg.responseText
			//alert('StrMEssage:' + strMessage)
			if (strMessage.length > 10)
			{
				document.getElementById("wb_contenu_in").innerHTML = strMessage
			}

			document.getElementById("SEARCH").value = document.getElementById("C_SEARCH").value
		}
		delete oMsg;
	}


	function init()
	{
		var strUrl;
		var strMessage;
		var intPosPI;
		var oMsg;
		
		oMsg = false;

		try {
			oMsg = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				oMsg = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				oMsg = false;
			}
		}

		if (!oMsg && typeof XMLHttpRequest!='undefined') {
			oMsg = new XMLHttpRequest();
		}

		strUrl = location.href.substring(location.href.lastIndexOf('?') + 1, location.href.length);

		if (strUrl != 0){		
			strUrl = "/_system/MRCLAJEMMERAIS/recherche/recherche.asp?" + strUrl;
			oMsg.open("GET", strUrl, false);
			oMsg.setRequestHeader("MethodName", "enterOrder");
			oMsg.setRequestHeader("MessageType", "Call");
			oMsg.setRequestHeader("Content-Type", "text/xml-SOAP");
			
			oMsg.send(null);

			strMessage = oMsg.responseText;
			if (strMessage.length > 10)
			{
				document.getElementById("wb_contenu_in").innerHTML = strMessage
			}

			document.getElementById("SEARCH").value = document.getElementById("C_SEARCH").value
		}
		delete oMsg;
	}