// JavaScript Document

var type;
var id;
var str;
var gather = "";
var order;
var ss;

function tablePrint()
{

var display_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
display_setting+="scrollbars=yes,width=890, height=705, left=10, top=25";

var content_innerhtml = document.getElementById("tbl_display").innerHTML;
var document_print=window.open("","",display_setting);
document_print.document.open();
document_print.document.write('<html><head><title>Product Print from MolexKits.com</title><link href="css/style.css" rel="stylesheet" type="text/css" media="all" /></head>');
document_print.document.write('<body style="font-family:verdana; font-size:12px;" onLoad="self.print();self.close();" >');
document_print.document.write(content_innerhtml);
document_print.document.write('</body></html>');
document_print.document.close();
return false;
}

function displaygrid(pageno,ss,mainid,order)
{
	//alert("pageno = "+pageno+" searchstring = "+ss+" mainid = "+mainid+" order = "+order);
	remoteCall("doSort.php?page="+pageno,"file=main&ss="+ss+"&mainid="+mainid+"&order="+order,"sorted");		
}

function displaygridFam(pageno,catsub,mainid,order)
{
	//alert("pageno = "+pageno+" searchstring = "+ss+" mainid = "+mainid+" order = "+order);
	remoteCall("doSort.php?page="+pageno,"file=mainFam&catsubid="+catsub+"&mainid="+mainid,"sorted");		
}

function filliframe(file,id,obj)
{
	//alert("ready to fill iframe"+file);
	document.getElementById('lowertabinfo').src = file;	
	//alert(obj);
	
	document.getElementById('id1').className = "";
	document.getElementById('id2').className = "";
	document.getElementById('id3').className = "";
	document.getElementById('id4').className = "";
	
	document.getElementById(obj).className = "selected";
}

//function sortme(order,ss)
//{
	//alert("m in a sortme function");
	//alert(order+" "+ss);
	//remoteCall("ajaxpages/doSort.php?order="+order+"&ss="+ss,"file=main","sorted");		
//}

function sorted()
{
	//alert(sResponse);
	document.getElementById('mydiv').innerHTML = sResponse;
}

function emptyit(str)
{
	document.getElementById(str).value = "";	
}


function validate()
{
	var oSearch = document.getElementByID("txtSearch");
	
	if (oSearch.value == "" || oSearch.value == "Search for kits by Molex part number or keyword")
	{
		alert("Please enter the search criteria");
		oSearch.setfocus();
		return false;	
	}
	return true;
}

function changeimage(imgpath)
{
	document.getElementById('mainimg').src = imgpath;
}

function openwindow(kitpartno)
{
	//window.open = "http://service.stkcheck.com/Default.aspx?mfg=d42f7334-e6b4-4e70-8f0f-fd275437b94a&parts="+kitpartno;
}
