function create_frame(){
	add_element('div','in_body','app_div','', 0, 0, 900, '100%');
	add_element('div','app_div','header_static','', 0, 0);
	add_element('div','app_div','header_dynamic','', 0, 0);
	add_element('div','app_div','header_barre','', 150, 0, 900, 38);
	add_element('div','app_div','break_main','hidden', 188, 0, 900, 500);
	add_element('div','app_div','main_static','', 188, 0, 900, 25, 0);
	add_element('div','break_main','main_dynamic','', 0, 0);
	add_element('div','app_div','bottom_static','', 685, 0);
	add_element('div','app_div','bottom_dynamic','', 685, 0);
}
function create_header_static(){
	add_element('img', 'header_static', 'img_top', './pic/img/img_top_acceuil.jpg', 0, 0);
	add_element('img', 'header_static', 'img_top', './pic/img/img_degrade_top.png', 0, 0, 900, 150);
	add_element('img','header_barre','','./pic/img/img_barre_blanche.png', 36, 0);
	add_element('img', 'header_barre', '', './pic/img/img_grille.png', 15, 0, '', '', '', 0);
	
	menu_list = [['A propos',100], ['Photos',85], ['Vidéos',85], ['News',80],['Contact',90]];
	ss_menu_list = [];
	ss_menu_list[0] = [['Bienvenue','about_welcome',100],['Dim','about_dim',75]];
	ss_menu_list[1] = [['Nuages','photo_nuages',70],['Foudre','photo_foudre',65],['Dégâts','photo_degats',65],['Paysages','photo_paysages',80],['Animaux','photo_animaux',75]];
	ss_menu_list[2] = [['Direct','videos',0]];
	ss_menu_list[3] = [['Direct','news',0]];
	ss_menu_list[4] = [['Direct','contact',0]];
	total_size = 0;
	pos_left = 400;
	for (i=0; i<menu_list.length; i++){
		total_size = total_size + menu_list[i][1];
	}
	add_element('txt', 'header_barre', '', '', 21, 0+pos_left, total_size-17, 15, 'menu_deroulant_left');
	add_element('txt', 'header_barre', '', '', 21, total_size-17+pos_left, 17, 15, 'menu_deroulant_right');
	add_element('div', 'main_static', 'ss_menu', 'hidden', 0, 0, '100%', 30);
	add_pos = 0;
	add = ['l', '', 'r'];
	for (i=0; i<menu_list.length; i++){
		if (i > 0){
			add_pos = add_pos + menu_list[i-1][1];
		}
		add_element('txt', 'header_barre', 'btn_menu_'+i+'l', '', 21, add_pos+pos_left, 17, 19, 'menu_deroulant_center');
		add_element('txt', 'header_barre', 'btn_menu_'+i, menu_list[i][0], 21, add_pos+17+pos_left, menu_list[i][1]-34, 19, 'menu_deroulant_center');
		add_element('txt', 'header_barre', 'btn_menu_'+i+'r', '', 21, add_pos+menu_list[i][1]-17+pos_left, 17, 19, 'menu_deroulant_center');
		for (z=0; z<3; z++){
			get_id('btn_menu_'+i+add[z]).num = i;
			get_id('btn_menu_'+i+add[z]).onmouseover = function(){display_menu('_high',this.num, -1)};
			get_id('btn_menu_'+i+add[z]).onmouseout = function(){display_menu('',this.num, -1)};
			get_id('btn_menu_'+i+add[z]).onclick = function(){
				if (get_id('btn_menu_'+this.num).page){
					get_id('btn_menu_selected').style.left = parseInt(get_id('btn_menu_'+this.num+'l').style.left) + 3;
					load_page(get_id('btn_menu_'+this.num).page);
				}
			}
		}
		if (ss_menu_list[i][0][2] == 0){
			get_id('btn_menu_'+i).page = ss_menu_list[i][0][1];
		}else{
			add_pos_ss_menu = 0;
			for (j=0; j<ss_menu_list[i].length; j++){
				if (j > 0){
					add_pos_ss_menu = add_pos_ss_menu + ss_menu_list[i][j-1][2];
				}
				add_element('txt','ss_menu', 'btn_ss_menu_'+i+'_'+j+'l', '', -30, add_pos+add_pos_ss_menu+pos_left, 17, 30, 'ssmenu_deroulant_left', 0);
				add_element('txt','ss_menu', 'btn_ss_menu_'+i+'_'+j, ss_menu_list[i][j][0], -30, add_pos+add_pos_ss_menu+17+pos_left, ss_menu_list[i][j][2]-17, 30, 'ssmenu_deroulant_center', 0);
				add_element('txt','ss_menu', 'btn_ss_menu_'+i+'_'+j+'r', '', -30, add_pos+add_pos_ss_menu+ss_menu_list[i][j][2]+pos_left, 17, 30, 'ssmenu_deroulant_right', 0);
				for (z=0; z<3; z++){
					get_id('btn_ss_menu_'+i+'_'+j+add[z]).page = ss_menu_list[i][j][1];
					get_id('btn_ss_menu_'+i+'_'+j+add[z]).num = j;
					get_id('btn_ss_menu_'+i+'_'+j+add[z]).menu = i;
					get_id('btn_ss_menu_'+i+'_'+j+add[z]).onmouseover = function(){display_menu('_high', this.menu, this.num)};
					get_id('btn_ss_menu_'+i+'_'+j+add[z]).onmouseout = function(){display_menu('', this.menu, this.num)};
					get_id('btn_ss_menu_'+i+'_'+j+add[z]).onclick = function(){
						get_id('btn_menu_selected').style.left = parseInt(get_id('btn_menu_'+this.menu+'l').style.left) + 3;
						load_page(this.page);
					}
				}
			}
		}
	}
	add_element('img','header_barre','btn_menu_selected','./pic/btn/btn_menu_selected.png', 20, 3+pos_left, 17, 17, 'hand_pointer');
	open_close_menu();
}
function display_menu(arg, menu_num, ss_menu_num){
	get_id('btn_menu_'+menu_num+'l').className = 'menu_deroulant_left' + arg;
	get_id('btn_menu_'+menu_num).className = 'menu_deroulant_center' + arg;
	get_id('btn_menu_'+menu_num+'r').className = 'menu_deroulant_right' + arg;
	if (ss_menu_num != -1){
		get_id('btn_ss_menu_'+menu_num+'_'+ss_menu_num).className = 'ssmenu_deroulant_center' + arg;
	}
}
function open_close_menu(){
	setTimeout(function(){open_close_menu()}, 0);
	for (i=0; i<menu_list.length; i++){
		if (ss_menu_list[i][0][2] != 0){
			for (j=0; j<ss_menu_list[i].length; j++){
				if (get_id('btn_menu_'+i).className == 'menu_deroulant_center_high'){
					if (parseInt(get_id('btn_ss_menu_'+i+'_'+j).style.top) < 0){
						get_id('btn_ss_menu_'+i+'_'+j+'l').style.top = parseInt(get_id('btn_ss_menu_'+i+'_'+j+'l').style.top) + 1;
						get_id('btn_ss_menu_'+i+'_'+j).style.top = parseInt(get_id('btn_ss_menu_'+i+'_'+j).style.top) + 1;
						get_id('btn_ss_menu_'+i+'_'+j+'r').style.top = parseInt(get_id('btn_ss_menu_'+i+'_'+j+'r').style.top) + 1;
					}
				}else{
					if (parseInt(get_id('btn_ss_menu_'+i+'_'+j).style.top) > -30){	
						get_id('btn_ss_menu_'+i+'_'+j+'l').style.top = parseInt(get_id('btn_ss_menu_'+i+'_'+j+'l').style.top) - 1;
						get_id('btn_ss_menu_'+i+'_'+j).style.top = parseInt(get_id('btn_ss_menu_'+i+'_'+j).style.top) - 1;
						get_id('btn_ss_menu_'+i+'_'+j+'r').style.top = parseInt(get_id('btn_ss_menu_'+i+'_'+j+'r').style.top) - 1;
					}
				}
			}
		}
	}	
}
function create_main_static(){
}
function create_bottom_static(){
	add_element('img','bottom_static','','./pic/img/img_barre_blanche.png', 0, 0);
	add_element('txt','bottom_static','btn_legal_terms','Website terms |', 5, 315, 100, '', 'text_11_right_white_hand_pointer');
	get_id('btn_legal_terms').onclick = function(){window.open("./pic/website_terms.pdf","","toolbar=no,location=no,titlebar=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,")};
	add_element('txt','bottom_static','btn_policy',' Private policy |', 5, 415, 90, '', 'text_11_right_white_hand_pointer');
	get_id('btn_policy').onclick = function(){window.open("./pic/private_policy.pdf","","toolbar=no,location=no,titlebar=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,")};
	add_element('txt','bottom_static','btn_credits','All contents © copyright 2010 Dimitri ROSEL, Tous droits réservés', 5, 500, 400, '', 'text_11_right_white_default');
	drapeaux = ['grande_bretagne', 'france'];
	for (i=0; i<drapeaux.length; i++){
		add_element('img','bottom_static','btn_'+drapeaux[i],'./pic/btn/btn_'+drapeaux[i]+'.jpg', 5, 5+25*i, '', '', 'hand_pointer');
		if (drapeaux[i] == 'grande_bretagne'){get_id('btn_'+drapeaux[i]).onclick = english}
		if (drapeaux[i] == 'france'){get_id('btn_'+drapeaux[i]).onclick = french}
	}
}
function add_content(from, num, top, left, width, height){
	add_element('img', from, 'back_'+num, './pic/img/img_degrade.png', top, left, width, height, '');
	add_element('img', from, 'back_'+num, './pic/img/img_degrade_vert.png', top+32, left+10, width-20, 2, '');
	add_element('txt', from, 'title_content_'+num, '', top+10, left+10, width-20, 20, 'gothm-v-small');
	add_element('txt', from, 'text_content_'+num, '', top+48, left+10, width-20, height-45, 'text_10_justify_white');
}
function add_page(height){
	add_element('div', 'main_dynamic', 'base_content', 'hidden', 90, 0, 900, 380);
	add_element('div', 'base_content', 'total_content', '', 0, 0, 900, height);
	add_element('img', 'base_content', 'scrollbar', './pic/btn/btn_scrollbar.png', 0, 880, 20, '100%', '');
	get_id('scrollbar').onclick = function(){
		if (mouse_y > 640){
			scroll_page(-10);
		}else if (mouse_y < 297){
			scroll_page(10);
		}else{
			scroll_page(-(mouse_y - 297 - parseInt(get_id('cursor').style.top))*(parseInt(get_id('total_content').style.height) - parseInt(get_id('base_content').style.height))/289);
		}
	}
	add_element('img', 'base_content', 'cursor', './pic/btn/btn_cursor.png', 22, 880, 20, 47, '');
	get_id('cursor').drag = 0;
	get_id('cursor').onmousedown = function(){
		get_id('cursor').drag = 1;
	}
}
function scroll_page(delta, abs){
	if (current_page == 'about_features' || current_page == 'about_product'){
		if (parseInt(get_id('total_content').style.top) + delta <= 0){
			if (parseInt(get_id('total_content').style.height) + (parseInt(get_id('total_content').style.top) + delta) >= parseInt(get_id('base_content').style.height)){
				get_id('total_content').style.top = parseInt(get_id('total_content').style.top) + delta;
			}else{
				get_id('total_content').style.top = -(parseInt(get_id('total_content').style.height) - parseInt(get_id('base_content').style.height));
			}
		}else{
			get_id('total_content').style.top = 0;
		}
		get_id('cursor').style.top = 22 - parseInt(get_id('total_content').style.top)*289/(parseInt(get_id('total_content').style.height) - parseInt(get_id('base_content').style.height));
	}
}
function drag_page(){
	if (current_page == 'about_features' || current_page == 'about_product'){
		if (get_id('cursor').drag == 1){
			scroll_page(-(mouse_y - 297 - parseInt(get_id('cursor').style.top))*(parseInt(get_id('total_content').style.height) - parseInt(get_id('base_content').style.height))/289);
		}
	}
}
function drop_page(){
	if (current_page == 'about_features' || current_page == 'about_product'){
		get_id('cursor').drag = 0;
	}
}
