//_________________________________________
//var projectname = "PROJECT NAME";
var page;
var projectname = document.title;
var titleSeparator = " | ";

function updateDocumentTitle(str)
{
	var result = "";
	
	if(str){
		result = projectname + titleSeparator + str;
	}else if(getQueryParamValue("page")){
		// getQueryParamValue in /common/js/flashobject.js
		result = projectname + titleSeparator + getQueryParamValue("page");
	}
	document.title = result;
};

function documentTitle(str){
	document.title = str;
}

//updateDocumentTitle();
function setPage (IDpage)
{
	page = IDpage;
}

//_________________________________________
function fullscreen(){self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);};
function winClose(){ self.close();}
function statusbar(str){ self.status(str);}

var mypopup;
function popup(url,name,p)
{
	if(p.fullscreen){
		p.l = 0; 
		p.t = 0;
		p.w = screen.availWidth;
		p.h = screen.availHeight;
		p.tb = p.mb = p.st = p.sb = p.r = 0;
	}else if (p.center){
		p.l = (screen.availWidth/2) - (p.w/2); 
		p.t = (screen.availHeight/2) - (p.h/2);
		p.tb = p.mb = p.st = p.sb = p.r = 0;
	}
	
	if(mypopup!=undefined) // si definie
	{ 
		if (!mypopup.closed) { mypopup.close();	}
	}
	mypopup = window.open(url,name,
	'left='+p.l
	+',top='+p.t
	+',width='+p.w
	+',height='+p.h
	+',toolbar='+p.tb
	+',menubar='+p.mb
	+',status='+p.st
	+',scrollbars='+p.sb
	+',resizable='+p.r
	+'');
}
//_________________________________________
// self close popup image
function popupImage(img) 
{
	titre="Agrandissement"; 
	w=open("",'image','width=500,height=500,toolbar=no,scrollbars=1,resizable=1,status=0');
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>"); 
	w.document.write("<link rel='stylesheet' media='screen' type='text/css' href='common/css/popup_image.css' />"); 
	w.document.write("<SCRIPT language=javascript>function Min(a,b) {if(a<b){return a;}else{return b;}}; function autoSize(){self.resizeTo(Min((document.images[0].width+40), screen.width-50), Min((document.images[0].height+70), screen.height-25));}</"+"SCRIPT>");
	//w.document.write("<BODY onload='javascript:autoSize();' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
	w.document.write("<body onload='javascript:autoSize();' onblur='window.close()' onclick='window.close()'>");
	w.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");
	w.document.write("<TD valign='middle' align='center'>");
		w.document.write("<DIV class='imgContent'>");
	w.document.write("<IMG src='"+img+"' border=0 alt='...'>"); 
		w.document.write("</DIV>");
	w.document.write("</TD>");
	w.document.write("</TR></TABLE>");
	w.document.write("</BODY></HTML>"); 
	w.document.close(); 
} 


//_________________________________________
// Change background color
function changeBackgroundColor(rgbVal){
	document.bgColor = rgbVal;
}


