function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}

function ezinesubmit()
{
	var emailvalue = document.forms[0].cpSys_Html_Form_email_address_savicom.value;
	var termsaccept = document.forms[0].cpSys_Html_Form_termsaccept.checked; 
	if (emailvalue.indexOf('@') > 1 && termsaccept == 1) {
		window.location='http://i.ms00.net/subscribe?list=RaganNewsstand&msgid=_MSGID_&redirect=http://www.prdaily.com/Main/eNewsletterThankyou.aspx&sublist=30&subscribe_button_name=Join&server_action:subscribe=Sign%20up&email_address=' + emailvalue;
	} else {
		if (termsaccept != 1) {
			alert('Please accept terms of use.');
		} else {
			alert('Please enter your e-mail.');
		}
	}
	return false;
}


function euezinesubmit()
{
	var emailvalue = document.forms[0].cpSys_Html_Form_euemail_address_savicom.value;
	var termsaccept = document.forms[0].cpSys_Html_Form_eutermsaccept.checked; 
	if (emailvalue.indexOf('@') > 1 && termsaccept == 1) {
		window.location='http://i.ms00.net/subscribe?list=RaganNewsstand&msgid=_MSGID_&redirect=http://www.prdaily.eu/PRDailyEU/eNewsletterThankyou.aspx&sublist=27&subscribe_button_name=Join&server_action:subscribe=Sign%20up&email_address=' + emailvalue;
	} else {
		if (termsaccept != 1) {
			alert('Please accept terms of use.');
		} else {
			alert('Please enter your e-mail.');
		}
	}
	return false;
}

