function minimum_height(class_edit,minheight){			
		$('.'+class_edit).hide();    		
		var foo_height = $('.'+class_edit).height();		
		if(foo_height>minheight) {
			/* $('.'+class_edit).css('height', foo_height + 'px').show(); OR TRY: */
			$('.'+class_edit).height(foo_height).show();
		}else{						
			$('.'+class_edit).height(minheight).show();
		}	
}

$(document).ready(function(){							
	$('#submit_form').change(function() {
  		$('#submit_form').submit();
	});

	$("a[rel^='prettyPhoto_black']").prettyPhoto({
		overlay_gallery: false,	
		hideflash: true,
		markup: '<div class="pp_pic_holder"> \
						<div class="ppt">&nbsp;</div> \
						<div class="pp_top"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
						<div class="pp_content_container"> \
							<div class="pp_left"> \
							<div class="pp_right"> \
								<div class="pp_content"> \
									<div class="pp_loaderIcon"></div> \
									<div class="pp_fade"> \
										<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
										<div class="pp_hoverContainer"> \
											<a class="pp_next" href="#">next</a> \
											<a class="pp_previous" href="#">previous</a> \
										</div> \
										<div id="pp_full_res"></div> \
										<div class="pp_details clearfix"> \
											<p class="pp_description"></p> \
											<a class="pp_close" href="#">Close</a> \
											<div class="pp_nav"> \
												<a href="#" class="pp_arrow_previous">Previous</a> \
												<p class="currentTextHolder">0/0</p> \
												<a href="#" class="pp_arrow_next">Next</a> \
											</div> \
										</div> \
									</div> \
								</div> \
							</div> \
							</div> \
						</div> \
						<div class="pp_bottom"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
					</div> \
					<div class="pp_overlay" style="background-color:#000000;"></div>'
   });
	$("a[rel^='prettyPhoto_pink']").prettyPhoto({
		overlay_gallery: false,
		hideflash: true,
		markup: '<div class="pp_pic_holder"> \
						<div class="ppt">&nbsp;</div> \
						<div class="pp_top"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
						<div class="pp_content_container"> \
							<div class="pp_left"> \
							<div class="pp_right"> \
								<div class="pp_content"> \
									<div class="pp_loaderIcon"></div> \
									<div class="pp_fade"> \
										<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
										<div class="pp_hoverContainer"> \
											<a class="pp_next" href="#">next</a> \
											<a class="pp_previous" href="#">previous</a> \
										</div> \
										<div id="pp_full_res"></div> \
										<div class="pp_details clearfix"> \
											<p class="pp_description"></p> \
											<a class="pp_close" href="#">Close</a> \
											<div class="pp_nav"> \
												<a href="#" class="pp_arrow_previous">Previous</a> \
												<p class="currentTextHolder">0/0</p> \
												<a href="#" class="pp_arrow_next">Next</a> \
											</div> \
										</div> \
									</div> \
								</div> \
							</div> \
							</div> \
						</div> \
						<div class="pp_bottom"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
					</div> \
					<div class="pp_overlay" style="background-color:#e0c2d5;"></div>'
   });

});



/* --------------------------------------------- AMAZON SCROLLER ------------------------------------------------------- */

