// JavaScript Document

//////////////////// Help //////////////////
////////////////////////////////////////////

var help_config =
{center:true,height:450,width:700,modal:true,resizable:false,initshow:true}

function openCommonHelp(solution_ID,category,searchquery) {
	popURL="../help_sub/help.cfm?solution_ID="+solution_ID+"&category="+category+"&search="+searchquery;
	// If window exists, destroy it.
	try{
	ColdFusion.Window.destroy('common_help',true);
	} catch (err) {}	
	// Create new window.	
	ColdFusion.Window.create('common_help','Help',popURL,help_config);	
	ob = ColdFusion.Window.getWindowObject('common_help');
    ob.center();	
	ColdFusion.Window.onHide('common_help',cleanupHelp);
}

function goToCommonHelp(solution_ID) {
	popURL="../help_sub/help.cfm?solution_ID="+solution_ID;
	ColdFusion.navigate(popURL,'common_help');	
	ColdFusion.Window.onHide('common_help',cleanupHelp);
}

function searchCommonHelp() {
	searchquery = document.forms.SearchForm.tags.value;
	popURL="../help_sub/help.cfm?search="+searchquery;
	ColdFusion.navigate(popURL,'common_help');	
	ColdFusion.Window.onHide('common_help',cleanupHelp);
}

function cleanupHelp() {
	ColdFusion.Window.destroy('common_help',true);
}


//////////////////// Slide //////////////////
/////////////////////////////////////////////

$(document).ready(function() {

	//Slider column.
	$('#slide_action').click(function(event) {
		$("#slider_column").animate({
					height : "toggle",
					width : "toggle"
				}, 1000);

		//	for change image
		if ($("a#slide_action img").attr("src") == prefix
				+ 'images/page_dra_arrow.png') {

			// content_inner_right 
			//contentbox_left

			$("a#slide_action img").attr("src",
					prefix + "images/page_dra_arrow2.png");
			$(".content_inner_right").animate({
						width : '95%',
						minheight : "425px"
					}, 1500);
			//$(".contentbox_left").animate({'width':'5px'}, 1500);	
		} else {
			$("a#slide_action img").attr("src",
					prefix + "images/page_dra_arrow.png");
			$(".content_inner_right").animate({
						width : '73%',
						minheight : "425px"
					}, 700);

			//  $(".contentbox_left").animate({width:'22%'}, 1500);	
		}

		event.preventDefault();
	});

});

runAfterContentLoads = function() {
	$('.contentbox_cent').css('height', '450px');
	$('.contentbox_cent').css('height', $('.xboxcontent').height());
}
