
function gotoDestination(action,adminaccess) {

 taction= action;
 document.forms[0].action.value = taction;

 tsection=document.forms[0].section.value;
 tlangue=document.forms[0].lng.value;

 if ((taction==null) || (taction=="")) { taction="voir"; document.forms[0].action.value=taction;}
 if ((tsection==null) || (tsection=="")) { tsection="news"; document.forms[0].section.value=tsection;}
 if ((tlangue==null) || (tlangue=="")) { tlangue="an"; document.forms[0].lng.value=tlangue;}
 var banner="";
 switch (tsection){
 case "home" :			if (tlangue=="fr") banner="ACCUEIL"; else banner="HOME"; break;
 case "production" :	if (tlangue=="fr") banner="CDs"; else banner="CDs"; break;
 case "news" :			if (tlangue=="fr") banner="NOUVELLES"; else banner="NEWS"; break;
 case "artists" :		if (tlangue=="fr") banner="ARTISTES"; else banner="ARTISTS"; break;
 case "urls" :			if (tlangue=="fr") banner="URLs"; else banner="URLs"; break;
 case "links" :			if (tlangue=="fr") banner="LIENS"; else banner="LINKS"; break;
 case "contact" :		if (tlangue=="fr") banner="CONTACT"; else banner="CONTACT"; break;
 case "stock" :			if (tlangue=="fr") banner="COMMANDER"; else banner="ORDER"; break;
 case "reviews" :		if (tlangue=="fr") banner="CRITIQUES"; else banner="REVIEWS"; break;
 case "about" :			if (tlangue=="fr") banner="À NOTRE SUJET"; else banner="ABOUT US"; break;
 case "distributors_cd" :	if (tlangue=="fr") banner="DISTRIBUTEURS CD"; else banner="CD DISTRIBUTORS"; break;
 case "distributors_prod" :	if (tlangue=="fr") banner="DISTRIBUTEURS PRODUITS AUDIO"; else banner="AUDIO PRODUCTS DISTRIBUTORS"; break;
 case "recservices" :	if (tlangue=="fr") banner="SERVICES D&#096;ENREGISTREMENT"; else banner="RECORDING SERVICES"; break;
 case "refsystem" :		if (tlangue=="fr") banner="SYSTÈME DE RÉFÉRENCE"; else banner="REFERENCE SYSTEM"; break;
 case "audioproducts" :	if (tlangue=="fr") banner="PRODUITS AUDIO"; else banner="AUDIO PRODUCTS"; break;
 case "imageflip" :		if (tlangue=="fr") banner="BOITIERS CD"; else banner="CD CASES"; break; 
 case "galleries" :		if (tlangue=="fr") banner="ALBUMS DE PHOTOS"; else banner="PHOTO GALLERY"; break; 
 case "photosgalleries" :if (tlangue=="fr") banner="PHOTOS DES ALBUMS"; else banner="PHOTOS FOR GALLERIES"; break; 
 case "plages" :if (tlangue=="fr") banner="PLAGES DES CD"; else banner="CD TRACKS"; break; 
 case "sales" :if (tlangue=="fr") banner="VENTES"; else banner="SALES"; break; 
 case "internetsecure" :if (tlangue=="fr") banner="TRANSACTIONS EN LIGNE"; else banner="ONLINE TRANSACTIONS"; break; 
 default :				if (tlangue=="fr") banner="FIDELIO AUDIO"; else banner="FIDELIO AUDIO";
}
  if (adminaccess=='normal') {
	  if (
      (tsection!='news') && 
		  (tsection!='production') && 
  	  (tsection!='artists') && 
	 	 	(tsection!='galleries') &&
	  	(tsection!='photosgalleries') &&
	  	(tsection!='reviews') &&
	  	(tsection!='distributors_cd') &&
	  	(tsection!='distributors_prod') &&
	  	(tsection!='recservices') &&
			(tsection!='refsystem') && 
			(tsection!='sales') && 
			(tsection!='plages') && 
			(tsection!='internetsecure') && 
	  	(tsection!='audioproducts')

	  	){
    		taction="voir";
		}
  }


 if ((tsection=='internetsecure') && (taction!='modifier')) {taction='modifier';}
 if ((tsection=='sales') && (taction!='modifier')) {taction='modifier';}
 if ((tsection=='stock') && (taction!='voir')) {taction='voir';}
 if (taction=='ajouter'){destination = tsection + '_insert.php?lng=' + tlangue;}
 if (taction=='modifier'){destination = tsection + '_showall.php?lng=' + tlangue;}

 if ((tsection=='distributors_cd') || (tsection=='distributors_prod')) {
 	if (taction=='ajouter'){ 
	 	if (tsection=='distributors_cd') destination='distributors_insert.php?lng=' + tlangue + "&cat=cd";	    
		else destination='distributors_insert.php?lng=' + tlangue + "&cat=product";
	}
 	if (taction=='modifier'){
	 	if (tsection=='distributors_cd') destination='distributors_showall.php?lng=' + tlangue + "&cat=cd";
		else destination='distributors_showall.php?lng=' + tlangue + "&cat=product";
	 }
  }
/*
if (tsection=='plages') {
 	 destination='plages_showall.php?lng=' + tlangue + "&cat=product";
  } 
*/


if (taction=='voir'){
	if (tsection=='stock') {
		destination = 'cart_show.php?lng=' + tlangue + '&code=admin';
	} else if (tsection=='imageflip') {
		destination = tsection + '_show.php?lng=' + tlangue;
	} else if ((tsection=='production') || 
						 (tsection=='news') || 
						 (tsection=='artists') || 
						 (tsection=='audioproducts') || 
						 (tsection=='recservices') || 
						 (tsection=='galleries') || 
						 (tsection=='reviews')) {
		destination = tsection+ '_list.php?lng=' + tlangue;
	} else if (tsection=='distributors_cd') {
		destination='distributors_show.php?lng=' + tlangue + "&cat=cd";
	} else if (tsection=='distributors_prod') {
		destination='distributors_show.php?lng=' + tlangue + "&cat=product";
	} else if (tsection=='plages') {
		destination='plages_showall.php?lng=' + tlangue + "&cat=product";
	} else destination = tsection + '_show.php?lng=' + tlangue;
}


 if (taction=='num'){
    if ((tsection=='imageflip') || (tsection=='artists')) {
     destination = 'reorder_machine.php?lng=' + tlangue + '&table=' + tsection + '&champtitre=nom';
    } else {
     destination = 'reorder_machine.php?lng=' + tlangue + '&table=' + tsection + '&champtitre=titre';
    }
  }	

 writeTitleBanner(banner);
 parent.mainFrame.location.href=(destination);
}