$(function () {

function test_mobi() {
	var test_mobile=false;

	if (/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) test_mobile=true;

	video_type = "flash";

	if((navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPad/i))) video_type = "html5"; else if(test_mobile) video_type = "directlink";

	//if (navigator.userAgent.match(/android 2.[3-9]|android 3.\d/i)) alert('hello flash enabled browser!!!!');
	
	//if (video_type != "flash") alert (video_type);
	

/*	var image_src="http://www.ragan.com/Uploads/Imports/Resource.ashx?sn=mtvgrab";
	var video_src ="http://ragan.vo.llnwd.net/o16/VideoCollector/mp4/TomFishman.mp4";

document.write('-----------------Test start here-----------------<br />');

if (video_type == "html5")  {document.write('<video id="aVid" width="320" height="240" controls="controls" poster="'+image_src+'" onclick="this.play();"><source src="'+video_src+'" type="video/mp4"></source></video>'); document.write('--------------------------HTML5-----------------------------<br />');}

if (video_type == "directlink")  {document.write('<a href="'+video_src+'"><img src="'+image_src+'" /></a>'); document.write('--------------------------DIRECT LINK-------------------------<br />');}

*document.write('-----------------Test end here-----------------<br />' + navigator.userAgent);*/
	return video_type;

}





   if ($("#usrnm").length > 0) {
        var var_usrnm = $("#usrnm").html();
        if (var_usrnm.length > 3) {
            $('.left_box_abstract').attr("style", "display:none;");
            $('#topnav_fbconnect_link').attr("style", "display:none;");
        }
		var var_usrr = $("#usrar").html();
		if (var_usrr.indexOf("956bc93f-b3d2-46e5-ace5-c6ad044e2863") > -1) {
            $('.b956bc93f').removeClass();
            $('.a956bc93f').removeClass();
			
			var domain = window.location.hostname.toLowerCase();
			domain = domain.replace("www.", "");
			var audience = "Main";
			var AudID_qf = "199198F64331417EB952215FC875F5BC";
			if (domain == "prdaily.eu" || domain == "prdaily.eu.com") {
				audience = "PRDailyEU";
				AudID_qf = "199198F64331417EB952215FC875F5BC";
			}
			
            $('#topnav_spaceformembercenter').html('<a href="/'+audience+'/MemberCenter.aspx">Member Center</a> | ');
        } else {
			$('#topnav_spaceformembercenter').html('<a href="https://www.qfie.com/ragan2/clsRAGANLookup.asp?strAspReason=101&SiteID=&AudID='+AudID_qf+'">My Account</a> | ');
		}

    }
	
	var scritp_path = ($(location).attr('href'));
	scritp_path = scritp_path.toLowerCase();
	
	if (scritp_path.indexOf('editors.aspx') > -1 || scritp_path.indexOf('authorid=') > -1) {
		$('#Editor').attr('class', 'a_nav_links a_nav_selected');
		$('#Main').attr('class', 'a_nav_links');
	}

	if (scritp_path.indexOf('video') > -1) {
		$('#Video').attr('class', 'a_nav_links a_nav_selected');
		$('#Main').attr('class', 'a_nav_links');
	}


	/*Mixing video with articles*/
    /*if ($('.topic_article_list').eq(1)) {
        var videbox = '<div id="video_box_full">' + $('#video_box_full').html() + '</div>';
        $('#video_box_full').remove();
        $('.topic_article_list').eq(1).after(videbox);
    }*/

    /*Date part*/

    var current_date = new Date();

    var month_names = new Array();
    month_names[month_names.length] = "January";
    month_names[month_names.length] = "February";
    month_names[month_names.length] = "March";
    month_names[month_names.length] = "April";
    month_names[month_names.length] = "May";
    month_names[month_names.length] = "June";
    month_names[month_names.length] = "July";
    month_names[month_names.length] = "August";
    month_names[month_names.length] = "September";
    month_names[month_names.length] = "October";
    month_names[month_names.length] = "November";
    month_names[month_names.length] = "December";

    var day_names = new Array();
    day_names[day_names.length] = "Sunday";
    day_names[day_names.length] = "Monday";
    day_names[day_names.length] = "Tuesday";
    day_names[day_names.length] = "Wednesday";
    day_names[day_names.length] = "Thursday";
    day_names[day_names.length] = "Friday";
    day_names[day_names.length] = "Saturday";

    currentDate_value = day_names[current_date.getDay()] + ", " + month_names[current_date.getMonth()] + " " + current_date.getDate() + ", " + current_date.getFullYear();

    $('#todays_date').html(currentDate_value);

    if ($('.sc_retweet_list').length) {
        var i_count_reseet = 0;
        /*var timevar_object = new Date();*/
        $('.sc_retweet_list').each(function () {
            /*timevar = timevar_object.getTime();*/
            i_count_reseet++;
            tweetmeme_style = 'compact';
            tweetmeme_source = 'MarkRaganCEO';
            tweetmeme_service = 'bit.ly';
            //  alert($(this).attr("layout"));
            if ($(this).attr("retweetlink")) { tweetmeme_url = $(this).attr("retweetlink").replace(":", "%3A"); } else { tweetmeme_url = location.href.replace(":", "%3A"); }
            if ($(this).attr("alt_retweetlink")) { if ($(this).attr("alt_retweetlink") != '') { tweetmeme_url = $(this).attr("alt_retweetlink").replace(":", "%3A"); } }

            $(this).append('');
            $(this).append('<iframe scrolling="no" height="25" frameborder="0" width="90" src="http://api.tweetmeme.com/button.js?url=' + tweetmeme_url + '&amp;style=' + tweetmeme_style + '&amp;source=' + tweetmeme_source + '&amp;service=' + tweetmeme_service + '&amp;b=1' + '"></iframe>');
        });
    }


    if ($('.comments_count table tbody tr td div').length) {
        var total_comments_on_page = $('.comments_count table tbody tr td div').html();
        $('.comments_count').replaceWith(' | <span class="articles_top_comments">' + total_comments_on_page + ' Comments</span>');
        $('.comments_count2').append(total_comments_on_page);
    }
    if ($('.sc_facebook_like').length) {
        counter_for_facebook_like = 10;
        var iframe_content = "";
        /*var timevar_object = new Date();*/
        $(".sc_facebook_like").each(function () {
            /*timevar = timevar_object.getTime();*/
            //  alert($(this).attr("layout"));
            if ($(this).attr("fblink")) { linkforfacebook = escape($(this).attr("fblink")); } else { linkforfacebook = escape(location.href); }
            if ($(this).attr("fbheight")) { heightforfacebook = $(this).attr("fbheight"); } else { heightforfacebook = 65; }
            /*alt_fblink*/
            if ($(this).attr("alt_fblink")) { if ($(this).attr("alt_fblink") != '') { linkforfacebook = escape($(this).attr("alt_fblink")); } }
            $(this).append('');
            iframe_content = '<iframe src="http://www.facebook.com/plugins/like.php?href=' + linkforfacebook + '&amp;layout=' + $(this).attr("layout") + '&amp;show_faces=true&amp;width=' + $(this).attr("fbwidth") + '&amp;action=like&amp;colorscheme=light&amp;height=' + heightforfacebook + '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' + $(this).attr("fbwidth") + 'px; height:' + heightforfacebook + 'px;" allowTransparency="true"></iframe>';
            $(this).append(iframe_content);
        });
    }

    if ($('.sc_facebook_like_comp').length) {
        counter_for_facebook_like = 10;
        var iframe_content = "";
        /*var timevar_object = new Date();*/
        $(".sc_facebook_like_comp").each(function () {
            /*timevar = timevar_object.getTime();*/
            //  alert($(this).attr("layout"));
            if ($(this).attr("fblink")) { linkforfacebook = escape($(this).attr("fblink")); } else { linkforfacebook = escape(location.href); }
            if ($(this).attr("fbheight")) { heightforfacebook = $(this).attr("fbheight"); } else { heightforfacebook = 65; }
            /*alt_fblink*/
            if ($(this).attr("alt_fblink")) { if ($(this).attr("alt_fblink") != '') { linkforfacebook = escape($(this).attr("alt_fblink")); } }
            $(this).append('');
            iframe_content = '<iframe src="http://www.facebook.com/plugins/like.php?href=' + linkforfacebook + '&amp;layout=' + $(this).attr("layout") + '&amp;show_faces=true&amp;width=' + $(this).attr("fbwidth") + '&amp;action=like&amp;colorscheme=light&amp;height=' + heightforfacebook + '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' + $(this).attr("fbwidth") + 'px; height:' + heightforfacebook + 'px;" allowTransparency="true"></iframe>';
            $(this).append(iframe_content);
        });
    }


    /*if ($('.dynamic_content_add')) {
        $('.dynamic_content_add').each(function () {
            var tmp_javascript_autonumber = $(this).attr('autonumber');
            var tmp_javascript_str = document.createElement('script');
            tmp_javascript_str.src = 'http://web.ragan.com/comments/rss/jsservice.php?anumb='+tmp_javascript_autonumber;
            tmp_javascript_str.type = 'text/javascript';
            document.getElementById(tmp_javascript_autonumber).appendChild(tmp_javascript_str);
            /*$(this).append(tmp_javascript_str);
        });
    }*/

    if ($('.sc_tweetememe').length) {
        var temp_url=location.href;
		temp_url=temp_url.toLowerCase();
		if (temp_url.indexOf("tomorrow") <=0) {
			$('.sc_tweetememe').each(function () {
				tweetmeme_style = 'normal';
				tweetmeme_source = 'MarkRaganCEO';
				tweetmeme_service = 'bit.ly';
				tweetmeme_url_temp = location.href.split('#')[0];
				tweetmeme_url_temp_prefix = 'http://www.ragan.com/Main/Articles/';
				if (tweetmeme_url_temp.split('/')[4].toLowerCase() == 'video') { tweetmeme_url_temp_prefix = 'http://www.ragan.com/Main/Video/'; }
				tweetmeme_url_temp = tweetmeme_url_temp_prefix + tweetmeme_url_temp.split('/')[5];
				tweetmeme_url = tweetmeme_url_temp.replace(":", "%3A");
				if ($(this).attr("retweetlink")) { tweetmeme_url = $(this).attr("retweetlink").replace(":", "%3A"); }
				if ($(this).attr("alt_retweetlink")) { if ($(this).attr("alt_retweetlink") != '') { tweetmeme_url = $(this).attr("alt_retweetlink").replace(":", "%3A"); } }
				$(this).append('<iframe scrolling="no" width="50" height="61" frameborder="0" src="http://api.tweetmeme.com/button.js?url=' + tweetmeme_url + '&amp;style=' + tweetmeme_style + '&amp;source= ' + tweetmeme_source + ' &amp;service=' + tweetmeme_service + '&amp;b=1"></iframe>');
			});
		}
    }
	
	 if ($('.sc_tweetememe_comp').length) {
        var temp_url=location.href;
		temp_url=temp_url.toLowerCase();
		if (temp_url.indexOf("tomorrow") <=0) {
			$('.sc_tweetememe_comp').each(function () {
				tweetmeme_style = 'compact';
				tweetmeme_source = 'MarkRaganCEO';
				tweetmeme_service = 'bit.ly';
				tweetmeme_url_temp = location.href.split('#')[0];
				tweetmeme_url_temp_prefix = 'http://www.ragan.com/Main/Articles/';
				if (tweetmeme_url_temp.split('/')[4].toLowerCase() == 'video') { tweetmeme_url_temp_prefix = 'http://www.ragan.com/Main/Video/'; }
				tweetmeme_url_temp = tweetmeme_url_temp_prefix + tweetmeme_url_temp.split('/')[5];
				tweetmeme_url = tweetmeme_url_temp.replace(":", "%3A");
				if ($(this).attr("retweetlink")) { tweetmeme_url = $(this).attr("retweetlink").replace(":", "%3A"); }
				if ($(this).attr("alt_retweetlink")) { if ($(this).attr("alt_retweetlink") != '') { tweetmeme_url = $(this).attr("alt_retweetlink").replace(":", "%3A"); } }
				$(this).append('<iframe scrolling="no" width="90" height="23" frameborder="0" src="http://api.tweetmeme.com/button.js?url=' + tweetmeme_url + '&amp;style=' + tweetmeme_style + '&amp;source= ' + tweetmeme_source + ' &amp;service=' + tweetmeme_service + '&amp;b=1"></iframe>');
			});
		}
    }

    if ($('.author_name').length) {
        $(".author_name").each(function () {
            // alert('Evoga: ' + $(this).children("a").html());
            if ($(this).children("a").html() == '1 - None')
                $(this).remove();
        });
    }

    if ($('.author').length) {
        $(".author").each(function () {
            // alert($(this).html());
            if (($(this).html() == ' &nbsp;&nbsp;|&nbsp;&nbsp; 1 - None') || ($(this).html() == '1 - None'))
                $(this).remove();
        });
    }

    $("#accordion").tabs("#accordion div.pane", { tabs: 'h2', effect: 'slide', initialIndex: null });
    $("ul.tabs").tabs("div.tabs_panes > div");



    /*if video player is in*/
    if ($('.videohomepage_player').length > 0) {

        /*Populate video*/
        var video_source = $('.video_source').html();
        var video_image = $('.video_image').html();
        var ragan_player = '<object height="350" width="450"><param value="http://www.ragan.com/Uploads/Imports/player/player.swf?file=http://ragan.vo.llnwd.net/o16/VideoCollector/' + video_source + '&amp;logo=http://www.ragan.com/Uploads/Imports/player/watermarkragantv.png&amp;image=' + video_image + '&amp;abouttext=About%20Ragan%20Communications&amp;aboutlink=http://www.ragan.com/&amp;fullscreen=true&amp;stretching=uniform&amp;bufferlength=5&amp;plugins=googlytics-1" name="movie"><param value="true" name="allowFullScreen"><param value="always" name="allowscriptaccess"><embed allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://www.ragan.com/Uploads/Imports/player/player.swf?file=http://ragan.vo.llnwd.net/o16/VideoCollector/' + video_source + '&amp;image=' + video_image + '&amp;logo=http://www.ragan.com/Uploads/Imports/player/watermarkragantv.png&amp;abouttext=About%20Ragan%20Communications&amp;aboutlink=http://www.ragan.com/&amp;fullscreen=true&amp;stretching=uniform&amp;bufferlength=5&amp;plugins=googlytics-1" width="450" height="350"></object>'

		var player_code_question = test_mobi();
		//alert ('Question is ' + player_code_question + ' ' + video_source.replace('/VideoCollector/', '/VideoCollector/mp4/').replace('.flv', '.mp4'));
		if (player_code_question != "flash") {
			//alert('It is not flash:' + video_source);
			if (video_source.indexOf('.flv') > 0)  {mobi_video_src = 'http://ragan.vo.llnwd.net/o16/mp4/' + video_source.replace(".flv", ".mp4");} else {
				mobi_video_src = 'http://ragan.vo.llnwd.net/o16//VideoCollector/' + video_source;}
			mobi_image_src = video_image;
			
			if (player_code_question == 'html5') {
				//alert('video code for html5 executed and video source is:' + mobi_video_src);
				ragan_player = '<video id="aVid" width="320" height="240" controls="controls" poster="'+mobi_image_src+'" onclick="this.play();"><source src="'+mobi_video_src+'" type="video/mp4"></source></video>';
			} else {
				ragan_player = '<a href="'+mobi_video_src+'"><img src="'+mobi_image_src+'" /></a>';
			}
			
		}



        $('.videohomepage_player').append(ragan_player);

        // create custom animation algorithm for jQuery called "drop" 
        $.easing.drop = function (x, t, b, c, d) {
            return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
        };


        // loading animation
        $.tools.overlay.addEffect("drop", function (css, done) {

            // use Overlay API to gain access to crucial elements
            var conf = this.getConf(),
			   overlay = this.getOverlay();

            // determine initial position for the overlay
            if (conf.fixed) {
                css.position = 'fixed';
            } else {
                css.top += $(window).scrollTop();
                css.left += $(window).scrollLeft();
                css.position = 'absolute';
            }

            // position the overlay and show it
            overlay.css(css).show();

            // begin animating with our custom easing
            overlay.animate({ top: '+=55', opacity: 1, width: '+=20' }, 400, 'drop', done);

            /* closing animation */
        }, function (done) {
            this.getOverlay().animate({ top: '-=55', opacity: 0, width: '-=20' }, 300, 'drop', function () {
                $(this).hide();
                done.call();
            });
        }
		);

     /*   $("a[rel]").overlay({
            effect: 'drop',
            mask: '#789'
        });*/

    }

    /*Video detail page populate vide0 record*/
    if ($('.video_record_image').length > 0) {
        var video_source = 'http://ragan.vo.llnwd.net/o16/VideoCollector/' + $('.video_record_video').html();
        var video_image = $('.video_record_image img').attr('src');

        if ((video_image.indexOf("http://") < 0) && (video_image.indexOf("Uploads/") < 0)) { 
			video_image = 'http://www.ragan.com' + '/Uploads/Imports/Images/VideoCollector' + video_image; 
			video_image = video_image.replace("Media/VideoCollector/", "");
		}

		/*if (video_image.indexOf("http://") < 0) { 
			if (video_image.indexOf("Uploads/") < 0) {
				if (video_image.indexOf("/Resource.ashx") >= 0) { video_image = '' + video_image; } else { 
					video_image = '/Uploads/Imports' + video_image;
				}
			} else {
				video_image = video_image;
			}
		}  */          


		if (video_image.indexOf("/Resource.ashx") >= 0) { video_image = '' + video_image; } else { }

        //alert('video_source: ' + video_source + ' video_image: ' +video_image );
        var ragan_player_code = '<object height="350" width="450"><param value="http://www.ragan.com/Uploads/Imports/player/player.swf?file=' + video_source + '&amp;logo=http://www.ragan.com/Uploads/Imports/player/watermarkragantv.png&amp;image=' + video_image + '&amp;abouttext=About%20Ragan%20Communications&amp;aboutlink=http://www.ragan.com/&amp;fullscreen=true&amp;stretching=uniform&amp;bufferlength=5&amp;plugins=googlytics-1" name="movie"><param value="true" name="allowFullScreen"><param value="always" name="allowscriptaccess"><param name="wmode" value="transparent" /><embed allowfullscreen="true" allowscriptaccess="always" wmode="transparent" type="application/x-shockwave-flash" src="http://www.ragan.com/Uploads/Imports/player/player.swf?file=' + video_source + '&amp;image=' + video_image + '&amp;logo=http://www.ragan.com/Uploads/Imports/player/watermarkragantv.png&amp;abouttext=About%20Ragan%20Communications&amp;aboutlink=http://www.ragan.com/&amp;fullscreen=true&amp;stretching=uniform&amp;bufferlength=5&amp;plugins=googlytics-1" width="450" height="350"></object>';
		var record_url =  location.href.split('#')[0];
		var end_of_record_url_array = record_url.split('_');
		record_url = end_of_record_url_array[end_of_record_url_array.length-1];
		
		
		var player_code_question = test_mobi();
		//alert ('Question is ' + player_code_question + ' ' + video_source.replace('/VideoCollector/', '/VideoCollector/mp4/').replace('.flv', '.mp4'));
		if (player_code_question != "flash") {
			//alert('It is not flash:' + video_source);
			if (video_source.indexOf('.flv') > 0)  {
				mobi_video_src = video_source.replace("/VideoCollector/", "/mp4/");
				mobi_video_src = mobi_video_src.replace(".flv", ".mp4");
			} else {
				mobi_video_src = video_source;
			}			
			mobi_image_src = video_image;
			
			if (player_code_question == 'html5') {
				//alert('video code for html5 executed and video source is:' + mobi_video_src);
				ragan_player_code = '<video id="aVid" width="320" height="240" controls="controls" poster="'+mobi_image_src+'" onclick="this.play();"><source src="'+mobi_video_src+'" type="video/mp4"></source></video>';
			} else {
				ragan_player_code = '<a href="'+mobi_video_src+'"><img src="'+mobi_image_src+'" /></a>';
			}
			
		}

		
		
		
		
		ragan_player = ragan_player_code

		$('.video_record_image').html(ragan_player);
		var video_caption = '<br /><br />' + $('.details_summary').html() + '<br /><br /><a class="url_button"><img src="/Uploads/Imports/Images/url_button.jpg" width="65" height="20" border="0" /></a> <a class="embed_button"><img src="/Uploads/Imports/Images/embed_button.jpg" width="65" height="20" border="0" /></a><div class="url_divtag" style="color:#999999; border:solid 0px #999999; FONT-SIZE: 10px;">URL <textarea id="URLEmbed_Video" style="FONT-SIZE: 10px; height: 16px; overflow:hidden; width:400px; border:solid 1px #999999;" name="URLEmbed" onClick="SelectAll(\'URLEmbed_Video\');" readOnly>' + record_url + '</textarea> </div> <br /> <div class="embed_divtag" style="color:#999999; border:solid 0px #999999; FONT-SIZE: 10px;">EMBED: <textarea id="Embed_Video" style="FONT-SIZE: 10px; height: 50px; overflow:hidden; border:solid 1px #999999; width:600px; vertical-align: top;" name="Embed" onClick="SelectAll(\'Embed_Video\');" readOnly><div class="article_video_embed">'+ ragan_player_code +'</div></textarea></div>';
		$('.details_summary').html(video_caption);
	
		/*toggle (show/hide) effect*/

		$(".url_button").click(function () {
		$(".url_divtag").toggle('slow');
		});

		$(".embed_button").click(function () {
		$(".embed_divtag").toggle('slow');
		});
		/*toggle (show/hide) effect end*/


    }

    if ($('.video_record_image_ls').length > 0) {
        $('.video_record_image_ls').each(function () {
            video_image = $(this).attr('src');
            if ((video_image.indexOf("http://") < 0)  && (video_image.indexOf("Uploads/") < 0)) { 
				video_image = '/Uploads/Imports/Images/VideoCollector' + video_image; 
				video_image = video_image.replace("Media/VideoCollector/", "");
			}
            if ((video_image.indexOf("/Resource.ashx") >= 0) || (video_image.indexOf("http://") < 0)) { video_image = 'http://www.prdaily.com' + video_image; } else { }
            $(this).attr('src', video_image);
        });
    }


    if ($('.video_record_ls').length > 0) {
        $('.video_record_image_ls:first').attr('width', '320');
        $('.video_record_ls:first').attr('class', 'video_record_ls video_record_ls_first');
        var video_first_html = $('.video_record_ls:first').html();
        $('.video_record_ls:first').html('<div class="article_featured_box_top"><img src="/Uploads/Imports/Images/featuredarticle_top.jpg" alt="featuredarticle_top"></div><div class="article_featured_rest"><div>' + video_first_html + '</div></div><div class="article_featured_box_bottom"><img src="/Uploads/Imports/Images/featuredarticle_bottom.jpg" alt="featuredarticle_bottom"></div>');
    }

    if ($('.video_list_full a img').length > 0) {
        var imgsrc_topic = $('.video_list_full a img').attr('src')
        if (imgsrc_topic.indexOf('http://www.ragan.com') > -1) imgsrc_topic = imgsrc_topic.replace("http://www.ragan.com", "");
        if (imgsrc_topic.indexOf('/Media') > -1 && imgsrc_topic.indexOf('http') == -1) {
			imgsrc_topic = imgsrc_topic.split('/')[0];
			$('.video_list_full a img').attr('src', '/Uploads/Imports/Images/VideoCollector/' + imgsrc_topic);
		}
    }
	
	if ($('.CpButton').length > 0) {
		 $('.CpButton').removeClass().attr("class", "registerbutton").attr("style", "").attr("style", "").attr("onmouseout", "").attr("onmouseover", "");
	}

});

/*$(document).ready(function () {

    $("a[rel]").overlay({
        effect: 'drop',
        mask: '#789'
    });
});*/
	
