﻿// Fichier JScript

function openWithPostData(page,data)
{
    var form = document.createElement('form');
    form.setAttribute('action', page);
    form.setAttribute('method', 'post');
    for (var n in data)
    {
        var inputvar = document.createElement('input');
        inputvar.setAttribute('type', 'hidden');
        inputvar.setAttribute('name', n);
        inputvar.setAttribute('value', data[n]);
        form.appendChild(inputvar);
    }
    document.body.appendChild(form);
    form.submit();
}



$(document).ready(function()
{
	nomPage=document.location.href.substring(document.location.href.lastIndexOf("/")).split("/")[1];
	
	var data = {};

	data.url  = nomPage;
	if(!parent.document.getElementById("id_iframe" )){

	openWithPostData('index.aspx',data);

	//window.location.href = 'index.aspx';
	 };
});

//function getURLParameter(name) {
//    return unescape(
//        (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
//    );
//   //var type = getURLParameter("categorie");
//}

function changeurl(str)
{
	document.getElementById("id_iframe").contentWindow.location.href = str;

    ///redimension iframe à 750px
	if(navigator.appName=="Microsoft Internet Explorer" ){
	   // if(document.all) document.all.id_iframe.style.height = document.body.scrollHeight;
	   // else
		parent.document.getElementById("id_iframe").style.height = 750;
		//parent.document.getElementById("id_iframe").style.height = document.body.scrollHeight;
	 }  
	else{
		parent.document.getElementById("id_iframe" ).style.height = 750 + "px";
		//parent.document.getElementById("id_iframe" ).style.height = document.body.offsetHeight + "px";
	 }
}

$(window).load(function()
{
	if(navigator.appName=="Microsoft Internet Explorer" ){
	   // if(document.all) document.all.id_iframe.style.height = document.body.scrollHeight;
	   // else
		parent.document.getElementById("id_iframe").style.height = document.body.scrollHeight;
	 }  
	else{
		parent.document.getElementById("id_iframe" ).style.height = document.body.offsetHeight + "px";
	 }
});
		
function displayFlash(swf, hauteur, largeur, couleur, nom) {
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+hauteur+"\" height=\""+largeur+"\" id=\""+nom+"\" align=\"middle\">\n");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n");
	document.write("<param name=\"scale\" value=\"noscale\" />");
	document.write("<param name=\"movie\" value=\""+swf+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\""+couleur+"\" /><embed scale=\"noscale\" src=\""+swf+"\" quality=\"high\" bgcolor=\""+couleur+"\" width=\""+hauteur+"\" height=\""+largeur+"\" name=\""+nom+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n");
	document.write("</object>\n");
}

function displayFlashTransparent(swf, hauteur, largeur, couleur, nom) {
	document.write("<object style=\"position:relative;Z-Index:10;\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+hauteur+"\" height=\""+largeur+"\" id=\""+nom+"\" align=\"middle\">\n");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n");
	document.write("<param name=\"scale\" value=\"noscale\" />");

	document.write("<param name=\"movie\" value=\""+swf+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\""+couleur+"\" /><embed wmode=\"transparent\" scale=\"noscale\" src=\""+swf+"\" quality=\"high\" bgcolor=\""+couleur+"\" width=\""+hauteur+"\" height=\""+largeur+"\" name=\""+nom+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n");
	document.write("<param name=\"wmode\" value=\"transparent\" />");
	document.write("</object>\n");
}

