/* Prototype templates */
var adTemplate = new Template(  
'<div class="fontsmall">Adid: #{adID}<br>Type: #{type}<br>Business: #{business}<br>Special Id: #{specialId}<br>Papers:</div>'); 
  
var paperTemplate = new Template(  
'<div class="fontsmall padHLarge">#{name}, #{state} - #{title}</div>');

var crppTemplate = new Template(
'<div class="row widthFull marginMedium bgcolor4">\
<div class="cell color2 marginMedium widthFull fontMedium"><strong>Consumer Reader Private Party Ad (Per Week)</strong><br>First #{basewords} Words: $#{basecost}<br>Each Additional Word: $#{addwordcost}<br>Border $#{border}<br> Check: $#{check}<br> Star: $#{star}<br>URL: $#{url}<br> Email: $#{email}<br> HighLight: $#{highlight}</div>\
</div>');
		    
var foTemplate = new Template(
'<div class="row widthFull marginMedium bgcolor4">\
<div class="cell color2 marginMedium widthFull fontMedium"><strong>Free Online Ad</strong><br>500 Characters Free<br> URL: $#{url}<br> HighLight: $#{highlight}</div>\
</div>');

var specialTemplate = new Template(
    '<tr class="pricingRow">\
       <td class="pricingCell" title="#{paperNameLong}">#{paperNameShort}</td>\
       <td class="pricingCell">#{paperType}</td>\
       <td class="pricingCell">\
         <div id="special#{specialID}">\
         <div><a class="specialHeading">#{headingShort}</a></div>\
         <div id="specialDetail#{specialID}" class="movable bgWhite padSmall width5 frame1">\
           <div class="table bgWhite">\
             <div class="row">\
               <div class="cell padMedium">#{paperNameLong} Special</div>\
             </div>\
             <div class="row">\
               <div class="cell weightBold padMedium">#{headingLong}</div>\
             </div>\
             <div class="row">\
               <div class="cell">#{message}</div>\
             </div>\
             <div class="row">\
               <div class="cell padSmall">\
               <table class="specialPricingTable">\
               <caption class="pricingCaption">Special Pricing</caption>\
               <tr class="pricingRow">\
               <td class="pricingCellCaption" title="Cost for each word in addtion to the base number of words for first week the ad runs.">First Week Cost</td>\
               <td class="pricingCellCaption" title="Cost for each word in addtion to the base number of words for the first week the ad runs.">First Week Add Word</td>\
               <td class="pricingCellCaption" title="Percent off the cost of the ad.">% Off</td>\
               <td class="pricingCellCaption" title="Cost of the ad for the base number of words for one week.">Cost</td>\
               <td class="pricingCellCaption" title="Number of words for the ad which you get for the base cost for one week."># Words</td>\
               <td class="pricingCellCaption" title="Cost for each word in addtion to the base number of words for one week.">Add Words</td>\
               <td class="pricingCellCaption" title="The minimum number of weeks the ad must run.">Min Week</td>\
               <td class="pricingCellCaption" title="The number of free weeks you receive with your ad.">Free Weeks</td>\
               </tr>\
               <tr class="pricingRow">\
               <td class="pricingCell">#{firstCost}</td>\
               <td class="pricingCell">#{firstAddWordCost}</td>\
               <td class="pricingCell">#{percentOff}</td>\
               <td class="pricingCell">#{cost}</td>\
               <td class="pricingCell">#{minWord}</td>\
               <td class="pricingCell">#{addWordCost}</td>\
               <td class="pricingCell">#{minWeeks}</td>\
               <td class="pricingCell">#{getWeeks}</td>\
               </tr>\
               </table>\
               </div>\
             </div>\
             <div class="row">\
               <div class="cell padSmall">\
               <table class="specialPricingTable">\
               <tr class="pricingRow">\
               <caption class="pricingCaption">Additional Pricing</caption>\
               <td class="pricingCellCaption" title="Cost to attach a website address to the ad for one week.">URL</td>\
               <td class="pricingCellCaption" title="Cost to attach an email address to the ad for one week.">Email</td>\
               <td class="pricingCellCaption" title="Cost to add a border to the print version of the ad for one week.">Border</td>\
               <td class="pricingCellCaption" title="Cost to add checks to the print version of the ad for one week.">Checks</td>\
               <td class="pricingCellCaption" title="Cost to add stars to the print version of the ad for one week.">Stars</td>\
               <td class="pricingCellCaption" title="Cost to add a highlight to the online version of the ad for one week.">HL</td>\
               <td class="pricingCellCaption" title="Cost to add images to the online version of the ad for one week.">Image</td>\
               <td class="pricingCellCaption" title="Cost to add video to the online versioin of the ad for one week.">Video</td>\
               </tr>\
               <tr class="pricingRow">\
               <td class="pricingCell">#{urlFee}</td>\
               <td class="pricingCell">#{emailFee}</td>\
               <td class="pricingCell">#{borderFee}</td>\
               <td class="pricingCell">#{checkBorderFee}</td>\
               <td class="pricingCell">#{starBorderFee}</td>\
               <td class="pricingCell">#{highLightFee}</td>\
               <td class="pricingCell">#{imageFee}</td>\
               <td class="pricingCell">#{videoFee}</td>\
               </tr>\
               </table>\
               </div>\
             </div>\
           </div>\
           </div>\
         </div>\
       </td>\
     </tr>'   
 );

 var specialUnavailableTemplate = new Template('<tr class="pricingRow"><td class="pricingCell" title="#{paperNameLong}">#{paperNameShort}</td><td class="pricingCell">#{papertype}</td><td class="pricingCell">Not available.</td></tr>');

 var specialDetailTemplate = new Template(
  '<div class="table bgWhite">\
    <div class="row">\
      <div class="cell padMedium">#{paperName} Special</div>\
    </div>\
    <div class="row">\
      <div class="cell weightBold padMedium">#{headingLong}</div>\
    </div>\
    <div class="row">\
      <div class="cell specialDetailCell">#{message}</div>\
    </div>\
    <div class="row">\
      <div class="cell padSmall">\
      <table class="pricingTable">\
      <caption class="pricingCaption">Special Pricing</caption>\
      <tr class="pricingRow">\
      <td class="pricingCell" title="Cost for each word in addtion to the base number of words for first week the ad runs.">First Week Cost</td>\
      <td class="pricingCell" title="Cost for each word in addtion to the base number of words for the first week the ad runs.">First Week Add Word</td>\
      <td class="pricingCell" title="Percent off the cost of the ad.">% Off</td>\
      <td class="pricingCell" title="Cost of the ad for the base number of words for one week.">Cost</td>\
      <td class="pricingCell" title="Number of words for the ad which you get for the base cost for one week."># Words</td>\
      <td class="pricingCell" title="Cost for each word in addtion to the base number of words for one week.">Add Words</td>\
      <td class="pricingCell" title="The minimum number of weeks the ad must run.">Min Week</td>\
      <td class="pricingCell" title="The number of free weeks you receive with your ad.">Free Weeks</td>\
      </tr>\
      <tr class="pricingRow">\
      <td class="pricingCell">#{firstCost}</td>\
      <td class="pricingCell">#{firstAddWordCost}</td>\
      <td class="pricingCell">#{percentOff}</td>\
      <td class="pricingCell">#{cost}</td>\
      <td class="pricingCell">#{minWord}</td>\
      <td class="pricingCell">#{addWordCost}</td>\
      <td class="pricingCell">#{minWeeks}</td>\
      <td class="pricingCell">#{getWeeks}</td>\
      </tr>\
      </table>\
      </div>\
    </div>\
    <div class="row">\
      <div class="cell padSmall">\
      <table class="pricingTable">\
      <tr class="pricingRow">\
      <caption class="pricingCaption">Additional Pricing</caption>\
      <td class="pricingCell" title="Cost to attach a website address to the ad for one week.">URL</td>\
      <td class="pricingCell" title="Cost to attach an email address to the ad for one week.">Email</td>\
      <td class="pricingCell" title="Cost to add a border to the print version of the ad for one week.">Border</td>\
      <td class="pricingCell" title="Cost to add checks to the print version of the ad for one week.">Checks</td>\
      <td class="pricingCell" title="Cost to add stars to the print version of the ad for one week.">Stars</td>\
      <td class="pricingCell" title="Cost to add a highlight to the online version of the ad for one week.">HL</td>\
      <td class="pricingCell" title="Cost to add images to the online version of the ad for one week.">Image</td>\
      <td class="pricingCell" title="Cost to add video to the online versioin of the ad for one week.">Video</td>\
      </tr>\
      <tr class="pricingRow">\
      <td class="pricingCell">#{urlFee}</td>\
      <td class="pricingCell">#{emailFee}</td>\
      <td class="pricingCell">#{borderFee}</td>\
      <td class="pricingCell">#{checkBorderFee}</td>\
      <td class="pricingCell">#{starBorderFee}</td>\
      <td class="pricingCell">#{highLightFee}</td>\
      <td class="pricingCell">#{imageFee}</td>\
      <td class="pricingCell">#{videoFee}</td>\
      </tr>\
      </table>\
      </div>\
    </div>\
  </div>');
    
