function comicspace_include(script) 
{
	if (script.substr(0, 1) == '/') {
		document.write("<script type='text/javascript' src='" + comicspace_static_url + script + "'></script>");
	}
	else {
		document.write("<script type='text/javascript' src='" + script + "'></script>");
	}
}

function jump(targ, sel_obj)
{
	eval(targ+".location='"+sel_obj.options[sel_obj.selectedIndex].value+"'");
}

function update_blank_descriptions()
{
	var key = document.getElementById('blank').value;
	var ids = key.split('|');
	
	// brand
	
	var brand_name = '';
	var brand_description = '';

	if (ids[2] > 0)
	{
		brand_name = stock.brands[ids[2]].name;
		brand_description = stock.brands[ids[2]].description;
	}
	
	if (brand_name && brand_description)
	{
		document.getElementById('brand_description').innerHTML = '<strong>'+brand_name+'</strong><br />';
		document.getElementById('brand_description').innerHTML+= brand_description;
		document.getElementById('brand_description').style.display = 'block';
	}
	else
	{
		document.getElementById('brand_description').style.display = 'none';
	}
	
	// style
	
	var style_name = '';
	var style_description = '';

	if (ids[1] > 0)
	{
		style_name = stock.styles[ids[1]].name;
		style_description = stock.styles[ids[1]].description;
	}
	
	if (style_name && style_description)
	{
		document.getElementById('style_description').innerHTML = '<strong>'+style_name+'</strong><br />';
		document.getElementById('style_description').innerHTML+= style_description;
		document.getElementById('style_description').style.display = 'block';
	}
	else
	{
		document.getElementById('style_description').style.display = 'none';
	}
}

// load up yahoo
if (comicspace_debug) {
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/logger/logger-debug.js");	
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/connection/connection-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/container/container_core-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/menu/menu-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/element/element-beta-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/button/button-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/json/json-debug.js");
}
else {
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/logger/logger-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/connection/connection-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/container/container_core-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/menu/menu-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/element/element-beta-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/button/button-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-debug.js");
	comicspace_include("http://yui.yahooapis.com/2.5.2/build/json/json-debug.js");
}

comicspace_include("/js/comicspace.js");