$(document).ready(function(){
		// Dialog			
		$('#dialog').dialog({
			autoOpen: false,
			modal: true, 
			overlay: { opacity: 0.5, background: "black" },
			width: 660,
			height: 500,
			hide: 'clip',
			show: 'clip'
		});
		//Closes when clicked
		$("#dialog").click(function () { 
      $(this).dialog("close"); 
    });
		// panel			
		$('#panel').dialog({
			modal: true, 
			overlay: { opacity: 0.5, background: "black" },
			width: 660,
			height: 500,
			hide: 'clip',
			show: 'clip'
		});
		//Validate
		$("#valForm").validate();
		//hidden boxes
		$(".hiddenBox").hide();
});

function showBlock(blockId){
	$(blockId).show();
}

function hideBlock(blockId){
	$(blockId).hide();
}

function alterLocation(urlStr){
	window.location = urlStr;
}

function magnifyPic(fotoName){
		var htmlStr = "<img width=\"640\"	src=\"http://fleshandbones.be/pics/details/" + fotoName + "\" />";
		$('#dialog').html(htmlStr);
		showDialog();
	}
	
function showDialog(){
		$('#dialog').dialog('open');
	}
	
var size_id = 1;

function addSize(){
		var htmlStr = "<div id=\"new_"+ size_id + "\"><input type=\"text\" class=\"text40\" name=\"sizeArr[]\" value=\"\" /><a href=\"javascript:deleteSize('new_" + size_id + "')\"> >> remove</a></div>";
		$('#sizeContainer').append(htmlStr);
		size_id ++;
}

function deleteSize(div_id){
		$('#'+div_id).remove();
}

function addPusher(){
		var flashvars = {
		};
		var params = {
			menu: "false",
			height: 480,
			width: 640,
			allowFullscreen: "true",
			allowScriptAccess: "always",
			wMode: "transparent"
		};
		var attributes = {
			id:"picturepusher"
		};
		swfobject.embedSWF("swf/picturepusher.swf", "flashcontent", "640", "480", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
}
function addTube(){
		var flashvars = {
			file: "tube.php",
			backcolor: "#000000",
			screencolor: "#000000",
			lightcolor: "#FFFFFF",
			frontcolor: "#CCCCCC",
			playlist: "right",
			playlistsize: "240",
			controlbar: "over"
		};
		var params = {
			height: 320,
			width: 640,
			allowFullscreen: "true",
			allowScriptAccess: "always",
			wMode: "transparent"
		};
		var attributes = {
			id:"tubeplayer"
		};
		swfobject.embedSWF("swf/FLVplayer.swf", "tubeplayer", "640", "300", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
}
