function ShowContent(contentname){
	document.getElementById(contentname).style.display="block";
}
function hideContent(contentname){
	document.getElementById(contentname).style.display="none";
}


function ClickRow(ChildRow)
	{
		if(document.getElementById(ChildRow).style.display =="none")
		{
			document.getElementById(ChildRow).style.display="block";
		}
		else
		{
			document.getElementById(ChildRow).style.display="none";
		}	
	}
	
function OverRow(PrimaryRow)
{
	document.getElementById(PrimaryRow).style.cursor ="hand";
}

function openSwatchWindow(ProductID) {
  
  ColdFusion.Window.create('SwatchWindow', 'www.designicons.co.uk', '',
  		{x:100,y:100,height:450,width:550,modal:true,closable:true,
        draggable:true,resizable:true,center:true,initshow:true,
        minheight:200,minwidth:200});
  ColdFusion.navigate('swatches.cfm?ProductID='+ProductID,'SwatchWindow');
  ColdFusion.Window.onShow('SwatchWindow',windowShowHandler.createCallback('www.designicons.co.uk','SwatchWindow'));
  ColdFusion.Window.show('SwatchWindow');
  
}
function windowShowHandler(title,name){
  var win = ColdFusion.Window.getWindowObject(name);
  win.setTitle(title);
}

/* product details page */
$(document).ready(function(){

$(".con_des1 h3:first").addClass("active");
$(".con_des1 div:not(:first)").hide();

$(".con_des1 h3").click(function(){
	$(this).next("div").slideToggle("slow")
	.siblings("div:visible").slideUp("slow");
	$(this).toggleClass("active");
	$(this).siblings("h3").removeClass("active");
});

});

/* ordering page */
$(document).ready(function(){

$(".item_des h3:first").addClass("active");
$(".item_des div:not(:first)").hide();

$(".item_des h3").click(function(){
	$(this).next("div").slideToggle("slow")
	.siblings("div:visible").slideUp("slow");
	$(this).toggleClass("active");
	$(this).siblings("h3").removeClass("active");
});

});

/* icon panel */
$(document).ready(function(){
							
								$(".btn-slide").click(function(){
									$("#panel").slideToggle("slow");
									$(this).toggleClass("active2"); return false;
								});
								
								 
							});


function submitTheForm() {
  ColdFusion.Ajax.submitForm('TheForm', 'searchresult.cfm', resultInsertHandler, insertErrorHandler); 	
}	
function resultInsertHandler() {
	//var resultDiv = document.getElementById("result");
	//resultDiv.innerHTML = "Changes saved.";
	//ColdFusion.Grid.refresh('TheGrid', true);
	//ColdFusion.objectCache['TheGrid'].selectedRow=-1;
	//ColdFusion.navigate('searchresult.cfm','SearchResultDiv');
}
function insertErrorHandler(id, message) {
	var resultDiv = document.getElementById("result");
	resultDiv.innerHTML = "Update error.";	
	
}

/* disable key press enter */

function disableEnterKey(e)
{
     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
          return false;
     else
          return true;
}

