﻿

//this is for the new default-css2.aspx made on 29-6-2006
function RemoveChildOfChild(parentChild)
{
//    var id=parentChild.id;
//    var dParent=document.getElementById(id);
    var kids = parentChild.childNodes;
    for (var child in parentChild) 
    {
        RemoveChildOfChild(kids[j]);
	   dParent.removeChild(kids[j]);
    }
////    for (j=0; j < kids.length; j++) 
////	{
////	   RemoveChildOfChild(kids[j]);
////	   dParent.removeChild(kids[j]);
////	}
}
function getQueryVariable(variable) 
		{
			    var query = window.location.search.substring(1);
			    var vars = query.split("&");
			    for (var i=0;i<vars.length;i++) 
			    {
				    var pair = vars[i].split("=");
				    if (pair[0] == variable) 
				    { 
				        //var dParent=document.getElementById('testD');
				      var dParent=document.getElementById('Contents');
				      try
		              {
					    var kids = dParent.childNodes;
				    	for (j=0; j < kids.length; j++) 
				    	{
				    	   //RemoveChildOfChild(kids[j]);
			    		  dParent.removeChild(kids[j]);
		    			}
					    return;
				      }
				      catch(e){}
				     }
			   }
		}
		
		
function HideDesign() 
		{
					var dParent=document.getElementById('Contents');
					var kids = dParent.childNodes;
					for (j=0; j < kids.length; j++) {
					 dParent.removeChild(kids[j]);}
		}
		
		
//****************************************************************
// Flash Function new  
//****************************************************************

function RunFlash(swf, hauteur, largeur, nom) {
	document.write("<object width=\""+hauteur+"\" height=\""+largeur+"\" id=\""+nom+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\">\n");
	document.write("<param name=\"quality\" value=\"high\">\n");
	document.write("<param name=\"wmode\" value=\"transparent\">\n");
	document.write("<param name=\"movie\" value=\""+swf+"\">\n");
	document.write("<embed src=\""+swf+"\" quality=\"high\" wmode=\"transparent\" width=\""+hauteur+"\" height=\""+largeur+"\" name=\""+nom+"\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">\n");
	document.write("</object>\n");
}



//this is for the old default.aspx I made leave it as it is
// JScript File
//function getQueryVariable(variable) 
//		{
//			var query = window.location.search.substring(1);
//			var vars = query.split("&");
//			for (var i=0;i<vars.length;i++) 
//			{
//				var pair = vars[i].split("=");
//				if (pair[0] == variable) 
//				{
//					var dParent=document.getElementById('testDIV');
//					var kids = dParent.childNodes;
//					for (j=0; j < kids.length; j++) {
//					 dParent.removeChild(kids[j]);
//					}
//					//document.getElementById('designTable').style.visibility='hidden';
//					//var d=document.getElementById('testDIV');
//					//var toBeRemoved=document.getElementById('testTD');
//					//d.removeChild(toBeRemoved);
//					return;
//				}
//			} 
//		}
//		
//function HideDesign() 
//		{
//					var dParent=document.getElementById('testDIV');
//					var kids = dParent.childNodes;
//					for (j=0; j < kids.length; j++) {
//					 dParent.removeChild(kids[j]);}
//		}
		
/*function MyPostBack()
    {
   
        //document.getElementById('dlDescription$ctl01$RTE_Description_Div_ta').style.width=790;
        //nodeValue
        var rows=0;
        //this is for the number of rows in the data list
        if(document.getElementById('lblNumberOfRowsInList')!=null)
        {
           rows=document.getElementById('lblNumberOfRowsInList').outerText;
           for(var i=1;i<=rows;i++)
           {
                //the id is fixed except for the number of the control of the RTE
             if(i<10)
             {
                 if( document.getElementById('dlDescription$ctl0'+i+'$RTE_Description_Div_ta')!=null)
                 {
                     var ctrl='dlDescription$ctl0'+i+'$RTE_Description_Div_ta';
                     document.getElementById(ctrl).style.height=130;              
                     document.getElementById(ctrl).style.width=530;
                 }
             }
             else if(i>=10)
             {
              var ctrl='dlDescription$ctl'+i+'$RTE_Description_Div_ta';
                     document.getElementById(ctrl).style.width=130;              
                     document.getElementById(ctrl).style.height=530;              
             }
           }
        }
    }*/