function show_selector_menu(select_menu_id){
	var select_menu = $(select_menu_id);
	if( select_menu.style.visibility == "inherit"){
		var menu_content = select_menu.firstchild;
		if(navigator.useragent.indexof('msie')>=0){
			menu_content.style.marginbottom = "0";
			var select_menu_height = select_menu.offsetheight;
			var timer = setinterval(
								function(){
									var marginb = parseint(menu_content.style.marginbottom);
									if( marginb<=parseint("-"+select_menu_height) ){
										menu_content.style.marginbottom = "0";
										select_menu.style.visibility = "hidden";
										clearinterval(timer);	
									}else{
										menu_content.style.marginbottom = (marginb-20)+"px";
									}
								}
								,1);
		}else{
			select_menu.style.visibility = "hidden";
		}
	}else{
		var menu_content = select_menu.firstchild;
		if(navigator.useragent.indexof('msie')>=0){
			menu_content.style.marginbottom = "-"+ select_menu.offsetheight+"px";
			var timer = setinterval(
								function(){
									var marginb = parseint(menu_content.style.marginbottom);
									if(marginb>=0){
										menu_content.style.marginbottom = "0";
										clearinterval(timer);	
									}else{
										menu_content.style.marginbottom = (marginb+20)+"px";
									}
								}
								,1);
		}
		selector_is_clicked[select_menu_id] = true;
		select_menu.style.visibility = "inherit";
	}
}

var showimageindex = -1;
var imagetimer;
function showimage(imageindex)
{
	var flash_img_div = document.getelementbyid("flash_img");
	var flash_title = document.getelementbyid("flash_title");	
	
	if(imageindex>fimgs.length-1){
		imageindex = 0;
	}
	
	if(!fimgs[imageindex] || imageindex==showimageindex)
		return false;	
	var imgid = "__fimg"+imageindex;
	flash_img_div.filters && flash_img_div.filters[0].apply();
	for(i=0; i<flash_img_div.childnodes.length; i++){
		flash_img_div.childnodes[i].style.display = "none";
	}
	if( document.getelementbyid(imgid) ){
		var imga = document.getelementbyid(imgid);
		imga.style.display = "block";
		if(imga.tagname=="object"){
			imga.rewind();
			imga.play();
		}
	}else{
		var pos = fimgs[imageindex].img.lastindexof(".");
		if( fimgs[imageindex].img.substr(pos+1).substr(0,3).tolowercase()=="swf" ){
			flash_img_div.innerhtml += '\
				<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="246" height="173" id="'+imgid+'">\
					<param name="movie" value="'+fimgs[imageindex].img+'" />\
					<param name="quality" value="high" />\
					<embed src="'+fimgs[imageindex].img+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="246" height="173"></embed>\
				</object>';

		}else{
			var img = new image();
			img.border = "0";
			img.src = fimgs[imageindex].img;
			img.width = "246";
			img.height = "173";
			var a = document.createelement("a");
			a.href = fimgs[imageindex].href;
			a.target = "_blank";
			a.id = imgid;
			a.appendchild(img);
			flash_img_div.appendchild(a);
		}
	}
	flash_img_div.filters && flash_img_div.filters[0].play();
	var flash_show_ctl_msg = document.getelementbyid("flash_show_ctl_msg");
	flash_show_ctl_msg.filters && flash_show_ctl_msg.filters[0].apply();
	flash_title.href = fimgs[imageindex].href;
	flash_title.innerhtml = fimgs[imageindex].title;
	flash_show_ctl_msg.filters && flash_show_ctl_msg.filters[0].play();
	showimageindex = imageindex;
	return true;
}
function imageplay()
{
	if(imagetimer) return;
	if(showimageindex>=fimgs.length-1){
		showimageindex = -1;
	}
	showimage(showimageindex+1);
	imagetimer = setinterval(function(){
					var stat = showimage(showimageindex+1);
					if(!stat){
						stop();
					}	
				},7000);
}
function stop(){
	clearinterval(imagetimer);
	imagetimer = null;
}
function shownextimage(){
	showimage(showimageindex+1);
}
function showprevimage(){
	showimage(showimageindex-1);
}



