jQuery(document).ready(function() { jQuery('#tdl_portfolio_upload_images').click(function() { var tbURL = jQuery('#add_image').attr('href'); if(typeof tbURL === 'undefined') { tbURL = jQuery('#content-add_media').attr('href'); } tb_show('', tbURL); return false; }); jQuery('#tdl_background_image_button').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_background_image').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_thumb_button').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_thumb').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_image_button').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_image').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_image_button2').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_image2').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_image_button3').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_image3').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_image_button4').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_image4').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_image_button5').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_image5').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_image_button6').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_image6').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_image_button7').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_image7').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_image_button8').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_image8').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_image_button9').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_image9').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_portfolio_image_button10').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_portfolio_image10').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_video_poster_button').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_video_poster').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); jQuery('#tdl_audio_poster_button').click(function() { window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#tdl_audio_poster').val(imgurl); tb_remove(); } tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true'); return false; }); });