// renault crédit intelligence
//  - scripts by atelier w, stefan niederhauser, 2002
//


var LANG = (document.location.href.indexOf('ref_') > 0 ? 'f' : ''); 


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


// utility functions, some (c) by macromedia

function findObj(n, d) {
	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 = findObj(n,d.layers[i].document);
	if (x==null && document.getElementById) x = document.getElementById(n);
	return x;
}


function showHideLayers() {
	var i, p, v, obj, args = showHideLayers.arguments;
	for (i = 0; i < (args.length - 2); i += 3) {
	    if ((obj = findObj(args[i])) != null) { 
    		v = args[i+2];	
		if (obj.style) {
		    obj = obj.style; 
		    v = (v == 'show') ? 'visible' : (v = 'hide') ? 'hidden': v;
		}
		obj.visibility=v;
	    }
	}
}

function doPreload() {
	for (i = 1; i <= navTopNum; i++) {
	    imgPreload(navTopName, navTopPre, i, navTopPost, navTopActive);
	    for (j = 1; j <= navSubNum[i]; j++) {
		imgPreload(navSubName, navTopPre, i+"_"+j, navTopPost, navTopActive);
	    }
	}
}

function imgPreload(name, imgPre, imgNum, imgPost, imgAct) {
	var imgName = name + imgNum + imgAct;
	var img = new Image();
	img.src = imgPre + imgNum + imgAct + imgPost;
	imgCache[imgName] = img;

	if (imgAct) imgPreload(name, imgPre, imgNum, imgPost, "");
}

function imgSet(name, imgSrc) {
	var img = findObj(name);
	if (img != null) 
	    return img.src = imgSrc;
	else
		return false;
}

function imgLoaded(name) {
	var img = findObj(name);
	return img.complete;
}

function winOpen(winName, path, feat) {
	if (feat == "full")
		feat = "toolbar=1,location=1,status=1,menubar=1,resizable=1,scrollbars=1";
	var win = window.open(winName, path, feat);
	win.focus();
}

function popup(path, width, height, feat, notcenter) {
	if (!width)
	    width = 300;
	if (!height)
	    height = 300;
	if (feat == "full")
		feat = "toolbar=1,location=1,status=1,menubar=1,resizable=1,scrollbars=1";
	else 
		feat = "width="+width+",height="+height+(feat ? ","+feat : "");
	if (!notcenter) 
		feat = "left="+(screen.width/2-width/2)+",top="+(screen.height/2-height/2) + ","+feat;
  	var win = window.open(path, width+"x"+height, feat);
	win.focus();
}