var contentBlockListItemTemplate =  new Template(
  '<div class="cc_row">\
  <div class="cc_cell1">#{contentId}</div>\
  <div class="cc_cell3">#{name}</div>\
  <div class="cc_cell2">#{title}</div>\
  <div class="cc_cell3">\
  <div style="text-align:right">\
  <a class="cc_contentBlockEditBtn" contentid="#{contentId}"><img src="../../common/images/cc_edit.png" alt="EDIT" title="EDIT"></a>\
  <a class="cc_contentBlockDeleteBtn" contentid="#{contentId}"><img src="../../common/images/cc_cancel_sm.png" alt="DELETE" title="DELETE"></a>\
  <a class="cc_contentBlockPreviewBtn" contentid="#{contentId}"><img src="../../common/images/cc_x2right.png" alt="ADD TO COLUMN PREVIEW" title="ADD TO COLUMN PREVIEW"></a>\
  </div>\
  </div>\
  </div>');
		
var contentBlockListItemAltTemplate =  new Template(
  '<div class="cc_alt_row">\
  <div class="cc_cell1">#{contentId}</div>\
  <div class="cc_cell3">#{name}</div>\
  <div class="cc_cell2">#{title}</div>\
  <div class="cc_cell3">\
  <div style="text-align:right">\
  <a class="cc_contentBlockEditBtn" contentid="#{contentId}"><img src="../../common/images/cc_edit.png" alt="EDIT" title="EDIT"></a>\
  <a class="cc_contentBlockDeleteBtn" contentid="#{contentId}"><img src="../../common/images/cc_cancel_sm.png" alt="DELETE" title="DELETE"></a>\
  <a class="cc_contentBlockPreviewBtn" contentid="#{contentId}"><img src="../../common/images/cc_x2right.png" alt="ADD TO COLUMN PREVIEW" title="ADD TO COLUMN PREVIEW"></a>\
  </div>\
  </div>\
  </div>');
  
