//showDebug();


var win1 =new Window('Demo1',{					
							className: "alphacube",
							width:280,
							height:140,
							zIndex: 100,
							resizable: true,
							title: "<b style='float:left;'>Etat du Menu</b>",
							showEffect:Effect.BlindDown,
							hideEffect: Effect.SwitchOff,
							draggable:true,
							wiredDrag: true
						});
/*
var win2 =new Window('Demo2',{					
							className: "alphacube",
							width:790,
							height:100,
						

							zIndex: 100,
							resizable: true,
							title: "<b style='float:left;'>fen&ecirc;tre de d&eacute;monstration</b>",
							
							
							draggable:true,
							wiredDrag: true
						});

var win = new Window({className: "alphacube", title: "Ruby on Rails", 
                      top:70, left:100, width:300, height:200, 
                      url: "http://www.rubyonrails.org/"});*/
var zindex = 10 ;
var win3 =new Window("cdc",{					
							className: "alphacube",
							width:650,
							height:400,
							resizable: true,
							showEffect:Effect.BlindDown,
							hideEffect: Effect.SwitchOff,
							
							 showEffectOptions: {duration:1.5}
						});	
function openDetailPromotion(id) {
	zindex++;
	zindex++;
	myurl="detailPromotion.php?id="+id;
	var winid = win3.getId();
	win3.setZIndex(zindex);
	win3.setLocation(tempY-100,tempX+200);
	win3.setAjaxContent(myurl,  {method: 'get'});
	win3.showCenter();
}
function openDescription(id) {
	zindex++;
	zindex++;
	//win.show();   	
	myurl="description.php?id="+id;
	//debug(win3.getId());url: murl,draggable:true,		destroyOnClose: true,					wiredDrag: true, url: "http://www.belloulou.com/",
	var winid = win3.getId();
	//debug(myurl);	showEffect:Effect.BlindDown,hideEffect: Effect.SwitchOff,
	//debug("FocusedWindow -> "+top.Windows.getFocusedWindow().getId());
	//							
	//	win3.setTitle("<div style='font-size:11px;color:#D37C2C;width:420px;display:block;font-weight:bold;'>"+titre+"</div>");
	//win3.setStatusBar("kiki");
	//	win3.showCenter(false,100,100);<div style='clear:both;'></div>"->"+winid+
	win3.setZIndex(zindex);
	win3.setLocation(tempY-100,tempX+200);
	//win3.setURL("http://www.belloulou.com/");
	//win3.setAjaxContent(murl);
	win3.setAjaxContent(myurl,  {method: 'get'});
	//top.Windows.focus(winid);
	
	win3.showCenter();
	/*
	//	getMouseXY();
	//	debug('mouseX :'+window.lastX+'  mouseY :'+window.lastY);
		
	//	win3.setLocation(y-200,x+100);, onComplete: eventSurForm
	//
	//Event.stop(event);
	//return false;
	*/
}


/*



var ie = (document.all)? true:false;
var ns4 = (document.layers)? true:false;
var ns6 = (document.getElementById)? true:false;
e = window.event;	

function getMouseXY(e){
	//	if (!e) e = window.event;	
       if (ie) {
            //Récupération de la position de la souris
            window.lastX=event.clientX;
            window.lastY=event.clientY;

		}else if (ns4) {
            //Récupération de la position de la souris
            window.lastX=e.pageX;
            window.lastY=e.pageY;
    
		}else if (ns6) {
            //Récupération de la position de la souris
            window.lastX=e.clientX;
            window.lastY=e.clientY;
		}


			debug('DANS getMouseXY mouseX :'+window.lastX+'  mouseY :'+window.lastY);
}
*/
function getWindowHeight() {
    var windowHeight=0;
    if (typeof(window.innerHeight)=='number') {
        windowHeight=window.innerHeight;
    }
    else {
     if (document.documentElement&&
       document.documentElement.clientHeight) {
         windowHeight = document.documentElement.clientHeight;
    }
    else {
     if (document.body&&document.body.clientHeight) {
         windowHeight=document.body.clientHeight;
      }
     }
    }
    return windowHeight;
}
/*
  getWindowHeight=function(){
    var innerHeight;
	  if (navigator.appVersion.indexOf('MSIE')>0) {
		  innerHeight = document.body.clientHeight;
    } else {
		  innerHeight = window.innerHeight;
    }
    return innerHeight;	
  }

*/
/*function getWindowWidth * - return window width, without scrollbar */ 
function getWindowWidth() {
    var w = 0;
    if (typeof(window.innerWidth) == 'number') { // Netscape
        w = window.innerWidth;
    } else if (document.documentElement && document.documentElement.clientWidth) {
        w = document.documentElement.clientWidth;
    } else if (document.body && document.body.offsetWidth) { //client
        w = document.body.offsetWidth;
    }
    return w;
}

			/*
  getWindowWidth=function(){
    var innerWidth;
	  if (navigator.appVersion.indexOf('MSIE')>0) {
		  innerWidth = document.body.clientWidth;
    } else {
		  innerWidth = window.innerWidth;
    }
    return innerWidth;	
  }
	url:"elal.php",

*/



/*
function openAjaxCdc(url,titre) {

	win3.setTitle("<div style='float:left;color:#D37C2C;width:420px;display:block;font-weight:bold;'>"+titre+"</div><div style='clear:both;'></div>");
	win3.setURL(url);
//	win3.showCenter(false,100,100);
	win3.show();
	debug('mouseX :'+x+'  mouseY :'+y);
	
//	getMouseXY();
//	debug('mouseX :'+window.lastX+'  mouseY :'+window.lastY);

//	win3.setLocation(window.lastX+50,window.lastY-50)
	
	
	//win3.setAjaxContent(url,  {method: 'get', onComplete: eventSurForm});

	//Event.stop(event);
	//return false;
}
*/
function openAjaxConfirm(event) {
	win1.setAjaxContent('info_panel.php',  {method: 'get', onComplete: eventSurForm});

	Event.stop(event);
	return false;
}

function openAjaxConfirm2(event) {

	win2.setSize('790', (getWindowHeight()-195));
	win2.setLocation('165', ((getWindowWidth()-800)/2));
	//	win2.setURL("elal.php");
	win2.setURL("http://www.eyeonisrael.com/Israel-touring-map.html");
	//win2.setSize('790', getWindowHeight());
	win2.show();
	//win2.setSize('790', getWindowHeight());
	/*
	var myheight = win2.getSize();
	alert(myheight.height);
	alert(getWindowHeight());
	*/
	Event.stop(event);
	return false;
}

function openAjaxConfirm3(event) {
	win1.setAjaxContent('doublemenu.php',  {method: 'get'});
	win1.showCenter();
	Event.stop(event);
	return false;
}



function openAjaxConfirm4(event) {
	
	win1.setContent('menu_from_db', true, true);
	win1.showCenter(false, 20,20);
	Event.stop(event);
	return false;
}
function openAjaxConfirm5(event) {
	win1.setAjaxContent('online.php',  {method: 'get'});
	win1.showCenter();
	Event.stop(event);
	return false;
}

//WindowStore.init();
