﻿var disabledDragDrop=true;
var pWin=null;

function subDet(sid)
{
    oModal('subPartList.aspx?id=' + sid,400,600);
}

/*****************
 Private Functions
 *****************/

function oWin(url, w, h, name)
{
	var win=window.open(url, name, "status=yes,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=yes,width=" + w + ",height=" + h);
	win.focus();
}


function oModal(url, width, height)
{	    
	var pw = null;	
	try
	{
		pw = loadParentWin();
	}
	catch(e) {}
	var obj = new Object();
	obj.parentWindow = pw;	
	return window.showModalDialog( url, obj, "dialogWidth:" + width + "px;dialogHeight:" + height +"px;center:yes;help:off;status:on;resizable:yes");	
}

/*function document.ondragstart()
{
	if (disabledDragDrop)
	{
		event.returnValue = false;
	}
}
*/
///set the parent window flag
function setPWin()
{
	try
	{
		pWin = ldPWin();
	}
	catch(e) {}
}

//
// Loads a reference to the parent window
//
function ldPWin()
{
	if (window.dialogArguments)
	{
		var o = window.dialogArguments;
		if (o.parentWindow)
		{
			return o.parentWindow;
		}
	}
	else if (window.opener && !window.opener.closed)
	{
		return window.opener;
	}
	else
	{
		return window;
	}
}

setPWin();

var NiftyLoad = function()
{
    Nifty('div.CodeResult', 'small');
    Nifty('div.ODashBox', 'transparent');    
    Nifty('div.fields','');    
}