<?php 
$d = 0; // search depth;
while (!file_exists(str_repeat('../', $d) . 'wp-config.php')) if (++$d > 99) exit;
$wp_config = str_repeat('../', $d) . 'wp-config.php';
require_once($wp_config);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>

<script type="text/javascript">
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}


function insertMisc() {
	
	var miscElement = getCheckedValue(document.getElementsByName('flxmisc'));

		if (miscElement != 0){
			
			if (miscElement == 'clear') {
			misccode = '<div style="clear:both;"><span style="display: none;">.</span></div>';
			}
			
			if (miscElement == 'space20') {
			misccode = '<div style="clear:both;height:20px;"><span style="display: none;">.</span></div>';
			}
			
			if (miscElement == 'space30') {
			misccode = '<div style="clear:both;height:30px;"><span style="display: none;">.</span></div>';
			}
			
			if (miscElement == 'space40') {
			misccode = '<div style="clear:both;height:40px;"><span style="display: none;">.</span></div>';
			}
			
			if (miscElement == 'space50') {
			misccode = '<div style="clear:both;height:50px;"><span style="display: none;">.</span></div>';
			}

			
		
		
		
		}

		
		if ( miscElement == 0 ){
			tinyMCEPopup.close();
		}
	if(window.tinyMCE) {
		if (typeof tinyMCEPopup.editor.insertContent == 'function') { // tinymce 4.x
			tinyMCEPopup.editor.insertContent(misccode);
		} else { // tinymce 3.x
			window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, misccode);
		} 
		
		tinyMCEPopup.editor.execCommand('mceRepaint');
		tinyMCEPopup.close();
	}

	return;
}
</script>

<title>FlexSqueeze Miscellaneous Elements</title>
<style type="text/css">
td img:hover, input:hover {cursor:pointer;}
td {border:1px solid #fff;}
.cancelbtn, .submitbtn {padding:5px;}
.cancelbtn:hover, .submitbtn:hover {background-color:#555;color:#fff;}

</style>
</head>

<body onLoad="tinyMCEPopup.executeOnLoad('init();');">
<form action="#" method="post" name="flexmisc">
  <table id="boxchoices" width="664" cellpadding="8">
    <tr>
      <td style="text-align:center;" width="33%"><label>
        <strong>Clear Floats</strong><br />
        Use this when an element is aligned left or right to force the next content below the element or to force a content box to surround an aligned element (such as a badge image)<br />
        <input type="radio" name="flxmisc" value="clear" />
       </label></td>
        
        <td style="text-align:center;" width="33%"><label>
        <strong>20px Spacer</strong><br />Insert for 20 pixels of blank space<br />
        <input type="radio" name="flxmisc" value="space20" />
       </label></td>
       
       <td style="text-align:center;" width="33%"><label>
        <strong>30px Spacer</strong><br />Insert for 30 pixels of blank space<br />
        <input type="radio" name="flxmisc" value="space30" />
       </label></td>
    </tr>
    
    <tr>
      <td style="text-align:center;" width="33%"><label>
        <strong>40px Spacer</strong><br />Insert for 40 pixels of blank space<br />
        <input type="radio" name="flxmisc" value="space40" />
       </label></td>
        
        <td style="text-align:center;" width="33%"><label>
        <strong>50px Spacer</strong><br />Insert for 50 pixels of blank space<br />
        <input type="radio" name="flxmisc" value="space50" />
       </label></td>
       
       <td style="text-align:center;" width="33%"></td>
    </tr>
    
    
    
     
    <tr>
      <td colspan="3">
        <input name="cancel" class="cancelbtn" type="button" value="Cancel"  onClick="tinyMCEPopup.close();" />
        
        <input name="submit" class="submitbtn" type="button" value="Insert Element" onClick="insertMisc();" />
        
        
      </td>
    </tr>
  </table>
</form>


</body>
</html>