//<!---
function OpenWindow(theURL,winName,features) 
{ 
	 window.open(theURL,winName,features);
}
//
function CloseWindow() { //v2.0
	window.close();
}

function switchImage(imgDest, imgSource)
{
   imgDest.src = imgSource.src;
}
//
//--------------------------------------------
//
function showUploadedImage(f,img) { 
								var browseObj = document.getElementById(f); 
								//browseObj.click(); 
								//var txtLocation = document.getElementById("txtFileName"); 
								//var txtLocation.value = browseObj.value;
								document.getElementById(img).src = browseObj.value;
				    
								//document.getElementById('textbox1').value = txtLocation.value;
				    
								//alert('test');
} 
//
//--------------------------------------------
//
function Test()
{
 alert('This is a test======');
 return true;
//
function popPage(theURL,x, y) { //v2.0
	window.open(theURL,x,y);
}
//
//--------------------------------------------
//
function clean()
{
interval=setInterval("makeclean(myImage)",10)
}
//
function foggy()
{
clearInterval(interval)
document.getElementById('myImage').filters.alpha.opacity=10
}

function makeclean()
{
if (document.getElementById('myImage').filters.alpha.opacity<100)
	{
	document.getElementById('myImage').filters.alpha.opacity+=5
	}
else if (window.interval)
	{
	clearInterval(interval)
	}
}
//
}
function IsButtonClicked(src) 
{
		var pos1, pos2;
		
		pos1 = src.lastIndexOf("_");
		pos2 = src.lastIndexOf(".");
		if (src.substring(pos1+1, pos2).toLowerCase() == "clicked")
				return true;
		else
				return false;   
	}
// --->
//<!-- http://www.wilsoninfo.com -->

//<!-- Begin
function testImage(img)
{
alert(img);
image1 = new Image();
image1.src = img;
}
// End -->
//------------------------------------

//<!--

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		btn_contactez_nous_01_btn_contactez_nous_02_over = newImage('<%= Page.ResolveUrl("~/images/btn_contactez-nous_01-btn_c.gif")%>');
		btn_contactez_nous_02_over = newImage('<%= Page.ResolveUrl("~/images/btn_contactez-nous_02-over.gif") %>');
		preloadFlag = true;
	}
}
// Begin
function preload() {
  if (!document.images) return;
  var ar = new Array();
  var arguments = preload.arguments;
  for (var i = 0; i < arguments.length; i++) {
    ar[i] = new Image();
    ar[i].src = arguments[i];
  }
}

// End -->

//***
//
function charCounter(label, fld)
{
		//alert(label + document.getElementById(field).value + ' --> ' + document.getElementById(field).value.length);
	    // display the length of a feidl value.
		    alert(label + document.getElementById(fld).value.length);
		    //alert(document.frmNewProducts.test1.value)
}
//
function openWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}
//
function closeWindow() { //v2.0
	window.close();
}
//
//
//
function openWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}
//
function closeWindow() { //v2.0
	window.close();
}
//
function changeBackColor(color)
{
	document.getElementById(f).style.background=color;
}
//
function changeTextColor(f, color)
{
	document.getElementById(f).style.color=color;
}
//
function changeBothColors(f, forecolor, backcolor)
{
	document.getElementById(f).style.color=forecolor;
	document.getElementById(f).style.background=backcolor;
	//document.getElementById(f).style.decoration=underline;
}

function SubmitToParent(str, frm)
{
	window.opener.document.frmParent.txtCity.value = str;
	window.close();
	return true;
}
//

// Lucner Jean-Baptiste -- 2005/11/27
function redirectQuestion(sConfirm, sURL) {
	//sConfirm = 'Si vous continuez, toutes les modifications de votre profil non enregistrées seront perdues. Cliquez sur ‘Annuler’ pour retourner enregistrer les modifications. Cliquez sur ‘OK’ pour continuer.';
	// need to replace double quote with a single quote
	if (window.confirm(sConfirm)) {
		location.href = sURL;
	}
}

//
function CheckLoginState()
{
  me.PageRedirect("../member/default.aspx")
}