var contentBlockListWidgetTemplate =  new Template(
  '<div class="cc_row">\
  <div class="cc_cell1">#{contentId}</div>\
  <div class="cc_cell3">#{name}</div>\
  <div class="cc_cell2">#{title}</div>\
  <div class="cc_cell3">\
  <div style="text-align:right">\
  <a class="cc_contentBlockPreviewBtn" contentid="#{contentId}"><img src="../../common/images/cc_x2right.png" alt="ADD TO COLUMN PREVIEW" title="ADD TO COLUMN PREVIEW"></a>\
  </div>\
  </div>\
  </div>');
      
var contentBlockListWidgetAltTemplate =  new Template(
  '<div class="cc_alt_row">\
  <div class="cc_cell1">#{contentId}</div>\
  <div class="cc_cell3">#{name}</div>\
  <div class="cc_cell2">#{title}</div>\
  <div class="cc_cell3">\
  <div style="text-align:right">\
  <a class="cc_contentBlockPreviewBtn" contentid="#{contentId}"><img src="../../common/images/cc_x2right.png" alt="ADD TO COLUMN PREVIEW" title="ADD TO COLUMN PREVIEW"></a>\
  </div>\
  </div>\
  </div>');  
  
		
var blockDefault = new Template('\
	<div id="cc:block:#{contentId}" class="cc_block" contentId="#{contentId}">\
	<div id="cc:title:#{contentId}" class="cc_title" contentId="#{contentId}">#{title}</div>\
	<div id="cc:body:#{contentId}" class="cc_body" contentId="#{contentId}">#{body}</div>\
	<div id="cc:detailLink:#{contentId}" class="cc_detaillink" contentId="#{contentId}">read more . . .</div>\
  </div>');
		
var blockNoTitle = new Template('\
  <div id="cc:block:#{contentId}" class="cc_block" contentId="#{contentId}">\
  <div id="cc:body:#{contentId}" class="cc_body2" contentId="#{contentId}">#{body}</div>\
  </div>');
  
