function show_lightbox_popup(lightbox_id,ajaxurl){//this function shows the lightbox and gets content via AJAX
	jQuery.noConflict();
	var lightbox_selector = "body #comments_handling_lightbox";
	var lightbox_exists = jQuery(lightbox_selector).length;
	if (lightbox_exists == 0){//if no comments lightbox exists then create it
		var lightbox_tags = '<div id="comments_handling_lightbox" class="lightbox_container is_hidden"><div class="lightbox_window"><div class="lightbox_content"></div></div></div>';
		jQuery("body").append(lightbox_tags);
	}
	if (jQuery(lightbox_selector).hasClass("is_hidden")){
		jQuery(lightbox_selector).toggleClass("is_hidden");
		jQuery(lightbox_selector).addClass("is_visible");
	}
	//AJAX starts here
	jQuery.get(ajaxurl,{},function(data){
											lightbox_content_window = "body #comments_handling_lightbox .lightbox_window .lightbox_content";
											jQuery(lightbox_content_window).html(data);
										});
}

function show_lightbox_popup_2(evt,ajaxurl){//this function shows the lightbox and gets content via AJAX
	jQuery.noConflict();
	var browser=navigator.appName;
	if (browser != "Microsoft Internet Explorer"){
		evt.preventDefault();
	}
	var lightbox_selector = "body #comments_handling_lightbox";
	var lightbox_exists = jQuery(lightbox_selector).length;
	if (lightbox_exists == 0){//if no comments lightbox exists then create it
		var lightbox_tags = '<div id="comments_handling_lightbox" class="lightbox_container is_hidden"><div class="lightbox_window"><div class="lightbox_content"></div></div></div>';
		jQuery("body").append(lightbox_tags);
	}
	if (jQuery(lightbox_selector).hasClass("is_hidden")){
		jQuery(lightbox_selector).toggleClass("is_hidden");
		jQuery(lightbox_selector).addClass("is_visible");
	}
	//AJAX starts here
	jQuery.get(ajaxurl,{},function(data){
											lightbox_content_window = "body #comments_handling_lightbox .lightbox_window .lightbox_content";
											jQuery(lightbox_content_window).html(data);
										});
	if (browser == "Microsoft Internet Explorer"){
		return false;
	}
}

function close_comment_lightbox(evt,lb_selector){ //this function closes the lightbox
	jQuery.noConflict();
	var browser=navigator.appName;
	if (browser != "Microsoft Internet Explorer"){
		evt.preventDefault();
	}

	if (jQuery(lb_selector).hasClass("is_visible")){
		jQuery(lb_selector).toggleClass("is_visible");
		jQuery(lb_selector).addClass("is_hidden");
	}

	if (browser == "Microsoft Internet Explorer"){
		return false;
	}
}

function popup_add_comment_lightbox(evt,obj_id,url){ //this function is called from the browser page to show the lightbox
	var browser=navigator.appName;

	if (browser != "Microsoft Internet Explorer"){
		evt.preventDefault();
	}
	var video_id = jQuery("#current_video_id_"+obj_id).val();
	var content_url = url + video_id;
	show_lightbox_popup(video_id,content_url);

	if (browser == "Microsoft Internet Explorer"){
		return false;
	}
}

/*
function popup_add_comment_lightbox(evt,obj_id,url){ //this function is called from the browser page to show the lightbox
	var browser=navigator.appName;
	var video_id = 	document.getElementById("current_video_id_"+obj_id).value;

	if (browser != "Microsoft Internet Explorer"){
		evt.preventDefault();
	}

	var content_url = url + video_id;
	show_lightbox_popup(video_id,content_url);

	if (browser == "Microsoft Internet Explorer"){
		return false;
	}
}
/*
function popup_show_comments_lightbox(evt,video_id, url){
	var browser=navigator.appName;
	if (browser != "Microsoft Internet Explorer"){
		evt.preventDefault();
	}
	var lb_id = lightbox_id;
	if (browser == "Microsoft Internet Explorer"){
		var body_width = jQuery('body').width();
		var body_height = jQuery('body').height();
		jQuery(lb_id).css("height",body_height);
		jQuery(lb_id).css("width",body_width);
	}
	jQuery("#lightbox_content").html("");
	jQuery(lb_id).css("display","block");
	//jQuery.get(show_url,function(data){jQuery("#lightbox_content").html(data);});
	if (browser == "Microsoft Internet Explorer"){
		return false;
	}
}
*/
