function get_thethe_image_slider($name)
{
    global $g_arrBoxes;
    $nPostID = 0;
    //$second_query = new WP_Query( 'post_name=' . sanitize_title($name) .'&post_type=thethe-slider');
    //$second_query = new WP_Query( array('post_name' => sanitize_title($name) ,'post_type' => 'thethe-slider'));
    $posts_array = get_posts(array('post_name' => sanitize_title($name), 'post_type' => 'thethe-slider'));
    // The Loop
    //echo '<pre>';
    //print_r($posts_arr);
    //echo '</pre>';
    //var_dump($second_query->get_posts());
    //var_dump($second_query->have_posts());
    //$res = $second_query->have_posts();
    //var_dump($res);
    //$second_query->query();
    /*while( $second_query->have_posts() ){
    		$second_query->the_post();
    		$nPostID = get_the_ID();
    	}*/
    foreach ($posts_array as $slider_post) {
        if ($slider_post->post_name == sanitize_title($name)) {
            $nPostID = $slider_post->ID;
            break;
        }
    }
    //$nPostID = 132;
    wp_reset_postdata();
    if (empty($nPostID)) {
        return false;
    }
    $oPost = get_post($nPostID);
    //var_dump($oPost);
    $arrOptions = array();
    //echo '<pre>';
    //print_r($g_arrBoxes);
    //echo '</pre>';
    foreach ($g_arrBoxes as $box) {
        if ($box['type'] == 'select' && !isset($box['keyvalue'])) {
            if ($box['name'] != '_slider_paginator_type' && $box['name'] != '_slider_paginator_position') {
                $arrOptions[$box['name']] = $box['values'][get_post_meta($oPost->ID, $box['name'], true)];
            } else {
                $arrOptions[$box['name']] = get_post_meta($oPost->ID, $box['name'], true);
            }
        } else {
            $arrOptions[$box['name']] = get_post_meta($oPost->ID, $box['name'], true);
        }
    }
    //$strSlides1 = get_post_meta(133, '_wp_attachment_metadata', true);
    $strSlides = get_post_meta($oPost->ID, 'slides', true);
    //var_dump($strSlides);
    //$strSlides = get_post_meta($oPost->ID, '_wp_attachment_metadata', true);
    //var_dump($strSlides);
    $arrSlides = is_array($arrSlides = @unserialize($strSlides)) ? $arrSlides : array();
    //echo '<pre>';
    //print_r($arrSlides);
    //echo '</pre>';
    //$arrSlides[0] = $strSlides1;
    //$arrSlides[1] = $strSlides2;
    $output = '';
    //echo '<pre>';
    //var_dump($arrSlides);
    //echo '</pre>';
    $output .= '<div class="thethe_image_slider ' . $arrOptions['_slider_style'] . '" id="thethe_image_slider' . $oPost->ID . '" style="width:780px;">';
    $output .= '<div class="thethe_image_slider_inner" style="width:780px; height:350px;">';
    $output .= '<div class="thethe-image-slider-settings">';
    $output .= '<span class="width">500</span>';
    $slider_loop = $arrOptions['_slider_loop'] ? 'true' : 'false';
    $output .= '<span class="loop">' . $slider_loop . '</span>
				<span class="pagginator_type">' . $arrOptions['_slider_paginator_type'] . '</span>
				<span class="pagginator_position">' . $arrOptions['_slider_paginator_position'] . '</span>
				<span class="height">' . $arrOptions['_slider_height'] . '</span>';
    $slider_autoplay = $arrOptions['_slider_autoplay'] ? 'true' : 'false';
    $slider_autoresize = $arrOptions['_slider_autoresize'] ? 'true' : 'false';
    $output .= '<span class="autoplay">' . $slider_autoplay . '</span>
				<span class="autoresize">' . $slider_autoresize . '</span>
				<span class="trans-time">' . $arrOptions['_slider_trans_time'] . '</span>';
    $slider_style = $arrOptions['_slider_style'] == 'none' ? 'none' : THETHE_IMAGE_SLIDER_URL . 'style/skins/' . $arrOptions['_slider_style'];
    $output .= '<span class="skin">' . $slider_style . '</span>
			</div>
			<div class="thethe-image-slider-loader"><div class="thethe-image-slider-progress"></div></div>';
    $output .= '<ul class="thethe-image-slider-slides">';
    foreach ($arrSlides as $i => $slide) {
        $output .= '<li>';
        $slide_caption = $slide['slide_caption'] ? 'true' : 'false';
        $output .= '	<div class="thethe-image-slider-slide-settings">
				    	<span class="time">' . $slide['delay'] . '</span>
				    	<span class="transition">' . $slide['transition'] . '</span>
				    	<span class="slide_caption">' . $slide_caption . '</span>
				    	<span class="caption-size">' . $slide['caption_size'] . '</span>
				    	<span class="caption-position">' . $slide['caption_position'] . '</span>
				    	<span class="caption_opacity">' . $slide['caption_opacity'] . '</span>						
				    	<span class="link">' . $slide['url'] . '</span>
			    	</div>';
        if ($arrOptions['_slider_autoresize']) {
            //var_dump($slide['file']);
            $image_src = $slide['image'] ? $slide['image'] : THETHE_IMAGE_SLIDER_URL . 'style/images/blank.gif';
            $output .= '<img src="' . $image_src . '" alt="' . $slide['title'] . '" class="thethe-image-slider-image"/>';
            //$image_src = $slide['image'] ? thethe_get_image_path( $slide['image'] ) : THETHE_IMAGE_SLIDER_URL.'style/images/blank.gif';
            //$output .='<img src="'.THETHE_IMAGE_SLIDER_URL . 'timthumb.php?w='.$arrOptions['_slider_width'].'&amp;h='.$arrOptions['_slider_height'].'&amp;zc=1&amp;src='.urlencode($image_src).'" alt="'.$slide['title'].'" class="thethe-image-slider-image"/>';
        } else {
            //$image_src = $slide['image'] ? $slide['image'] : THETHE_IMAGE_SLIDER_URL.'style/images/blank.gif';
            $image_src = $slide['file'] ? $slide['file'] : THETHE_IMAGE_SLIDER_URL . 'style/images/blank.gif';
            $output .= '<img src="' . $image_src . '" alt="' . $slide['title'] . '" class="thethe-image-slider-image"/>';
        }
        $url = str_ireplace(array('http://', 'https://'), '', $slide['url']);
        $output .= $url ? '<a class="slide-link" href="http://' . $url . '" title="' . $slide['title'] . '">&nbsp;</a>' : '';
        if ($slide['slide_caption']) {
            $slideCaptionBgColor = $slide['caption_bg_color'] ? 'style="background:' . $slide['caption_bg_color'] . ';"' : '';
            $slideCaptionTextColor = $slide['caption_text_color'] ? 'style="color:' . $slide['caption_text_color'] . ';"' : '';
            //					$output .='
            //					<div class="thethe-image-slider-caption thethe-image-slider-caption-'.$slide['caption_position'].' thethe-image-slider-caption-bg thethe-image-slider-caption-'.$slide['caption_style'].'" '.$slideCaptionBgColor.'></div>
            //					<div class="thethe-image-slider-caption front thethe-image-slider-caption-'.$slide['caption_position'].' thethe-image-slider-caption-'.$slide['caption_style'].'">
            //
            //			    		<div class="thethe-image-slider-caption-inner" '.$slideCaptionTextColor.'>
            //				    		<div class="thethe-image-slider-caption-text">';
            //
            //					$output .='</div></div></div>';
            $output .= '<div class="slide-information"><div class="slide-title"  >' . $slide['title'] . '</div>';
            $output .= '<div class="slide-text"  >' . $slide['text'] . '</div></div><div style="clear:both"></div>';
        }
        $output .= '</li>';
    }
    $output .= '</ul>';
    if ($arrOptions['_slider_controls']) {
        $output .= '<div class="thethe-image-slider-controls-prev thethe-previous thethe-image-slider-controls" id="thethe_image_slider' . $oPost->ID . '-previous"></div>
					<div class="thethe-image-slider-controls-pause thethe-image-slider-controls thethe-';
        $output .= $arrOptions['_slider_autoplay'] ? 'pause' : 'play';
        $output .= '" id="thethe_image_slider' . $oPost->ID . '-pause"></div>
					<div class="thethe-image-slider-controls-next thethe-image-slider-controls thethe-next" id="thethe_image_slider' . $oPost->ID . '-next"></div>';
    }
    $output .= '</div>';
    if ($arrOptions['_slider_paginator']) {
        $output .= '<div class="thethe-image-slider-thumbnails thethe-image-slider-thumbnails-' . $arrOptions['_slider_paginator_type'] . ' thethe-image-slider-thumbnails' . $arrOptions['_slider_paginator_position'] . '">';
        foreach ($arrSlides as $i => $slide) {
            $output .= '<div class="thethe-image-slider-thumbnails-thumb">';
            if ($arrOptions['_slider_paginator_type'] == 'thumbnails') {
                $image_src = thethe_get_image_path($slide['image']);
                $output .= '<div class="thumbnail-img" style="background-image:url(' . THETHE_IMAGE_SLIDER_URL . 'timthumb.php?w=40&amp;h=40&amp;zc=1&amp;src=' . urlencode($image_src) . ')" >&nbsp;</div>';
            } elseif ($arrOptions['_slider_paginator_type'] == 'numbers') {
                $output .= $i + 1;
            } elseif ($arrOptions['_slider_paginator_type'] == 'slidenames') {
                $output .= $slide['title'];
            } elseif ($arrOptions['_slider_paginator_type'] == 'dots') {
            }
            $output .= '</div>';
        }
        $output .= '</div>';
    }
    if ($arrOptions['_slider_backlink']) {
        $output .= '<a class="thethe-backlink" href="http://thethefly.com/wp-plugins/thethe-image-slider/" title="Powered by TheThe Image Slider WordPress Plugin" target="_blank">?</a>';
    }
    $output .= '</div>';
    return $output;
}
;<?php 
            echo get_the_ID();
            ?>
