How to use wp_get_attachment with CDN

I am trying to make a photo appear within the code of a few plugins here.

I keep running into this problem though.. I can't get the URLs to rewrite for CDN usage.

Example:

<?php
    $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
    if(function_exists('has_post_thumbnail') && has_post_thumbnail() && !$hideThumbnail){
	?><a href="<?php the_permalink(); ?>"><?php
	$img_id=$pex_page->layout=='full'?'featured_box_img_full':'featured_box_img';
	the_post_thumbnail($img_id, array('class'=>'img-frame'));
	?></a>
	<?php

It displays an image like this "http://site.com/secure/wp-content/uploads/2013/10/image.jpg" but I want it to display like "http://cdn.site.com/secure/wp-content/uploads/2013/10/image.jpg".

Any idea how to change this code to display the cdn. before the domain for the images to use my CDN? I use W3 cache plugin but it won't rewrite this...

THANKS!!!!