
		function openModalDialog(pageURL, arguments, options)
		{
		  var finalOptions = "status:no;help:no";
		  if(options != "")
		    finalOptions += ";" + options;
		  else
		    finalOptions += options;
		    
		  return showModalDialog(pageURL,arguments,finalOptions);		
		}	
		
function GetTrackingInfo(objectId,value)
{
    window.location = 'TrackingInformation.aspx?orderNumber=' + document.getElementById(objectId).value+"&val="+value;
}
		
	 function clearTrack(objId)
     {
        document.getElementById(objId).value = "";
      }	
		
		
		
		
		
		
		
function UncheckOtherCheckBoxesInList(checkBoxListId,checkBoxIndex,numOfItems)
{
    // Get the checkboxlist object.
    objCtrl = document.getElementById(checkBoxListId);
    
    // Does the checkboxlist not exist?
    if(objCtrl == null)
        return;

    var i = 0;
    var objItem = null;

    for(i = 0; i < numOfItems; i++)
    {
        objItem = document.getElementById(checkBoxListId + '_' + i);

        if(objItem == null)
            continue;

        // If i does not equal the checkbox that is never to be disabled.
        if(i != checkBoxIndex)
                objItem.checked = false;
    }
}

function OpenTextWindow(sId, sName, iCols)
{
    var sText
    try
    {
    sText = document.all.item(sId).value;
    }
    catch(x)
    {
     sText = sId.value;    
    }
	var TextArray = new Array();
	var sDiagWith = Math.round(iCols / 3) + 1
	var intTextLength = sText.length;
	var x,j;
	
	if (intTextLength > 4000){
		x = 0;
		j = 0;
		while (intTextLength > x) {
			TextArray[j] = sText.substr(x,4000);
			x = x + 4000;
			j++;
		}
	}
	else {
		TextArray[0] = sText;
	}
		
	TextArray = openModalDialog("/Common/TextWindow.aspx?id=" + sId + "&name=" + sName + "&cols=" + iCols,TextArray,"dialogWidth:" + sDiagWith.toString() + ";dialogHeight:25;unadorned=yes;edge=raised;status=no;help=no");
	
	if (TextArray != null){
		if (TextArray[0] != "~&cancel~&"){
			strText = "";
							
			for (x = 0; x < TextArray.length; x++){
				 strText = strText + TextArray[x];
			}
			
			try
			{
			document.all.item(sId).value = strText;
			}
			catch(y)
			{
			 sId.value = strText;
			}
	//		ValidateText(sId);
		}
	}
}

function hover(loc, cls){
  //alert("loc=" + loc + " and cls=" + cls);
  if(loc.disabled==false)
  {
  if(loc.className)
  {
 // alert("classname=" + loc.className);
     loc.className=cls;
     }   
    }
}

// Refreshing AsyncPanel through javascript for partial postback (Subimal, 28-June-2007)
    function RefreshAsyncPanel(panelID)
    {
       var warpPanel = ig$(panelID);
       if(!warpPanel)
       return;
       warpPanel.refresh();
    }
    

//Method for getting the multiselectd text from the Listbox(Sabyasachi, 20-Feb-2008)    
function GetMultiselectText(objectListBox)
{
    var strNotes='';
    var i=0;

    for(i=0;i<objectListBox.length;i++)
    if(objectListBox.options[i].selected==true)
        strNotes = strNotes + objectListBox.options[i].text + '. ';

    return strNotes;
}


///////////////////////////////////////////////////////////////////////////////////
// The constructor for tab panes
//
// el : HTMLElement		The html element used to represent the tab pane
// bUseCookie : Boolean	Optional. Default is true. Used to determine whether to us
//						persistance using cookies or not
//
function WebFXTabPane( el, bUseCookie ) {
	if ( !hasSupport() || el == null ) return;
	
	this.element = el;
	this.element.tabPane = this;
	this.pages = [];
	this.selectedIndex = null;
	this.useCookie = bUseCookie != null ? bUseCookie : true;
	
	// add class name tag to class name
	this.element.className = this.classNameTag + " " + this.element.className;
	
	// add tab row
	this.tabRow = document.createElement( "div" );
	this.tabRow.className = "tab-row";
	el.insertBefore( this.tabRow, el.firstChild );

	var tabIndex = 0;
	if ( this.useCookie ) {
		tabIndex = Number( WebFXTabPane.getCookie( "webfxtab_" + this.element.id ) );
		if ( isNaN( tabIndex ) )
			tabIndex = 0;
	}
	this.selectedIndex = tabIndex;
	
	// loop through child nodes and add them
	var cs = el.childNodes;
	var n;
	for (var i = 0; i < cs.length; i++) {
		if (cs[i].nodeType == 1 && cs[i].className == "tab-page") {
			this.addTabPage( cs[i] );
		}
	}
}

WebFXTabPane.prototype.classNameTag = "dynamic-tab-pane-control";

WebFXTabPane.prototype.setSelectedIndex = function ( n ) {
	if (this.selectedIndex != n) {
		if (this.selectedIndex != null && this.pages[ this.selectedIndex ] != null )
			this.pages[ this.selectedIndex ].hide();
		this.selectedIndex = n;
		this.pages[ this.selectedIndex ].show();
		
		if ( this.useCookie )
			WebFXTabPane.setCookie( "webfxtab_" + this.element.id, n );	// session cookie
	}
};
	
WebFXTabPane.prototype.getSelectedIndex = function () {
	return this.selectedIndex ;
};
	
WebFXTabPane.prototype.addTabPage = function ( oElement ) {
	if ( !hasSupport() ) return;
	
	if ( oElement.tabPage == this )	// already added
		return oElement.tabPage;

	var n = this.pages.length;
	var tp = this.pages[n] = new WebFXTabPage( oElement, this, n );
	tp.tabPane = this;
	
	// move the tab out of the box
	this.tabRow.appendChild( tp.tab );
			
	if ( n == this.selectedIndex )
		tp.show();
	else
		tp.hide();
		
	return tp;
};
	
WebFXTabPane.prototype.dispose = function () {
	this.element.tabPane = null;
	this.element = null;		
	this.tabRow = null;
	
	for (var i = 0; i < this.pages.length; i++) {
		this.pages[i].dispose();
		this.pages[i] = null;
	}
	this.pages = null;
};



// Cookie handling
WebFXTabPane.setCookie = function ( sName, sValue, nDays ) {
	var expires = "";
	if ( nDays ) {
		var d = new Date();
		d.setTime( d.getTime() + nDays * 24 * 60 * 60 * 1000 );
		expires = "; expires=" + d.toGMTString();
	}

	document.cookie = sName + "=" + sValue + expires + "; path=/";
};

WebFXTabPane.getCookie = function (sName) {
	var re = new RegExp( "(\;|^)[^;]*(" + sName + ")\=([^;]*)(;|$)" );
	var res = re.exec( document.cookie );
	return res != null ? res[3] : null;
};

WebFXTabPane.removeCookie = function ( name ) {
	setCookie( name, "", -1 );
};