// Copyright 2010 htmldrive.net Inc.
/**
* @projectHomepage http://www.htmldrive.net/welcome/amazon-scroller
* @projectDescription Amazon style image and title scroller
* @author htmldrive.net
* More script and css style : htmldrive.net
* @version 1.0
* @license http://www.apache.org/licenses/LICENSE-2.0
*/ 
(function(a){
    a.fn.amazon_scroller=function(p){
        var p=p||{};

        var g=p&&p.scroller_time_interval?p.scroller_time_interval:"3000";
        var h=p&&p.scroller_title_show?p.scroller_title_show:"enable";
        var i=p&&p.scroller_window_background_color?p.scroller_window_background_color:"white";
        var j=p&&p.scroller_window_padding?p.scroller_window_padding:"5";
        var k=p&&p.scroller_border_size?p.scroller_border_size:"1";
        var l=p&&p.scroller_border_color?p.scroller_border_color:"black";
        var m=p&&p.scroller_images_width?p.scroller_images_width:"50";
        var n=p&&p.scroller_images_height?p.scroller_images_height:"70";
        var o=p&&p.scroller_title_size?p.scroller_title_size:"12";
        var q=p&&p.scroller_title_color?p.scroller_title_color:"blue";
        var r=p&&p.scroller_show_count?p.scroller_show_count:"5";
        var d=p&&p.directory?p.directory:"images";
        j += "px";
        k += "px";
        m += "px";
        n += "px";
        o += "px";
        var dom=a(this);
        var s;
        var t=0;
        var u;
        var v;
        var w=dom.find("ul:first").children("li").length;
        var x=Math.ceil(w/r);
        if(dom.find("ul").length==0||dom.find("li").length==0){
            dom.append("Require content");
            return null
            }
            dom.find("ul:first").children("li").children("a").children("img").css("width",m).css("height",n);
        if(h=='enable'){
            dom.find("ul:first").children("li").children("a").each(function(){
                $(this).append('<br/>'+$(this).attr("title"))
                })
            }
            s_s_ul(dom,j,k,l,i);
        s_s_nav(dom.find(".amazon_scroller_nav"),d);
        m=parseInt(m);
        dom.find("ul:first").children("li").css("width",m+"px");
        dom.find("ul:first").children("li").children("a").css("color",q);
        dom.find("ul:first").children("li").children("a").css("font-size",o);
        begin();
        play();
        dom.find(".amazon_scroller_nav").children("li").hover(
            function(){
                if($(this).parent().children().index($(this))==0){
                $(this).css("background-position","left -50px");
                }else if($(this).parent().children().index($(this))==1){
                $(this).css("background-position","right -50px");
                }
            },
            function(){
                if($(this).parent().children().index($(this))==0){
                $(this).css("background-position","left top");
                }else if($(this).parent().children().index($(this))==1){
                $(this).css("background-position","right top");
                }
            }
        );
        dom.find(".amazon_scroller_nav").children("li").click(function(){
            if($(this).parent().children().index($(this))==0){
                previous()
                }else if($(this).parent().children().index($(this))==1){
                next()
                }
            });
    function begin(){
        var a=dom.find("ul:first").children("li").outerWidth(true)*w;
        dom.find("ul:first").children("li").hide();
        dom.find("ul:first").children("li").slice(0,r).show();
        u=dom.find("ul:first").outerWidth();
        v=dom.find("ul:first").outerHeight();
        dom.find("ul:first").width(a);
        dom.width(u+60);
        dom.height(v);
        dom.children(".amazon_scroller_mask").width(u);
        dom.children(".amazon_scroller_mask").height(v);
        dom.find("ul:first").children("li").show();
        dom.css("position","relative");
        dom.find("ul:first").css("position","absolute");
        dom.children(".amazon_scroller_mask").width(u);
        dom.children(".amazon_scroller_mask").height(v);
        dom.find(".amazon_scroller_nav").css('top',(v-50)/2+parseInt(j)+"px");
        dom.find(".amazon_scroller_nav").width(u+60)
        }
        function previous(){
        if(t==0){
            t=x-2
            }else{
            if(t==1){
                t=x-1
                }else{
                t-=2
                }
            }
        play();
    }
    function next(){
    play()
    }
    function play(){
    clearTimeout(s);
    dom.find("ul:first").animate({
        left:-(t*u)
        },500);
    t++;
    if(t>=x){
        t=0
        }
        s=setTimeout(play,g)
    }
    function s_s_ul(a,b,c,d,e){
    b=parseInt(b);
    c=parseInt(c);
    var f="border: "+d+" solid "+" "+c+"px; padding:"+b+"px; background-color:"+e;
    a.attr("style",f)
    }
    function s_s_nav(a,d){
    var b=a.children("li:first");
    var c=a.children("li:last");
    a.children("li").css("width","25px");
    a.children("li").css("height","50px");
    a.children("li").css('background-image','url("'+d+'/arrow.gif")');
    c.css('background-position','right top');
    a.children("li").css('background-repeat','no-repeat');
    c.css('right','0px');
	b.css('left','0px');
    }
}
})(jQuery);
/* --------------------------------------------- AMAZON SCROLLER ------------------------------------------------------- */