function SetFocus(c) {
	document.getElementById(c).select(); 
	document.getElementById(c).focus(); 
return true; 
} 

//checks all DataGrid CheckBoxes with the given name with the given value
function CheckAllBoxes(aspCheckBoxID, checkVal) {
	 var elm, re, i, pos
	 
   re = new RegExp(':' + aspCheckBoxID + '$')  //generated control name starts with a colon
   for(i = 0; i < document.forms[0].elements.length; i++) {
      elm = document.forms[0].elements[i]
      if (elm.type == 'checkbox') {
				 pos = elm.name.lastIndexOf(":")
				 if (pos > -1) {
				 	  if (elm.name.substring(0,pos)	 == aspCheckBoxID && checkVal) {  // + " " + aspCheckBoxID + " " + checkVal);
               elm.checked = checkVal
               if (elm.checked == true)
               {
                 elm.color = 'blue';
               }   
            }  
         }
      }   
   }
   return true;
}

// Uncheck all check boxes
function ClearAllBoxes(aspCheckBoxID, checkVal) {
	 var elm, re, i, pos
	 
   re = new RegExp(':' + aspCheckBoxID + '$')  //generated control name starts with a colon
   for(i = 0; i < document.forms[0].elements.length; i++) {
      elm = document.forms[0].elements[i]
      if (elm.type == 'checkbox') {
				 pos = elm.name.lastIndexOf(":")
				 if (pos > -1) {
				 	  if (elm.name.substring(0,pos)	 == aspCheckBoxID && checkVal==false) {  // + " " + aspCheckBoxID + " " + checkVal);
               elm.checked = checkVal
               if (elm.checked == true)
               {
                 elm.color = 'blue';
               }   
            }  
         }
      }   
   }
   return true;
}

function showHelp(strURL, strAnchor, intBuilderID)
{
    var strText = "";
    if (strURL == '/help/help.aspx?ma=  ')
    {
		  if (strAnchor == 'confidentialinfo') {
			  strText = "/" + strAnchor;
		  }
		  else {
			 //strText = '/Help.aspx?=target=' + strAnchor + "#" + strAnchor;
			 strURL = strURL + '?target=' + strAnchor;
		  }
		}  
		else {
			 //strText = '/Help.aspx?=target=' + strAnchor + "#" + strAnchor;
			 strURL = strURL + '?target=' + strAnchor;
		}  
    //alert(strURL);
    var winRUHelp = window.open(strURL, "help", "width=650,height=315,scrollbars=1,resizable=yes");

	// LJB on May-14-2005
	//if popup killed by a popupkiller ask the user to turn it off
    if(!winRUHelp){
			Alert("Popup blocker exists");
		//alertPopUpBlockerDetected();
    }
    winRUHelp.focus();
}

function IsButtonClicked(src) 
{
		var pos1, pos2;
		
		pos1 = src.lastIndexOf("_");
		pos2 = src.lastIndexOf(".");
		if (src.substring(pos1+1, pos2).toLowerCase() == "clicked")
				return true;
		else
				return false;   
	}

function RedirectQuestion(sConfirm, sURL) {
	//sConfirm = 'Si vous continuez, toutes les modifications de votre profil non enregistrées seront perdues. Cliquez sur ‘Annuler’ pour retourner enregistrer les modifications. Cliquez sur ‘OK’ pour continuer.';
	// need to replace double quote with a single quote
	if (window.confirm(sConfirm)) {
		location.href = sURL;
	}
}

// Nannette Thacker http://www.shiningstar.net
function confirmSubmit(msg)
{
var agree=confirm(msg);
if (agree)
	return true ;
else
	return false ;
}

//-----------------------------------------------------------------------------

function enlargeImage(image)
{
document.getElementById(image).width="200"
document.getElementById(image).height="360"
}

function moveback()
{
document.getElementById(image).width="100"
document.getElementById(image).height="180"
}

function browserVersion()
{
   g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
   if (g_fIsSP2)
   {
   alert('//This browser is Internet Explorer in SP2. ');
   }
   else
   {
   alert('//This browser is not Internet Explorer in SP2.');
   }
}

// -->

			
								
