//ボックス
jQuery(document).ready(function(){
		debugging = true;
 
		$.fn.ceebox.videos.base.param.allowScriptAccess = "sameDomain" //added to kill the permissions problem
		$.extend($.fn.ceebox.videos,{
			uctv:{
				siteRgx: /uctv\.tv\/search\-details/i, 
				idRgx: /(?:showID=)([0-9]+)/i, 
			}
		});
		//$().ceebox(); //used to test to make sure the init call works.
		//$(".ceebox").ceebox({boxColor:'#fff',borderColor:'#525252',textColor:'#333',videoJSON:"js/humor.json"});
		$(".ceebox").ceebox({borderColor:'#dcdcdc',boxColor:"#fff"});
		//$("map").ceebox({fadeOut:"slow",fadeIn:"slow",onload:function(){$("#cee_box").animate({backgroundColor:"#F00"},function(){$(this).animate({backgroundColor:"#fff"})});}});		
		$("map").ceebox();		
		$(".ceebox2").ceebox({unload:function(){$("body").css({background:"#ddf"})}});
		//window.console.log($.fn.ceebox.videos.colbertFull)
		//$("body").ceebox(); //uncomment and every link on the page is in one gallery
		var testhtml = "<a href='http://balsaman.org' title='Balsa Man'>Balsa Man</a>"
		var testhtml2 = "<div style='padding:20px;text-align:center'><h2>Hi I am some content built as a javascript variable!</h2><p><a href='#' class='cee_close'>Close Me</a></p></div>"
		$("#testlink").click(function(){
			$.fn.ceebox.overlay();
			$.fn.ceebox.popup(testhtml,{onload:true,htmlWidth:600,htmlHeight:450});
			return false;		  
		});
		$("#testlink2").click(function(){
			$.fn.ceebox.overlay();
			$.fn.ceebox.popup(testhtml2,{width:600,height:400});
			return false;
		});
		//$.fn.ceebox.popup(testhtml,{onload:true,htmlWidth:600,htmlHeight:450});
	});

function apnd(drpid,link,url) {
	$("#"+drpid).empty();
	var tag1 = document.getElementById(drpid);
	
	tag1.removeAttribute("onmouseover");

  	/* A要素を新たに生成 */

	var ancdom = document.createElement("a");

	ancdom.href = link;
	ancdom.target = "_blank";
	
	/* img要素を新たに生成 */
	var img = document.createElement("img");;
	img.src = url;
	img.className = "imgc";
	
			/* 画面表示 */

	ancdom.appendChild(img);
	tag1.appendChild(ancdom);
	
	$(".ceebox").ceebox();
	
}

function apnd2(drpid,link,txt) {
	$("#"+drpid).empty();
	var tag1 = document.getElementById(drpid);
	
	tag1.removeAttribute("onmouseover");

  	/* A要素を新たに生成 */

	var ancdom = document.createElement("a");

	ancdom.href = link;
	ancdom.target = "_blank";
	
	
	/* テキストノードを新たに生成 */
	var text = document.createTextNode(txt);
	
			/* 画面表示 */

	ancdom.appendChild(text);
	tag1.appendChild(ancdom);
	
	$(".ceebox").ceebox();

}

function apnd3(drpid,txt,page,br,setsu,sl,shop,count_result) {
	$("#"+drpid).empty();
	var tag1 = document.getElementById(drpid);
	
	tag1.removeAttribute("onmouseover");

  	/* A要素を新たに生成 */

	var ancdom = document.createElement("a");
	
	if(shop >= 1){
		ancdom.href = "search.php?key="+txt+"&page="+page+"&br="+br+"&shop="+shop+"&count_result="+count_result;
	}else	{
		ancdom.href = "http://www.chaos-collection.com/pl/page.php?key="+txt+"&page="+page+"&br="+br;
	}
	ancdom.rel = "nofollow";
	
	
	/* テキストノードを新たに生成 */
	if(sl !== 2){
	var text = document.createTextNode(page);
	}else	{
	var text = document.createTextNode(setsu);
	}
			/* 画面表示 */

	ancdom.appendChild(text);
	tag1.appendChild(ancdom);

}

function apnd4(drpid,link,url) {
	$("#"+drpid).empty();
	var tag1 = document.getElementById(drpid);
	
	tag1.removeAttribute("onmouseover");

  	/* A要素を新たに生成 */

	var ancdom = document.createElement("a");

	ancdom.href = link;
	
	/* img要素を新たに生成 */
	var img = document.createElement("img");;
	img.src = url;
	img.border = 0;
	
			/* 画面表示 */

	ancdom.appendChild(img);
	tag1.appendChild(ancdom);
	
}