function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
}

function launchPublishPopUp(){
	var windowWidth=216;
	var windowHeight=54;
	var initIntLeftPos= (480/2)-(windowWidth/2);
	var intTopPos = 60;
	var intLeftPos= initIntLeftPos;
	if(parent.screenY){
	    if(document.layers){
			var intTopPos = parent.screenY + 60;
			var intLeftPos= parent.screenX + initIntLeftPos;
		} else {
			var intTopPos = parent.screenY + 60;
			var intLeftPos= parent.screenX + initIntLeftPos;
		}
	}
	if(parent.screenTop){
		var intTopPos = parent.screenTop + 60;
		var intLeftPos= parent.screenLeft + initIntLeftPos;
	}
	args='width='+windowWidth+',height='+windowHeight+',top='+intTopPos+',screenY='+intLeftPos+',left='+intLeftPos+',screenX='+intTopPos;
	tempfid2002 = window.open("","tempfid2002",args);
	tempfid2002.document.open();
	tempfid2002.document.write('<html>');
	tempfid2002.document.write('<head>');
	tempfid2002.document.write('<title>Un Instant S.V.P.</title>');
	tempfid2002.document.write('</head>');
	tempfid2002.document.write('<body bgcolor=\"#D4D0C8\" text=\"#000000\">');
	tempfid2002.document.write('<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">');
	tempfid2002.document.write('  <tr>');
	tempfid2002.document.write('    <td valign=\"middle\" align=\"center\"><img src=\"../admindb/images/uninstant.gif\" width=\"200\" height=\"50\"></td>');
	tempfid2002.document.write('  </tr>');
	tempfid2002.document.write('</table>');
	tempfid2002.document.write('</body>');
	tempfid2002.document.write('</html>');
	tempfid2002.document.close();
	tempfid2002.focus();
}

function closePopUp(){
   tempfid2002.close();
} 


function publishIt(){
 var destination="publish.php";
 if (confirm("Êtes-vous certain de vouloir effectuer cette mise à jour?\n Cette opération prendra quelques minutes...")){
 launchPublishPopUp();
 parent.mainFrame.location.href=(destination);
 }
}

function cree_csv(){
	tsection=document.forms[0].section.value;
	tlangue=document.forms[0].lng.value;
	if ((tsection==null) || (tsection=="")) { tsection="ventes"; document.forms[0].section.value=tsection;}
	if ((tlangue==null) || (tlangue=="")) { tlangue="an"; document.forms[0].lng.value=tlangue;}
	if (tsection=="sales")  {
		destination = 'sales_csv.php?lng=' + tlangue;
		parent.mainFrame.location.href=(destination);
	}


}


function find(what,banner) {
    for (var i=0;i<parent.frames.length;i++) {	
         if (parent.frames[i].name == what) {
			 return true;
			 }
    }
    return false;
}

function writeTitleBanner(banner){
  for (var i=0;i<parent.frames.length;i++) {	
    if (parent.frames[i].name == 'titleFrame') {
		parent.titleFrame.writetoLyr("MyDiv", banner);
		}
  }
}

function writeTitleBanner_Old(banner){
 if (find('titleFrame')) {
  parent.titleFrame.writetoLyr("MyDiv", banner);
 }
 else {
  // not loaded frames
 }
}

/*
function writeTitleBanner(banner){
 parent.centerFrame.titleFrame.document.open();
 parent.centerFrame.titleFrame.document.writeln('<html>');
 parent.centerFrame.titleFrame.document.writeln('<head>');
 parent.centerFrame.titleFrame.document.writeln('<title>Fidelio Audio</title>');
 parent.centerFrame.titleFrame.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
 parent.centerFrame.titleFrame.document.writeln('</head>');
 parent.centerFrame.titleFrame.document.writeln('<body leftmargin="0" text="#CCCCCC" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#4573B3">');
 parent.centerFrame.titleFrame.document.write('<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"><b>');
 parent.centerFrame.titleFrame.document.write(banner);
 parent.centerFrame.titleFrame.document.writeln('</b></font>');
 parent.centerFrame.titleFrame.document.writeln('</body>');
 parent.centerFrame.titleFrame.document.writeln('</html>');
 parent.centerFrame.titleFrame.document.close();
}
*/