//closed area-search
$content .= '<div id="area-copy">';
$content .= '<table border="0" cellpadding="0" cellspacing="0" class="form">';
$content .= '<tr><td>Products ID to Copy</td><td>&nbsp;</td><td><input type="text" id="pid-copy" onfocus="$(this).select();">';
$content .= '</td></tr>';
$content .= '</table>';
$content .= '<div id="pid-copy-list-elements" style="margin-top:20px;"></div>';
$content .= '</div>';
//closed area-copy
$content .= '</div>';
//closed products-add-elements-tabs
$content .= '<input type="hidden" id="pid" value="' . $products_id . '" />';
if ($is_accessed_from_design_mgmt) {
    $content .= '<div class="draft-comment-view-area" style="float:left;margin:10px 0 0 240px;">';
    //COLORS REQUEST
    $content .= drawColorsRequest($draft->colors_request, 'colors-request', '', 'Colors Request', '', true);
    //COMMENTS
    $content .= $draft->comments->drawComments('', 'Draft Comments');
    $content .= '</div>';
}
$title = "Add Element";
$javascript = '     var pid = $("#pid").val();

                    function setFocusedElement(index) {
                        if(index==0) {
                            $("#di-elid").focus();
                        }else if(index==1) {
                            $("#filters").focus();
                        }else if(index==2) {
                            $("#pid-copy").focus();
                        }
 $content .= '<div style="margin-bottom:5px;">';
 if ($draft->approve_status != '0') {
     $content .= '<h2 style="margin:0;">' . $draft_title . '</h2>';
 } else {
     $content .= '<h2 id="draft-name" style="margin:0;"><span>' . $draft_title . '</span></h2>';
     $content .= '<div id="draft-name-edit" style="display:none;"><input type="text" value="" class="iwbutton input" /></div>';
 }
 $content .= '</div>';
 $content .= '<div id="draft-actions" style="margin-bottom:20px;">';
 if ($draft->approve_status != 'A') {
     $content .= '<input type="button" id="btn-upload" value="Change Image" title="Upload New Image replacing current one" />';
     $content .= '<input type="button" id="btn-delete" value="Delete Draft" title="Delete Draft Permanently" class="red" />';
 }
 $content .= '</div>';
 //COLORS REQUEST
 $content .= drawColorsRequest($draft->colors_request, 'colors-request', '', 'Draft Colors Request', '');
 //COMMENTS
 $content .= $draft->comments->drawComments($session_userinfo['username'], 'Draft Comments');
 //FOLLOWERS
 $content .= $draft->followers->drawFollowersWithContainer('Draft Followers');
 $content .= '</div>';
 $js_reload_followers = $draft->followers->JSReloader();
 $javascript = '
         ' . $draft->comments->drawCommentsJSAction('reloadList();' . $js_reload_followers) . '
         ' . $draft->followers->drawFollowersJSAction($session_userinfo['id'], '') . '
         ' . drawColorsRequestJSAction('colors-request', 'UPDATECOLORSREQUEST', 'REMOVEFROMCOLORSREQUEST', 'drafts_id', $draft->id, $js_reload_followers) . '
         var url_alt = "?open=designs-draft";
         $("#draft-name-edit").append("<input type=\'button\' id=\'name-update\' name=\'update\' value=\'Update\' />");
         $("#draft-name-edit").append("<input type=\'button\' id=\'name-cancel\' name=\'cancel\' value=\'Cancel\' />");
         function draftDeleted(xmlResult, txtStatus) {
             if(txtStatus=="success") {
     $draft_title .= '</h3>';
     $content .= $draft_title;
     $content .= '<div><input type="text" id="drname-' . $keyid . '" style="width:280px;" value="' . $draft_name . '" ' . $name_dis . '/></div>';
     $content .= '<div id="' . $keyid . '" class="draftbtns" style="margin-top:5px;"><input type="hidden" name="drafts_id" value="' . $d['drafts_id'] . '" /></div>';
     $content .= '</div>';
     //COLORS REQUEST
     $hidden_input = '<input type="hidden" value="' . $d['drafts_id'] . '"/>';
     if ($draft_exist) {
         $draft = new design_draft($d[drafts_id]);
         $colors_request = $draft->colors_request;
         $cr_style = 'margin-top:10px;';
     } else {
         $colors_request = '';
         $cr_style = 'display:none;';
     }
     $content .= drawColorsRequest($colors_request, "dra-{$d['drafts_id']}-colors-request", $cr_style, 'Draft Colors Request', '', false, $hidden_input);
     $content .= '</div>';
 }
 $content .= '</div>';
 //RIGHT Part close
 //FOLLOWERS
 $content .= $design->followers->drawFollowersWithContainer('Design Followers');
 $js_reload_followers = $design->followers->JSReloader();
 $javascript = '
         ' . $design->comments->drawCommentsJSAction('reloadList();' . $js_reload_followers) . '
         ' . $design->followers->drawFollowersJSAction($session_userinfo['id'], '') . '
         ' . drawColorsRequestJSAction('colors-request', 'UPDATECOLORSREQUEST', 'REMOVEFROMCOLORSREQUEST', 'drafts_id', 'pub_vars', $js_reload_followers) . '
         function nameUpdated(xmlResult, txtStatus) {
             if(txtStatus=="success") {
                 var draft_name = $("draft_name", xmlResult).text();
                 var draft_namekey = $("draft_namekey", xmlResult).text();
         //$imglink = '<a href="'.webImageSource($draft['image_1']).'" target="_blank">';
         $imglink = '<a href="?open=designs-draft-detail&amp;id=' . $draft['drafts_id'] . '" target="_self">';
         $content .= '<div style="float:left;">';
         $content .= $draft_title . '<br />';
         $content .= $imglink . webImage($draft['image_1'], '80', '80', $image_title, '') . '</a>';
         $content .= '</div>';
     }
     $content .= '<div style="padding-top:100px;"><a href="?open=designs-draft&amp;designs_id=' . $design->id . '" target="_self">&equiv; Edit Drafts</a></div>';
     $content .= '</div>';
 }
 //SOURCE OF IDEAS
 $content .= drawNotes($design->source_of_ideas, 'source-of-ideas', '', 'Source of Ideas');
 //DESIGNS DESCRIPTION
 $content .= drawNotes($design->designs_description, 'designs-description', '', 'Designs Description');
 //COLORS REQUEST
 $content .= drawColorsRequest($design->colors_request, 'colors-request', '', 'Design Colors Request', '');
 //COMMENTS
 $content .= $design->comments->drawComments($session_userinfo['username'], 'Design Comments');
 //WATCHLIST
 if (in_array($session_userinfo['id'], $design->watched_by)) {
     $style_atw = 'style="display:none;"';
     $style_rfw = '';
 } else {
     $style_atw = '';
     $style_rfw = 'style="display:none;"';
 }
 $content .= '<div style="margin-top:20px;">';
 $content .= '<img id="low" src="images/ajax-load-2.gif" style="display:none;"/>';
 $content .= '<div id="atw" ' . $style_atw . '><input id="btn-add-watchlist" type="button" value="Add to My Watchlist"/></div>';
 $content .= '<div id="rfw" ' . $style_rfw . '><small>This design already on your watchlist!</small><br/><input id="btn-rem-watchlist" type="button" class="red" value="Remove from My Watchlist"/></div>';
 $content .= '</div>';