//BEGIN DRP BUSINESS SOLUTIONS JS updated AUG08 v1.7
//
var loaded = false ;
var d = document ;
var isOpen = false ;
var ns4 = d.layers ;
var ns6= d.getElementById&&!d.all
var ie = d.all ;

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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];}}
}


var fenetre;

function MM_openBrWindow(theURL,winName,features) { //v2.0

	
	if(theURL.indexOf('popup_image.php')!=-1 || theURL.indexOf('.jpg')!=-1 || theURL.indexOf('.jpe')!=-1 || theURL.indexOf('.jpeg')!=-1 || theURL.indexOf('.gif')!=-1) {

		typePopup = 'zoom';

	} else {

		pagesScrolls = new Array('8100.php', '8200.php', '10300.php', '10500.php', '2210.php', '2715.php', '2735.php', 'nouveaute/index.php', 'nouveaute/uk/index.php');

		typePopup = 'autre';

		for(i=0;i<pagesScrolls.length;i++) {

			if(theURL.indexOf(pagesScrolls[i])!=-1) {

				typePopup = 'scroll';

				break;

			}

		}//for
		

	}

	nomPopup = typePopup;


	chemin_fichier_zoom = ((window.top.location.toString().indexOf('drpbusiness.com')==-1) && (window.top.location.toString().indexOf('dlpbusiness.com')==-1)) ? '/gib01/gib01' : '';


	if(features.indexOf('resizable=no')==-1)
		features += ',resizable=yes';
	else
		features = features.replace(/resizable=no/, 'resizable=yes');

	features += ',top=20,left=50';

	
	/*if(fenetreScroll && typePopup!='scroll')
		fenetreScroll.close();*/


	if(typePopup=='zoom' && theURL.indexOf('popup_image.php')==-1)
		fenetre = window.open(chemin_fichier_zoom+'/popup_zoom.php?url=' + theURL,nomPopup,features);
	else if(typePopup!='scroll')
		fenetre = window.open(theURL,nomPopup,features);
	else
		fenetreScroll = window.open(theURL,nomPopup,features);


		temp = features.match(/width=[^,]*/i);
		largeur = parseInt(temp[0].substring(6, temp[0].length));

		temp = features.match(/height=[^,]*/i);
		hauteur = parseInt(temp[0].substring(7, temp[0].length));


		laFenetre = (typePopup=='scroll') ? window.fenetreScroll : window.fenetre;


		if(document.all) {

			largeur += 10;
			hauteur += 30;

			laFenetre.resizeTo(largeur, hauteur);
			
		} else if (document.layers || document.getElementById) {

			laFenetre.innerHeight = hauteur;
			laFenetre.innerWidth = largeur;

		}

	laFenetre.focus();

}//MM_openBrWindow() trafiquée


/* close popup windows */
function stopError() {
return true;
}
//window.onerror = stopError;
function closepopup() {
parent.close()
}

/*fix bg color NS4.x*/
function setTdBg(bgcolor,tdIndex)
{
	if (ns4) document.write ('<td bgcolor=#'+ bgcolor +' valign="bottom">');
	else  document.write ('<td bgcolor=#'+ bgcolor +' valign="bottom" background="../img/hotcong/bg_'+ tdIndex +'.gif">');
}

function show(){
	if(loaded){
    if(ns4){d.layers['display02'].visibility = "show";}
    else if(ie){d.all['display02'].style.visibility = "visible";}
    else if(ns6){d.getElementById('display02').style.visibility = "visible";}
	}
}

function hide(){
	if(loaded){
    if(ns4){d.layers['display02'].visibility = "hide";}
    else if(ie){d.all['display02'].style.visibility = "hidden";}
    else if(ns6){d.getElementById('display02').style.visibility = "hidden";}
	}
}

function openClose(){
	if (!isOpen) {show(); isOpen = true ; return true;}
	else {hide(); isOpen = false ;}
}

function getDropdownValue(theDropdown) {
	if ( (theDropdown.length!=0) && (theDropdown.selectedIndex!=-1) )
		return theDropdown.options[theDropdown.selectedIndex].value;
	else
		return '';
}

//CHECK FLASH
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}

//UPDATE JAN/FEB 05
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_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];}
}

 //06
 //Newsletters Popping windows
function pop5x00(url)
{
 	popz=window.open(url,'popz','toolbar=no, scrollbars=yes, resizable=yes, status=no, location=no, directories=no, menubar=no, width=524, height=490, top=0, left=20');
		popz.focus();
}

 //Video Display Popping windows
function popVidDisplay(url)
{
 	popz=window.open(url,'popVidDisplay','toolbar=no, scrollbars=yes, resizable=yes, status=no, location=no, directories=no, menubar=no, width=603, height=490, top=20, left=20');
		popz.focus();
}

 //Commercial offer MAR09
function popComOffer(url)
{
 	popz=window.open(url,'popComOffer','toolbar=no, scrollbars=yes, resizable=yes, status=no, location=no, directories=no, menubar=no, width=620, height=490, top=20, left=20');
		popz.focus();
}