var blockNoDetail = new Template('\
  <div id="cc:block:#{contentId}" class="cc_block" contentId="#{contentId}">\
  <div id="cc:title:#{contentId}" class="cc_title" contentId="#{contentId}">#{title}</div>\
  <div id="cc:body:#{contentId}" class="cc_body" contentId="#{contentId}">#{body}</div>\
  </div>');
    
var blockAdminDefault = new Template('\
  <div>\
  <div id="cc:block:#{contentId}" class="cc_block_main" contentId="#{contentId}">\
  <div id="cc:title:#{contentId}" class="cc_title" contentId="#{contentId}">#{title}</div>\
  <div id="cc:body:#{contentId}" class="cc_body" contentId="#{contentId}">#{body}</div>\
  <div id="cc:detailLink:#{contentId}" class="cc_detaillink" contentId="#{contentId}">read more . . .</div>\
  </div>\
  <div class="cc_block_controls">\
  <div class="cc_block_controls_cell"><a class="cc_contentColumnUpBtn" contentId="#{contentId}"><img src="../../common/images/cc_up.png" width="20px" height="20px" alt="MOVE UP" title="MOVE UP"></a></div>\
  <div class="cc_block_controls_cell"><a class="cc_contentColumnDownBtn" contentId="#{contentId}"><img src="../../common/images/cc_down.png" width="20px" height="20px" alt="MOVE DOWN" title="MOVE DOWN"></a></div>\
  <div class="cc_block_controls_cell"><a class="cc_contentColumnDeleteBtn" contentId="#{contentId}"><img src="../../common/images/cc_cancel_sm.png" width="20px" height="20px" alt="REMOVE FROM COLUMN" title="REMOVE FROM COLUMN"></a></div>\
  </div>\
  </div>\
  ');
		
var blockAdminNoTitle = new Template('\
  <div>\
  <div id="cc:block:#{contentId}" class="cc_block_main" contentId="#{contentId}">\
  <div id="cc:body:#{contentId}" class="cc_body2" contentId="#{contentId}">#{body}</div>\
  </div>\
  <div class="cc_block_controls">\
  <div class="cc_block_controls_cell"><a class="cc_contentColumnUpBtn" contentId="#{contentId}"><img src="../../common/images/cc_up.png" width="20px" height="20px" alt="MOVE UP" title="MOVE UP"></a></div>\
  <div class="cc_block_controls_cell"><a class="cc_contentColumnDownBtn" contentId="#{contentId}"><img src="../../common/images/cc_down.png" width="20px" height="20px" alt="MOVE DOWN" title="MOVE DOWN"></a></div>\
  <div class="cc_block_controls_cell"><a class="cc_contentColumnDeleteBtn" contentId="#{contentId}"><img src="../../common/images/cc_cancel_sm.png" width="20px" height="20px" alt="REMOVE FROM COLUMN" title="REMOVE FROM COLUMN"></a></div>\
  </div>\
  </div>\
  ');
  
var blockAdminNoDetail = new Template('\
  <div>\
  <div id="cc:block:#{contentId}" class="cc_block_main" contentId="#{contentId}">\
  <div id="cc:title:#{contentId}" class="cc_title" contentId="#{contentId}">#{title}</div>\
  <div id="cc:body:#{contentId}" class="cc_body" contentId="#{contentId}">#{body}</div>\
  </div>\
  <div class="cc_block_controls">\
  <div class="cc_block_controls_cell"><a class="cc_contentColumnUpBtn" contentId="#{contentId}"><img src="../../common/images/cc_up.png" width="20px" height="20px" alt="MOVE UP" title="MOVE UP"></a></div>\
  <div class="cc_block_controls_cell"><a class="cc_contentColumnDownBtn" contentId="#{contentId}"><img src="../../common/images/cc_down.png" width="20px" height="20px" alt="MOVE DOWN" title="MOVE DOWN"></a></div>\
  <div class="cc_block_controls_cell"><a class="cc_contentColumnDeleteBtn" contentId="#{contentId}"><img src="../../common/images/cc_cancel_sm.png" width="20px" height="20px" alt="REMOVE FROM COLUMN" title="REMOVE FROM COLUMN"></a></div>\
  </div>\
  </div>\
  ');

var blockDetail = new Template('\
		<div>\
		<div id="cc:detailclose:#{contentId}" class="cc_detailclose" style="float:right;" onclick="$(\'cc:detail\').toggle();">\
		X</div>\
		#{detail}\
		</div>\
		');	