" />
									<a href="<?php 
            echo getTabURLIS('editslide&id=' . get_the_ID());
            ?>
&sid=<?php 
            echo $i;
            ?>
" class="thethe-edit">
									<?php 
            if (!empty($arrSlide['image'])) {
                ?>
                                    <?php 
                $image_src = thethe_get_image_path($arrSlide['image']);
                ?>
										<img src="<?php 
                echo THETHE_IMAGE_SLIDER_URL . 'timthumb.php?w=80&h=80&zc=1&src=' . urlencode($image_src);
                ?>
" />
									<?php 
            } else {
                ?>
										<img src="<?php 
                echo THETHE_IMAGE_SLIDER_URL;
                ?>
style/images/smallnoimg.png" />
									<?php 
            }
            ?>
function _thethe_image_slider_rebuild_slides($id)
{
    include 'inc/inc.boxes.php';
    $strSlides = get_post_meta($id, 'slides', true);
    $arrSlides = is_array($arrSlides = @unserialize($strSlides)) ? $arrSlides : array();
    ?>
		

						<?php 
    foreach ($arrSlides as $i => $arrSlide) {
        ?>
							<div class="thethe-slide postbox" id="slide<?php 
        echo $i;
        ?>
slider<?php 
        echo $id;
        ?>
">
								<div style="width:25px">										
									<img src="<?php 
        echo THETHE_IMAGE_SLIDER_URL;
        ?>
style/images/move.png" title="Drag to Reorder slides" class="hndle" />
								</div>
								<div style="width:15%">
									<input type="hidden" name="slide[]" value="<?php 
        echo $i;
        ?>
;<?php 
        echo $id;
        ?>
" />
									<a href="<?php 
        echo getTabURLIS('editslide&id=' . $id);
        ?>
&sid=<?php 
        echo $i;
        ?>
" class="thethe-edit">
									<?php 
        if (!empty($arrSlide['image'])) {
            ?>
                                    <?php 
            $image_src = thethe_get_image_path($arrSlide['image']);
            ?>
										<img src="<?php 
            echo THETHE_IMAGE_SLIDER_URL . 'timthumb.php?w=80&h=80&zc=1&src=' . urlencode($image_src);
            ?>
" />
									<?php 
        } else {
            ?>
										<img src="<?php 
            echo THETHE_IMAGE_SLIDER_URL;
            ?>
style/images/smallnoimg.png" />
									<?php 
        }
        ?>
									</a>
								</div>
								<div style="width:20%">
									<a href="<?php 
        echo getTabURLIS('editslide&id=' . $id);
        ?>
&sid=<?php 
        echo $i;
        ?>
" class="row-title"><?php 
        echo $arrSlide['title'];
        ?>
</a><br />
									<?php 
        if (!empty($arrSlide['url'])) {
            ?>
									<a href="http://<?php 
            echo $arrSlide['url'];
            ?>
" target="_blank" class="thethe-slider-small"><?php 
            echo $arrSlide['url'];
            ?>
</a>
									<?php 
        }
        ?>
								</div>
								<div style="width:6%"><?php 
        echo $arrSlide['delay'] / 1000 . 's';
        ?>
</div>
								<div style="width:10%"><?php 
        echo $arrTransitionsList[$arrSlide['transition']];
        ?>
</div>
								<div style="width:34%"><?php 
        echo substr(htmlspecialchars($arrSlide['text']), 0, 400);
        ?>
</div>
								<div style="width:10%">
									<a href="<?php 
        echo getTabURLIS('editslide&id=' . $id);
        ?>
&sid=<?php 
        echo $i;
        ?>
" class="thethe-edit" id="editslide<?php 
        echo $i;
        ?>
slider<?php 
        echo $id;
        ?>
"><?php 
        _e('Edit');
        ?>
</a>
									<a href="#" class="thethe-slider-delete-slide" id="deleteslide<?php 
        echo $i;
        ?>
slider<?php 
        echo $id;
        ?>
" title="<?php 
        _e('Delete');
        ?>
 <?php 
        echo $arrSlide['title'];
        ?>
"><?php 
        _e('Delete');
        ?>
</a>
								</div>
								<br clear="all" />
							</div>
						<?php 
    }
    ?>

					<?php 
    if (!empty($arrSlides)) {
        ?>
					<div style="clear: both"></div>
					<?php 
    }
    ?>
        
<?php 
}