<!--

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2005 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

-->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8">
  <meta http-equiv="Expires" content="Tue, 00 Dec 2000 00:00:00 GMT">
  <title>Image Details</title>
  <link href="StockPhoto.css" rel="stylesheet" type="text/css" media="all">
  <style type="text/css" media="all">
   <!--

  .chip    { position:absolute; visibility:hidden; z-index: 100;background-color:#FFFFA0; border:1px black solid; padding:1px; font-family: %_PRIMARYFONT%_; font-size:%_CHIP_FONTSIZE%_; color:#000000; width:%_CHIP_WIDTH%_}
    #ID       { font-family: %_PRIMARYFONT%_; position: absolute; top: 16px;  left: 15px;   width: 695px; height:  18px }
    #Image    { font-family: %_PRIMARYFONT%_; position: absolute; top: 35px;  left: 15px;   width: 458px; height: 411px }
    #ImageP1Pre  { font-family: %_PRIMARYFONT%_; position: absolute; top: 35px;  left: 15px;   width: 458px; height: 411px }
    #Image4Size1 { font-family: %_PRIMARYFONT%_; position: absolute; top: 35px;  left: 15px;   width: 458px; height: 411px }
    #prImage    { font-family: %_PRIMARYFONT%_; position: absolute; top: 35px;  left: 15px;   width: 458px; height: 411px }
    #prImageP1Pre  { font-family: %_PRIMARYFONT%_; position: absolute; top: 35px;  left: 15px;   width: 458px; height: 411px }
    #info     { font-family: %_PRIMARYFONT%_; position: absolute; top: 35px; left: 488px; width: 222px; height: 130px }
    #FileSize { border:none ; font-family: %_PRIMARYFONT%_; position: absolute; top: 30px; left: 488px; width: 222px; height: 238px }
    #survey { border:1px #CCCCCC solid; font-family: %_PRIMARYFONT%_; position: absolute; top: 200px; left: 488px; width: 229px; height: 218px }

    #KwImage       { overflow: auto; font-family: %_PRIMARYFONT%_; position: absolute; top: 35px;  left: 15px;   width: 458px; height: 411px; visivility:hidden}
    #KwImagePre    { overflow: auto; font-family: %_PRIMARYFONT%_; position: absolute; top: 35px;  left: 15px;   width: 458px; height: 411px; visibility:visible}
    #KwTitle       { border: 0px; padding:0px; margin: 0px; font-family: %_PRIMARYFONT%_; position: absolute; top: 40px; left: 488px; width: 222px; height: 23x }
    #KwSubTitle    { border-left: 1px gray solid; border-top: 1px gray solid; border-right: 1px gray solid; background-color:#c8d9da; padding:0px; margin: 0px; font-family: %_PRIMARYFONT%_; position: absolute; top: 70px; left: 488px; width: 222px; height: 57px }
    #KwSubSelect   { border-left: 1px gray solid; border-top: 1px gray solid; border-right: 1px gray solid;background-color:#c8d9da; padding:0px; margin: 0px; font-family: %_PRIMARYFONT%_; position: absolute; top: 70px; left: 488px; width: 222px; height: 57px }
    #Keywords      { overflow: auto; border: 1px gray solid; padding:0px; margin: 0px; font-family: %_PRIMARYFONT%_; position: absolute; top: 127px; left: 488px; width: 222px; height: 282px }
    #KeywordsPre   { overflow: auto; border: 1px gray solid; padding:0px; margin: 0px; font-family: %_PRIMARYFONT%_; position: absolute; top: 127px; left: 488px; width: 222px; height: 282px }
    #KeywordsPane2Progress		{ overflow: auto; border: 1px gray solid; padding:0px; margin: 0px; font-family: %_PRIMARYFONT%_; position: absolute; top: 127px; left: 488px; width: 222px; height: 282px }
    #KeywordsPane2ResultShared 	{ overflow: auto; border: 1px gray solid; padding:0px; margin: 0px; font-family: %_PRIMARYFONT%_; position: absolute; top: 127px; left: 488px; width: 222px; height: 282px }
    #KeywordsPane2ResultWhole  	{ overflow: auto; border: 1px gray solid; padding:0px; margin: 0px; font-family: %_PRIMARYFONT%_; position: absolute; top: 127px; left: 488px; width: 222px; height: 282px }
    #KwSearchAgain { border: 0px; padding:0px; margin: 0px; font-family: %_PRIMARYFONT%_; position: absolute; top: 415px; left: 488px; width: 222px; height: 40px }

    .navcont_BD1B01F1 { width: 100% }
    .navbox_BD1B01F1  { width: 100%; height: 20px }
    #bottom           { background-color: #afbebf; position: absolute; top: 465px; left: 0px; width: 725px; height: 35px }

    #container1 { visibility: visible; font-family: %_PRIMARYFONT%_; position: absolute; top: 45px;  left: 0px;   width: 725px; height:  20px }

  .mylink {font-size:%_TAB_FONT_Size%_; font-family: %_PRIMARYFONT%_; color:%_TAB_KWLINK_FONT_Color%_}
  .mylink a:hover {cursor:hand}

  .tabs {font-size:%_TAB_FONT_Size%_; font-family: %_PRIMARYFONT%_; font-weight:%_TAB_FONT_Weight%_; white-space: nowrap;
      text-decoration:none; background-image:url(%_HTMLImageDir2%_/ImgDetail/tab_bggrey.gif); background-position:top}

  .tabs_active {font-size:%_TAB_ACTIVE_FONT_Size%_; font-family: %_PRIMARYFONT%_; font-weight:%_TAB_ACTIVE_FONT_Weight%_; white-space: nowrap;
      text-decoration:none; background-image:url(%_HTMLImageDir2%_/ImgDetail/tab_bgwht.gif);background-position:top;}

  .tabs_stroke {background-image:url(%_HTMLImageDir2%_/ImgDetail/tab_stroke1.gif);}

  .tab_bkcolor {color :#666666}
  .tab_hlcolor {color :#000}

  .tab-container {background: #fff; border:0px;}
  .tab-panes { margin: 0px }
  .bold_smallwhite  {color: #ffffff; font-size: 10px; font-family: 'Lucida Grande', tahoma; font-weight: bold; text-decoration: none}

  .addcartbutton  {font-size: %_BUTTON_FONTSIZE%_; font-family: %_PRIMARYFONT%_;height: %_BUTTON_HEIGHT%_; width: %_ADDCART_WIDTH%_}
  .addcartbutton_g  {font-size: %_BUTTON_FONTSIZE%_; font-family: %_PRIMARYFONT%_;height: %_BUTTON_HEIGHT%_; width: %_ADDCART_WIDTH%_; color: #666666}
  .dlcompbutton   {font-size: %_BUTTON_FONTSIZE%_; font-family: %_PRIMARYFONT%_;height: %_BUTTON_HEIGHT%_; width: %_DLCOMP_WIDTH%_}
  .dlcompbutton_g {font-size: %_BUTTON_FONTSIZE%_; font-family: %_PRIMARYFONT%_;height: %_BUTTON_HEIGHT%_; width: %_DLCOMP_WIDTH%_; color: #666666}
  .edcompbutton   {font-size: %_BUTTON_FONTSIZE%_; font-family: %_PRIMARYFONT%_;height: %_BUTTON_HEIGHT%_ }
  .edcompbutton_g {font-size: %_BUTTON_FONTSIZE%_; font-family: %_PRIMARYFONT%_;height: %_BUTTON_HEIGHT%_; width: %_EDCOMP_WIDTH%_; color: #666666}
  .closebutton    {font-size: %_BUTTON_FONTSIZE%_; font-family: %_PRIMARYFONT%_;height: %_BUTTON_HEIGHT%_; width: %_CLOSEB_WIDTH%_}
 
   .menuItem { font-family: %_PRIMARYFONT%_ ; font-size:%_OPENWITH_FONTSIZE%_; padding-left:10px;background-Color:menu;color:#000000;}
  .menuItemDefault {font-family: %_PRIMARYFONT%_ ; font-size:%_OPENWITH_FONTSIZE%_; font-weight:bold; padding-left:10px; background-Color:menu; color:black; }
  .highlightItem { font-family: %_PRIMARYFONT%_ ; font-size:%_OPENWITH_FONTSIZE%_; padding-left:10px; background-Color:#cccccc; color:white;  }
  .contextMenu { position:fixed; display:none; z-index:1; background-Color:menu; padding-top: 10px; padding-bottom: 10px; border:solid; border-style: solid;  border-left-width: 5px;  border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px; border-left-color: #afbebf ; border-right-color:#cccccc ; border-bottom-color:#cccccc; border-top-color:#cccccc; }
   
    
      -->
  </style>
  <csactions>
   <csaction name="bd1c4e420" class="Close Window" type="onevent"></csaction>
   <csaction name="bd1c64f11" class="Go Last Page" type="onevent"></csaction>
  </csactions>
  <csscriptdict>
   <script type="text/javascript">
    <!--
	//	----------------------
	// NewGpk variables
	//	----------------------

	// Status code - same values must be define in st17ImgDetail.jsx
	var nglbcnst_gpk3_start             = 0;
	var nglbcnst_gpk3_noXmp             = 1; // error
	var nglbcnst_gpk3_getCompInProgress = 2;
	var nglbcnst_gpk3_getCompError      = 4;
	var nglbcnst_gpk3_getCompDone       = 8;

	var nglbcnst_gpk3_getReslInProgress = 16;
	var nglbcnst_gpk3_getReslError      = 32;
	var nglbcnst_gpk3_getReslDone       = 64;

	var nglbcnst_gpk3_allDone           = 128;
	var nglbcnst_gpk3_compSkipped       = 256;
  
  // Watson : 1256701 - keys to be trapped for Keyword-checkboxes
	var nglbcnst_gpk3_keySpace           = 32;
	var nglbcnst_gpk3_keyTab             = 9;
	var nglbcnst_gpk3_keyUp              = 38;
	var nglbcnst_gpk3_keyDown            = 40;
	var nglbcnst_gpk3_keyReturn          = 13;
	
	var nglbcnst_gpk3_allError		   = nglbcnst_gpk3_noXmp | nglbcnst_gpk3_getCompError | nglbcnst_gpk3_getReslError;
	var nglbcnst_gpk3_allComplete	   = nglbcnst_gpk3_allDone | nglbcnst_gpk3_getReslDone | nglbcnst_gpk3_getCompDone;

	var cnst_maxNoOfImgsPerPage =9; 	// No of images in left panel
	var cnst_maxNoOfKeyords     =500;	// No of Keywords per one column

	var cnst_timeOutSec         =15;
	var cnst_timeOutErrMsg      ="%_ERRORINGETTINGIMGE%_";
	var cnst_timeOutErrMsgPane23    ="%_ERRORINDWLDIMGE%_";
	var nglb_KeywordsTimeOut    =false;

	var nglb_doc_id		        =%_CONSTDOC_ID%_;
	var nglb_maxNoOfImg         =%_MAXNOOFIMG%_;
	var nglb_newGpk             ="%_NEWGPK%_";
	var nglb_containerNumber    ="%_CONTAINERNUMBER%_";
	var nglb_tabNumber          ="%_TABNUMBER%_";
	var nglb_factor             =0;
	var nglb_keywords			="";
	var nglb_keywordsShared		="";
	var nglb_initializeScreen   =true;
	var glb_noOfProcessed       =0;
	var nglb_SelectedImg        =-1; // selected image cell
	var nglb_ShareOrWhole       =1;  // 0:Share 1: Whole
	var nglb_FirstCorrectFromES =true;
	var nglbcnst_OP_AND         =" %_OP_AND%_ ";

	var nglb_currPane1Img       =-1;

	var glbcnst_DocumentID      ="%_DOCUMENTID%_";
	var glbcnst_index           =%_IINDEX%_;
	var glbcnst_TotalIndex      =%_TOTALINDEX%_;
	var glbcnst_NotSupported    ="%_NOTSUPPORTEDTEXT%_";

	var glb_inCompFolder        =false;
	var glb_inPurchasedFolder   =false;

	var glb_MainJpgNm           ="";
	var glb_ImgWidth            =100;
	var glb_ImgHeight           =100;
	var CSStopExecution         =false;
	var glb_NumResolutions;
	
	var glb_arrSelectedResolutions = {};
	
	var aMenuList = %_OPENWITHARR%_;
	var noShow = %_OPENNOSHOW%_;
	// Watson: 1256701
	var glb_Checkbox_Index = 0;
	
	var nglb_imgDefaultHeight   = %_IMGDEFAULTHEIGHT%_;
	var nglb_imgDefaultWidth    = %_IMGDEFAULTWIDTH%_;
	var nglb_InitialSpiningWheel= true;
	var glb_imageAdjust={
		m:  %_IMGADJ_M%_,
		ph: %_IMGADJ_PH%_,
		pw: %_IMGADJ_PW%_,
		iw: %_IMGADJ_IW%_,
		ih: %_IMGADJ_IH%_,
		cx: %_IMGADJ_CX%_
	};

	//	----------------------
	// New gpk3 function -BEG-
	//	----------------------
	var dt=[
				%_function_SetDt%_
	];	// dttype: bit 1: Add (#) to Search Key ords
		//     		   2: place border
		//	   		   4: image selection by single click
		//			   8: 4-division display
		//			  16: keyword progress display

	// KeyWord display
	var nglb_Prev_Kw_idx   =-1; // Previous idx for keyword display
	var nglb_Prev_KwTitle  =0;  // 0: standard 1: with radio button
	var nglb_Prev_KwTable  =-1; // 0: standard 1:Progressing 1:Shared 2:Whole
	var nglb_KeyWordDivNm  =["Keywords",     "KeywordsPane2Progress",     "KeywordsPane2ResultShared",     "KeywordsPane2ResultWhole"];
	var nglb_KeyWordTableNm=["keywordstable","keywordsPane2ProgressTable","keywordsPane2ResultSharedTable","keywordsPane2ResultWholeTable"];
	var nglb_TabNmIdx      =-1; // value used at createTableForThisTable() last time
	var nglb_KWdsTableSize =[0,0,0,0];

	var glb_inLoadKeyword = "%_INLOADKEYWORDS%_";
	var glb_TitleNumChar = %_TITLE_NUM_CHAR%_;
	var glb_TitleText = "%_TitleText%_";
	var glb_DespNumChar = %_DESP_NUM_CHAR%_;
	var glb_OpAnd =  " %_OP_AND%_ ";
	var glb_State0Text = "%_STATE0TEXT%_";
	var glb_InProgressText = "%_INPROGRESSTEXT%_";
	var glb_string_Of="%__OF_%_";
	var glb_HtmlImageDir2 = '%_HTMLImageDir2%_';

	var glb_Add2CartLock     = true;
	var glb_DownloadCompLock = true;
	var glb_EditCompLock     = true;
	
	var glb_OpenWithLeft = %_OPENWITHLEFT%_;
	var glb_OpenWithTop = %_OPENWITHTOP%_;

// do not delete the following line. It means there is no %_xxxxx%_ in the following session
//??DO NOT CONVERT START

	function switchKeyTableTitle( which )
	{	// 0: standard
		// 1: with radio button
		if( which != nglb_Prev_KwTitle )
		{
			nglb_Prev_KwTitle = which;
			var keyTitle1 = document.getElementById( "KwSubTitle" );
			var keyTitle2 = document.getElementById( "KwSubSelect" );
			if( which == 0 )
			{
				keyTitle2.style.visibility = "hidden";
				keyTitle1.style.visibility = "visible";
			}
			else
			{
				keyTitle1.style.visibility = "hidden";
				keyTitle2.style.visibility = "visible";
			}
		}
	}
	
  // 1288262
  function changeButtonStatus( oButtonObj, bEnabled )
  {
    var sNewButtonColor;

    if( bEnabled )
    {
      sNewButtonColor = "#000000";
    }
    else
    {
      sNewButtonColor = "#666666";
    }
    
    if( undefined != oButtonObj && undefined != oButtonObj.style )
    {
      oButtonObj.style.color = sNewButtonColor;
      oButtonObj.disabled = !bEnabled;
    }
  }

	// 1288262
  function switchButtonStatus( oButtonSetName, bEnabled )
  {
    if( undefined != oButtonSetName )
    {
        if( 'dlcomp' == oButtonSetName && (glb_inPreviousSearchFolder) ) // 1327428
        { 
          changeButtonStatus( document.getElementById("downloadCompButton1"), bEnabled );
          changeButtonStatus( document.getElementById("downloadCompButton2"), bEnabled );          
          changeButtonStatus( document.getElementById("downloadCompButton3"), bEnabled );
        }
        else if( 'editcomp' == oButtonSetName )
        {
          changeButtonStatus( document.getElementById("openwith1"), bEnabled );
          changeButtonStatus( document.getElementById("openwith2"), bEnabled );          
          changeButtonStatus( document.getElementById("openwith3"), bEnabled );          

        }
        else if( 'add2cart' == oButtonSetName )
        {
          changeButtonStatus( document.getElementById("addToCartButton1"), bEnabled );
          changeButtonStatus( document.getElementById("addToCartButton2"), bEnabled );
          changeButtonStatus( document.getElementById("addToCartButton3"), bEnabled );
          changeButtonStatus( document.getElementById("addToCartButtonInset"), bEnabled );
        }
    }
  }
  
	function switchKeyTableItself( idx, which )
	{	// 0: standard 1:Progressing 1:Shared 2:Whole
		var i, KeyTableIs, KeyTab;
		if( which != nglb_Prev_KwTable )
		{
			// the following code to remove spining wheel and attached "progressing" message.
			// So it should be done only once.
			nglb_KwPrgrsBarRemoved = true;
			nglb_Prev_KwTable = which;
			for( i=0; i<nglb_KeyWordDivNm.length; i++ )
			{
				KeyTableIs = document.getElementById( nglb_KeyWordDivNm[ i ] );
				KeyTab     = document.getElementById( nglb_KeyWordTableNm[ i ] )
				if( i == which )
				{
					KeyTableIs.style.visibility = "visible";
					KeyTab.style.visibility = "visible";
				}
				else
				{
					KeyTab.style.visibility = "hidden";
					KeyTableIs.style.visibility = "hidden";
				}
			}
			nglb_Prev_Kw_idx = idx;
			return( which );
		}
		if( idx != nglb_Prev_Kw_idx )
		{
			nglb_Prev_Kw_idx = idx;
			return( which );
		}
		return( -1 );
	}
	function removeInitObj( objNm )
	{
		try
		{
			var mydata0  = document.getElementById( objNm );
			try { mydata0.style.visibility = "hidden"; } catch(e) { ; }
			if( ( mydata0 != null )&&( mydata0 != undefined )&&( mydata0.hasChildNodes() ) )
			{
				mydata0.removeChild( mydata0.childNodes[0] );
			}
		} catch(e) { ; }
	}
	var nglb_KeywordsPrevNo     =-1;
	var nglb_KeywordsPreDispGone=false;
	function checkKeywordsTimeOut( noOfProcessed )
	{	// Queued only when ( glb_noOfProcessed < nglb_maxNoOfImg )
		if( glb_noOfProcessed == nglb_KeywordsPrevIdx )
		{
			nglb_KeywordsTimeOut = true;
			// We switch to error mode
		}
	}
	function setKeywordsDisplay( idx )
	{
		var i, Tab1, Tab2, TabNmIdx=-1, iType, sorted, str, kk; // 0: current idx 1: aggregate 2: selected img
		if( nglb_tabNumber == "pane2" )
		{
			nglb_KeywordsPrevNo = glb_noOfProcessed;
			if( ( dt[ idx ].dttype & 16 ) == 0 )
			{	// want display spining wheel
				if( ( glb_noOfProcessed >= nglb_maxNoOfImg )||
					( nglb_KeywordsTimeOut ) )
				{	// treat as we reach the last one
					;
				}
				else
				{	// We're proceeding
					if( glb_noOfProcessed < nglb_maxNoOfImg )
						setTimeout( "checkKeywordsTimeOut("+glb_noOfProcessed+");", cnst_timeOutSec * 1000 ); // we start timer
					for( i=0; i<nglb_KeyWordDivNm.length; i++ )
					{
						Tab1 = document.getElementById( nglb_KeyWordDivNm[ i ] );
						Tab1.style.visibility = "hidden";
					}
					Tab1 = document.getElementById( "KeywordsPre" );
					Tab1.style.visibility = "visible";
					try
					{
						kk = Math.ceil( ( glb_noOfProcessed * 94 ) / nglb_maxNoOfImg );
						str = glb_inLoadKeyword + " ("+kk+" %)";
						document.getElementById("kwstatustextPre").childNodes[0].nodeValue = str;
					} catch(e) { ; }
					return;
				}
			}
			if( glb_noOfProcessed < nglb_maxNoOfImg )
			{	// We are gathering data
				switchKeyTableTitle( 0 ); // standard title
				if( nglb_maxNoOfImg <= 1 )
				{
					iType    = 0;
					TabNmIdx = switchKeyTableItself( idx, 0 ); // standard
				}
				else
				{
					iType    = 1;
					TabNmIdx = switchKeyTableItself( idx, 1 ); // pane2 progress
				}
			}
			else
			{	// Got all data
				if( nglb_maxNoOfImg <= 1 )
				{
					iType    = 0;
					switchKeyTableTitle( 0 ); // standard title
					TabNmIdx = switchKeyTableItself( idx, 0 ); // standard
				}
				else if( nglb_SelectedImg >= 0 )
				{
					iType    = 2;
					switchKeyTableTitle( 0 ); // standard title
					TabNmIdx = switchKeyTableItself( idx, 0 ); // standard
				}
				else
				{
					iType = 1;
					switchKeyTableTitle( 1 ); // title with radio
					if( nglb_ShareOrWhole == 0 )
						 TabNmIdx = switchKeyTableItself( idx, 2 ); // Shared
					else TabNmIdx = switchKeyTableItself( idx, 3 ); // Whole
				}

				glb_Add2CartLock     = false;
				glb_DownloadCompLock = false;
				glb_EditCompLock     = false;
	       
        // 1288262
				switchButtonStatus( 'add2cart', true);
				switchButtonStatus( 'dlcomp', true);
				switchButtonStatus( 'editcomp', true);
			}
			if( TabNmIdx >= 0 )
			{
				switch( iType )
				{
					case  2: sorted = dt[ nglb_SelectedImg ].keyWords; break;
					case  1: {
						if( nglb_ShareOrWhole == 0 )
							 sorted = nglb_keywordsShared;
						else sorted = nglb_keywords;
					} break;
					default: sorted = dt[ idx ].keyWords
				}
				if( sorted.charAt(0) != ',' )
				{
					sorted = sortKeywords( sorted );
					switch( iType )
					{
						case  2: dt[ nglb_SelectedImg ].keyWords = sorted; break;
						case  1: {
							if( nglb_ShareOrWhole == 0 )
								 nglb_keywordsShared = sorted;
							else nglb_keywords       = sorted;
						}; break;
						default: dt[ idx ].keyWords = sorted;
					}
				}
				if( ! nglb_KeywordsPreDispGone )
				{
					removeInitObj( "InProgKwsPre" );
					removeInitObj( "kwstatustextPre" );
					Tab1 = document.getElementById( "KeywordsPre" );
					Tab1.style.visibility    = "hidden";
					// Watson 1373165 - commented out the line below
                    // (note that control doesn't seem to reach the similar code in the block below.
                    //  If it does, we'll need to make similar changes in the other block too...)
					// nglb_Prev_KwTable        = -1;
					nglb_KeywordsPreDispGone = true;
				}
				createTableForThisTable( TabNmIdx, sorted.substring( 1, sorted.length ) ); // displayed only when nglb_tabNumber == "pane2"
			}
			if( ! nglb_KeywordsPreDispGone )
			{
				removeInitObj( "InProgKwsPre" );
				removeInitObj( "kwstatustextPre" );
				Tab1 = document.getElementById( "KeywordsPre" );
				Tab1.style.visibility    = "hidden";
				nglb_Prev_KwTable        = -1;
				nglb_KeywordsPreDispGone = true;
			}
		}
		return( TabNmIdx );
	}
	function doDisplayImageInfo( idx )
	{
		updateDisplayedImage( idx );
	}
	function fromScript_displayImageInfo( arg )
	{	// { idx:n, imgType:  // bRet == 1 ... .jpg file with xmp, retval.imagePath = selPath
		//		      //      == 2|6 . file w/ xmp, retval.imagePath = local "ImgNotAvailBig.jpg" path
		//		      //      == 8 ... remote Version Cue file
		// 		dispType: // == 1 ... not Comp yet / == 2 ... Comp
		//		iPath:"", iHeight:n, iWidth:n, iFname:""     +ret.iPath +'"'
		eval( arg );
		var idx = args.idx, iPath;
		iPath = unescape( args.iPath );
		if( iPath != "" )
			dt[ idx ].iPath = iPath;
		dt[ idx ].iHeight   = args.iHeight;
		dt[ idx ].iWidth    = args.iWidth;
		dt[ idx ].iFname    = args.iFname;
		setTimeout( "doDisplayImageInfo("+idx+");", 10 );
	}
	function fromScript_gotStatusReport( arg )
	{	// it is called when all data is obained
		eval( arg );
		dt[ args.idx ].status = args.status;
		if( ( args.status & nglbcnst_gpk3_allDone ) != 0 )
		{
			++glb_noOfProcessed;
		}
		else if( ( args.status & nglbcnst_gpk3_getReslDone ) != 0 )
		{
			updateResolutions();
		}
		else
		{	// error or nglbcnst_gpk3_getReslDone
			++glb_noOfProcessed;
		}
    	updateDisplayedImage( args.idx )
		if( nglb_tabNumber == "pane2" )
		{	// All data has just gotten
			setKeywordsDisplay( args.idx );
		}
	}
	function fromScript_CompOk( arg )
	{	// it is called when the comp file is ready
		eval( arg );
		var Title, iPath;
		var idx   = args.idx;
		var iPath = unescape( args.iPath );
		if( iPath != "" )
			dt[ idx ].iPath   = iPath;
		dt[ idx ].MediaID     = unescape( args.MediaID );
		dt[ idx ].RefID 	  = unescape( args.RefID );
		dt[ idx ].MediaTitle  = unescape( args.MediaTitle );
		dt[ idx ].PartnerName = unescape( args.PartnerName );
		dt[ idx ].imgType     = 2; // Comp can be displayed
		if( ! nglb_KeywordsTimeOut )
		{
			Title = dt[ idx ].MediaTitle;
			if( Title.length > glb_imageAdjust.cx )
				Title = Title.substring(0,glb_imageAdjust.cx-3) +"...";
			try {
				document.getElementById("txtwd_a_"+idx).childNodes[0].nodeValue = Title;
				document.getElementById("tdtxt_"+idx).style.visibility = "visible";
			} catch(e) { ; }
		}
		if(( nglb_tabNumber == "pane2") && (nglb_maxNoOfImg == 1))
		{
			loadBasicXMPData(true);
		}
	}

	function dofromScript_KeyWds( arg )
	{
		var sorted;
		eval( arg ); // args={ idx:xx, ky:str};
		dt[ args.idx ].keyWords = unescape( args.ky );
		nglb_Prev_KwTitle = -1;
		nglb_Prev_KwTable = -1;
		setKeywordsDisplay( args.idx );
	}
	function fromScript_KeyWds( arg )
	{
		setTimeout( 'dofromScript_KeyWds( "'+arg+'")', 10 );
	}
	function stripFreq( inA )
	{
		var i, r, t, ouA="";
		r = inA.split( ',' );
		for( i=0; i<r.length; i++ )
		{
			if( r[ i ] != "" )
			{
				t = r[ i ].split( '\177' );
				if( t.length > 1 )
				{
					if( ouA != "" )
						ouA += ",";
					ouA += ( "1\177"+t[1] );
				}
			}
		}
		return( ouA );
	}
	function dofromScript_AllKeyWds( arg )
	{
		eval( arg ); // args={ fact:xxx, ky:str};
		nglb_factor         = args.fact;
		nglb_keywordsShared = unescape( args.ky );
		nglb_keywords	    = stripFreq( nglb_keywordsShared );
		nglb_Prev_KwTitle = -1;
		nglb_Prev_KwTable = -1;
		setKeywordsDisplay( args.idx );
	}
	function fromScript_AllKeyWds( arg )
	{
		setTimeout( 'dofromScript_AllKeyWds( "'+arg+'")', 10 );
	}
	function dofromScript_AllKeyWdsBC3( arg )
	{
		eval( arg ); // args={ fact:xxx, ky:str};
		nglb_factor         = args.fact;
		nglb_keywordsShared = unescape( args.sky );
		nglb_keywords	    = unescape( args.ky );
		nglb_Prev_KwTitle = -1;
		nglb_Prev_KwTable = -1;
		setKeywordsDisplay( args.idx );
	}
	function fromScript_AllKeyWdsBC3( arg )
	{
		setTimeout( 'dofromScript_AllKeyWdsBC3( "'+arg+'")', 10 );
	}

	var makeURLuniqueNo=10000000;
	function makeURLunique( fileNm, bUnique )
	{
		var s = fileNm.split( '?' );
		if( bUnique ) 
			 return( s[0] + ( "?randomFactor="+( makeURLuniqueNo++ ) ) );
		else return( s[0] );
	}
	function displayJpgImg( idx, jpgImg )
	{
		var imgObj = document.images[ jpgImg ];
		if( ( dt[ idx ].iHeight > 0 )&&( dt[ idx ].iWidth > 0 ) )
		{	// Image size is given from ExtendScript
				imgObj.src    = makeURLunique( dt[ idx ].iPath, true );
				imgObj.width  = dt[ idx ].iWidth;
				imgObj.height = dt[ idx ].iHeight;
				glb_ImgHeight = dt[ idx ].iWidth;
				glb_ImgWidth  = dt[ idx ].iHeight;
		}
		else
		{ // So we need to adjust to the window
			var imgHeight, imgWidth, newW, newH, myImg = new Image();
				myImg.src = makeURLunique( dt[ idx ].iPath, true );
				imgHeight = myImg.height;
				imgWidth  = myImg.width;
				glb_ImgWidth = Math.ceil( ( nglb_imgDefaultHeight * imgWidth ) / imgHeight );
				if( glb_ImgWidth > nglb_imgDefaultWidth )
				{
					glb_ImgHeight = Math.ceil( ( nglb_imgDefaultWidth * imgHeight ) / imgWidth );
					glb_ImgWidth  = nglb_imgDefaultWidth;
				}
				else
				{
					glb_ImgHeight = nglb_imgDefaultHeight;
				}
				imgObj.src    = makeURLunique( dt[ idx ].iPath, true );
				imgObj.width  = glb_ImgWidth;
				imgObj.height = glb_ImgHeight;
		}
		document.images[ jpgImg ].style.visibility = "visible";
	}
	function updateDisplayedImage( idx )
	{
		try
		{
			if( dt[ idx ].iPath != "" )
			{
				if( nglb_tabNumber == "pane1")
				{
					displayJpgImg( idx, "JPGImg" );
					displayJpgImg( idx, "JPGImgPre" );

				} // if( nglb_tabNumber == "pane1" )
				else if (nglb_tabNumber == "pane3")
				{
					displayJpgImg( idx, "JPGImg4Pr" ); // JPGImg4Pr is the image element in the Provider pane
					displayJpgImg( idx, "JPGImgPrePr" );
				}
			}
			setupPanes( nglb_containerNumber, nglb_tabNumber );
			adjustImg( idx );
		} catch(e) { ; }
	}

	var nglb_correctIdx;
	function docorrectIdx()
	{	// This function is called from ExtendScript from function: stockphoto.gpk3.displayGpk3(),
		// which is executed when...
		// 1) each thread (for image) is started, or
		// 2) from callback corresponding to [Back]/[Next] arrow
		try
		{	// status:n, dttype:<dbg-switch>, imgType:<see above>, dispType:<>
			var idx = nglb_correctIdx.idx, iPath;
			dt[ idx ].imgType  = nglb_correctIdx.imgType;
			dt[ idx ].dispType = nglb_correctIdx.dispType;
			iPath = unescape( nglb_correctIdx.iPath );
			if( iPath != "" )
				dt[ idx ].iPath= iPath;
			dt[ idx ].iHeight  = nglb_correctIdx.iHeight;
			dt[ idx ].iWidth   = nglb_correctIdx.iWidth;
			dt[ idx ].iFname   = unescape( nglb_correctIdx.iFname );
			nglb_containerNumber = nglb_correctIdx.container;
			nglb_tabNumber       = nglb_correctIdx.tableNo;
			//glbcnst_index        = nglb_correctIdx.idx;
			glb_MainJpgNm        = nglb_correctIdx.imgPath;
			glb_inCompFolder     = nglb_correctIdx.inCompFolder;
			glb_inPurchasedFolder= nglb_correctIdx.inPurchasedFolder;
			glb_inPreviousSearchFolder = nglb_correctIdx.inPreviousSearchFolder;
			glb_isThumbnail = nglb_correctIdx.isThumbnail;
			updateDisplayedImage( idx );
		} catch(e) { ; }
	}
	function correctIdx( ecmd )
	{
		eval( unescape( ecmd ) );
		setTimeout( "docorrectIdx();", 10 );
	}
	function adjustImg( idx )
	{	// idx =0,1,2,3
		if( nglb_KeywordsTimeOut )
			return;
		try
		{
			if( dt[ idx ].iPath != "" )
			{
				if( nglb_FirstCorrectFromES )
				{
					nglb_FirstCorrectFromES = false;
					// Removing KwImagePre
					removeInitObj( "InProgImgPane2" )
					removeInitObj( "statustextPane2" )
					var pane2_1 = document.getElementById( "KwImagePre" );
					pane2_1.style.visibility = "hidden";
					// Init object in Image4Size1 div
					removeInitObj( "InProgImg4Size1" )
					removeInitObj( "ErrorImg4Size1" )
					removeInitObj( "statustext4Size1" )
					var jpgimgObj0 = document.getElementById( "Image4Size1" );
					var jpgimgObj1 = document.getElementById( "KwImage" );
					var jpgimgObj2 = document.getElementById( "KwImagePre" );
					if( nglb_maxNoOfImg <= 1 )
					{
						jpgimgObj0.style.visibility = "visible";
						jpgimgObj1.style.visibility = "hidden";
						jpgimgObj2.style.visibility = "hidden";
					}
					else
					{
						jpgimgObj0.style.visibility = "hidden";
						jpgimgObj1.style.visibility = "visible";
						jpgimgObj2.style.visibility = "hidden";
					}
				}
				// if( dt[ idx ].iPath != dt[ idx ].prevDisp )
				{
					try
					{
						if( nglb_maxNoOfImg <= 1 )
						{
							var status = dt[ glbcnst_index ].status;
							if (undefined != status)
							{
    							var oPane2PostDiv = document.getElementById( "Pane2PostDiv" );
    							var oPane2PreDiv = document.getElementById( "Pane2PreDiv" );
    							if ( ( ( status & nglbcnst_gpk3_getCompDone ) != 0 )
    							     || ( ( status & nglbcnst_gpk3_allError ) != 0 )
                                     || ( dt[ glbcnst_index ].timeOut != 0 ) )
    							{
    							     oPane2PostDiv.style.visibility = "visible";
    							     oPane2PostDiv.style.display = "";
    							     oPane2PreDiv.style.visibility = "hidden";
    							     oPane2PreDiv.style.display = "none";
    							     
    							     if ( ( status & nglbcnst_gpk3_getCompDone ) != 0 )
    							     {
    							         displayJpgImg( idx, "JPGImg4Size1" );
    							     }
    							     else
    							     {
                              document.images['ErrorImg4Size1'].style ="visibility:visible;width:20";
					                    document.images['ErrorImg4Size1'].src   = makeURLunique( document.images['ErrorImg4Size1'].src, true );
					                    var mydata1  = document.getElementById("statustext4Size1");
				                      if ((mydata1 != null) && (mydata1 != undefined))
                      				{
                      					if (mydata1.hasChildNodes()) { mydata1.removeChild(mydata1.childNodes[0]); }
                      					 var mytext1 = document.createTextNode(cnst_timeOutErrMsgPane23);
                      					mydata1.appendChild(mytext1);
                      					mydata1.style.visibility = "visible";
                      				}
                        }
    							}
    							else
    							{
    							     oPane2PreDiv.style.visibility = "visible";
    							     oPane2PreDiv.style.display = "";
    							     oPane2PostDiv.style.visibility = "hidden";
    							     oPane2PostDiv.style.display = "none";
                                     displayJpgImg( idx, "JPGImgPre2" );                                
                                }
                            }
                            else
                            {
                                displayJpgImg( idx, "JPGImg4Size1" );
                            }
						}
						else
						{
							var i, j, srcFile, imgHeight, imgWidth, newH, newW,
							j = idx % glb_imageAdjust.m;
							i = ( idx - j ) / glb_imageAdjust.m;
							if( j == 0 )
							{
								if( i > 0 ) {
									var SpColObj = document.getElementById( "trimg_"+i );
									SpColObj.height = glb_imageAdjust.ih;
								}
							}
							else
							{
								var SpRowObj = document.getElementById( "tdimgsp_"+j );
								SpRowObj.width = glb_imageAdjust.iw;
							}
							var srcObj = document.getElementById("tdimg_"+idx);
							if( idx < nglb_maxNoOfImg )
							{
								srcFile = dt[ idx ].iPath;
							}
							else
							{
								srcFile = "../images/spacer.gif";
							}
							if( srcFile.indexOf( "/spacer.gif" ) < 0 )
							{
								var myImg = new Image();
								myImg.src = makeURLunique( srcFile, true );
								imgHeight = myImg.height;
								imgWidth  = myImg.width;
								if( ( imgHeight <= 0 )||( imgWidth <= 0 ) )
								{
									myImg.src = makeURLunique( "../images/spacer.gif", true );
								}
								else
								{
									// Assume img height == ph
									newW = ( glb_imageAdjust.ph * imgWidth ) / imgHeight;
									if( newW > glb_imageAdjust.pw )
									{
										newH = ( glb_imageAdjust.pw * imgHeight ) / imgWidth;
										newW = glb_imageAdjust.pw;
										// it implies that the image is shorter than the space we provide.
										if( nglb_maxNoOfImg > 1 )
										{
											var spacer = document.getElementById( "tdimgsp_"+idx );
											spacer.height = glb_imageAdjust.ph - newH;
										}
									}
									else
									{
										newH = glb_imageAdjust.ph;
									}
								}
								srcObj.height = Math.ceil( newH );
								srcObj.width  = Math.ceil( newW );
								srcObj.src    = makeURLunique( srcFile, true );
								srcObj.style.visibility = "visible";
							}
						} // if( nglb_maxNoOfImg <= 1 )
					}
					catch(e) { ; }
					dt[ idx ].prevDisp = dt[ idx ].iPath;
				} // if( dt[ idx ].iPath != dt[ idx ].prevDisp )
			} // if( dt[ idx ].iPath != "" )
		}
		catch(e) { ; }
	}
	function fromScript_KeyByFreq( arg )
	{
	}
	function fromScript_KeyByName( arg )
	{
	}
	var glb_SortDispDone=false;
	function sortKeywords( inKy )
	{
		var a0, n0, a1, n1, k, kMax, ouKy=inKy;
		this.compare=function( c1, n1, c2, n2 )
		{
			var i, n, Bt1, Bt2;
			if( n1 < n2 )
				 n = n1;
			else n = n2;
			for( i=0; i<n; i++ )
			{
				Bt1 = c1.charCodeAt( i );
				Bt2 = c2.charCodeAt( i );
				if( Bt1 > Bt2 )
				{
					return( -1 );
				}
				if( Bt1 < Bt2 )
				{
					return( 1 );
				}
			}
			if( n1 > n2 )
				return( -1 );
			return( 0 );
		}
		try
		{
			if( inKy.charAt(0) == ',' )
			{
				return( ouKy );
			}
			var ar    = inKy.split(',');
			var bSwap = true;
			var pcent, pstr;
			for( kMax=ar.length; ((kMax>=2)&&(bSwap)); kMax-- )
			{	// can not be here if kMax == 0 or 1 (no need to sort)
			 //   if( ( document.getElementById("kwstatustextPre") != null )&&
			//		( document.getElementById("kwstatustextPre") != undefined )&&
			//		( document.getElementById("kwstatustextPre").hasChildNodes() ) )
			//	{
				if( ! glb_SortDispDone )
				{
					pcent = Math.ceil( 6 - ( ( ( kMax + 1 ) * 6 ) / ( ar.length+1 ) ) );
					if( pcent < 0  )
						pcent = 1;
					if( pcent > 6 )
						pcent = 6;
					pstr = glb_inLoadKeyword + " ("+(pcent+94)+"%)";
					document.getElementById("kwstatustextPre").childNodes[0].nodeValue = pstr;
				}
			//	}
				a0 = ar[0];
				n0 = a0.length;
				bSwap = false;
				for( k=1; k<kMax; k++ )
				{
					a1 = ar[ k ];
					n1 = a1.length;
					if( this.compare( a0, n0, a1, n1 ) < 0 )
					{
						bSwap   = true;
						ar[k-1] = a1;
						ar[k]   = a0;
					}
					else
					{
						a0 = a1;
						n0 = n1;
					}
				}
			}
			ouKy = "";
			for( k=0; k<ar.length; k++ )
			{
				if( ar[ k ] != "" )
				{
					ouKy += ( "," + ar[ k ] ); // the first char of ouKy is ','
				}
			}
		}
		catch(e) { ; }
		glb_SortDispDone = true;
		return( ouKy );
	}
	function multiImgSel( idx )
	{
		if( ( dt[ idx ].dttype & 4 ) == 0 )
			return;
		if( idx == nglb_SelectedImg )
		{ // deselect
			var imgCell0 = document.getElementById( "tdimg_"+nglb_SelectedImg );
			imgCell0.border  = "0pt solid white";
			nglb_SelectedImg = -1;
		}
		else
		{
			if( nglb_SelectedImg >= 0 )
			{	// Already selected
				var imgCell1 = document.getElementById( "tdimg_"+nglb_SelectedImg );
				imgCell1.border = "0pt solid white";
			}
			var imgCell2 = document.getElementById( "tdimg_"+idx );
			imgCell2.border  = "2pt solid black";
			nglb_SelectedImg = idx;
		}
		nglb_Prev_KwTitle = -1;
		nglb_Prev_KwTable = -1;
		setKeywordsDisplay( glbcnst_index );
	}
	function SelKeyPressed( which )
	{	// which 0:shared 1:whole
		nglb_ShareOrWhole = which;
		setKeywordsDisplay( glbcnst_index );
		return( true );
	}
	function KWSpiningWheel( OnOff /* "1" on / "0" off */ )
	{
		// we decided not to display spinning wheel here
		//var spin = document.getElementById( "Kwspin" );
		if( OnOff == '1' )
		{
			; //spin.style.visibility = "visible";
		}
		else 
		{
			//spin.style.visibility = "hidden";
			glb_Add2CartLock = false;
			glb_DownloadCompLock = false;
			glb_EditCompLock = false;
		}
	}
	//	----------------------
	// New gpk3 function -END-
	//	----------------------

	function CSAction(array)
	{
		return CSAction2(CSAct, array);
	}
	function CSAction2(fct, array)
	{
		var result;
		for (var i=0;i<array.length;i++)
		{
			if(CSStopExecution)
			{
				return false;
			};
			var aa = fct[array[i]];
			if (aa == null)
			{
				return false;
			};
			var ta = new Array;
			for(var j=1;j<aa.length;j++)
			{
				if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2))
				{
					if(aa[j][0]=="VAR")
					{
						ta[j]=CSStateArray[aa[j][1]];
					}
					else
					{
						if(aa[j][0]=="ACT")
						{
							a[j]=CSAction(new Array(new String(aa[j][1])));
						}
						else
						{
							ta[j]=aa[j];
						};
					};
				}
				else
				{
					ta[j]=aa[j];
				};
       			}
			result=aa[0](ta);
		}
		return result;
	}

	CSAct = new Object;

	function CSCloseWindow()
	{
		if (self.parent.frames.length != 0)
		{
			self.parent.close()
		}
		else
		{
			window.close()
		}
	}

	function CSGoBack1() { history.back() }

	function CSClickReturn ()
	{
		var bAgent = window.navigator.userAgent;
		var bAppName = window.navigator.appName;
		if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
		{
			return true; /* dont follow link */
		}
		else
		{
			return false; /* dont follow link */
		};
	}

	function newImage(arg)
	{
		if (document.images)
		{
			rslt = new Image();
			rslt.src = arg;
			return rslt;
		}
	}

	userAgent = window.navigator.userAgent;
	browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
	mustInitImg = true;
	function initImgID()
	{
		var di = document.images;
		if (mustInitImg && di)
		{
			for (var i=0; i<di.length; i++)
			{
				if (!di[i].id) di[i].id=di[i].name;
			}
			mustInitImg = false;
		}
	}

	function findElement(n,ly)
	{
		var d = document;
		if (browserVers < 4)
		{
			return d[n];
		};
		if ((browserVers >= 6) && (d.getElementById))
		{
			initImgID; return(d.getElementById(n))
		};
		var cd = ly ? ly.document : d;
		var elem = cd[n];
		if (!elem)
		{
			for (var i=0;i<cd.layers.length;i++)
			{
				elem = findElement(n,cd.layers[i]);
				if (elem)
				{
					return elem;
				};
			}
		}
		return elem;
	}

	function changeImagesArray(array)
	{
		if (preloadFlag == true)
		{
			var d = document; var img;
			for (i=0;i<array.length;i+=2)
			{
				img = null; var n = array[i];
				if (d.images)
				{
					if (d.layers)
					{
						img = findElement(n,0);
					}
					else
					{
						img = d.images[n];
					}
				}
				if (!img && d.getElementById)
				{
					img = d.getElementById(n);
				}
				if (!img && d.getElementsByName)
				{
					var elms = d.getElementsByName(n);
					if (elms)
					{
						for (j=0;j<elms.length;j++)
						{
							if (elms[j].src)
							{
								img = elms[j]; break;
							}
						}
					}
				}
				if (img)
				{
					img.src = array[i+1];
				}
			}
		}
	}

	function tipBody(tipName, changeStyle, left, right)
	{
		var cObj = document.all[tipName].style;
		switch (changeStyle)
		{
			case 1: //onmouseover
				cObj.visibility = "visible";
				break;

			case 2: //onmouseout
				cObj.visibility = "hidden";
				break;

		}
  		cObj.left = left;
		cObj.top  = right;

		return( true );
	}

	function changeImagesNToolTip(name, path, tipName, changeStyle, left, right)
	{
		tipBody(tipName,changeStyle,left, right);
		changeImages(name, path);
		return( true );
	}
	function changeImgwrapNToolTip(index, name, path, tipName, changeStyle,left, right)
	{
		tipBody(tipName,changeStyle, left, right);
		changeImgwrap(index,name, path);
		return( true );
	}

	function changeImages()
	{
		changeImagesArray(changeImages.arguments);
		return( true );
	}

	function changeImgwrap(a,b,c)
	{
		if (a < glb_NumResolutions)
		{
			changeImages(b,c);
		};
		return( true );
	}
    // -->
   </script>
  </csscriptdict>
  <csactiondict>
   <script type="text/javascript">
    <!--
	CSAct[/*CMP*/ 'bd1c4e420'] = new Array(CSCloseWindow);
	CSAct[/*CMP*/ 'bd1c64f11'] = new Array(CSGoBack1);
	var preloadFlag = false;

    function setCurrentSelectedResolution(iImgIndex, iResolutionIndex)
    {
        if (('undefined' != typeof iImgIndex) && ('undefined' != typeof iResolutionIndex)
            && ('undefined' != typeof glb_arrSelectedResolutions))
        {
            glb_arrSelectedResolutions[iImgIndex] = iResolutionIndex;
        }
    }
   
    function getCurrentSelectedResolution(iImgIndex)
    {
        if (('undefined' != typeof iImgIndex)
            && ('undefined' != typeof glb_arrSelectedResolutions)
            && ('undefined' != typeof glb_arrSelectedResolutions[iImgIndex]))
        {
            return glb_arrSelectedResolutions[iImgIndex];
        }
        else
        {
            return 0;  // default
        }
    }
    
	function updateResolutions()
	{
		var i, argStr, radioValue, desc, price, theID, myTab, myrow, mydata, mytext, index, tag;
		var numResolutions = call( "_cbimgDetail_getNoOfReslutions", glbcnst_DocumentID+(glbcnst_index.toString()) );
		var radioValuePre = "Resolution";
        var iSelectedResolution = getCurrentSelectedResolution(glbcnst_index); // we don't need to check validity of glbcnst_index here
		
		if( numResolutions > 5 )
		{
			numResolutions = 5;
		};
		glb_NumResolutions = numResolutions;

		for( i=0; i<numResolutions; i++ )
		{
			argStr = (glbcnst_index.toString())+','+i.toString();
			radioValue = radioValuePre + i.toString();

			desc   = call( "_cbimgDetail_getResDescription",  glbcnst_DocumentID+argStr);
			price  = call( "_cbimgDetail_getPrice", glbcnst_DocumentID+argStr);

			//get Comp Desc Title.

			var inp1 =  document.createElement('INPUT');    // checkbox
			inp1.setAttribute('type','radio');
			inp1.setAttribute('name', "SelectResolution");
			inp1.setAttribute('value',radioValue);
			
			inp1.iResIndex = i; // set property iResIndex
			inp1.setAttribute('onclick',"setCurrentSelectedResolution(glbcnst_index, this.iResIndex);");

			if (iSelectedResolution == i)
			{
				inp1.setAttribute('checked',true);
			}

			theID  = document.getElementById("FileSize");
			myTab  = theID.getElementsByTagName('table').item(1);
			myrow  = myTab.getElementsByTagName('tr').item(1+i);
			mydata = myrow.getElementsByTagName('td').item(0);
			if (mydata.hasChildNodes())
				mydata.replaceChild(inp1, mydata.childNodes[0]);
			else
				mydata.appendChild(inp1);

			mydata = myrow.getElementsByTagName('td').item(1);
			myText = document.createTextNode(desc);
			if (mydata.hasChildNodes())
				mydata.replaceChild(myText, mydata.childNodes[0]);
			else
				mydata.appendChild(myText);

			//get Comp price.
			mydata = myrow.getElementsByTagName('td').item(2);
			myText = document.createTextNode(price);
			if (mydata.hasChildNodes())
			{
				mydata.replaceChild(myText, mydata.childNodes[0]);
			}
			else
			{
				mydata.appendChild(myText);
			}

		};

		if (numResolutions < 5)
		{
			//Clear the rest table rows rather that delete them.
			theID  = document.getElementById("FileSize");
			myTab  = theID.getElementsByTagName('table').item(1);
			for (r = numResolutions; r < 5; r ++)
			{
				myrow  = myTab.getElementsByTagName('tr').item(r + 1);
				myText = document.createTextNode(" ");
				for (i=0; i < 3; i++)
				{
					mydata = myrow.getElementsByTagName('td').item(i);
					if (mydata.hasChildNodes())
					{
						mydata.replaceChild(myText, mydata.childNodes[0]);
					}
					else
					{
						mydata.appendChild(myText);
					}
				}
			}
		}

	}

	function loadFileSizeRes( index )
	{
		//we get the call back to update in updateResolutions()
		desc = call( "_cbimgDetail_getFileSize", glbcnst_DocumentID+( (glbcnst_index.toString())+','+index.toString() ) );
	}

	function ChangeTextFieldValue(chkBox)
	{

	}
  
  function CheckboxKeyPressHandler( oEvent, sCurID )
	{
	   if( undefined != oEvent && undefined != oEvent.target
     &&  undefined != sCurID && undefined != oEvent.keyCode )
	   {
	      var aCurIDNumArray = sCurID.split('_');
	      var iKeyCode = oEvent.keyCode;
	      var iCurIDNum = 0;
	      	      	      	      
	      if( (undefined == aCurIDNumArray) || (2 != aCurIDNumArray.length))
	      {
	        return false;
	      }

        iCurIDNum = aCurIDNumArray[1];
        
        if( nglbcnst_gpk3_keyTab == iKeyCode ) // tab
	      {
	        var oNextObj = document.getElementById('findSimilarButton');
          if( undefined != oNextObj )
          {
            oNextObj.focus( );
          } 
	      }
	      else if( nglbcnst_gpk3_keyUp == iKeyCode ) // up-key
        {
          var sNextID = aCurIDNumArray[0] + "_" + (iCurIDNum - 1);
          var oNextObj = document.getElementById( sNextID );
          if( (0 < iCurIDNum ) &&  (undefined != oNextObj) )
          {
            oNextObj.focus( );
          }
	      }
	      else if(nglbcnst_gpk3_keyDown == iKeyCode ) // dn-key
	      {
	       var sNextID = aCurIDNumArray[0] +"_" + (+iCurIDNum + 1); 
	       var oNextObj = document.getElementById( sNextID );
	       	          
	       if( (iCurIDNum < (glb_Checkbox_Index-1)) && (undefined != oNextObj) )
	       {
	         oNextObj.focus( );
	       }
	      }
	      else if( (nglbcnst_gpk3_keySpace==iKeyCode) || (nglbcnst_gpk3_keyReturn==iKeyCode) ) // return true
	      {
	       return true;
	      }
	   }

	   return false;
	}
	
	function insertTD(tr, k)
	{
		try
		{
			var inp1 =  document.createElement('INPUT');    // checkbox
			inp1.setAttribute('type','checkbox');
			inp1.setAttribute('name', k);
			inp1.setAttribute('value','0');
			
      // 1256701, 0=shared, 1=whole
      if( 0 == nglb_ShareOrWhole ) 
      {
			   inp1.setAttribute('id', 'kwdCheckBoxS_'+ glb_Checkbox_Index);
			}
			else
			{
			   inp1.setAttribute('id', 'kdwCheckBoxA_' + glb_Checkbox_Index);
			}
			inp1.setAttribute('onkeydown', 'CheckboxKeyPressHandler(event, this.id);');
			glb_Checkbox_Index = glb_Checkbox_Index + 1;

			inp1.onclick=function(){ChangeTextFieldValue(this);}

			var newText = document.createTextNode(k);

			var newTD = document.createElement("td");
			newTD.setAttribute('width','8');
			tr.appendChild(newTD);

			newTD = document.createElement("td");
			newTD.setAttribute('class','body');
			newTD.appendChild(inp1);
			newTD.appendChild(newText);
			tr.appendChild(newTD);
		}
		catch(e) { ; }
	}
	function insertTDspace(tr)
	{
		try
		{
			var inp1    = document.createTextNode( "xx" );
			var newText = document.createTextNode( "yy" );
			
			var newTD = document.createElement("td");
			newTD.setAttribute('width','8');
			newTD.setAttribute('color','white');
			tr.appendChild( newTD );

			newTD = document.createElement("td");
			newTD.setAttribute('class','bold_smallwhite');
			newTD.setAttribute('style','display:inline; visibility:hidden');
			newTD.setAttribute('color','white');
			newTD.appendChild( inp1 );
			newTD.appendChild( newText );
			tr.appendChild( newTD );
		}
		catch(e) { ; }
	}

	function insertTR(kwTable, k, i, iMax, bSpace)
	{
		try
		{
			var newTR = document.createElement("tr");
			if( bSpace )
				 insertTDspace( newTR );
			else insertTD( newTR, k );
			try
			{
				if( i<iMax )
					 kwTable.replaceChild( newTR, kwTable.childNodes[i] );
				else kwTable.appendChild(  newTR );
			}
			catch(e) { ; }
		}
		catch(e) { ; }
	}
	function createTableForThisTable( tabNm, keywordArray )
	{
		if( tabNm < 0 )
			return;
		try
		{
			var i, iMax, kVal, trueSize=0, rObj, iSt;
			var keyArray = keywordArray.split(",");
			var kwTable  = document.getElementById( nglb_KeyWordTableNm[ tabNm ] );
			var gMaxKeys = keyArray.length;
      // 1256701
			glb_Checkbox_Index = 0;
			nglb_TabNmIdx = tabNm; // save the last value

			if( keyArray[0] == "_-_-_" )
			{
				iSt  = 1;
				iMax = keyArray.length;
			}
			else
			{
				iSt = 0;
				if( tabNm == 2 )
				{
					iMax = 0;
					for( i=0; i<keyArray.length; i++ )
					{
						kVal = ( keyArray[i] ).split( "\177" );
						if( ( kVal.length > 1 )&&( kVal[1] != "" ) )
						{
							if( ( nglb_factor - kVal[0] ) >= nglb_maxNoOfImg)
								 iMax++;
							else break;
						}
					}
				}
				else
				{
					iMax = keyArray.length;
				}
			}
			for (i=iSt; i < iMax; i++)
			{
				if( iSt > 0 )
				{
					if( keyArray[i] != "" )
					{
						insertTR(kwTable, keyArray[i], trueSize, nglb_KWdsTableSize[ nglb_TabNmIdx ], false );
						trueSize++;
					}
				}
				else
				{
					kVal = ( keyArray[i] ).split( "\177" );
					if( ( kVal.length > 1 )&&
						( kVal[1] != "" ) )
					{
						insertTR(kwTable, kVal[1], trueSize, nglb_KWdsTableSize[ nglb_TabNmIdx ], false );
						trueSize++;
					}
				}
			}
		//	if( tabNm == 2 )
		//	{
				for( i=trueSize; i < 14; i++ )
				{
					insertTR(kwTable, "  ", i, nglb_KWdsTableSize[ nglb_TabNmIdx ], true );
					trueSize++;
				}
		//	}
			if (trueSize > 0)
			{
				//enable search again button.
				if (document.all("Search").disabled == true)
				{
					document.all("Search").disabled = false;
				}
			}
			for( i=trueSize; i<nglb_KWdsTableSize[ nglb_TabNmIdx ]; i++ )
			{
				try
				{
					kwTable.removeChild( kwTable.childNodes[i] );
				}
				catch(e)
				{
					i = nglb_KWdsTableSize[ nglb_TabNmIdx ];
				}
			}
		}
		catch(e) { ; }
		nglb_KWdsTableSize[ nglb_TabNmIdx ] = trueSize;
	}

		var glb_PrevPaneForloadKeyword="";
		var glb_PrevIdxForloadKeyword =-1;
	function loadKeyword( pane, idx )
	{
		var sorted;
		if( ( pane == glb_PrevPaneForloadKeyword )&&
			( idx  == glb_PrevIdxForloadKeyword  ) )
			return;
		glb_PrevPaneForloadKeyword = pane;
		glb_PrevIdxForloadKeyword  = idx;

	}

	function deleteTitle()
	{
		if (nglb_maxNoOfImg <= 1)
			return;
		theID  = document.getElementById("ID");
		myTab  = theID.getElementsByTagName('table').item(0);
		mydata = myTab.getElementsByTagName('td').item(0);
			
		if(document.getElementById("titleBar1").hasChildNodes() == true && document.getElementById("titleBar").hasChildNodes())
		{
			document.getElementById("titleBar1").childNodes[0].nodeValue = document.getElementById("titleBar").childNodes[0].nodeValue;	
		}
		else
		{
		    if (mydata.childNodes[0])
		    {
		 	 document.getElementById("titleBar1").appendChild(mydata.childNodes[0]);
		 	}
		}
		if (mydata.hasChildNodes())
			mydata.removeChild(mydata.childNodes[0]);	
	}

	function loadBasicXMPData(titleOnly)
	{
		var i, argStr, desc, price, theID, myTab, myrow, mydata, mytext, index, tag;

		//mediaID
		desc   = dt[ glbcnst_index ].MediaID;
		desc1  = dt[ glbcnst_index ].MediaTitle;
		theID  = document.getElementById("ID");
		myTab  = theID.getElementsByTagName('table').item(0);
		mydata = myTab.getElementsByTagName('td').item(0);

        if ( (undefined != mydata.childNodes) && (undefined != mydata.childNodes[0]))
        {
		    mydata.removeChild(mydata.childNodes[0]);
		}

		desc2 = desc1;
		if (desc2.length > glb_TitleNumChar)
		{
			desc2 = desc2.substring(0, glb_TitleNumChar) + "...";
		}
		if (desc2.length == 0)
		{
			desc2 = dt[ glbcnst_index ].RefID;
		}
		else
		{
			desc2 = dt[ glbcnst_index ].RefID + " " + glb_TitleText + " " + desc2;
		}
		mytext = document.createTextNode(desc2);
		mydata.appendChild(mytext);

		if (titleOnly)
			return;

		//Media ID
		theID = document.getElementById("imageidtext");
		var CurrNode = document.createTextNode( desc );
		if (theID.hasChildNodes())
			theID.replaceChild(CurrNode, theID.childNodes[0]);
		else
			theID.appendChild( CurrNode );

		//Media Title
		desc = desc1;
		if (desc.length > glb_DespNumChar)
		{
			desc = desc.substring(0, glb_DespNumChar) + "...";
		}
		theID = document.getElementById("titletext");
		var CurrNode = document.createTextNode( desc );
		if (theID.hasChildNodes())
			theID.replaceChild(CurrNode, theID.childNodes[0]);
		else
			theID.appendChild( CurrNode );

		//Provider
		desc  = dt[ glbcnst_index ].PartnerName;
		theID = document.getElementById("providerText");
		CurrNode = document.createTextNode( desc );
		if (theID.hasChildNodes())
			theID.replaceChild(CurrNode, theID.childNodes[0]);
		else
			theID.appendChild( CurrNode );

	}

	function curImageSize(request)
	{
		var theIDTag;
		if (nglb_tabNumber == "pane1")
		{
			theIDTag = document.getElementById("Image");
		}
		else if (nglb_tabNumber == "pane3")
		{
			theIDTag = document.getElementById("prImage");
		}
		var mytable   = theIDTag.getElementsByTagName('table').item(0);
		var myrow     = mytable.getElementsByTagName('tr').item(0);
		var myImgsrc  = mytable.getElementsByTagName('img').item(0);
		var imgwidth  = myImgsrc.width;
		var imgheight = myImgsrc.height, n=0;

		switch (request)
		{
			case 'get':

				//waiting loop for image to load
				while( ( ( imgwidth == 0 )||( imgheight == 0 ) )&&( n<500 ) )
				{
					imgwidth  = myImgsrc.width;
					imgheight = myImgsrc.height;
					n++;
				};

				var wRate = 458 / imgwidth;
				var hRate = 411 / imgheight;

				if( wRate < hRate )
				{
					myImgsrc.height = myImgsrc.height * wRate;
					myImgsrc.width  = myImgsrc.width * wRate;
				}
				else
				{
					myImgsrc.height = myImgsrc.height * hRate;
					myImgsrc.width  = myImgsrc.width * hRate;
				}

				//global data save for later use.
				glb_ImgWidth  = myImgsrc.width;
				glb_ImgHeight = myImgsrc.height;

				//reset it.
				myImgsrc.width = 1;
				myImgsrc.height = 1;

				break;
		}

	}

	function loadCurImage( getCompAndResState )
	{

	if( nglb_tabNumber == "pane2") // nglb_tabNumber != "pane1"
		{
			if ((getCompAndResState  == '1') && (nglb_maxNoOfImg == 1))
			{
				loadBasicXMPData(true);
			}
			return( true );
		}

		if (getCompAndResState  == '1')
		{

					//disable inprogress and error
			if (nglb_tabNumber == "pane1")
			{
				if ((document.images['InProgImg'] != null) && (document.images['InProgImg'] != undefined))
				{
					document.images['InProgImg'].style.visibility="hidden";
					document.images['InProgImg'].style.width="0";
					document.images['InProgImg'].src = makeURLunique( document.images['InProgImg'].src, true );
				}
				
				if ((document.images['ErrorImg'] != null) && (document.images['ErrorImg']!= undefined))
				{
					document.images['ErrorImg'].style.visibility="hidden";
					document.images['ErrorImg'].style.width="0";
					document.images['ErrorImg'].src = makeURLunique( document.images['ErrorImg'].src, true );
				}
				
				var jpgObj = document.images['JPGImg'];
				jpgObj.style  = "visibility:visible;width:"+glb_ImgWidth+";height:"+glb_ImgHeight;
				jpgObj.height = glb_ImgHeight;
				jpgObj.width  = glb_ImgWidth;
				jpgObj.style.visibility = "visible";
				
			}
			else if (nglb_tabNumber == "pane3")
			{
				if ((document.images['InProgImg4Pr'] != null) && (document.images['InProgImg4Pr'] != undefined))
				{
					document.images['InProgImg4Pr'].style.visibility="hidden";
					document.images['InProgImg4Pr'].style.width="0";
					document.images['InProgImg4Pr'].src = makeURLunique( document.images['InProgImg4Pr'].src, true );
				}
				
				if ((document.images['ErrorImg4Pr'] != null) && (document.images['ErrorImg4Pr']!= undefined))
				{
					document.images['ErrorImg4Pr'].style.visibility="hidden";
					document.images['ErrorImg4Pr'].style.width="0";
					document.images['ErrorImg4Pr'].src = makeURLunique( document.images['ErrorImg4Pr'].src, true );
				}
				
				var jpgObj = document.images['JPGImg4Pr'];
				jpgObj.style  = "visibility:visible;width:"+glb_ImgWidth+";height:"+glb_ImgHeight;
				jpgObj.height = glb_ImgHeight;
				jpgObj.width  = glb_ImgWidth;
				jpgObj.style.visibility = "visible";
			}
			
			
			
			if( nglb_maxNoOfImg <= 1 )
			{
				if ((document.images['InProgImg4Size1'] != null) && (document.images['InProgImg4Size1'] != undefined))
				{
					document.images['InProgImg4Size1'].style.visibility="hidden";
					document.images['InProgImg4Size1'].style.width="0";
					document.images['InProgImg4Size1'].src = makeURLunique( document.images['InProgImg4Size1'].src, true );
				}
				if ((document.images['ErrorImg4Size1'] != null) && (document.images['ErrorImg4Size1']!= undefined))
				{
					document.images['ErrorImg4Size1'].style.visibility="hidden";
					document.images['ErrorImg4Size1'].style.width="0";
					document.images['ErrorImg4Size1'].src = makeURLunique( document.images['ErrorImg4Size1'].src, true );
				}
				
				var jpgObj4Size1 = document.images['JPGImg4Size1'];
				jpgObj4Size1.style  = "visibility:visible;width:"+glb_ImgWidth+";height:"+glb_ImgHeight;
				jpgObj4Size1.height = glb_ImgHeight;
				jpgObj4Size1.width  = glb_ImgWidth;
				jpgObj4Size1.style.visibility = "visible";
			}

			nglb_InitialSpiningWheel = false;
			nglb_currPane1Img = glbcnst_index;

			//load Media title, provider nd ID
			loadBasicXMPData(false);
		}
				else
		{
			if (getCompAndResState == '3')
			{
				// for pane3
				
				if (nglb_tabNumber == "pane3")
				{
					var jpgObj = document.images['JPGImg4Pr'];
					jpgObj.style  = "visibility:visible;width:"+1+";height:"+1;
					jpgObj.height = 1;
					jpgObj.width  = 1;
					jpgObj.style.visibility = "hidden";
					
					document.images['InProgImg4Pr'].style="visibility:hidden;width:0";
					document.images['InProgImg4Pr'].src = makeURLunique( document.images['InProgImg4Pr'].src, true );
	
					document.images['ErrorImg4Pr'].style="visibility:visible;width:20";
					document.images['ErrorImg4Pr'].src = makeURLunique( document.images['ErrorImg4Pr'].src, true );
					
				} 
				else if (nglb_tabNumber == "pane1")
				{
					// Hide Jpg image
					var jpgObj = document.images['JPGImg'];
					jpgObj.style  = "visibility:visible;width:"+1+";height:"+1;
					jpgObj.height = 1;
					jpgObj.width  = 1;
					jpgObj.style.visibility = "hidden";
					
					document.images['InProgImg'].style="visibility:hidden;width:0";
					document.images['InProgImg'].src = makeURLunique( document.images['InProgImg'].src, true );

					document.images['ErrorImg'].style="visibility:visible;width:20";
					document.images['ErrorImg'].src = makeURLunique( document.images['ErrorImg'].src, true );
				}
				
				if( nglb_maxNoOfImg <= 1 )
				{
				    var oPane2PostDiv = document.getElementById( "Pane2PostDiv" );
				    var oPane2PreDiv = document.getElementById( "Pane2PreDiv" );
				    oPane2PostDiv.style.visibility = "visible";
    			    oPane2PostDiv.style.display = "";
    			    oPane2PreDiv.style.visibility = "hidden";
    			    oPane2PreDiv.style.display = "none";
    			    
    			    // Hide Jpg image
					var jpgObj = document.images['JPGImg4Size1'];
					jpgObj.style  = "visibility:visible;width:"+1+";height:"+1;
					jpgObj.height = 1;
					jpgObj.width  = 1;
					jpgObj.style.visibility = "hidden";
    			    
					document.images['InProgImg4Size1'].style="visibility:hidden;width:0";
					document.images['InProgImg4Size1'].src  = makeURLunique( document.images['InProgImg4Size1'].src, true );
					document.images['ErrorImg4Size1'].style ="visibility:visible;width:20";
					document.images['ErrorImg4Size1'].src   = makeURLunique( document.images['ErrorImg4Size1'].src, true );
				}

			}
		}

		return( true );
	}

	function printImgDetail()
	{
	    // Disable print functionality for GP&K window
		// call( "_cbimgDetail_execPrint", glbcnst_DocumentID+(glbcnst_index.toString()) );
		return( true );
	}

	function searchAgain()
	{
		if( nglb_TabNmIdx >= 0 )
		{
			try
			{
				var keyArrays  = "";
				var i, p, myrow, mydata, myInsert, eachOne;
				var myTable = document.getElementById( nglb_KeyWordTableNm[ nglb_TabNmIdx ] );
				for( i=0; i<nglb_KWdsTableSize[ nglb_TabNmIdx ]; i++ )
				{
					try
					{
						myrow    = myTable.getElementsByTagName('tr').item(i);
						mydata   = myrow.getElementsByTagName('td').item(1);
						myInsert = mydata.childNodes[0];

						if (myInsert.checked == true)
						//if (myInsert.getAttribute('checked') == 'true')
						{
							if( keyArrays != "" )
							{
								keyArrays += glb_OpAnd;
							}
							eachOne = myInsert.getAttribute('name');
							if( ( dt[ glbcnst_index ].dttype & 1 ) != 0 )
							{
								p = eachOne.lastIndexOf('(');
								if( p > 0 )
									eachOne = eachOne.substring( 0, p-1 );
							}
							keyArrays += eachOne;
						}
					} catch(e) { ; }
				}
				call( "_gpk3_search", "doc_id="+nglb_doc_id+",ky='"+escape(keyArrays)+"'" );
				if (keyArrays != "")
				{
					closeDialog();
				}

			}
			catch(e) { ; }
		}
		return( true );
	}

	function saveComp()
	{
		call("_cbimgDetail_execDownloadComp",glbcnst_DocumentID+(glbcnst_index.toString()));
		return( true );
	}

	function addToCart( ResolutionIndex )
	{
		call( "_cbimgDetail_execAddToCart", glbcnst_DocumentID+(glbcnst_index.toString())+","+(ResolutionIndex.toString()) );
		return( true );
	}

	function closeDialog()
	{
		if( nglb_newGpk == "gpk" )
			 call( "_gpk3_closeDialog", "doc_id="+nglb_doc_id );
		else call("_cbimgDetail_CloseDialog",glbcnst_DocumentID+(glbcnst_index.toString()));
		return true;
	}

	function updateStatusMsg(getCompAndResState)
	{
		var i, argStr, desc, price, theID, myTab, myrow, mydata, mytext, mydata1, mytext1, index, tag;
		if( getCompAndResState == '1' ) {
			mydata  = document.getElementById("statustext");
			if ((mydata != null) && (mydata != undefined) && (mydata.hasChildNodes()))
			{
				mydata.removeChild(mydata.childNodes[0]);
			}
			if( nglb_maxNoOfImg <= 1 )
			{
				mydata1  = document.getElementById("statustext4Size1");
				if ((mydata1 != null) && (mydata1 != undefined) && (mydata1.hasChildNodes()))
				{
					mydata1.removeChild(mydata1.childNodes[0]);
				}
			}
			
			if (nglb_tabNumber == "pane3")
			{
				mydata1 = document.getElementById("statustext4Pr");
				if ((mydata1 != null) && (mydata1 != undefined) && (mydata1.hasChildNodes()))
				{
					mydata1.removeChild(mydata1.childNodes[0]);
				}
			}
		}
		else
		{

			mydata  = document.getElementById("statustext");
			switch (getCompAndResState)
			{
				case '0' :
					desc = glb_State0Text;
					break;

				case '2' :
					desc = glb_InProgressText;
					break;

				case '3' :
			   	if(nglb_tabNumber == "pane1")
			   {
					   desc = cnst_timeOutErrMsg;
				 }
				 else
				 {
				    desc = cnst_timeOutErrMsgPane23;
         }
         break;

			}
			if (nglb_tabNumber == "pane1")
			{ 
				if ((mydata != null) && (mydata != undefined))
				{
				  if (mydata.hasChildNodes()) { mydata.removeChild(mydata.childNodes[0]); }
					mytext = document.createTextNode(desc);
					mydata.appendChild(mytext);
				}
			}
			if( nglb_maxNoOfImg <= 1 )
			{
				mydata1  = document.getElementById("statustext4Size1");
				if ((mydata1 != null) && (mydata1 != undefined))
				{
					if (mydata1.hasChildNodes()) { mydata1.removeChild(mydata1.childNodes[0]); }
					 mytext1 = document.createTextNode(cnst_timeOutErrMsgPane23);
					mydata1.appendChild(mytext1);
					mydata1.style.visibility = "visible";
				}
			}
			if (nglb_tabNumber == "pane3")
			{
				mydata1  = document.getElementById("statustext4Pr");
				if ((mydata1 != null) && (mydata1 != undefined))
				{
					if (mydata1.hasChildNodes()) { mydata1.removeChild(mydata1.childNodes[0]); }
					mytext1 = document.createTextNode(desc);
					mydata1.appendChild(mytext1);
			    mydata1.style.visibility = "visible";
				}
			}
			
		}

	}
	function placeArrow()
	{
		var backObj, nextObj;
		var prBackObj, prNextObj;
		
		if (nglb_tabNumber == "pane1")
		{
			backObj = document.getElementById( "PreviousPage" );
			nextObj = document.getElementById( "NextPage" );
		}
		else if (nglb_tabNumber == "pane3")
		{	
			backObj = document.getElementById( "prPreviousPage" );
			nextObj = document.getElementById( "prNextPage" );
		}
		else
		{
			// if it is any other pane, just return
			return;
		}
		
		if( nglb_maxNoOfImg <= 1 )
		{
			backObj.style.visibility = "hidden";
			nextObj.style.visibility = "hidden";
		}
		else
		{
			if( glbcnst_index <= 0 )
			{
				backObj.style.visibility = "hidden";
				nextObj.style.visibility = "visible";
			}
			else
			{
				backObj.style.visibility = "visible";
			};
			if( glbcnst_index >= ( glbcnst_TotalIndex - 1 ) )
			{
				nextObj.style.visibility = "hidden";
			}
			else
			{
				nextObj.style.visibility = "visible";
			};
		};
	}
	var prevCntOfImgsStr="";
	var prevCntOfImgs;
	
	// The following variables are used to maintain Count display for the Provider pane
	var prevCntOfImgsStr4Pr="";
	var prevCntOfImgs4Pr;

	function dispcntofimgs()
	{
		if (nglb_tabNumber == "pane2")
		{
			// pane2 has nothing to do with count of images display
			return;
		}
		try
		{
			var n, sztext, theID;
			n = nglb_maxNoOfImg;
			if( nglb_maxNoOfImg <= 1 )
			{
				sztext = " ";
			}
			else
			{
				sztext = (""+(glbcnst_index+1)) + glb_string_Of + (""+nglb_maxNoOfImg);
			};
			
			if (nglb_tabNumber == "pane1")
			{
				theID = document.getElementById( "BackNext" );
				if( prevCntOfImgsStr != "" )
				{
					if( prevCntOfImgsStr == sztext )
					{
						setTimeout( "dispcntofimgs();", 1000 );
						return;
					};
					theID.removeChild( prevCntOfImgs );
				};
				prevCntOfImgsStr = sztext;
				prevCntOfImgs    = document.createTextNode( sztext )
				theID.appendChild( prevCntOfImgs );
			}
			else if (nglb_tabNumber == "pane3")
			{
				theID = document.getElementById( "prBackNext" );
				if( prevCntOfImgsStr4Pr != "" )
				{
					if( prevCntOfImgsStr4Pr == sztext )
					{
						setTimeout( "dispcntofimgs();", 1000 );
						return;
					};
					theID.removeChild( prevCntOfImgs4Pr );
				};
				prevCntOfImgsStr4Pr = sztext;
				prevCntOfImgs4Pr    = document.createTextNode( sztext )
				theID.appendChild( prevCntOfImgs4Pr );
				//providerPaneViewed(); // we need to tell Burp that a new image ID detail is being viewed.
			}
			placeArrow();
			
		}
		catch(e) { ; }
		setTimeout( "dispcntofimgs();", 1000 );
		return( true );
	}

	function changeFocus( BackOrNext )
	{ // 0:Back 1:Next
		if( ( BackOrNext == 0 )&&( glbcnst_index <= 0 ) )
		{
			return;
		};
		if( ( BackOrNext == 1 )&&( glbcnst_index >= ( glbcnst_TotalIndex - 1 ) ) )
		{
			return;
		};

		glb_Add2CartLock     = true;
		glb_DownloadCompLock = true;
		glb_EditCompLock     = true;
		
    // 1288262
		switchButtonStatus('add2cart', false);
		switchButtonStatus('dlcomp', false);
		switchButtonStatus('editcomp', false);
		
		glbcnst_index = call( "_cbimgDetail_ChangeDisplayImage", glbcnst_DocumentID+(glbcnst_index.toString())+","+(BackOrNext.toString())+";"+nglb_tabNumber);
		return( true );
	}

	var nglb_reloadImages_scheduled=false;
	var nglb_reloadImages_PrevIdx  =-1;
	var nglb_reloadImages_timerID  =0; // clearTimeout( timerID );
	function scheduleReloadImages( nTry )
	{
		nglb_reloadImages_scheduled = false;
		reloadImages( nTry+1 );
	}
	function reloadImages( nTry )
	{
		
		if( nglb_tabNumber == "pane2" ) // nglb_tabNumber != "pane1"
			return( true );
		if( nglb_reloadImages_scheduled )
			return( true ); //  Scheduled one is coming anyway so we can ignore now
		if( nglb_reloadImages_PrevIdx != glbcnst_index )
		{
			nglb_reloadImages_PrevIdx = glbcnst_index;
			nTry = 0; // restart for new image
		}
		var getCompAndResState, p1status=0;
		var status = dt[ glbcnst_index ].status;
		if( ( status & nglbcnst_gpk3_compSkipped ) != 0 )
		{
			getCompAndResState = "2";
		}
		else if( ( status & nglbcnst_gpk3_allComplete ) != 0 )
		{
			getCompAndResState = "1"; p1status = 1;
		}
		else if( ( ( dt[ glbcnst_index ].status & nglbcnst_gpk3_allError) != 0 )||( dt[ glbcnst_index ].timeOut != 0 ) )
		{
			getCompAndResState = "3"; p1status = 1;
		}
		else if( status == nglbcnst_gpk3_start )
		{
			getCompAndResState = "0";
		}
		else
		{
			getCompAndResState = "2";
		}

		// Need to rest p1status value because the 'allComplete' status now
		// comes right after we get Resolutions info. (Earlier it used to indicate
		// the availability of Resolution + Comp + Info).
		
		// See if we need to check against other flags also (e.g. Comp Error)
		if ( (getCompAndResState != "3")
            && ( ( status & nglbcnst_gpk3_getCompDone ) == 0 ) )
		{
            p1status = 0;
        }
        else
        {
            p1status = 1;
        }

		if( nglb_tabNumber == "pane1" )
		{
			
			//if( dt[ glbcnst_index ].p1status != p1status )
			//{
				var t0, t1, t2, t3;
				if( p1status == 0 )
				{	// Not ready
					t0 = document.getElementById( "InProgImgP1Pre" );
					t0.style.visibility = "visible";
					t0.style.display = "inline";
					t1 = document.getElementById( "statustextP1Pre" );
					t1.style.visibility = "visible";
					t1.style.display = "inline";
					t2 = document.getElementById( "ImageP1Pre" );
					t2.style.visibility = "visible";
					t2.style.display = "inline";
					t3 = document.getElementById( "Image" );
					t3.style.visibility = "hidden";
					t3.style.display = "none";
				}
				else
				{
					t0 = document.getElementById( "InProgImgP1Pre" );
					t0.style.visibility = "hidden";
					t0.style.display = "none";
					t1 = document.getElementById( "statustextP1Pre" );
					t1.style.visibility = "hidden";
					t1.style.display = "none";
					t2 = document.getElementById( "ImageP1Pre" );
					t2.style.visibility = "hidden";
					t2.style.display = "none";
					t3 = document.getElementById( "Image" );
					t3.style.visibility = "visible";
					t3.style.display = "block";
					placeArrow();
				}
				dt[ glbcnst_index ].p1status = p1status;
			//}
			
			var t;
			t = document.getElementById( "InProgImgP1Pre4Pr" );
			t.style.visibility = "hidden";
			t.style.display = "none";
			t = document.getElementById( "statustextP1Pre4Pr" );
			t.style.visibility = "hidden";
			t.style.display = "none";
			t = document.getElementById( "prImageP1Pre" );
			t.style.visibility = "hidden";
			t.style.display = "none";
			t = document.getElementById( "prImage" );
			t.style.visibility = "hidden";
			t.style.display = "none";
			
		}
		else if (nglb_tabNumber == "pane3")
		{
			
			//if( dt[ glbcnst_index ].p1status != p1status )
			//{
				var t0, t1, t2, t3;
				if( p1status == 0 )
				{	// Not ready
					t0 = document.getElementById( "InProgImgP1Pre4Pr" );
					t0.style.visibility = "visible";
					t0.style.display = "inline";
					t1 = document.getElementById( "statustextP1Pre4Pr" );
					t1.style.visibility = "visible";
					t1.style.display = "inline";
					t2 = document.getElementById( "prImageP1Pre" );
					t2.style.visibility = "visible";
					t2.style.display = "inline";
					t3 = document.getElementById( "prImage" );
					t3.style.visibility = "hidden";
					t3.style.display = "none";
				}
				else
				{
					t0 = document.getElementById( "InProgImgP1Pre4Pr" );
					t0.style.visibility = "hidden";
					t0.style.display = "none";
					t1 = document.getElementById( "statustextP1Pre4Pr" );
					t1.style.visibility = "hidden";
					t1.style.display = "none";
					t2 = document.getElementById( "prImageP1Pre" );
					t2.style.visibility = "hidden";
					t2.style.display = "none";
					t3 = document.getElementById( "prImage" );
					t3.style.visibility = "visible";
					t3.style.display = "block";
					placeArrow();
				}
			//	dt[ glbcnst_index ].p1status = p1status;
			//}
			
			var t;
			t = document.getElementById( "InProgImgP1Pre" );
			t.style.visibility = "hidden";
			t.style.display = "none";
			t = document.getElementById( "statustextP1Pre" );
			t.style.visibility = "hidden";
			t.style.display = "none";
			t = document.getElementById( "ImageP1Pre" );
			t.style.visibility = "hidden";
			t.style.display = "none";
			t = document.getElementById( "Image" );
			t.style.visibility = "hidden";
			t.style.display = "none";
			
		}
		
		
		try
		{
			updateStatusMsg(getCompAndResState);
		}
		catch(e) { ; }
		try
		{
			loadCurImage( getCompAndResState );
		}
		catch(e) { ; }
		if (getCompAndResState  == '1') // Data is successfully prepared
		{
			//will not load keywords depending on getcompAndResState

			try
			{
				loadKeyword( nglb_tabNumber, glbcnst_index );
			}
			catch(e) { ; }

			if( call( "_cbimgDetail_getNoOfReslutions",glbcnst_DocumentID+(glbcnst_index.toString()) ) == 0 )
			{
				if (call( "_cbimgDetail_badReslutionsFound",glbcnst_DocumentID+(glbcnst_index.toString()) ) == 0)
				{	//cannot determine if resolution file is bad, try fetchin it again.
					try
					{
						loadFileSizeRes( glbcnst_index ); /* will not be executed */
					}
					catch(e) { ; }
				}
			}
			else
			{

				try
				{
					updateResolutions();
				}
				catch(e) { ; }
			}

			glb_Add2CartLock     = false;
			glb_DownloadCompLock = false;
			glb_EditCompLock     = false;
	     // 1288262
			switchButtonStatus('add2cart', true);
			switchButtonStatus('dlcomp', true);
			switchButtonStatus('editcomp', true);

		}
		else if( getCompAndResState != '3' )
		{	//  Not done yet AND not error -> Data preparation is in progress
			if( nTry >= cnst_timeOutSec ) // 15 second time out
			{
				dt[ glbcnst_index ].status |= nglbcnst_gpk3_allError;
				dt[ glbcnst_index ].timeOut	= 1;
			}
			if( ! nglb_reloadImages_scheduled )
			{
				nglb_reloadImages_scheduled = true;
				nglb_reloadImages_timerID   = setTimeout( "scheduleReloadImages("+nTry+")", 1000 ); // if we need to cancel
			}
		}

		if ((getCompAndResState  == '1') || (getCompAndResState  == '3'))
		{
			try
			{
				dispcntofimgs();
			}
			catch(e) { ; }
		}

		return getCompAndResState;
	}

	function preloadImages()
	{
		glb_MainJpgNm = makeURLunique( document.images['JPGImg'].src, false );

		curImageSize('get');
		var getCompAndResState = reloadImages( 0 );

		window.focus();
		if (document.images)
		{
			pre_buy_R      = newImage(glb_HtmlImageDir2 + '/ImgDetail/buy_R.gif');
			pre_buy_C      = newImage(glb_HtmlImageDir2 + '/ImgDetail/buy_C.gif');
			pre_download_R = newImage(glb_HtmlImageDir2 + '/ImgDetail/download_R.gif');
			pre_download_C = newImage(glb_HtmlImageDir2 + '/ImgDetail/download_C.gif');
			pre_back_R     = newImage(glb_HtmlImageDir2 + '/ImgDetail/back_R.gif');
			pre_next_R     = newImage(glb_HtmlImageDir2 + '/ImgDetail/next_R.gif');
			pre_print_R    = newImage(glb_HtmlImageDir2 + '/print/print_R.gif');
			pre_print_C    = newImage(glb_HtmlImageDir2 + '/print/print_C.gif');
			preloadFlag    = true;
		}

		//will not load keywords depending on getcompAndResState
		loadCurImage(getCompAndResState);

		//document.all("JPGImg").style.visibility = "visible";
       
		//if state is 1(sucess) or 3(error) then display arrows
		if (getCompAndResState  == '0' || getCompAndResState  == '2')
		{
			document.all("PreviousPage").style.visibility = "hidden";
			document.all("NextPage").style.visibility     = "hidden";
			
			document.all("prPreviousPage").style.visibility = "hidden";
			document.all("prNextPage").style.visibility     = "hidden";
		}
				
		return( true );
	}

	function addImgToCart( )
	{
		if (glb_Add2CartLock)
			return;

		var ResolutionIndex = getCurrentSelectedResolution(glbcnst_index);
		glb_Add2CartLock = true;
		call( "_cbimgDetail_execAddToCart", glbcnst_DocumentID+(glbcnst_index.toString())+","+(ResolutionIndex.toString()) );
	}

	function addAllImgToCart( )
	{
		if (glb_Add2CartLock)
			return;
		glb_Add2CartLock = true;
		call( "_gpk3_addAllTmgToCart", "doc_id="+nglb_doc_id );
		return( true );
	}

	function downloadComp()
	{
		if (glb_DownloadCompLock)
			return (true);
		glb_DownloadCompLock = true;
		call("_cbimgDetail_execDownloadComp",glbcnst_DocumentID+(glbcnst_index.toString()));
	}

	function downloadAllComp()
	{
		if (glb_DownloadCompLock)
			return (true);
		glb_DownloadCompLock = true;
		call( "_gpk3_downloadAllComp", "doc_id="+nglb_doc_id );
		return( true );
	}
		var bButtonClick = 0;
	var bHideMenu=0;
	
	
	function DisplayMenu() 
	{		
		if (glb_EditCompLock)
			return true;
		if (0== noShow || aMenuList.length == 0)
		{
			if ("pane2" == nglb_tabNumber)
			{
				return editAllComp(-1);
			}
			else
			{
				return editComp(-1);
			}
		}		
		if ("inline" == contextMenu.style.display)
		{
			bHideMenu = 0;
			return true;
		}
		else
		{
			bHideMenu=1;
		}
		var iIndex;
		var sOnclickName;
		var oElementDiv;
		var oLineBreak;
		var openwith;
		var iXOffset = 0;
		var iYOffset = 0;
	
		if(0==bButtonClick)
		{
			bButtonClick=1;
			for( iIndex in aMenuList)
			{  
				oElementDiv= document.createElement("div");
				oElementDiv.setAttribute('id',aMenuList[iIndex]);
		// http://www.opera.com/docs/specs/opera9/js/dom/ Opera 9 uses DOM 2
				oElementDiv.setAttribute('class',"menuItem");
				oElementDiv.setAttribute('style','padding-bottom:5px;padding-right:10px');
		 
		   		if(aMenuList[iIndex]!=".")
		   		{
					oElementDiv.innerHTML=aMenuList[iIndex];
					contextMenu.appendChild(oElementDiv);
	  			}
	  			else
	  			{
	  				oLineBreak=document.createElement("hr");
	  				contextMenu.appendChild(oLineBreak);
	  			}
			} 
		}
	  	contextMenu.style.display="inline";
		if("pane1" == nglb_tabNumber)
		{
			openwith = document.getElementById("openwith1");
		}
		if("pane2" == nglb_tabNumber)
		{
			openwith = document.getElementById("openwith2");
		}
		if("pane3" == nglb_tabNumber)
		{
			openwith = document.getElementById("openwith3");
		}
	
	  // Watson : 1290009
	  if( undefined != document.body )
	  {
	   iXOffset = document.body.scrollLeft;
	   iYOffset = document.body.scrollTop;
	  }
  	document.getElementById("contextMenu").style.top = glb_OpenWithTop - document.getElementById("contextMenu").offsetHeight - iYOffset;
		document.getElementById("contextMenu").style.left = openwith.offsetLeft + 133  -document.getElementById("contextMenu").offsetWidth - iXOffset;
	   
	   if(document.getElementById("contextMenu").style.left.charAt() == '-')
	   {
        document.getElementById("contextMenu").style.top = glb_OpenWithTop - document.getElementById("contextMenu").offsetHeight - iYOffset - 22;
        document.getElementById("contextMenu").style.left = 0;
     }
     
  }

	function ClickMenu() {
	    var sDisplayName;
		contextMenu.style.display="none";
		var oEventName=event.srcElement;
		var arrIndex = 0;
		for( sDisplayName in aMenuList)
		{
			if(oEventName.id===aMenuList[sDisplayName])
			{
				// <TODO> Call function to ExtendScript
				// 	call( "_gpk3_execEditComps", "doc_id="+nglb_doc_id+",ist="+glbcnst_index+",ied="+glbcnst_index+", index="+iIndex);
				
				if ("pane2" == nglb_tabNumber)
				{
					return editAllComp(arrIndex);
				}
				else
				{
					return editComp(arrIndex);
				}
			}
			arrIndex++;
		}
	}


	function SwitchMenu() 
	{ 
		var eEventName=event.srcElement;
		if ("menuItem" == eEventName.className) 
		{
			eEventName.className="highlightItem";
		}
		else if ("highlightItem" == eEventName.className) 
		{
			eEventName.className="menuItem";
		}
	}

	function DisableMenu()
	{
		if(1==bHideMenu)
		{
			bHideMenu=0;
		}
		else
		{
		  contextMenu.style.display="none";
		}
	}

	function editComp( appIndex )
	{
		glb_EditCompLock = true;
		call( "_gpk3_execEditComps", "doc_id="+nglb_doc_id+",ist="+glbcnst_index+",ied="+glbcnst_index+",selectedIndex="+appIndex );
		return( true );
	}

	function editAllComp( idx )
	{
		glb_EditCompLock = true;
		call( "_gpk3_execEditComps", "doc_id="+nglb_doc_id+",ist="+0+",ied="+(nglb_maxNoOfImg-1)+",selectedIndex="+idx );
		return( true );
	}

	function shoppingCart()
	{
		call("_cbimgDetail_execViewShoppingCart",glbcnst_DocumentID+(glbcnst_index.toString()));
		closeDialog();
	}

	function imageDetailHelp()
	{
		call ("_cbNav_RunHelpFile", "");
	}

    // -->
   </script>
  </csactiondict>

    <script language="JavaScript1.3">
    var panes = new Array();

    var showTabReentrancy=0; // This is too ugly, isn't it

    window.onscroll = scroll;

    function scroll()
    {
      if (( 'undefined' != typeof bHideMenu ) && (0 == bHideMenu))
	{
 		DisableMenu();
	}
    }

    function leftCapClicked()
    {
      if (nglb_tabNumber == "pane2" || nglb_tabNumber == "pane3")
        showPane('pane1');
    }

    function rightCapClicked()
    {
	if (nglb_tabNumber == "pane1" || nglb_tabNumber == "pane2")
		showPane('pane3');
    }

    function mouseOverTab1()
    {
	theID = document.getElementById("tab1color");
	theID.className="tab_hlcolor";
    }

    function mouseOutTab1()
    {
	theID = document.getElementById("tab1color");
	theID.className="tab_bkcolor";
    }

    function mouseOverTab2()
    {
	theID = document.getElementById("tab2color");
	theID.className="tab_hlcolor";
    }

    function mouseOutTab2()
    {
	theID = document.getElementById("tab2color");
	theID.className="tab_bkcolor";
    }
    
    function mouseOverTab3()
    {
	theID = document.getElementById("tab3color");
	theID.className="tab_hlcolor";
    }

    function mouseOutTab3()
    {
	theID = document.getElementById("tab3color");
	theID.className="tab_bkcolor";
    }

    function showTab(paneId)
    {
	if (nglb_tabNumber != paneId)
	{
	    glb_Add2CartLock     = true;
	    glb_DownloadCompLock = true;
	    glb_EditCompLock     = true;
	    
	    // 1288262
	    switchButtonStatus('add2cart', false);
	    switchButtonStatus('dlcomp', false);
	    switchButtonStatus('editcomp', false);
	}

        if (paneId == "pane1")
        {
            document.images["tab_leftcap"].src  = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_leftcap.gif", true );
            document.images["tab_overlap1"].src  = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_overlap.gif", true );
            document.images["tab_overlap2"].src  = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_overlap_grey1.gif", true );
            document.images["tab_rightcap"].src = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_rightcap.gif", true );
            theID  = document.getElementById("container1");

            myTable = theID.getElementsByTagName('table').item(0);
            myrow  = myTable.getElementsByTagName('tr').item(0);
            mydata = myrow.getElementsByTagName('td').item(1);
            mydata.className = "tabs_active";
            mydata = myrow.getElementsByTagName('td').item(3);
            mydata.className = "tabs";
            mydata = myrow.getElementsByTagName('td').item(5);
            mydata.className = "tabs";
            nglb_tabNumber   = paneId;
            if( showTabReentrancy <= 0 )
            {
                showTabReentrancy++;
                updateDisplayedImage( glbcnst_index );
                reloadImages( 0 );
                showTabReentrancy--;
            }
            
        }

        if (paneId == "pane2")
        {
            document.images["tab_leftcap"].src  = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_leftcap_f2.gif", true );
            document.images["tab_overlap1"].src  = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_overlap_f2.gif", true );
            document.images["tab_overlap2"].src  = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_overlap.gif", true );
            document.images["tab_rightcap"].src = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_rightcap.gif", true );
            theID  = document.getElementById("container1");

            myTable = theID.getElementsByTagName('table').item(0);
            myrow  = myTable.getElementsByTagName('tr').item(0);
            mydata = myrow.getElementsByTagName('td').item(1);
            mydata.className = "tabs";
            mydata = myrow.getElementsByTagName('td').item(3);
            mydata.className = "tabs_active";
            mydata = myrow.getElementsByTagName('td').item(5);
            mydata.className = "tabs";
            nglb_tabNumber   = paneId;
            deleteTitle();
        }
        
        if (paneId == "pane3")
        {
        	//providerPaneViewed();
            document.images["tab_leftcap"].src  = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_leftcap_f2.gif", true );
            document.images["tab_overlap1"].src  = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_overlap_grey2.gif", true );
            document.images["tab_overlap2"].src  = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_overlap_f2.gif", true );
            document.images["tab_rightcap"].src = makeURLunique( glb_HtmlImageDir2 + "/ImgDetail/tab_rightcap_f2.gif", true );
            theID  = document.getElementById("container1");

            myTable = theID.getElementsByTagName('table').item(0);
            myrow  = myTable.getElementsByTagName('tr').item(0);
            mydata = myrow.getElementsByTagName('td').item(1);
            mydata.className = "tabs";
            mydata = myrow.getElementsByTagName('td').item(3);
            mydata.className = "tabs";
            mydata = myrow.getElementsByTagName('td').item(5);
            mydata.className = "tabs_active";
            nglb_tabNumber   = paneId;
            if( showTabReentrancy <= 0 )
            {
                showTabReentrancy++;
                updateDisplayedImage( glbcnst_index );
                reloadImages( 0 );
                showTabReentrancy--;
            }
            
        }
        
        setKeywordsDisplay( glbcnst_index );
    }
    var nglb_correctIdx;
    function showPane(paneId)
    {
        showTab(paneId);
        for (var con in panes)
        {
            if (panes[con][paneId] != null)
            {
                var pane = document.getElementById(paneId);
                pane.style.display = "block";
                for (var i in panes[con])
                {
                    var pane = panes[con][i];
                    if (pane == undefined) continue;
                    if (pane.id == paneId)
                    {
                        pane.style.visibility = "visible";
                        if( ( nglb_KeywordsTimeOut )&&( paneId == "pane2" ) )
                        {
                            try {
                                var pane2_a, pane2_b, pane2_c, pane2_d, pane2_e, pane2_f, pane2_g, pane2_h;
                                pane2_a = document.getElementById( "KwImagePre" );       pane2_a.style.visibility = "hidden";  pane2_a.style.display = "none";
                                pane2_b = document.getElementById( "KwImage" );          pane2_b.style.visibility = "hidden";  pane2_b.style.display = "none";
                                pane2_c = document.getElementById( "Image4Size1" );      pane2_c.style.visibility = "visible";
                                pane2_d = document.getElementById( "JPGImg4Size1" );     pane2_d.style.visibility = "hidden";
                                pane2_e = document.getElementById( "InProgImg4Size1" );  pane2_e.style.visibility = "hidden";
                                pane2_f = document.getElementById( "ErrorImg4Size1" );   pane2_f.style.visibility = "visible"; pane2_f.style.width = 20;
                                removeInitObj( "statustext4Size1" ); pane2_g = document.createTextNode( cnst_timeOutErrMsgPane23 ); pane2_g.style.visibility = "visible";
                                pane2_h = document.getElementById( "statustext4Size1" ); pane2_h.style.visibility = "visible";
                                pane2_h.appendChild( pane2_g )
                             } catch(e) { ; }
                        }
                        if( ( nglb_FirstCorrectFromES )&&( paneId == "pane2" ) )
                        {
                            var pane2_0, pane2_1, pane2_2;
                            if( nglb_maxNoOfImg <= 1 )
                            {
                                pane2_1 = document.getElementById( "KwImagePre" );
                                pane2_1.style.visibility = "hidden";
                                pane2_0 = document.getElementById( "Image4Size1" );
                                pane2_0.style.visibility = "visible";
                                pane2_2 = document.getElementById( "statustext4Size1" );
                                pane2_2.style.visibility = "visible";
                                
                            }
                            else
                            {
                                var pane2_1_item_1 = document.getElementById( "InProgImgPane2" );
                                pane2_1_item_1.style.visibility = "visible";
                                var pane2_1_item_2 = document.getElementById( "statustextPane2" );
                                pane2_1_item_2.style.visibility = "visible";
                                pane2_1 = document.getElementById( "KwImagePre" );
                                pane2_1.style.visibility = "visible";
                                pane2_0 = document.getElementById( "Image4Size1" );
                                pane2_0.style.visibility = "hidden";
                            }
                            var pane2_2 = document.getElementById( "KwImage" );
                            pane2_2.style.visibility = "hidden";
                        }
                        continue;
                    }
                    pane.style.display = "none";
                    pane.style.visibility = "hidden";
                }
            }
        }

        var closeButton;
       if (paneId == "pane1")
        {
        	closeButton = window.document.IMForm.close;
        }
        else if (paneId == "pane2")
        {
        	closeButton = window.document.IMForm.close2;
        }
        else if (paneId == "pane3")
        {
        	closeButton = window.document.IMForm.close3;
        }
        closeButton.focus();
		
   if ( false == glb_isThumbnail && !glb_inPreviousSearchFolder)
		{
			var obj;
		    if (paneId == "pane1")
		    {
					obj = document.IMForm.DownloadComp;
				}
				else if (paneId == "pane2")
				{
					obj = document.IMForm.DownloadComp2;
				}
				else if (paneId == "pane3")
				{
					obj = document.IMForm.DownloadComp3;
				}
					
			obj.className = "dlcompbutton_g";
			obj.disabled = true;
		}

		if (paneId == "pane3")
    	{
    		//providerPaneViewed();
    	}
        return false;
    }

	var savedPane="";
    function setupPanes(containerId, defaultPane)
    {
		if( ( savedPane == defaultPane )&&( defaultPane == "pane2" ) )
		{
      		if( false == glb_isThumbnail && !glb_inPreviousSearchFolder)
			{
				var obj;
				obj = document.IMForm.DownloadComp2;
				obj.className = "dlcompbutton_g";
				obj.disabled = true;
			}
			return;
		}
		else savedPane = defaultPane;
        panes[containerId] = new Array();
        var maxHeight = 0; var maxWidth = 0;
        var container = document.getElementById(containerId);
        var paneContainer = container.getElementsByTagName("div")[0];
        var paneList = paneContainer.childNodes;
        for (var i=0; i < paneList.length; i++ )
        {
            var pane = paneList[i];
            if (pane.nodeType != 1) continue;
            if (pane.offsetHeight > maxHeight) maxHeight = pane.offsetHeight;
            if (pane.offsetWidth  > maxWidth ) maxWidth  = pane.offsetWidth;
            panes[containerId][pane.id] = pane;
            pane.style.display = "none";
        }
        paneContainer.style.height = maxHeight + "px";
        paneContainer.style.width  = maxWidth + "px";

        showPane(defaultPane);
        preloadImages();
    }

    function PrimaryStartup()
    {

    	 if (trimString(document.getElementById("multiLineText").value) == '')
		{
			document.getElementById("multiLineText").value='';
		}
        call( "_gpk3_startBackGround", "doc_id="+nglb_doc_id+",nKeys="+cnst_maxNoOfKeyords );
        /*B*/ call ("_burpUrl_omitBurpUrl", "" );
    }
    
    //provider pane click
    function providerPaneViewed()
    {
    	if (glb_Add2CartLock == true) // - this means that processing is still being done
    	{
    		setTimeout( "providerPaneViewed();", 1000 ); // we start timer
    	}
    	var titleString;
    	if(!document.getElementById("titleBar").hasChildNodes())
    	{
    		if (document.getElementById("titleBar1").hasChildNodes())
    		{
    	 		titleString = document.getElementById("titleBar1").childNodes[0].nodeValue;
    		}
    	}
    	else
    	{
    		titleString = document.getElementById("titleBar").childNodes[0].nodeValue;
    	}
    	var arrASPRefId;
    	
    	if ((titleString != undefined) && (titleString.length > 0))
    	{
    		arrASPRefId = titleString.split(' ');
    	}
    	var sASPRefId;
    	
    	if ((arrASPRefId != undefined) && (arrASPRefId.length > 0))
    	{ 
    		
    		sASPRefId = arrASPRefId[0];
    	}
    	var sImageId = dt[ glbcnst_index ].MediaID;
    	var type;
    	
    	if ( (sASPRefId == undefined) || (sASPRefId == undefined) || (sASPRefId == "") || (sImageId == ""))
    	{
    		return;
    	}
    	// <TODO> The event type values are hard-coded here we need to define these values at ExtendScript and use them.
    	if (sASPRefId == sImageId)
    	{
    		type = 'idca'; // image doesnt contain asp reference,=> image ID is being shown at other places also, still the user has viewed the provider pane
    	}
    	else
    	{
    		type = 'ica'; // image contains asp reference, => image ID is shown only in the provider pane
    	}    	
    	/*B*/
    	// The callback will start the burp process and also let us know whether its time to display the Survey
    	
    	var bRetShowSurvey = call("_burp_viewProviderTab", "doc_id="+nglb_doc_id+",type='"+type+"',mid='"+sImageId+"',partnerName='"+dt[ glbcnst_index ].PartnerName+"'");
		if (bRetShowSurvey == true)
		{
			document.getElementById("survey").style.visibility = "visible";
			document.getElementById("survey").style.display = "inline";
		}
		else
		{
			document.getElementById("survey").style.visibility = "hidden";
			document.getElementById("survey").style.display = "none";
		}
    }

	//survey
	function trimString (sSource)
    {
        if (sSource != undefined)
        {
            return sSource.replace(/^\s+/g, '').replace(/\s+$/g, '');
        }
        else
        {
            return '';
        }
    }
    
    var ansIndex;
    
    function setAnswerSelection(index)
    {
    	if( 4 == index )
    	{
    		textAreaChange();
    	} 
    	ansIndex = index;
    }
    
    function textAreaChange()
    {
    	var eRadio =  document.getElementById("ans4");
    	var eSubmit = document.getElementById("submit"); // here eSubmit will not be undefined at any case
    	var iLength = document.getElementById("multiLineText").value.length;
    	var iMaxVal=100;
    	var oTextArea = document.getElementById("multiLineText");
    	eRadio.checked = true;
		if (trimString(document.getElementById("multiLineText").value) != '')
		{
			
			eSubmit.disabled = false;		
		}
		else
		{
			document.getElementById("multiLineText").value='';
			eSubmit.disabled = true;
			
		}
		if(iLength >= iMaxVal)
		{	
			call("_cbsurveyBeep",0);
			document.getElementById("multiLineText").value= oTextArea.value.substring(0,iMaxVal);
		}
		return true;
    }
    
    function disableTextArea()
    {
    	if (trimString(document.getElementById("multiLineText").value) == "")
    	{
    		document.getElementById("multiLineText").value == "";
    	}
    }
    
	function enableSubmit()
	{
		document.getElementById("submit").disabled = false;
		return true;
	}
	
	function enableTextArea()
	{
		if (trimString(document.getElementById("multiLineText").value) == "")
    	{
    		document.getElementById("multiLineText").value == "";
    	}
		document.getElementById("multiLineText").disabled = false;
		return true;
	}
	
	function submitSurvey()
	{
		// The following is the extra level of check which is added, just incase ansIndex is undefined.
		if (ansIndex == undefined)
		{
		 return;
		}
		var eAns;
		if (ansIndex != 4) // for 4th option, we need to pick the value from the multi-line text box
		{
			var elementIndex = "ans" + ansIndex;
		 	eAns = document.getElementById(elementIndex);
		}
		else
		{
			eAns = document.getElementById("multiLineText");
		}

		var sImageId = dt[ glbcnst_index ].MediaID;
        var sPartnerName = dt[ glbcnst_index ].PartnerName;
        
        document.getElementById("survey").style.visibility = "hidden";
		document.getElementById("survey").style.display = "none";
			
		call("_gpk3_submitSurvey", "doc_id="+nglb_doc_id+",mid="+sImageId+",partnerName="+sPartnerName+",ansIndex="+ansIndex+",ans='"+eAns.value + "'" );
		return true;
	}
	
// do not delete the following line. 
//??DO NOT CONVERT END

  </script>

 </head>

 <body onload='PrimaryStartup();' onClick="DisableMenu();" bgcolor="#ffffff">

       <div id="contextMenu" class = "contextMenu" onclick="ClickMenu()" onmouseover="SwitchMenu()"  onmouseout="SwitchMenu()" > </div>
 
  <div id="titleBar1" style="visibility:hidden; display:none"> %_MEDIAIDDATA%_ </div>
  
  
  <div id="Print_N_Tip" class="chip" style="width:%_Print_N_width%_; text-align:center">%_PRINT_TIPS%_</div>
  <div id="DL_COMP_TIP" class="chip" style="width:%_DL_COMP_width%_; text-align:center">%_DL_COMP_TIPS%_</div>
  <div id="BUY_N_TIP"   class="chip" style="width:%_BUY_N_width%_;   text-align:center">%_ADD_TO_CART%_</div>
  <div id="CART_N_TIP"  class="chip" style="width:%_CART_N_width%_;  text-align:center">%_SHOPPING_CART%_</div>
  <div id="HELP_N_TIP"  class="chip" style="width:%_HELP_N_width%_;  text-align:center">%_HELP%_</div>

  <FORM ACTION="st17ImgDetail.htm" NAME="IMForm">
  <div id="ID">
    <table width="691" border="0" cellspacing="0" cellpadding="0">
     <td id="titleBar" align="left" class="header" style="visibility:visible; font-family: %_PRIMARYFONT%_">%_MEDIAIDDATA%_
      <td width="32">
 	<a onmouseover="changeImagesNToolTip('ShoppingCart','%_HTMLImageDir2%_/ImgDetail/asp_globalnav_cart.png', 'CART_N_TIP', 1, event.x-%_CART_N_width%_-5,event.y-%_CART_N_height%_);return true"
           onmouseout="changeImagesNToolTip('ShoppingCart','%_HTMLImageDir2%_/ImgDetail/asp_globalnav_cart.png', 'CART_N_TIP', 2, event.x-%_CART_N_width%_-5,event.y-%_CART_N_height%_);return true"
           onClick="return shoppingCart()">
       <img id="ShoppingCart" src="%_HTMLImageDir2%_/ImgDetail/asp_globalnav_cart.png" alt="Shopping Cart" name="ShoppingCart" width="22" height="22" border="0">
      </a>
      </td>
      <td width="32">
 	<a onmouseover="changeImagesNToolTip('Print_N','%_HTMLImageDir2%_/ImgDetail/C_Print_Md_N.png', 'Print_N_Tip', 1, event.x-%_Print_N_width%_-5,event.y-%_Print_N_height%_);return true"
           onmouseout="changeImagesNToolTip('Print_N','%_HTMLImageDir2%_/ImgDetail/C_Print_Md_N.png', 'Print_N_Tip', 2, event.x-%_Print_N_width%_-5,event.y-%_Print_N_height%_);return true"
           onClick="return printImgDetail()">
       <img id="Print_N" src="%_HTMLImageDir2%_/ImgDetail/C_Print_Md_N.png" alt="Print" name="Print_N" width="22" height="22" border="0">
      </a>
      </td>
      <td width="32">
 	<a onmouseover="changeImagesNToolTip('ImageDetailHelp','%_HTMLImageDir2%_/ImgDetail/asp_globalnav_help.png', 'HELP_N_TIP', 1, event.x-%_HELP_N_width%_-5,event.y-%_HELP_N_height%_);return true"
           onmouseout="changeImagesNToolTip('ImageDetailHelp','%_HTMLImageDir2%_/ImgDetail/asp_globalnav_help.png', 'HELP_N_TIP', 2, event.x-%_HELP_N_width%_-5,event.y-%_HELP_N_height%_);return true"
           onClick="return imageDetailHelp()">
       <img id="ImageDetailHelp" src="%_HTMLImageDir2%_/ImgDetail/asp_globalnav_help.png" alt="Help" name="ImageDetailHelp"   width="22" height="22" border="0">
      </a>
      </td>
    </table>
  </div>

<div class="tab-container" id="container1">
  <MAP NAME="leftcap">
  <AREA TITLE="leftcap" onClick="leftCapClicked()" onMouseOver="mouseOverTab1()" onMouseOut="mouseOutTab1()" SHAPE=RECT COORDS="12,3,19,23">
  </MAP>

  <MAP NAME="overlap">
  <AREA TITLE="overlap1" onClick="showPane('pane1')" onMouseOver="mouseOverTab1()" onMouseOut="mouseOutTab1()" SHAPE=POLY COORDS="0,3, 2,3, 24,23, 0,23">
  <AREA TITLE="overlap2" onClick="showPane('pane2')" onMouseOver="mouseOverTab2()" onMouseOut="mouseOutTab2()" SHAPE=POLY COORDS="17,3, 24,3, 24,21, 17,13">
  </MAP>
  
  <MAP NAME="overlap2">
  <AREA TITLE="overlap2" onClick="showPane('pane2')" onMouseOver="mouseOverTab2()" onMouseOut="mouseOutTab2()" SHAPE=POLY COORDS="0,3, 2,3, 24,23, 0,23">
  <AREA TITLE="overlap3" onClick="showPane('pane3')" onMouseOver="mouseOverTab3()" onMouseOut="mouseOutTab3()" SHAPE=POLY COORDS="17,3, 24,3, 24,21, 17,13">
  </MAP>
  
  <MAP NAME="overlap_f2">
  <AREA TITLE="overlap11" onClick="showPane('pane1')" onMouseOver="mouseOverTab1()" onMouseOut="mouseOutTab1()" SHAPE=POLY COORDS="0,3, 2,3, 12,12, 12,23, 0,23">
  <AREA TITLE="overlap22" onClick="showPane('pane2')" onMouseOver="mouseOverTab2()" onMouseOut="mouseOutTab2()" SHAPE=POLY COORDS="17,3, 24,3, 24,23, 17,23">
  </MAP>
  
  <MAP NAME="overlap_f3">
  <AREA TITLE="overlap31" onClick="showPane('pane2')" onMouseOver="mouseOverTab2()" onMouseOut="mouseOutTab2()" SHAPE=POLY COORDS="0,3, 2,3, 12,12, 12,23, 0,23">
  <AREA TITLE="overlap32" onClick="showPane('pane3')" onMouseOver="mouseOverTab3()" onMouseOut="mouseOutTab3()" SHAPE=POLY COORDS="17,3, 24,3, 24,23, 17,23">
  </MAP>
  
  <MAP NAME="rightcap">
  <AREA TITLE="overlap4" onClick="rightCapClicked()" onMouseOver="mouseOverTab3()" onMouseOut="mouseOutTab3()" SHAPE=POLY COORDS="0,3, 2,3, 24,23, 0,23">
  </MAP>

  <table border="0" cellpadding="0" cellspacing="0" width="725">
    <tr>
      <td width="%_TAB_LEFTCAP_width%_">
       <img name="tab_leftcap" src="%_HTMLImageDir2%_/ImgDetail/tab_leftcap.gif" width="%_TAB_LEFTCAP_width%_" height="23" border="0" alt="" usemap="#leftcap">
      </td>
      <td class=tabs_active width="%_TAB_PRICE_width%_" align=center>
       <a alt="" onClick="return showPane('pane1')" onMouseOver="mouseOverTab1()" onMouseOut="mouseOutTab1()">
        <span id="tab1color" class="tab_bkcolor"> &nbsp;%_PRICELBL%_&nbsp; </span>
       </a>
      </td>
      
      <td width="%_TAB_OVERLAP_width%_">
       <img name="tab_overlap1" src="%_HTMLImageDir2%_/ImgDetail/tab_overlap.gif" width="%_TAB_OVERLAP_width%_" height="23" border="0" alt="" usemap="#overlap">
      </td>
      <td class=tabs width="%_TAB_KEYWORKS_width%_" align=center>
       <a alt="" onClick="return showPane('pane2')" onMouseOver="mouseOverTab2()" onMouseOut="mouseOutTab2()"> 
        <span id="tab2color" class="tab_bkcolor"> &nbsp;%_KEYWORDS%_&nbsp; </span>
       </a>
      </td>
      <td width="%_TAB_OVERLAP_width%_">
       <img name="tab_overlap2" src="%_HTMLImageDir2%_/ImgDetail/tab_overlap_grey1.gif" width="%_TAB_OVERLAP_width%_" height="23" border="0" alt="" usemap="#overlap2">
      </td>
      <td class=tabs width="%_TAB_KEYWORKS_width%_" align=center>
       <a alt="" onClick="providerPaneViewed();return showPane('pane3')" onMouseOver="mouseOverTab3()" onMouseOut="mouseOutTab3()">
        <span id="tab3color" class="tab_bkcolor"> &nbsp;%_ProviderTag%_&nbsp; </span>
       </a>
      </td>
      <td width="%_TAB_RIGHTCAP_width%_"><img name="tab_rightcap" src="%_HTMLImageDir2%_/ImgDetail/tab_rightcap.gif" width="%_TAB_RIGHTCAP_width%_" height="23" border="0" alt="" usemap="#rightcap"></td>
      <td class=tabs_stroke width=536> </td>
    </tr>
  </table>

<div class="tab-panes">
  <div id="pane1" style="visibility:hidden; display:none">

  <div id="Image">
   <table width="458" height="411" border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td align="center" valign="middle">
        <img src="%_DetailImg%_" alt="" border="0" id="JPGImg" name="JPGImg" style="visibility:hidden">
        <img src="%_HTMLImageDir2%_/ShopCart/InProgress_gray.gif" alt="" border="0" align="absmiddle" id="InProgImg" name="InProgImg" style="visibility:visible;width:20">
        <img src="%_HTMLImageDir2%_/ImgDetail/error.gif" alt="" align="absmiddle" border="0" id="ErrorImg" name="ErrorImg" style="visibility:hidden;width:0">
        <a id="statustext" class="bold_body" align="left" style="visibility:visible; font-family: %_PRIMARYFONT%_"> </a>
     </td>
    </tr>
   </table>
  </div>

  <!-- ======================================================= -->
  <div id="ImageP1Pre">
    <table width="458" height="411" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" valign="middle">
        <img src="%_DetailImg%_" alt="" border="0" id="JPGImgPre" align="absmiddle" name="JPGImgPre" style="max-width:128;max-height:128" /><p />
	  <img src="%_HTMLImageDir2%_/ShopCart/InProgress_gray.gif" alt="" border="0" align="absmiddle" id="InProgImgP1Pre" name="InProgImgP1Pre" style="visibility:visible;width:20">
          <a id="statustextP1Pre" class="bold_body" align="left" style="visibility:visible; font-family: %_PRIMARYFONT%_">%_INPROGRESSTEXT%_</a>
        </td>
      </tr>
   </table>
  </div>
  <!-- ======================================================= -->

    
  <div id="FileSize">
   <table width="220" border="0" cellspacing="2" cellpadding="3">
    <tr height="35" align="left"> <td>
      <span class="header" font-family: %_PRIMARYFONT%_>%_GETPRICE%_</span>
    </td></tr>
   </table>
   <table width="220" border="0" style="border:1px gray solid" rules=none frame=box cellspacing="2" cellpadding="3" height="100">
    <tr height="23">
     <td class="bold_small" bgcolor="#c8d9da" align="right" valign="top" width="8" height="23" style="visibility:visible; font-family: %_PRIMARYFONT%_"></td>
     <td class="bold_body" bgcolor="#c8d9da" height="19" style="visibility:visible; font-family: %_PRIMARYFONT%_">%_FileResText%_</td>
     <td class="bold_body" align="left" bgcolor="#c8d9da" width="78" height="19" style="visibility:visible; font-family: %_PRIMARYFONT%_">%_PRICELBL%_</td>
    </tr>
    <tr height="30">
     <td class="body" height="30"></td>
     <td class="body" height="30"></td>
     <td class="body" align="left" width="78" height="30"></td>
    </tr>
    <tr height="30">
     <td class="body" height="30"></td>
     <td class="body" height="30"></td>
     <td class="body" align="left" width="78" height="30"></td>
    </tr>
    <tr height="30">
     <td class="body" height="30"></td>
     <td class="body" height="30"></td>
     <td class="body" align="left" width="78" height="30"></td>
    </tr>
    <tr height="30">
     <td class="body" height="30"></td>
     <td class="body" height="30"></td>
     <td class="body" align="left" width="78" height="30"></td>
    </tr>
    <tr height="30">
     <td class="body" height="30"></td>
     <td class="body" height="30"></td>
     <td class="body" align="left" width="78" height="30"></td>
    </tr>
    <tr height="30">
     <td colspan=3 align="center" class="bold_body" bgcolor="#afbebf" height="19" style="visibility:visible; font-family: %_PRIMARYFONT%_">
       <!-- Watson : 1288262 -->
      <input class="addcartbutton_g" id="addToCartButtonInset" type="button" name="AddtoCart"    value="%_ADDTOCARTBUTTON%_"    onclick="return addImgToCart()" style="visibility:visible; font-family: %_PRIMARYFONT%_" disabled>
     </td>
    </tr>
   </table>
   <table width="222" border="0" cellspacing="0" cellpadding="0">
    <tr height="23"><td>&nbsp;</td></tr>
    <tr height="23"> <td>
      <span class="mylink"> <a alt="" onClick="return showPane('pane2')">%_VIEWKEYWORDS%_</a> </span>
    </td></tr>
    <tr height="23"> <td>
      <span class="mylink"> <a alt="" onClick="providerPaneViewed();return showPane('pane3')">%_SHOWPROVIDER%_</a> </span>
    </td></tr>
   </table>
  </div>
  
  
  
  <div id="bottom" onclick="CSAction(new Array(/*CMP*/'bd1c4e420'));return CSClickReturn()" csclick="bd1c4e420">
   <table width="725" border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td width="22"></td>
     <td width="22">
      <a onmouseover="changeImages('PreviousPage','%_HTMLImageDir2%_/ImgDetail/back_R.gif');return true"
         onmouseout="changeImages( 'PreviousPage','%_HTMLImageDir2%_/ImgDetail/back_N.gif');return true"
         onClick="return( changeFocus(0) )">
       <img id="PreviousPage" style=" visibility:hidden" src ="%_HTMLImageDir2%_/ImgDetail/back_N.gif" alt="" name="PreviousPage" width="22" height="18" border="0">
      </a>
     </td>
     <td width="66">
      <table width="66" border="0" cellspacing="0" cellpadding="0" height="20">
       <tr>
        <td class="bold_small" align="center" valign="middle"><div id="BackNext"></div></td>
       </tr>
      </table>
     </td>
     <td width="22">
      <a onmouseover="changeImages('NextPage','%_HTMLImageDir2%_/ImgDetail/next_R.gif');return true"
         onmouseout="changeImages( 'NextPage','%_HTMLImageDir2%_/ImgDetail/next_N.gif');return true"
         onClick="return( changeFocus(1) )">
       <img id="NextPage" style=" visibility:hidden" src="%_HTMLImageDir2%_/ImgDetail/next_N.gif" alt="" name="NextPage" width="22" height="18" border="0">
      </a>
     </td>

     <td width="578" height="35" align="right">
      <div id = "closeButton">
      <!-- Watson : 1288262 -->     
       <input id="openwith1" class="edcompbutton_g"  type="button" name="EditComp"     value="%_OPENWITH%_"     onclick="return DisplayMenu()"     style="visibility:visible; font-family: %_PRIMARYFONT%_" disabled>
       <input class="addcartbutton_g" id="addToCartButton1" type="button" name="AddtoCart"    value="%_ADDTOCARTBUTTON%_"    onclick="return addImgToCart()" style="visibility:visible; font-family: %_PRIMARYFONT%_" disabled>
       <input class="dlcompbutton_g"  id="downloadCompButton1" type="button" name="DownloadComp" value="%_DOWNLOADCOMPBUTTON%_" onclick="return downloadComp()" style="visibility:visible; font-family: %_PRIMARYFONT%_" disabled>
       <input class="closebutton"   type="button" name="close"        value="%_CLOSEBUTTON%_"        onclick="return closeDialog()"  style="visibility:visible; font-family: %_PRIMARYFONT%_">
      </div>
     </td>
     <td width="15">
     </td>
    </tr>
   </table>
  </div>
</div>

<div id="pane2" style="visibility:hidden; display:none">

  <!-- ======================================================= -->
  <div id="Image4Size1" style="visibility:%_IMAGE4SIZE_VIS%_">
    <table width="458" height="411" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" valign="middle">
         <div id="Pane2PostDiv">
          <img src="../images/spacer.gif" alt="" border="0" id="JPGImg4Size1" name="JPGImg4Size1" style="visibility:hidden">
          <img src="%_HTMLImageDir2%_/ShopCart/InProgress_gray.gif" alt="" border="0" align="absmiddle" id="InProgImg4Size1" name="InProgImg4Size1" style="visibility:%_IMAGE4SIZE_VIS%_;width:20">
          <img src="%_HTMLImageDir2%_/ImgDetail/error.gif" alt="" align="absmiddle" border="0" id="ErrorImg4Size1" name="ErrorImg4Size1" style="visibility:hidden;width:0">
          <a id="statustext4Size1" class="bold_body" align="left" style="visibility:%_IMAGE4SIZE_VIS%_; font-family: %_PRIMARYFONT%_"></a>
         </div>
         
         <div id="Pane2PreDiv" style="visibility:hidden;display:none">
          <img src="%_DetailImg%_" alt="" border="0" id="JPGImgPre2" align="absmiddle" name="JPGImgPre2" style="max-width:128;max-height:128" /><p />
    	  <img src="%_HTMLImageDir2%_/ShopCart/InProgress_gray.gif" alt="" border="0" align="absmiddle" id="InProgImgP2Pre" name="InProgImgP2Pre" style="visibility:visible;width:20">
          <a id="statustextP2Pre" class="bold_body" align="left" style="visibility:visible; font-family: %_PRIMARYFONT%_">%_INPROGRESSTEXT%_</a>
         </div>

        </td>
      </tr>
    </table>
  </div>
  <!-- ======================================================= -->

  <div id="KwImage" style="visibility:hidden">
	<table id="KwImgs" width="458" height="411" border="0" cellspacing="0" cellpadding="0">
		%_function_SetImgs%_
		
   </table>
  </div>

  <div id="KwImagePre" style="visibility:%_KWIMAGEPRE_VIS%_">
	<table id="KwImgsPre" width="458" height="411" border="0" cellspacing="0" cellpadding="0">
     <tr>
      <td align="center" valign="middle">
        <img src="%_HTMLImageDir2%_/ShopCart/InProgress_gray.gif" alt="" border="0" align="absmiddle" id="InProgImgPane2" name="InProgImgPane2" style="visibility:%_KWIMAGEPRE_VIS%_;width:20">
        <a id="statustextPane2" class="bold_body" align="left" style="visibility:%_KWIMAGEPRE_VIS%_; font-family: %_PRIMARYFONT%_">%_INPROGRESSTEXT%_</a>
	  </td>
	 </tr>
    </table>
  </div>

  <div id="KwTitle">
   <table border="0" width="222" rules=none frame=box cellspacing="0" cellpadding="0" height="23">
    <tr height="23"> 
	 <td class="header">
      %_FINDSIMILAR%_
	 </td>
	 <td width="20">
	  <img src="../images/spacer.gif" id="Kwspace" name="Kwspace" style="visibility=visible;width:20">
	 </td>
	 <td>
	  <img src="%_HTMLImageDir2%_/ShopCart/InProgress_gray.gif" id="Kwspin" name="Kwspin" style="visibility:hidden">
	 </td>
	</tr>
   </table>
  </div>

  <div id="KwSubTitle" style="visibility:visible">
   <table border="0" width="222" rules=none frame=box cellspacing="0" cellpadding="8" height="57">
    <tr height="57"> <td class="bold_body">
      %_KEYWORDHELP%_
    </td></tr>
   </table>
  </div>

  <div id="KwSubSelect" style="visibility:hidden">
   <table border="0" width="222" rules=none frame=box cellspacing="0" cellpadding="8" height="57">
    <tr height="57">
	    <td class="bold_body">
		<!-- Watson : 1256701 -->
		<input type="radio" name="KeyDisp" value="shared" 
		onFocus="if(this.checked){ SelKeyPressed(0); }"
		onClick="SelKeyPressed(0)" />%_KeySubSelShared%_<br/>
		<input type="radio" name="KeyDisp" value="whole"  
		onFocus="if(this.checked){ SelKeyPressed(1); }"
		onClick="SelKeyPressed(1)" checked />%_KeySubSelWhole%_
	 </td>
    </tr>
   </table>
  </div>

  <!-- ======================================================== -->
  <div id="KeywordsPre" style="visibility:%_KEYWORDSPRE_VIS%_">
    <table id = "keywordstablePre" border="0" width="200" rules=none frame=box cellspacing="0" cellpadding="1" height="279">
      <tr> <td align="center" valign="middle" colspan=2>
        <img src="%_HTMLImageDir2%_/ShopCart/InProgress_gray.gif" alt="" border="0" align="absmiddle" id="InProgKwsPre" name="InProgKwsPre" style="visibility:%_KEYWORDSPRE_VIS%_;width:20">
        <a id="kwstatustextPre" class="bold_body" align="left" style="visibility:%_KEYWORDSPRE_VIS%_; font-family: %_PRIMARYFONT%_">%_INLOADKEYWORDS%_</a>
      </td> </tr>
    </table>
  </div>
  <!-- ======================================================== -->

  <div id="Keywords" style="visibility:%_KEYWORDS_VIS%_">
    <table id = "keywordstable" border="0" width="200" rules=none frame=box cellspacing="0" cellpadding="1" height="279">
   </table>
  </div>

  <div id="KeywordsPane2Progress" style="visibility:hidden">
    <table id = "keywordsPane2ProgressTable" border="0" width="200" rules=none frame=box cellspacing="0" cellpadding="1" height="279">
   </table>
  </div>

  <div id="KeywordsPane2ResultShared" style="visibility:hidden">
    <table id = "keywordsPane2ResultSharedTable" border="0" width="200" rules=none frame=box cellspacing="0" cellpadding="1" height="279">
   </table>
  </div>

  <div id="KeywordsPane2ResultWhole" style="visibility:hidden">
    <table id = "keywordsPane2ResultWholeTable" border="0" width="200" rules=none frame=box cellspacing="0" cellpadding="1" height="279">
   </table>
  </div>

  <div id="KwSearchAgain">
   <table border="0" width="222" rules=none frame=box cellspacing="0" cellpadding="0" height="40">
     <tr> <td align="left" valign="middle" height="24">
     <!-- Watson : 1256701 -->
      <input class="buttonh" type="button" id="findSimilarButton" name="Search" value="%_FINDSIMILAR%_" onclick="return searchAgain()" disabled=true style="visibility:visible">
     </td> </tr>
   </table>
  </div>

  <div id="bottom" onclick="CSAction(new Array(/*CMP*/'bd1c4e420'));return CSClickReturn()" csclick="bd1c4e420">
   <table width="725" border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td width="132"> </td>
     <td width="578" height="35" align="right">
      <div id = "closeButton">
      <!-- Watson : 1288262 -->
       <input id="openwith2"  class="edcompbutton_g"  type="button" name="EditComp2"     value="%_OPENWITH%_"     onclick="return DisplayMenu();"   style="visibility:visible; font-family: %_PRIMARYFONT%_" disabled>
       <input class="addcartbutton_g" id="addToCartButton2" type="button" name="AddtoCart2"    value="%_ADDTOCARTBUTTON%_"    onclick="return addAllImgToCart()" style="visibility:visible; font-family: %_PRIMARYFONT%_" disabled>
       <input class="dlcompbutton_g" id="downloadCompButton2" type="button" name="DownloadComp2" value="%_DOWNLOADCOMPBUTTON%_" onclick="return downloadAllComp()" style="visibility:visible; font-family: %_PRIMARYFONT%_" disabled>
       <input class="closebutton"   type="button" name="close2"        value="%_CLOSEBUTTON%_"        onclick="return closeDialog()"     style="visibility:visible; font-family: %_PRIMARYFONT%_">
      </div>
     </td>
     <td width="15"> </td>
    </tr>
   </table>
  </div>
</div>
<div id="pane3" style="visibility:hidden; display:none">
  
  <div id="prImage">
   <table width="458" height="411" border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td align="center" valign="middle">
        <img src="%_DetailImg%_" alt="" border="0" id="JPGImg4Pr" name="JPGImg4Pr" style="visibility:visible">
        <img src="%_HTMLImageDir2%_/ShopCart/InProgress_gray.gif" alt="" border="0" align="absmiddle" id="InProgImg4Pr" name="InProgImg4Pr" style="visibility:hidden;width:20">
        <img src="%_HTMLImageDir2%_/ImgDetail/error.gif" alt="" align="absmiddle" border="0" id="ErrorImg4Pr" name="ErrorImg4Pr" style="visibility:hidden;width:0">
        <a id="statustext4Pr" class="bold_body" align="left" style="visibility:hidden; font-family: %_PRIMARYFONT%_"></a>
     </td>
    </tr>
   </table>
  </div>

  <!-- ======================================================= -->
  <div id="prImageP1Pre">
    <table width="458" height="411" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" valign="middle">
          <img src="%_DetailImg%_" alt="" border="0" id="JPGImgPrePr" align="absmiddle" name="JPGImgPrePr" style="max-width:128;max-height:128" /><p />
	        <img src="%_HTMLImageDir2%_/ShopCart/InProgress_gray.gif" alt="" border="0" align="absmiddle" id="InProgImgP1Pre4Pr" name="InProgImgP1Pre4Pr" style="visibility:hidden;width:20">
          <a id="statustextP1Pre4Pr" class="bold_body" align="left" style="visibility:hidden; font-family: %_PRIMARYFONT%_">%_INPROGRESSTEXT%_</a>
        </td>
      </tr>
   </table>
  </div>
  <!-- ======================================================= -->
  
  
  <div id="info">
   <table width="222" border="0" cellspacing="0" cellpadding="0">
    <tr height="23"> <td>
      <span class="header" style="font-family: %_PRIMARYFONT%_"> %_ABOUTTHISIMAGE%_ </span>
    </td></tr>
    <tr height="6"> <td>
    </td></tr>
    <tr height="23"> <td>
      <span class="bold_small" style="font-family: %_PRIMARYFONT%_"> %_ProviderText%_ </span>
      <span class="body" id="providerText"> </span>
    </td></tr>
    <tr height="23"> <td>
      <span  class="bold_small" style="font-family: %_PRIMARYFONT%_"> %_PROVIDERID%_ </span>
      <span class="body" id="imageidtext"> </span>
    </td></tr>
    <tr height="23"> <td>
      <span  class="bold_small" style="font-family: %_PRIMARYFONT%_"> %_DESCRIPTION%_ </span>
      <span class="body" id="titletext"> </span>
    </td></tr>
    <tr height="6"> <td>
    </td></tr>
    <tr height="23"> <td>
      <span class="mylink"> <a alt="" onClick="return showPane('pane1')" > %_GETPRICES%_ </a> </span>
    </td></tr>
    <tr height="23"> <td>
      <span class="mylink"> <a alt="" onClick="return showPane('pane2')"> %_VIEWKEYWORDS%_ </a> </span>
    </td></tr>
   </table>
  </div>
  
  <div id="survey" style="visibility:hidden;display:none;">
   <table width="229" border="0" style="border:none; background-color:#EEEEEE;" rules=none frame=box cellspacing="2" cellpadding="3" height="100">
    <tr height="18" style="padding-left:2px;text-transform:uppercase;background-color:#CCCCCC;font-size:11px;font-weight:bold">
     <td>
      <span style="color:#FFFFFF;padding-left:2px;" > %_CUSTOMERPOLL%_ </span>
     </td>
    </tr>
    <tr height="25" style="color:#000000;font-size:11px;font-weight:bold">
     <td style="padding-left:12px;padding-top:5px">
       %_POLLQUESTION%_
     </td>
    </tr>
    <tr height="25" style="color:#000000;font-size:11px;">
     <td style="padding-left:12px;">
      <input type="radio" id="ans1" value="%_POLLANS1%_" name="AnswerLine" onclick="setAnswerSelection(1);disableTextArea();return enableSubmit()"> %_POLLANS1%_
     </td>
    </tr>
    <tr height="25" style="padding-left:5px;color:#000000;font-size:11px;">
     <td style="padding-left:12px;">
      <input type="radio" id="ans2" value="%_POLLANS2%_" name="AnswerLine" onclick="setAnswerSelection(2);disableTextArea();return enableSubmit()"> %_POLLANS2%_
     </td>
    </tr>
    <tr height="25" style="padding-left:5px;color:#000000;font-size:11px;">
     <td style="padding-left:12px;">
      <input type="radio" id="ans3" value="%_POLLANS3%_" name="AnswerLine" onclick="setAnswerSelection(3);disableTextArea();return enableSubmit()"> %_POLLANS3%_
     </td>
    </tr>
    <tr height="25" style="padding-left:5px;color:#000000;font-size:11px;">
     <td style="padding-left:12px;">
      <input type="radio" id="ans4" value="%_POLLANS4%_" name="AnswerLine" onclick="setAnswerSelection(4);return enableTextArea()"> %_POLLANS4%_
     </td>
    </tr>
    <tr height="35">
     <td style="padding-left:25px;">
      	<textarea id="multiLineText" value="" rows="2" cols="%_SURVEYTEXTCOLS%_" style="font-family:%_PRIMARYFONT%_;font-size:11px;overflow:hidden" onkeydown='return setTimeout("textAreaChange()",1)' onkeyup='return setTimeout("textAreaChange()",1)' onclick="setAnswerSelection(4); return textAreaChange()">
      </textarea>
     </td>
    </tr>
    <tr height="30" style="color:#000000;font-size:11px;">
     <td align="center">
      <input class="edcompbutton" id="submit" type="button" Value="%_SUBMIT%_" style="text-align:center;color:#000000;font-family: %_PRIMARYFONT%_;font-size:11px" onclick="return submitSurvey()"  disabled>
     </td>
    </tr>
   </table>
   
  </div>

  <div id="bottom" onclick="CSAction(new Array(/*CMP*/'bd1c4e420'));return CSClickReturn()" csclick="bd1c4e420">
   <table width="725" border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td width="22"></td>
     <td width="22">
      <a onmouseover="changeImages('prPreviousPage','%_HTMLImageDir2%_/ImgDetail/back_R.gif');return true"
         onmouseout="changeImages( 'prPreviousPage','%_HTMLImageDir2%_/ImgDetail/back_N.gif');return true"
         onClick="providerPaneViewed();return( changeFocus(0) )">
       <img id="prPreviousPage" src="%_HTMLImageDir2%_/ImgDetail/back_N.gif" onmouseover="this.style.cursor='hand';" onmouseout="this.style.cursor='default';" alt="" name="prPreviousPage" width="22" height="18" border="0">
      </a>
     </td>
     <td width="66">
      <table width="66" border="0" cellspacing="0" cellpadding="0" height="20">
       <tr>
        <td class="bold_small" align="center" valign="middle"><div id="prBackNext"></div></td>
       </tr>
      </table>
     </td>
     <td width="22">
      <a onmouseover="changeImages('prNextPage','%_HTMLImageDir2%_/ImgDetail/next_R.gif');return true"
         onmouseout="changeImages( 'prNextPage','%_HTMLImageDir2%_/ImgDetail/next_N.gif');return true"
         onClick="providerPaneViewed(); return( changeFocus(1) )">
       <img id="prNextPage" src="%_HTMLImageDir2%_/ImgDetail/next_N.gif" onmouseover="this.style.cursor='hand';" onmouseout="this.style.cursor='default';" alt="" name="prNextPage" width="22" height="18" border="0">
      </a>
     </td>
 <td width="578" height="35" align="right">
      <div id = "closeButton">
      <!-- Watson : 1288262 -->
       <input id="openwith3" class="edcompbutton_g"  type="button" name="EditComp3"     value="%_OPENWITH%_"     onclick="return DisplayMenu()" style="visibility:visible; font-family: %_PRIMARYFONT%_" disabled>
       <input class="addcartbutton_g" id="addToCartButton3" type="button" name="AddtoCart3"    value="%_ADDTOCARTBUTTON%_"    onclick="return addImgToCart()"  style="visibility:visible; font-family: %_PRIMARYFONT%_" disabled>
       <input class="dlcompbutton_g" id="downloadCompButton3" type="button" name="DownloadComp3" value="%_DOWNLOADCOMPBUTTON%_" onclick="return downloadComp()" style="visibility:visible; font-family: %_PRIMARYFONT%_" disabled>
       <input class="closebutton"   type="button" name="close3"        value="%_CLOSEBUTTON%_"        onclick="return closeDialog()"  style="visibility:visible; font-family: %_PRIMARYFONT%_">
      </div>
     </td>
     <td width="15">
     </td>
    </tr>
   </table>
  </div>
</div>
</div>
</FORM>
</body>
</html>