function anketa_vote(domain,sadd,seg_identification,column,par3){	
	$('#anketa').load(domain+"classes/classes_ank_ajax.php?action=anketa&sadd="+sadd+"&seg_identification="+seg_identification+"&column="+column+"&par3="+par3+"",'',function(){						
	});					
}

function hideContent(type){
	$('#'+type).slideUp();
}

function showContent(type){
	$('#'+type).slideDown();
}

/* ------------------------------------ popout menu - start ------------------------------------------- */
var t;
function generate_popoutmenu(prod_menu_id,domain){		
	/* $(".popoutmenus").slideUp(); */
	if($("#popout_"+prod_menu_id).is(":visible")===false){
		$("#"+prod_menu_id).append("<div id='popout_"+prod_menu_id+"' class='popoutmenus' style='position:absolute; width:200px; height:200px; margin-left:200px; background-color:red;' onmouseover=''>aaa</div>");
		$("#popout_"+prod_menu_id).show();		
	}
	$("#popout_"+prod_menu_id).load(domain+"classes/classes_ank_ajax.php?action=generate_popoutmenu",'',function(){						
	});	
}

function hide_popoutmenu(prod_menu_id,domain,parents_for_popout_display,browser_name,browser_version){	
	t = setTimeout(function() {		
		$(".popoutmenus").stop(true,true);
		if(browser_name=='MSIE' && browser_version<=7) $(".popoutmenus").hide();	
		else $(".popoutmenus").fadeOut('fast');	
	}, 500);
	
    $(this).data('timeout', t);
}
function show_popoutmenu(prod_menu_id,domain,parents_for_popout_display,browser_name,browser_version){	
	clearTimeout(t);
	$(".popoutmenus").stop(true,true);
  	$(".popoutmenus").hide();
	var arr = parents_for_popout_display.split(',');
	if(arr[0]!='' || arr[0]!='undefined') $("#popout_"+arr[0]).show();
	if(arr[1]!='' || arr[1]!='undefined') $("#popout_"+arr[1]).show();
	if(arr[2]!='' || arr[2]!='undefined') $("#popout_"+arr[2]).show();
	if(arr[3]!='' || arr[3]!='undefined') $("#popout_"+arr[3]).show();
	if(arr[4]!='' || arr[4]!='undefined') $("#popout_"+arr[4]).show();	
	if(browser_name=='MSIE' && browser_version<=7) $("#popout_"+prod_menu_id).show();
	else $("#popout_"+prod_menu_id).fadeIn('fast');
	
	/*
	var t = setTimeout(function() {		
		anything herer....
    }, 500);
	
    $(this).data('timeout', t);
	*/
}



/* ------------------------------------ popout menu - end ------------------------------------------- */

function display_omo_image(div_id,ext,extomo,type,im_width,im_id,im_id_omo){	
	if(type==''){
		var src = $("#"+div_id).attr("src").replace("."+ext, "_omo."+extomo);
		$("#"+div_id).attr("src", src).fadeIn();
	}
	if(type=='CAT'){
		/* alert(im_id+"_"+im_width+"."+ext+"...."+im_id_omo+"_"+im_width+"."+extomo); */
		var src = $("#catimg_"+div_id).attr("src").replace(im_id+"_"+im_width+"."+ext, im_id_omo+"_"+im_width+"."+extomo);
		$("#catimg_"+div_id).attr("src", src).fadeIn();
		$("#catdiv_"+div_id).attr('class', 'segment_cat_title_div_omo');
		$("#catlink_"+div_id).attr('class', 'segment_cat_title_link_omo');		
	}

	
}
function hide_omo_image(div_id,ext,extomo,type,im_width,im_id,im_id_omo){
	if(type==''){
		var src = $("#"+div_id).attr("src").replace("_omo."+extomo, "."+ext);
		$("#"+div_id).attr("src", src).fadeIn();
	}
	if(type=='CAT'){
		var src = $("#catimg_"+div_id).attr("src").replace(im_id_omo+"_"+im_width+"."+extomo, im_id+"_"+im_width+"."+ext);
		$("#catimg_"+div_id).attr("src", src).fadeIn();
		$("#catdiv_"+div_id).attr('class', 'segment_cat_title_div');
		$("#catlink_"+div_id).attr('class', 'segment_cat_title_link');		
	}
	
}

