/*
        ggggggggggg
        ggggggggggg
        ggggggggggg
 gggg   gggg   gggg
 gggg   gggg   gggg
 gggg   gggg   gggg
 gggg          gggg
 gggg          gggg
 gggggggggggggggggg
 gggggggggggggggggg   
 gggggggggggggggggg    © 2000 - 2005 graphicator.com | masterscript v2.01 | by blexa */
 
 
 
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header




var action_going = false;
	var action_from = -1;
	var action_to = -1;
	
	function at_over(el) {
		if(action_going) return;
		
		var ai,at,i;
		var id = el.id.substr(3);

		for(i=0; i!=-1; i++) {
			ai = document.getElementById("ai_"+i);
			if(!ai) break;
			at = document.getElementById("at_"+i);
			
			if(ai.style.width == "454px")
				action_from = i;
			
			

			
			/*if(i==id) {
				ai.style.width = "454px";
				ai.style.visibility = "visible";
				at.style.width = "71px";
			}
			else {
				ai.style.width = "0px";
				ai.style.visibility = "hidden";
				at.style.width = "149px";
			}*/
		}
		action_to = id;
		action_going = true;
		setTimeout('accordion_roll('+action_from+','+action_to+')',10);
	}
	
	function accordion_roll(action_from, action_to) {
		var a_from_i = document.getElementById("ai_"+action_from);
		var a_from_t = document.getElementById("at_"+action_from);
		
		var a_to_i = document.getElementById("ai_"+action_to);
		var a_to_t = document.getElementById("at_"+action_to);
	
		var a_to_i_width = a_to_i.style.width.substr(0,a_to_i.style.width.length-2);
		var a_to_t_width = a_to_t.style.width.substr(0,a_to_t.style.width.length-2);
		var a_from_i_width = a_from_i.style.width.substr(0,a_from_i.style.width.length-2);
		var a_from_t_width = a_from_t.style.width.substr(0,a_from_t.style.width.length-2);
	
		if(a_from_i_width==454) {
			a_from_i.style.visibility = "hidden";
			a_to_i.style.visibility = "visible";
		}
		if(a_to_i_width>=454) {
			a_to_i.style.visibility = "visible";
			action_going = false;
			return;
		}
	
		if(a_to_t_width>71) {
			if(a_to_t_width>100) {
				a_to_t_width=a_to_t_width-10;
				a_from_t_width=a_from_t_width-(-10);
			}
			else if(a_to_t_width>80) {
				a_to_t_width=a_to_t_width-5;
				a_from_t_width=a_from_t_width-(-5);
			}
			else {
				a_to_t_width--;
				a_from_t_width++;			
			}
			
			a_to_t.style.width = a_to_t_width+"px";
			a_from_t.style.width = a_from_t_width+"px";
		}
		
		if(a_to_i_width<250) {
			a_to_i_width=a_to_i_width-(-25);
			a_from_i_width=a_from_i_width-25;
		}
		else if(a_to_i_width<350) {
			a_to_i_width=a_to_i_width-(-10);
			a_from_i_width=a_from_i_width-10;
		}
		else if(a_to_i_width<420) {
			a_to_i_width=a_to_i_width-(-5);
			a_from_i_width=a_from_i_width-5;
		}
		else if(a_to_i_width<440) {
			a_to_i_width=a_to_i_width-(-2);
			a_from_i_width=a_from_i_width-2;
		}
		else {
			a_to_i_width++;
			a_from_i_width--;
		}
		
		a_to_i.style.width = a_to_i_width+"px";
		a_from_i.style.width = a_from_i_width+"px";
		
		setTimeout('accordion_roll('+action_from+','+action_to+')',10);
	}










isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.div_hidden : document.getElementById("div_hidden");  
  hotDog=isIE ? event.srcElement : e.target;  
  while (hotDog.id!="div_hidden"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }  
  if (hotDog.id=="div_hidden"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMe(){
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.div_hidden.visibility="hide";
}

function showMe(){
  if (isIE||isNN) whichDog.style.visibility="visible";
  else if (isN4) document.div_hidden.visibility="show";
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");
 
 
 
 
 
 
 
 
 
 
 
 
 

function show_simple(img,note,title) {
	window.open("system/modules/popupgallery/showpic.php?"+img+"&"+note+"&"+title, "photoWin", "scrollbars=no,status=no,width=500,height=390");
}

function show_simple_gallery(images,img) {
	window.open("system/modules/popupgallery/showgallery.php?"+images+"&"+img, "photoWin", "scrollbars=no,status=no,width=500,height=390");
}

function hide_simple_gallery_div() {
	var div = document.getElementById("div_hidden");
	div.style.display="none";
}

function show_simple_gallery_div(images,img) {
	var div = document.getElementById("div_hidden");
	var div_hidden_content = document.getElementById("div_hidden_content");
	
	var imgs = images.split("^");
	var imgid = img;
	var desc = new Array();
	for(var i=0; i<imgs.length; i++) {
		if(imgs[i].indexOf(":::")!=-1) {
			imgid=i;
			imgs[i] = imgs[i].substr(0,imgs[i].indexOf(":::"));
		}
		desc[i] = '';			
		var pipe=imgs[i].indexOf('|||');
		if(pipe != -1) {
			desc[i] = imgs[i].substr(pipe+3);
			imgs[i] = imgs[i].substr(0,pipe);
		}
	}
	images = images.replace(/:::/g,"");	
	images = images.replace(/\"/g, "&quot;");
	
	var htmlcode;
	
	var img = document.getElementById("show_simple_gallery_img");
	if(img != undefined) {
		img.src="system/routines/imagemagic/imagethumb.php?s="+imgs[imgid]+"&w=600&h=600";			
		
		var bottom = document.getElementById("show_simple_gallery_div_bottom");
		htmlcode = '';
		
		htmlcode += "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr>";
		
		htmlcode += "<td align=\"left\" width=\"30\">";
		if(imgid>0) {
			htmlcode += "<img src=\"system/modules/popupgallery/images/btn_back.gif\" onclick=\"show_simple_gallery_div('"+images+"','"+(imgid-1)+"')\"></div>";
		}
		htmlcode += "</td><td align=\"center\" style=\"color:black\">"+desc[imgid]+"\u00a0</td>";
		if(imgid<imgs.length-2) {
			htmlcode += "<td align=\"right\" width=\"53\"><img src=\"system/modules/popupgallery/images/btn_stop.gif\" onclick=\"hide_simple_gallery_div()\"> <img src=\"system/modules/popupgallery/images/btn_next.gif\" onclick=\"show_simple_gallery_div('"+images+"','"+(imgid-1+2)+"')\">";
			img.onclick = function() {show_simple_gallery_div(images,(imgid-1+2));}
		}
		else {
			htmlcode += "<td align=\"right\" width=\"30\"><img src=\"system/modules/popupgallery/images/btn_stop.gif\" onclick=\"hide_simple_gallery_div()\"> ";
			img.onclick = function() {hide_simple_gallery_div();}
		}
		htmlcode += "</td></tr></table>";
		
		bottom.innerHTML = htmlcode;
		div.style.display="block";
		div.style.top = document.body.scrollTop+10;
	}
	else {
		htmlcode = "<div style=\"cursor:move;\"><div style=\"margin:10px 10px 5px 10px;\"><table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"center\"><img id=\"show_simple_gallery_img\" "+(imgid<imgs.length-2?"onclick=\"show_simple_gallery_div('"+images+"','"+(imgid-1+2)+"')\"":"onclick=\"hide_simple_gallery_div()\"")+ "src=\"system/routines/imagemagic/imagethumb.php?s="+imgs[imgid]+"&w=600&h=500\"></td></tr><tr><td>";
		
		
		htmlcode += "<div id=\"show_simple_gallery_div_bottom\">";
		
		htmlcode += "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr>";
		
		htmlcode += "<td align=\"left\" width=\"30\">";
		if(imgid>0) {
			htmlcode += "<img src=\"system/modules/popupgallery/images/btn_back.gif\" onclick=\"show_simple_gallery_div('"+images+"','"+(imgid-1)+"')\"></div>";
		}
		htmlcode += "</td><td align=\"center\" style=\"color:black\">"+desc[imgid]+"\u00a0</td>";
		if(imgid<imgs.length-2) {
			htmlcode += "<td align=\"right\" width=\"53\"><img src=\"system/modules/popupgallery/images/btn_stop.gif\" onclick=\"hide_simple_gallery_div()\"> <img src=\"system/modules/popupgallery/images/btn_next.gif\" onclick=\"show_simple_gallery_div('"+images+"','"+(imgid-1+2)+"')\">";
		}
		else
			htmlcode += "<td align=\"right\" width=\"30\"><img src=\"system/modules/popupgallery/images/btn_stop.gif\" onclick=\"hide_simple_gallery_div()\"> ";
		htmlcode += "</td></tr></table>";
		
		htmlcode += "</div></td></tr></table></div></div>";
		
		div_hidden_content.innerHTML = htmlcode;
		div.style.display="block";
		div.style.top = document.body.scrollTop+10;
	
	}
	//window.open("system/modules/popupgallery/showgallery.php?"+images+"&"+img, "photoWin", "scrollbars=no,status=no,width=500,height=390");
}

function over(his,obr){
	document.getElementById(his).src=obr;
}
	
function display(evt,id,content){
	var status;
	status=document.getElementById(id).style.display;
	var divX = evt.clientX + document.documentElement.scrollLeft || evt.clientX + window.scrollX,
        divY = evt.clientY + document.documentElement.scrollTop || evt.clientY + window.scrollY;
	if (status=='none'){
		document.getElementById(id).style.display='block';
		if (divX<900){
			document.getElementById(id).style.top=''+(divY+5)+'px'
			document.getElementById(id).style.left=''+(divX+5)+'px'
		}
		else{
			document.getElementById(id).style.top=''+(divY+5)+'px'
			document.getElementById(id).style.left=''+(divX-160)+'px'
		}
		document.getElementById(id).innerHTML='<span id=\"close_help\" onclick=\"hide(\'help\');\">x</span>';
		document.getElementById(id).innerHTML+=content;
	}
	if (status=='block'){
		document.getElementById(id).style.display='none';
		document.getElementById(id).innerHTML='';
		display(evt,id,content);
	}
}

function hide(id){
document.getElementById(id).style.display='none';
document.getElementById(id).innerHTML='';
}
