﻿/*

	Copyright 2010 Cevican AB. www.SolidComponents.com
	Do not modify.

	-	*** Please note that no functions in this JavaScript file may be called directly.
		*** Only Commands in SCToolboxAPI.js may be called.

	-	Toolbox Light™ is free software and in order to use it, the customer 
		must include proper credits on each web page that utilizes the software.
		“CAD support powered by SolidComponents™ technology”.
		
	-	The provided “Non-Disclosure” paragraph must be included into every web 
		page that utilizes an instance of Toolbox Light™.
		
	-	Toolbox Light™ is intellectual property of Cevican AB and may under no 
		circumstances be copied, modified, distributed, “de-compiled” or disclosed 
		to third parties. Toolbox Light™ is equipped with monitoring functions that 
		will detect possible misuse.
		
	-	Only customers of Cevican AB may implement and use Toolbox Light™.
		
	-	Toolbox Light™ may only be included into one web site to support one company 
		only.
				
	-	Toolbox Light™ may only be used as specified in the manual and Toolbox library 
		functions not specified in the public API may under no circumstances be called 
		directly.
		
	-	Toolbox Light™ should be considered a “constant Beta” product that is 
		continuously developed. Functionality may be changed or modified.
		
	-	The customer understands that the latest version of Toolbox Light™ must always 
		be used and that the customer may only include the Toolbox library directly from 
		SolidComponents URL. By using the SolidComponents Toolbox URL, the use of the 
		latest version will be ensured.
		
	-	Toolbox Light™ is provided free of charge without any warranties and is used on 
		the customers own risk. Reasonable care has been taken and the software has been 
		rigorously tested in order to minimize the risk for critical errors.
		
	-	It is strictly forbidden to bypass the Toolbox Light™ communication manager to 
		call SolidComponents servers directly. All communication with SolidComponents 
		must be handled directly by the communication manager which is ensured by using 
		the provided API.
		
	-	Cevican AB takes no responsibility for any consequences, direct or indirect, by 
		using Toolbox Light™.
		
	-	Toolbox Light™ utilizes existing well-known and accepted IT-technology to 
		communicate between client and server. As the Internet is a constantly changing 
		environment, it is though still not possible to completely guarantee exactly the 
		same functionality in the future.
		
	-	Toolbox Light™ has been developed with future compatibility as a guiding rule. 
		Though, the customer understands that Cevican AB has the right to require the 
		customer to implement modifications to their current implementation in order to 
		continue using Toolbox Light™.
		
	-	The general conditions for using Toolbox Light™ may be modified without prior 
		notification. It is the customers’ responsibility to stay informed. The general 
		conditions are accessible from the customers’ administrative system at their 
		SolidComponents product catalogue.
		
	-	The customer understands that activity will be logged in order to provide 
		statistics, error control and to provide support as well as to prevent fraud and 
		possible misuse.
		
	-	Identification will be required using a digital security key that may be changed 
		over time in order to certify that Toolbox Light™ is used properly.
		
	-	In the case of certain reasons, such as but not limited to, security issues 
		Cevican AB has the right to deactivate features of Toolbox Light™.
		
	-	Toolbox Light™ may only be used to support manual user interaction through mouse 
		and keyboard activity and all attempts to programmatically access or utilize 
		server resources is strictly prohibited.

*/


/*
	2011-11-10  v.1.1.1		Added configurator exist check.
	2011-04-19	v.1.1.0		Added support for Ajax updates of part numbers in product tables. Added command SCRefresh().
	2011-04-19	v.1.1.0		Added version check.
*/


var SCToolbox={Constants:{ConstantList:{"AJAXLINK":"ht"+"tp://www.solidcomponents.com/asp.net/Toolbox1.ashx","CONFIGURATORLINK":"ht"+"tp://www.solidcomponents.com/api/configurator.asp","INTERVAL_CONTROLPANELTIMER":200,"INTERVAL_CHECKPROGRESS":2E3,"INTERVAL_OBJECTMANGER":100,"INTERVAL_OBJECTLISTUPDATE":500,"INTERVAL_OBJECTLISTREFRESH":200,"LIMIT_OBJECTS":120,"TOOLBOX_VERSION":"1.1.1"},Value:function(Key){return SCToolbox.Constants.ConstantList[Key]}},ObjectBindingsList:{"ToolboxObject_CAD_Link":{},
"ToolboxObject_Configurator":{"SCCC":"SCCC","SelectedFormat":"SelectedFormat","CurrentConfiguratorID":"CurrentConfiguratorID","CurrentLanguage":"CurrentLanguage","CurrentConfiguratorType":"CurrentConfiguratorType","CurrentConfiguratorWidth":"CurrentConfiguratorWidth","CurrentConfiguratorHeight":"CurrentConfiguratorHeight"},"ToolboxObject_Progress":{"CurrentProgress":"CurrentProgress","CurrentWorkID":"CurrentWorkID"},"ToolboxObject_Format_Selector":{},"ToolboxObject_Download_Icon":{"CurrentProgress":"CurrentProgress",
"CurrentDownloadLink":"CurrentDownloadLink","CurrentWorkID":"CurrentWorkID","CurrentWorkError":"CurrentWorkError"},"ToolboxObject_Download_Thumbnail":{"CurrentProgress":"CurrentProgress","CurrentDownloadLink":"CurrentDownloadLink","CurrentWorkID":"CurrentWorkID","CurrentWorkError":"CurrentWorkError","CurrentThumbnailLink":"CurrentThumbnailLink"}},ObjectLimitList:{"ToolboxObject_CAD_Link":100,"ToolboxObject_Configurator":1,"ToolboxObject_Progress":1,"ToolboxObject_Format_Selector":1,"ToolboxObject_Download_Icon":1,
"ToolboxObject_Download_Thumbnail":1},Text:{"CADFailedMsg":"An error occurred while creating CAD-file.","DownloadLink":"Click to download file.","DownloadLinkEmpty":"No file to download.","CADLink":"Click to create CAD.","CADNotExist":"CAD does not exist for this part number.","CADChecking":"Checking for CAD support","SelectCADFormat":"Select CAD format."},VariableBindings:{List:[],Add:function(_ObjectID,_ObjectVariableName,_Variable){var tmpBinding=new function(){};tmpBinding.ObjectID=_ObjectID;
tmpBinding.ObjectVariableName=_ObjectVariableName;tmpBinding.Variable=_Variable;SCToolbox.VariableBindings.List.push(tmpBinding)}},ProductResources:{Item:function(_PartNo){this.PartNo=_PartNo;this.CAD="INIT"},List:[],AddProduct:function(_PartNo){SCToolbox.ProductResources.List.push(new SCToolbox.ProductResources.Item(_PartNo))},SetCAD:function(_PartNo,_Value){for(var i in SCToolbox.ProductResources.List)if(SCToolbox.ProductResources.List[i].PartNo==_PartNo)SCToolbox.ProductResources.List[i].CAD=_Value},
GetCAD:function(_PartNo){var retval=false;for(var i in SCToolbox.ProductResources.List)if(SCToolbox.ProductResources.List[i].PartNo==_PartNo)retval=SCToolbox.ProductResources.List[i].CAD;return retval}},CADFormatsList:{"SOLIDWORKS":{"Tag":"SolidWorks","Enabled":true},"PROE":{"Tag":"Pro/E","Enabled":true},"SAT":{"Tag":"Sat","Enabled":true},"STEP":{"Tag":"Step","Enabled":true},"PARASOLID":{"Tag":"Parasolid","Enabled":true},"IGES":{"Tag":"Iges","Enabled":true},"DWG":{"Tag":"Dwg","Enabled":true},"DXF":{"Tag":"Dxf",
"Enabled":true},"CATIAV5":{"Tag":"Catia V5","Enabled":false}},VariableManager:{List:[{"Type":"SET_CURRENTWORKID","Terms":"true","Variable":"CurrentWorkID","Value":"tmpJob.GetParameter('WorkID')"},{"Type":"SET_CURRENTWORKID","Terms":"true","Variable":"CurrentDownloadLink","Value":"tmpJob.GetParameter('OutputFile')"},{"Type":"SET_CURRENTWORKID","Terms":"true","Variable":"CurrentThumbnailLink","Value":"tmpJob.GetParameter('ThumbnailFile')"},{"Type":"SET_CURRENTWORKID","Terms":"true","Variable":"CurrentProgress",
"Value":"'0'"},{"Type":"SET_CURRENTWORKID","Terms":"true","Variable":"CurrentWorkError","Value":"''"},{"Type":"SET_WORKPROGRESS","Terms":"tmpJob.GetParameter('WorkID') == SCToolbox.Variables.Value('CurrentWorkID')","Variable":"CurrentProgress","Value":"tmpJob.GetParameter('Progress')"},{"Type":"SET_FORMAT","Terms":"true","Variable":"SelectedFormat","Value":"tmpJob.GetParameter('Format')"},{"Type":"SET_CURRENTCONFIGURATORID","Terms":"true","Variable":"CurrentConfiguratorID","Value":"tmpJob.GetParameter('ConfiguratorID')"},
{"Type":"SET_CURRENTCONFIGURATORID","Terms":"true","Variable":"CurrentDownloadLink","Value":"''"},{"Type":"SET_CURRENTCONFIGURATORID","Terms":"true","Variable":"CurrentThumbnailLink","Value":"''"},{"Type":"SET_CURRENTCONFIGURATORID","Terms":"true","Variable":"CurrentProgress","Value":"'0'"},{"Type":"SET_DEFAULTLANG","Terms":"true","Variable":"CurrentLanguage","Value":"tmpJob.GetParameter('Lang')"},{"Type":"SET_DEFAULTLANG","Terms":"true","Variable":"DefaultLanguage","Value":"tmpJob.GetParameter('Lang')"},
{"Type":"ERROR","Terms":"tmpJob.GetParameter('ErrorType') == 'WorkFailed'","Variable":"CurrentProgress","Value":"'1'"},{"Type":"ERROR","Terms":"tmpJob.GetParameter('ErrorType') == 'WorkFailed'","Variable":"CurrentDownloadLink","Value":"''"},{"Type":"ERROR","Terms":"tmpJob.GetParameter('ErrorType') == 'WorkFailed'","Variable":"CurrentThumbnailLink","Value":"''"},{"Type":"ERROR","Terms":"tmpJob.GetParameter('ErrorType') == 'WorkFailed'","Variable":"CurrentWorkError","Value":"SCToolbox.Text['CADFailedMsg']"},
{"Type":"SET_CONFIGURATOR_INFO","Terms":"true","Variable":"CurrentConfiguratorType","Value":"tmpJob.GetParameter('Type')"},{"Type":"SET_CONFIGURATOR_INFO","Terms":"true","Variable":"CurrentConfiguratorWidth","Value":"tmpJob.GetParameter('Width')"},{"Type":"SET_CONFIGURATOR_INFO","Terms":"true","Variable":"CurrentConfiguratorHeight","Value":"tmpJob.GetParameter('Height')"},{"Type":"ERROR","Terms":"tmpJob.GetParameter('ErrorType') == 'ConfigNotFound'","Variable":"CurrentConfiguratorType","Value":"'ConfigNotFound'"}],
ListDebugMessage:[{"Type":"SET_WORKPROGRESS","Terms":"tmpJob.GetParameter('WorkID') == SCToolbox.Variables.Value('CurrentWorkID') && tmpJob.GetParameter('Progress') == '1'","Message":"Work completed."},{"Type":"SET_CURRENTCONFIGURATORID","Terms":"true","Message":"Starting CAD from configurator."},{"Type":"ERROR","Terms":"tmpJob.GetParameter('ErrorType') == 'WorkFailed'","Message":"Error: Work failed."},{"Type":"ERROR","Terms":"tmpJob.GetParameter('ErrorType') == 'HttpReferrer'","Message":"Error: Http Referrer invalid. Toolbox disabled."},
{"Type":"ERROR","Terms":"tmpJob.GetParameter('ErrorType') == 'Version'","Message":"Error: Toolbox version mismatch. Toolbox disabled."},{"Type":"ERROR","Terms":"tmpJob.GetParameter('ErrorType') == 'ApiVersion'","Message":"Error: Toolbox Api version mismatch. Toolbox disabled."},{"Type":"ERROR","Terms":"tmpJob.GetParameter('ErrorType') == 'ConfigNotFound'","Message":"Error: Configurator not found."}],Execute:function(){SCToolbox.Variables.Set("CommandQueueCount",SCToolbox.CommandQueue.List.length);
if(SCToolbox.ControlPanel.CommandList[SCToolbox.CommandQueue.GetNextCommandType()]=="CLIENT"){var tmpJob=SCToolbox.CommandQueue.GetNextJob();for(var i in SCToolbox.VariableManager.List)if(SCToolbox.VariableManager.List[i].Type==tmpJob.Type)if(eval(SCToolbox.VariableManager.List[i].Terms))SCToolbox.Variables.Set(SCToolbox.VariableManager.List[i].Variable,eval(SCToolbox.VariableManager.List[i].Value));for(var i in SCToolbox.VariableManager.ListDebugMessage)if(SCToolbox.VariableManager.ListDebugMessage[i].Type==
tmpJob.Type)if(eval(SCToolbox.VariableManager.ListDebugMessage[i].Terms))SCToolbox.AddDebug(SCToolbox.VariableManager.ListDebugMessage[i].Message);if(tmpJob.Type=="SET_RESOURCECAD")for(var i in tmpJob.Items)SCToolbox.ProductResources.SetCAD(tmpJob.Items[i].Key,tmpJob.Items[i].Value=="true"?"TRUE":"FALSE")}}},Variables:{VariableList:{"SCCC":"","CommandQueueCount":0,"CurrentProgress":0,"CurrentWorkID":0,"CurrentDownloadLink":"","CurrentThumbnailLink":"","SelectedFormat":"SOLIDWORKS","CurrentLanguage":"",
"DefaultLanguage":"","CurrentConfiguratorID":"","CurrentConfiguratorType":"","CurrentConfiguratorWidth":"","CurrentConfiguratorHeight":"","CurrentWorkError":""},Set:function(Key,Value){SCToolbox.Variables.VariableList[Key]=Value},Value:function(Key){return SCToolbox.Variables.VariableList[Key]},Inc:function(Key,Step){SCToolbox.Variables.Set(Key,SCToolbox.Variables.Value(Key)+Step)},Dec:function(Key,Step){SCToolbox.Variables.Set(Key,SCToolbox.Variables.Value(Key)-Step)}},Flags:{FlagList:{"Flag_CommandQueueChanged":false,
"Flag_CommandQueueExist":false,"Flag_WorkInProgressExist":false,"Flag_AddProgressTimer":false,"Flag_GetProgress":false,"Flag_AddProgressJob":false,"Flag_ProgressTimerExist":false,"Flag_ServerJobExist":false,"Flag_ClientJobExist":false,"Flag_WorkFailed":false,"Flag_Toolbox_Enabled":true,"Flag_WorkID_Exists":false},Set:function(Key,Value){SCToolbox.Flags.FlagList[Key]=Value},Clear:function(Key){SCToolbox.Flags.FlagList[Key]=false},Get:function(Key){return SCToolbox.Flags.FlagList[Key]}},ControlPanel:{Timer:null,
CommandList:{"CAD":"SERVER","GET_WORKPROGRESS":"SERVER","SET_CURRENTWORKID":"CLIENT","SET_WORKPROGRESS":"CLIENT","SET_FORMAT":"CLIENT","SET_CURRENTCONFIGURATORID":"CLIENT","CONFIGCAD":"SERVER","GET_DEFAULTLANG":"SERVER","SET_DEFAULTLANG":"CLIENT","GET_RESOURCECAD":"SERVER","SET_RESOURCECAD":"CLIENT","ERROR":"CLIENT","INIT":"SERVER","ENABLE_TOOLBOX":"CLIENT","GET_CONFIGURATOR_INFO":"SERVER","SET_CONFIGURATOR_INFO":"CLIENT"},Init:function(){setTimeout("SCToolbox.ControlPanel.TimerEvent();",SCToolbox.Constants.Value("INTERVAL_CONTROLPANELTIMER"))},
ActionQueue:{List:[],Add:function(_Command){SCToolbox.ControlPanel.ActionQueue.List.push(_Command)},Clear:function(){SCToolbox.ControlPanel.ActionQueue.List=[]},Execute:function(){for(var i in SCToolbox.ControlPanel.ActionQueue.List)eval(SCToolbox.ControlPanel.ActionQueue.List[i]);SCToolbox.ControlPanel.ActionQueue.Clear()}},TimerEvent:function(){var tmpCommandQueueChanged=SCToolbox.Flags.Get("Flag_CommandQueueChanged");SCToolbox.Flags.Set("Flag_CommandQueueExist",SCToolbox.CommandQueue.List.length>
0?true:false);if(SCToolbox.Flags.Get("Flag_CommandQueueExist")==true){var tmpNextCommandType=SCToolbox.ControlPanel.CommandList[SCToolbox.CommandQueue.GetNextCommandType()];if(tmpNextCommandType=="SERVER")SCToolbox.Flags.Set("Flag_ServerJobExist",true);if(tmpNextCommandType=="CLIENT")SCToolbox.Flags.Set("Flag_ClientJobExist",true)}var VariableRuleList=[{"Terms":"SCToolbox.Variables.Value('CurrentProgress')\t== 1","Event":"SCToolbox.Flags.Set('Flag_WorkInProgressExist',\tfalse);"},{"Terms":"SCToolbox.Variables.Value('CurrentProgress')\t== 1",
"Event":"SCToolbox.Variables.Set('CurrentWorkID', 0);"},{"Terms":"SCToolbox.Variables.Value('CurrentWorkID')\t\t!= 0","Event":"SCToolbox.Flags.Set('Flag_WorkID_Exists',\t\ttrue);"},{"Terms":"SCToolbox.Variables.Value('CurrentWorkID')\t\t== 0","Event":"SCToolbox.Flags.Set('Flag_WorkID_Exists',\t\tfalse);"}];for(var i in VariableRuleList)if(eval(VariableRuleList[i].Terms))eval(VariableRuleList[i].Event);var NextCommandTypeList=[{"Type":"ERROR","Terms":"SCToolbox.CommandQueue.GetNextCommandParameter('ErrorType') == 'WorkFailed'",
"Event":"SCToolbox.Flags.Set('Flag_WorkFailed',\t\t\ttrue);"},{"Type":"ERROR","Terms":"SCToolbox.CommandQueue.GetNextCommandParameter('ErrorType') == 'HttpReferrer'","Event":"SCToolbox.Flags.Set('Flag_Toolbox_Enabled',\t\tfalse);"},{"Type":"ERROR","Terms":"SCToolbox.CommandQueue.GetNextCommandParameter('ErrorType') == 'Version'","Event":"SCToolbox.Flags.Set('Flag_Toolbox_Enabled',\t\tfalse);"},{"Type":"ERROR","Terms":"SCToolbox.CommandQueue.GetNextCommandParameter('ErrorType') == 'ApiVersion'","Event":"SCToolbox.Flags.Set('Flag_Toolbox_Enabled',\t\tfalse);"},
{"Type":"ENABLE_TOOLBOX","Terms":"true","Event":"SCToolbox.Flags.Set('Flag_Toolbox_Enabled',\t\ttrue);"},{"Type":"SET_CURRENTWORKID","Terms":"true","Event":"SCToolbox.Flags.Set('Flag_WorkInProgressExist',\ttrue);"},{"Type":"SET_CURRENTWORKID","Terms":"true","Event":"SCToolbox.Flags.Set('Flag_WorkFailed',\t\t\tfalse);"}];var tmpNextCommandType=SCToolbox.CommandQueue.GetNextCommandType();for(var i in NextCommandTypeList)if(NextCommandTypeList[i].Type==tmpNextCommandType)if(eval(NextCommandTypeList[i].Terms))eval(NextCommandTypeList[i].Event);
var FlagRulesList=[{"Terms":"true","Event":"SCToolbox.Flags.Set('Flag_AddProgressTimer',\t\ttrue);"},{"Terms":"SCToolbox.Flags.Get('Flag_ProgressTimerExist')\t\t== true","Event":"SCToolbox.Flags.Set('Flag_AddProgressTimer',\t\tfalse);"},{"Terms":"SCToolbox.Flags.Get('Flag_WorkInProgressExist')\t== false","Event":"SCToolbox.Flags.Set('Flag_AddProgressTimer',\t\tfalse);"},{"Terms":"SCToolbox.Flags.Get('Flag_AddProgressTimer')\t\t== true","Event":"setTimeout(\"SCToolbox.Flags.Set('Flag_GetProgress', true);\", SCToolbox.Constants.Value('INTERVAL_CHECKPROGRESS'));"},
{"Terms":"SCToolbox.Flags.Get('Flag_AddProgressTimer')\t\t== true","Event":"SCToolbox.Flags.Set('Flag_ProgressTimerExist',\ttrue);"},{"Terms":"true","Event":"SCToolbox.Flags.Set('Flag_AddProgressJob',\t\ttrue);"},{"Terms":"SCToolbox.Flags.Get('Flag_WorkID_Exists')\t\t\t== false","Event":"SCToolbox.Flags.Set('Flag_AddProgressJob',\t\tfalse);"},{"Terms":"SCToolbox.Flags.Get('Flag_WorkFailed')\t\t\t\t== true","Event":"SCToolbox.Flags.Set('Flag_AddProgressJob',\t\tfalse);"},{"Terms":"SCToolbox.Flags.Get('Flag_GetProgress')\t\t\t== false",
"Event":"SCToolbox.Flags.Set('Flag_AddProgressJob',\t\tfalse);"},{"Terms":"SCToolbox.Flags.Get('Flag_GetProgress')\t\t\t== true","Event":"SCToolbox.Flags.Set('Flag_ProgressTimerExist',\tfalse);"}];for(var i in FlagRulesList)if(eval(FlagRulesList[i].Terms))eval(FlagRulesList[i].Event);if(SCToolbox.Flags.Get("Flag_ServerJobExist")==true)SCToolbox.ControlPanel.ActionQueue.Add("SCToolbox.JobManager.Execute();");if(SCToolbox.Flags.Get("Flag_ClientJobExist")==true)SCToolbox.ControlPanel.ActionQueue.Add("SCToolbox.VariableManager.Execute();");
if(SCToolbox.Flags.Get("Flag_AddProgressJob")==true)SCToolbox.ControlPanel.ActionQueue.Add("SCToolbox.CommandManager.GET_WORKPROGRESS();");var tmpClearFlags=["Flag_CommandQueueChanged","Flag_ServerJobExist","Flag_ClientJobExist","Flag_AddProgressJob","Flag_GetProgress","Flag_AddProgressTimer"];for(var i in tmpClearFlags)SCToolbox.Flags.Clear(tmpClearFlags[i]);SCToolbox.ControlPanel.ActionQueue.Execute();if(SCToolbox.Flags.Get("Flag_Toolbox_Enabled")==true)setTimeout("SCToolbox.ControlPanel.TimerEvent();",
SCToolbox.Constants.Value("INTERVAL_CONTROLPANELTIMER"))}},CommandManager:{CAD:function(PartNo){var tmpJob=new SCToolbox.JobClass("CAD");tmpJob.AddParameter("PartNo",PartNo);tmpJob.AddParameter("Format",SCToolbox.Variables.Value("SelectedFormat"));SCToolbox.CommandQueue.Add(tmpJob)},GET_WORKPROGRESS:function(){var tmpJob=new SCToolbox.JobClass("GET_WORKPROGRESS");tmpJob.AddParameter("WorkID",SCToolbox.Variables.Value("CurrentWorkID"));SCToolbox.CommandQueue.Add(tmpJob)},SET_WORKPROGRESS:function(WorkID,
Progress){var tmpJob=new SCToolbox.JobClass("SET_WORKPROGRESS");tmpJob.AddParameter("WorkID",WorkID);tmpJob.AddParameter("Progress",Progress);SCToolbox.CommandQueue.Add(tmpJob)},SET_FORMAT:function(Format){var tmpJob=new SCToolbox.JobClass("SET_FORMAT");tmpJob.AddParameter("Format",Format);SCToolbox.CommandQueue.Add(tmpJob)},SET_CURRENTWORKID:function(WorkID,OutputFile,ThumbnailFile){var tmpJob=new SCToolbox.JobClass("SET_CURRENTWORKID");tmpJob.AddParameter("WorkID",WorkID);tmpJob.AddParameter("OutputFile",
OutputFile);tmpJob.AddParameter("ThumbnailFile",ThumbnailFile);SCToolbox.CommandQueue.Add(tmpJob)},SET_CURRENTCONFIGURATORID:function(ConfiguratorID){var tmpJob=new SCToolbox.JobClass("SET_CURRENTCONFIGURATORID");tmpJob.AddParameter("ConfiguratorID",ConfiguratorID);SCToolbox.CommandQueue.Add(tmpJob)},CONFIGCAD:function(ConfiguratorID){var tmpJob=new SCToolbox.JobClass("CONFIGCAD");tmpJob.AddParameter("ConfiguratorID",ConfiguratorID);SCToolbox.CommandQueue.Add(tmpJob)},GET_DEFAULTLANG:function(){var tmpJob=
new SCToolbox.JobClass("GET_DEFAULTLANG");SCToolbox.CommandQueue.Add(tmpJob)},SET_DEFAULTLANG:function(Lang){var tmpJob=new SCToolbox.JobClass("SET_DEFAULTLANG");tmpJob.AddParameter("Lang",Lang);SCToolbox.CommandQueue.Add(tmpJob)},GET_RESOURCECAD:function(){var tmpJob=new SCToolbox.JobClass("GET_RESOURCECAD");for(var i in SCToolbox.ProductResources.List)tmpJob.AddItem(SCToolbox.ProductResources.List[i].PartNo,"");SCToolbox.CommandQueue.Add(tmpJob)},SET_RESOURCECAD:function(Items){var tmpJob=new SCToolbox.JobClass("SET_RESOURCECAD");
tmpJob.Items=Items;SCToolbox.CommandQueue.Add(tmpJob)},ERROR:function(ErrorType){var tmpJob=new SCToolbox.JobClass("ERROR");tmpJob.AddParameter("ErrorType",ErrorType);SCToolbox.CommandQueue.Add(tmpJob)},INIT:function(){var tmpJob=new SCToolbox.JobClass("INIT");tmpJob.AddParameter("Version",SCToolbox.Constants.Value("TOOLBOX_VERSION"));tmpJob.AddParameter("ApiVersion",SCToolboxApiVersion);SCToolbox.CommandQueue.Add(tmpJob)},ENABLE_TOOLBOX:function(){var tmpJob=new SCToolbox.JobClass("ENABLE_TOOLBOX");
SCToolbox.CommandQueue.Add(tmpJob)},GET_CONFIGURATOR_INFO:function(ConfiguratorID){var tmpJob=new SCToolbox.JobClass("GET_CONFIGURATOR_INFO");tmpJob.AddParameter("ConfiguratorID",ConfiguratorID);SCToolbox.CommandQueue.Add(tmpJob)},SET_CONFIGURATOR_INFO:function(Type,Width,Height){var tmpJob=new SCToolbox.JobClass("SET_CONFIGURATOR_INFO");tmpJob.AddParameter("Type",Type);tmpJob.AddParameter("Width",Width);tmpJob.AddParameter("Height",Height);SCToolbox.CommandQueue.Add(tmpJob)}},CommandQueue:{List:[],
Add:function(_Job){SCToolbox.CommandQueue.List.push(_Job);SCToolbox.Flags.Set("Flag_CommandQueueChanged",true)},GetNextCommandType:function(){var retval="";if(SCToolbox.CommandQueue.List.length>0)retval=SCToolbox.CommandQueue.List[0].Type;return retval},GetNextCommandParameter:function(_ParameterName){var retval="";if(SCToolbox.CommandQueue.List.length>0)retval=SCToolbox.CommandQueue.List[0].GetParameter(_ParameterName);return retval},GetNextJob:function(){var tmpJob=SCToolbox.CommandQueue.List.shift();
SCToolbox.Flags.Set("Flag_CommandQueueChanged",true);return tmpJob}},JobManager:{Execute:function(){if(SCToolbox.ControlPanel.CommandList[SCToolbox.CommandQueue.GetNextCommandType()]=="SERVER"){var tmpJob=SCToolbox.CommandQueue.GetNextJob();switch(tmpJob.Type){case "CAD":SCToolbox.CommunicationManager.Send(tmpJob);break;case "GET_WORKPROGRESS":SCToolbox.CommunicationManager.Send(tmpJob);break;case "CONFIGCAD":SCToolbox.CommunicationManager.Send(tmpJob);break;case "GET_DEFAULTLANG":SCToolbox.CommunicationManager.Send(tmpJob);
break;case "GET_RESOURCECAD":SCToolbox.CommunicationManager.Send(tmpJob);break;case "INIT":SCToolbox.CommunicationManager.Send(tmpJob);break;case "GET_CONFIGURATOR_INFO":SCToolbox.CommunicationManager.Send(tmpJob);break}switch(tmpJob.Type){case "CAD":SCToolbox.AddDebug("Starting CAD for part no '"+tmpJob.GetParameter("PartNo")+"' in '"+tmpJob.GetParameter("Format")+"'.");break}}}},CommunicationManager:{Send:function(_Job){_Job.URL=document.URL;_Job.SCCC=SCToolbox.Variables.Value("SCCC");jQuery.getScript(SCToolbox.Constants.Value("AJAXLINK")+
"?Job="+SCToolbox.serialize(_Job)+"&random="+SCToolbox.Random(16))}},ResultManager:{Recieve:function(_Result){var Result=new SCToolbox.ResultClass;Result.Type=_Result.Type;Result.Parameters=_Result.Parameters;Result.Items=_Result.Items;switch(Result.Type){case "SET_CURRENTWORKID":SCToolbox.CommandManager.SET_CURRENTWORKID(Result.GetParameter("WorkID"),Result.GetParameter("OutputFile"),Result.GetParameter("ThumbnailFile"));break;case "SET_WORKPROGRESS":SCToolbox.CommandManager.SET_WORKPROGRESS(Result.GetParameter("WorkID"),
Result.GetParameter("Progress"));break;case "CONFIGCAD":SCToolbox.CommandManager.CONFIGCAD(Result.GetParameter("ConfiguratorID"));break;case "SET_DEFAULTLANG":SCToolbox.CommandManager.SET_DEFAULTLANG(Result.GetParameter("DialPrefix"));break;case "SET_RESOURCECAD":SCToolbox.CommandManager.SET_RESOURCECAD(Result.Items);break;case "ERROR":SCToolbox.CommandManager.ERROR(Result.GetParameter("ErrorType"));break;case "ENABLE_TOOLBOX":SCToolbox.CommandManager.ENABLE_TOOLBOX();break;case "SET_CONFIGURATOR_INFO":SCToolbox.CommandManager.SET_CONFIGURATOR_INFO(Result.GetParameter("Type"),
Result.GetParameter("Width"),Result.GetParameter("Height"));break}switch(Result.Type){case "SET_CURRENTWORKID":SCToolbox.AddDebug("Work started for file '"+Result.GetParameter("OutputFile")+"'.");break;case "CONFIGCAD":SCToolbox.AddDebug("ResultManager: ConfigCAD "+Result.GetParameter("ConfiguratorID"));break;case "SET_RESOURCECAD":SCToolbox.AddDebug("Recieved resource CAD from server.");break}}},ObjectList:{List:[],Add:function(_Type,_ID){if(SCToolbox.ObjectList.Count("")>SCToolbox.Constants.Value("LIMIT_OBJECTS")-
1)SCToolbox.AddDebug("To many objects on page.");else if(SCToolbox.ObjectList.Count(_Type)>SCToolbox.ObjectLimitList[_Type]-1)SCToolbox.AddDebug("To many objects of type: "+_Type);else{SCToolbox.AddDebug("Adding object of type: "+_Type);var tmpObject=new SCToolbox.SCObject;tmpObject.Init(_ID,_Type);SCToolbox.ObjectList.List.push(tmpObject)}},Clear:function(_Type){var tmpList=new Array;if(_Type.toUpperCase()!="ALL")for(var i in SCToolbox.ObjectList.List)if(SCToolbox.ObjectList.List[i].Type!=_Type)tmpList.push(SCToolbox.ObjectList.List[i]);
SCToolbox.ObjectList.List=tmpList},AddSetting:function(_ID,_Setting,_Value){for(var i in SCToolbox.ObjectList.List)if(SCToolbox.ObjectList.List[i].HtmlID==_ID)SCToolbox.ObjectList.List[i].Settings[_Setting]=_Value},Count:function(_Type){if(_Type=="")return SCToolbox.ObjectList.List.length;else{var tmpNum=0;for(var i in SCToolbox.ObjectList.List)if(SCToolbox.ObjectList.List[i].Type==_Type)tmpNum++;return tmpNum}}},SCObject:function(){this.ID="";this.Type="";this.HtmlID="";this.VariableList=new Array;
this.Settings=new Array;this.AddVariable=function(_Name){this.VariableList[_Name]=null};this.SetVariable=function(_Name,_Value){this.VariableList[_Name]=_Value};this.Init=function(_ID,_Type){this.ID=SCToolbox.Random(8);this.Type=_Type;this.HtmlID=_ID;for(var i in SCToolbox.ObjectBindingsList[_Type]){this.AddVariable(i);SCToolbox.VariableBindings.Add(this.ID,i,SCToolbox.ObjectBindingsList[_Type][i])}};this.Update=function(){for(var i in SCToolbox.VariableBindings.List)if(SCToolbox.VariableBindings.List[i].ObjectID==
this.ID)this.VariableList[SCToolbox.VariableBindings.List[i].ObjectVariableName]=SCToolbox.Variables.Value(SCToolbox.VariableBindings.List[i].Variable)};this.Draw=function(){if(this.Type=="ToolboxObject_CAD_Link"){var tmpPointer=document.getElementById(this.HtmlID);var tmpPartNo="";var tmpText="";if(this.Settings["PartNoFromParam"]==true){tmpPartNo=jQuery("#"+this.HtmlID).attr("partno");tmpText=tmpPointer.innerHTML}else{tmpPartNo=tmpPointer.innerHTML;tmpText=tmpPointer.innerHTML}tmpPointer.innerHTML=
"";var newLinkTag=document.createElement("span");newLinkTag.setAttribute("title",SCToolbox.Text["CADChecking"]);if(this.Settings["ShowIcon"]==true){var newImg=document.createElement("img");newImg.setAttribute("src","http://www.solidcomponents.com/api/save_dimm.gif");newImg.setAttribute("align","middle");var newLinkText=document.createTextNode(tmpText);newLinkTag.appendChild(newImg);newLinkTag.appendChild(newLinkText)}else{var newLinkText=document.createTextNode(tmpText);newLinkTag.appendChild(newLinkText)}tmpPointer.appendChild(newLinkTag);
this.AddVariable("PartNo");this.SetVariable("PartNo",tmpPartNo);this.AddVariable("Text");this.SetVariable("Text",tmpText);this.AddVariable("ValidCAD");this.SetVariable("ValidCAD",false);this.AddVariable("Ready");this.SetVariable("Ready",false);SCToolbox.ProductResources.AddProduct(tmpPartNo)}if(this.Type=="ToolboxObject_Configurator"){var tmpPointer=document.getElementById(this.HtmlID);var tmpConfiguratorName=tmpPointer.innerHTML;tmpPointer.innerHTML="";var newImg=document.createElement("img");newImg.setAttribute("src",
"http://www.solidcomponents.com/shared/img/load.gif");newImg.setAttribute("align","middle");var newText=document.createTextNode("Loading configurator.");tmpPointer.appendChild(newImg);tmpPointer.appendChild(newText);this.AddVariable("ConfiguratorName");this.SetVariable("ConfiguratorName",tmpConfiguratorName);this.AddVariable("CurrentLink");this.SetVariable("CurrentLink","");this.AddVariable("Ready");this.SetVariable("Ready",false);SCToolbox.CommandManager.GET_CONFIGURATOR_INFO(tmpConfiguratorName)}else if(this.Type==
"ToolboxObject_Progress"){var tmpPointer=document.getElementById(this.HtmlID);if(this.Settings["Bar"]==true){tmpPointer.innerHTML="";var newProgressBar=document.createElement("div");var newTextContainer=document.createElement("div");newProgressBar.setAttribute("id",this.HtmlID+"_value");newProgressBar.setAttribute("class","ProgressValue");newProgressBar.setAttribute("className","ProgressValue");newProgressBar.style.width="0%";newTextContainer.setAttribute("id",this.HtmlID+"_text");newTextContainer.setAttribute("class",
"ProgressText");newTextContainer.setAttribute("className","ProgressText");tmpPointer.appendChild(newProgressBar);tmpPointer.appendChild(newTextContainer)}else tmpPointer.innerHTML="-";this.AddVariable("CurrentValue");this.SetVariable("CurrentValue",0);this.AddVariable("TargetValue");this.SetVariable("TargetValue",0);this.AddVariable("Step");this.SetVariable("Step",0);this.AddVariable("LastWorkID");this.SetVariable("LastWorkID",0);this.AddVariable("CurrentDisplayText");this.SetVariable("CurrentDisplayText",
"")}else if(this.Type=="ToolboxObject_Format_Selector"){this.Options=new Array;for(var i in SCToolbox.CADFormatsList)if(SCToolbox.CADFormatsList[i].Enabled==true)this.Options[i]=SCToolbox.CADFormatsList[i].Tag;var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="";var newCombo=document.createElement("select");newCombo.setAttribute("id",this.HtmlID+"_combo");newCombo.setAttribute("title",SCToolbox.Text["SelectCADFormat"]);tmpPointer.appendChild(newCombo);SCToolbox.EventManager.AttachEvent("onChange",
this.HtmlID+"_combo","SCToolbox.CommandManager.SET_FORMAT(this.value);");SCToolbox.Combo.Clear(this.HtmlID+"_combo");for(var i in this.Options)SCToolbox.Combo.AddOption(this.HtmlID+"_combo",this.Options[i],i)}else if(this.Type=="ToolboxObject_Download_Icon"){this.AddVariable("LinkOnPage");this.SetVariable("LinkOnPage","");var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="-"}else if(this.Type=="ToolboxObject_Download_Thumbnail"){this.AddVariable("LinkOnPage");this.SetVariable("LinkOnPage",
"");var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="-"}else;};this.Refresh=function(){if(this.Type=="ToolboxObject_CAD_Link")if(this.VariableList["Ready"]!=null&&this.VariableList["Ready"]==false)if(SCToolbox.ProductResources.GetCAD(this.VariableList["PartNo"])=="TRUE"){if(document.getElementById(this.HtmlID)){this.SetVariable("Ready",true);var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="";var newLinkTag=document.createElement("a");newLinkTag.setAttribute("href",
"java"+"script:void(0);");newLinkTag.setAttribute("id",this.HtmlID+"_link");newLinkTag.setAttribute("title",SCToolbox.Text["CADLink"]);if(this.Settings["ShowIcon"]==true){var newImg=document.createElement("img");newImg.setAttribute("src","http://www.solidcomponents.com/api/save.gif");newImg.setAttribute("align","middle");var newLinkText=document.createTextNode(this.VariableList["Text"]);newLinkTag.appendChild(newImg);newLinkTag.appendChild(newLinkText)}else{var newLinkText=document.createTextNode(this.VariableList["Text"]);
newLinkTag.appendChild(newLinkText)}tmpPointer.appendChild(newLinkTag);SCToolbox.EventManager.AttachEvent("onClick",this.HtmlID+"_link","SCToolbox.CommandManager.CAD('"+this.VariableList["PartNo"]+"');")}}else if(SCToolbox.ProductResources.GetCAD(this.VariableList["PartNo"])=="FALSE"){if(document.getElementById(this.HtmlID)){this.SetVariable("Ready",true);var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="";var newLinkTag=document.createElement("span");newLinkTag.setAttribute("title",
SCToolbox.Text["CADNotExist"]);if(this.Settings["ShowIcon"]==true){var newImg=document.createElement("img");newImg.setAttribute("src","http://www.solidcomponents.com/api/save_dimm.gif");newImg.setAttribute("align","middle");var newLinkText=document.createTextNode(this.VariableList["Text"]);newLinkTag.appendChild(newImg);newLinkTag.appendChild(newLinkText)}else{var newLinkText=document.createTextNode(this.VariableList["Text"]);newLinkTag.appendChild(newLinkText)}tmpPointer.appendChild(newLinkTag)}}else;
if(this.Type=="ToolboxObject_Configurator")if(this.VariableList["Ready"]!=null&&this.VariableList["Ready"]==false){if(this.VariableList["CurrentConfiguratorType"]=="ConfigNotFound"){this.SetVariable("Ready",true);var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="";tmpPointer.appendChild(document.createTextNode("Configurator with the id '"+this.VariableList["ConfiguratorName"]+"' was not found."))}if(this.VariableList["CurrentConfiguratorType"]=="V4"){this.SetVariable("Ready",
true);var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="";var tmpWidth=this.VariableList["CurrentConfiguratorWidth"];var tmpHeight=this.VariableList["CurrentConfiguratorHeight"];var newTopBar=document.createElement("div");newTopBar.style.width=tmpWidth;newTopBar.style.height="24px";newTopBar.style.border="1px solid #CCCCCC";newTopBar.style.backgroundColor="#E6E6E6";tmpPointer.appendChild(newTopBar);var newIframe=document.createElement("iframe");newIframe.setAttribute("src",
"");newIframe.setAttribute("id",this.HtmlID+"_iframe");newIframe.setAttribute("frameborder","no");newIframe.setAttribute("scrolling","no");newIframe.style.borderLeft="1px solid #CCCCCC";newIframe.style.borderRight="1px solid #CCCCCC";newIframe.style.width=tmpWidth;newIframe.style.height=tmpHeight;tmpPointer.appendChild(newIframe);var newBottomBar=document.createElement("div");newBottomBar.style.width=tmpWidth;newBottomBar.style.height="24px";newBottomBar.style.border="1px solid #CCCCCC";newBottomBar.style.backgroundColor=
"#E6E6E6";newBottomBar.style.textAlign="right";var newCadLink=document.createElement("a");newCadLink.setAttribute("href","java"+"script:void(0);");newCadLink.setAttribute("id",this.HtmlID+"_link");var newCadBtn=document.createElement("img");newCadBtn.setAttribute("id",this.HtmlID+"_cadbutton");newCadBtn.setAttribute("src","http://www.solidcomponents.com/shared/img/cad-up.gif");newCadBtn.setAttribute("title",SCToolbox.Text["CADLink"]);newCadBtn.setAttribute("border","0");newCadBtn.style.margin="0px";
newCadLink.appendChild(newCadBtn);newBottomBar.appendChild(newCadLink);tmpPointer.appendChild(newBottomBar);SCToolbox.EventManager.AttachEvent("onMouseOver",this.HtmlID+"_cadbutton","this.src = 'http://www.solidcomponents.com/shared/img/cad-over.gif'");SCToolbox.EventManager.AttachEvent("onMouseOut",this.HtmlID+"_cadbutton","this.src = 'http://www.solidcomponents.com/shared/img/cad-up.gif'");SCToolbox.EventManager.AttachEvent("onClick",this.HtmlID+"_link","var tmpID = SCToolbox.Random(8); SCToolbox.CommandManager.SET_CURRENTCONFIGURATORID(tmpID); SCToolbox.CommandManager.CONFIGCAD(tmpID);")}}else{if(this.VariableList["Ready"]!=
null&&this.VariableList["Ready"]==true)if(this.VariableList["CurrentConfiguratorType"]=="V4"){var tmpPointer=document.getElementById(this.HtmlID+"_iframe");if(this.VariableList["SCCC"]!=null&&this.VariableList["ConfiguratorName"]!=null&&this.VariableList["SelectedFormat"]!=null&&this.VariableList["CurrentConfiguratorID"]!=null&&this.VariableList["CurrentLanguage"]!=null&&this.VariableList["CurrentLanguage"]!=""){var tmpLink=SCToolbox.Constants.Value("CONFIGURATORLINK")+"?SCCC="+this.VariableList["SCCC"]+
"&Name="+this.VariableList["ConfiguratorName"]+"&Lang="+this.VariableList["CurrentLanguage"]+"#"+"CADFORMAT="+this.VariableList["SelectedFormat"]+";ID="+this.VariableList["CurrentConfiguratorID"];if(tmpLink!=this.VariableList["CurrentLink"]){this.SetVariable("CurrentLink",tmpLink);tmpPointer.src=tmpLink}}}}else if(this.Type=="ToolboxObject_Progress"){if(this.VariableList["CurrentWorkID"]!=null){var tmpPointer=document.getElementById(this.HtmlID);var tmpCurrentProgress=parseFloat((""+this.VariableList["CurrentProgress"]).replace(",",
"."));var tmpCurrentTarget=parseFloat((""+this.VariableList["CurrentTarget"]).replace(",","."));var tmpCurrentValue=parseFloat((""+this.VariableList["CurrentValue"]).replace(",","."));var tmpStep=parseFloat((""+this.VariableList["Step"]).replace(",","."));if(this.VariableList["CurrentWorkID"]!=this.VariableList["LastWorkID"]&&this.VariableList["CurrentProgress"]!=1){this.SetVariable("LastWorkID",""+this.VariableList["CurrentWorkID"]);tmpCurrentTarget=0;tmpCurrentValue=0;tmpStep=0}if(tmpCurrentProgress==
1){tmpCurrentTarget=1;tmpCurrentValue=1;tmpStep=0}else{if(tmpCurrentProgress>tmpCurrentTarget){tmpCurrentTarget=tmpCurrentProgress;tmpStep=(tmpCurrentTarget-tmpCurrentValue)/10}else if(tmpCurrentValue>=tmpCurrentTarget*0.999&&this.VariableList["CurrentWorkID"]!=0){tmpCurrentTarget=tmpCurrentValue+(1-tmpCurrentValue)*0.05;tmpStep=(tmpCurrentTarget-tmpCurrentValue)/10}tmpCurrentValue=tmpCurrentValue+tmpStep}var tmpDisplayText=(tmpCurrentValue*100).toFixed(1)+"%";var tmpUpdate=false;if(this.VariableList["CurrentDisplayText"]!=
tmpDisplayText)tmpUpdate=true;if(tmpUpdate==true)if(this.Settings["Bar"]==true){document.getElementById(this.HtmlID+"_value").style.width=parseInt(tmpCurrentValue*100)+"%";document.getElementById(this.HtmlID+"_text").innerHTML=tmpDisplayText}else tmpPointer.innerHTML=tmpDisplayText;this.VariableList["CurrentDisplayText"]=tmpDisplayText;this.VariableList["CurrentProgress"]=tmpCurrentProgress;this.VariableList["CurrentTarget"]=tmpCurrentTarget;this.VariableList["CurrentValue"]=tmpCurrentValue;this.VariableList["Step"]=
tmpStep}}else if(this.Type=="ToolboxObject_Format_Selector");else if(this.Type=="ToolboxObject_Download_Icon")if(this.VariableList["CurrentProgress"]==null);else if(this.VariableList["CurrentWorkError"]!=""){if(""+this.VariableList["CurrentWorkError"]!=""+this.VariableList["LinkOnPage"]){this.SetVariable("LinkOnPage",""+this.VariableList["CurrentWorkError"]);var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="";var newImg=document.createElement("img");newImg.setAttribute("src",
"http://www.solidcomponents.com/api/alert.gif");newImg.setAttribute("align","middle");newImg.setAttribute("title",this.VariableList["CurrentWorkError"]);tmpPointer.appendChild(newImg)}}else if(this.VariableList["CurrentProgress"]==1){if(""+this.VariableList["CurrentDownloadLink"]!=""+this.VariableList["LinkOnPage"]){this.SetVariable("LinkOnPage",""+this.VariableList["CurrentDownloadLink"]);var tmpCurrentDownloadLink=this.VariableList["CurrentDownloadLink"];var tmpPointer=document.getElementById(this.HtmlID);
tmpPointer.innerHTML="";var newLinkTag=document.createElement("a");var newImg=document.createElement("img");newLinkTag.setAttribute("href",tmpCurrentDownloadLink);newImg.setAttribute("src","http://www.solidcomponents.com/api/save.gif");newImg.setAttribute("align","middle");newImg.setAttribute("title",SCToolbox.Text["DownloadLink"]);newLinkTag.appendChild(newImg);tmpPointer.appendChild(newLinkTag)}}else{if(this.VariableList["CurrentProgress"]!=1)if("BLANK"!=""+this.VariableList["LinkOnPage"]){this.SetVariable("LinkOnPage",
"BLANK");var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="";var newImg=document.createElement("img");newImg.setAttribute("src","http://www.solidcomponents.com/api/save_dimm.gif");newImg.setAttribute("align","middle");newImg.setAttribute("title",SCToolbox.Text["DownloadLinkEmpty"]);tmpPointer.appendChild(newImg)}}else if(this.Type=="ToolboxObject_Download_Thumbnail")if(this.VariableList["CurrentProgress"]==null);else if(this.VariableList["CurrentWorkError"]!=""){if(""+this.VariableList["CurrentWorkError"]!=
""+this.VariableList["LinkOnPage"]){this.SetVariable("LinkOnPage",""+this.VariableList["CurrentWorkError"]);var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="";var newImg=document.createElement("img");newImg.setAttribute("src","http://www.solidcomponents.com/api/FileCouldNotBeCreated100px.gif");newImg.setAttribute("align","middle");newImg.setAttribute("title",this.VariableList["CurrentWorkError"]);tmpPointer.appendChild(newImg)}}else if(this.VariableList["CurrentProgress"]==
1){if(""+this.VariableList["CurrentDownloadLink"]!=""+this.VariableList["LinkOnPage"]){this.SetVariable("LinkOnPage",""+this.VariableList["CurrentDownloadLink"]);var tmpCurrentDownloadLink=this.VariableList["CurrentDownloadLink"];var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="";var newLinkTag=document.createElement("a");var newImg=document.createElement("img");newLinkTag.setAttribute("href",tmpCurrentDownloadLink);newImg.setAttribute("src",this.VariableList["CurrentThumbnailLink"]);
newImg.setAttribute("align","middle");newImg.setAttribute("title",SCToolbox.Text["DownloadLink"]);newLinkTag.appendChild(newImg);tmpPointer.appendChild(newLinkTag)}}else{if(this.VariableList["CurrentProgress"]!=1)if("BLANK"!=""+this.VariableList["LinkOnPage"]){this.SetVariable("LinkOnPage","BLANK");var tmpPointer=document.getElementById(this.HtmlID);tmpPointer.innerHTML="";var newImg=document.createElement("img");newImg.setAttribute("src","http://www.solidcomponents.com/api/save_100_dimm.gif");newImg.setAttribute("align",
"middle");newImg.setAttribute("title",SCToolbox.Text["DownloadLinkEmpty"]);tmpPointer.appendChild(newImg)}}else;}},ObjectManager:{Draw:function(_Type){if(_Type.toUpperCase()=="ALL")for(var i in SCToolbox.ObjectList.List)SCToolbox.ObjectList.List[i].Draw();else for(var i in SCToolbox.ObjectList.List)if(SCToolbox.ObjectList.List[i].Type==_Type)SCToolbox.ObjectList.List[i].Draw()},Update:function(){for(var i in SCToolbox.ObjectList.List)if(SCToolbox.ObjectList.List[i].Type!="ToolboxObject_Progress")SCToolbox.ObjectList.List[i].Update()},
Refresh:function(){for(var i in SCToolbox.ObjectList.List)if(SCToolbox.ObjectList.List[i].Type!="ToolboxObject_Progress")SCToolbox.ObjectList.List[i].Refresh()},Execute:function(){},ValidationList:{"SCCADLink":{"Attribs":[],"innerHTML":true,"msgFaild":"'Failed to create SCCADLink. PartNo = \"'+document.getElementById(_ID).innerHTML+'\"'","msgNoObj":"Failed to find html object for SCCADLink."},"SCIconCADLink":{"Attribs":[],"innerHTML":true,"msgFaild":"'Failed to create SCIconCADLink. PartNo = \"'+document.getElementById(_ID).innerHTML+'\"'",
"msgNoObj":"Failed to find html object for SCIconCADLink."},"SCAttrCADLink":{"Attribs":["partno"],"innerHTML":false,"msgFaild":"'Failed to create SCAttrCADLink. PartNo = \"'+jQuery('#'+_ID).attr('partno')+'\"'","msgNoObj":"Failed to find html object for SCAttrCADLink."},"SCAttrIconCADLink":{"Attribs":["partno"],"innerHTML":false,"msgFaild":"'Failed to create SCAttrIconCADLink. PartNo = \"'+jQuery('#'+_ID).attr('partno')+'\"'","msgNoObj":"Failed to find html object for SCAttrIconCADLink."},"SCConfigurator":{"Attribs":[],
"innerHTML":true,"msgFaild":"'Failed to create SCConfigurator.'","msgNoObj":"Failed to find html object for SCConfigurator."},"SCProgress":{"Attribs":[],"innerHTML":false,"msgFaild":"'Failed to create SCProgress.'","msgNoObj":"Failed to find html object for SCProgress."},"SCProgressbar":{"Attribs":[],"innerHTML":false,"msgFaild":"'Failed to create SCProgressbar.'","msgNoObj":"Failed to find html object for SCProgressbar."},"SCCADFormatMenu":{"Attribs":[],"innerHTML":false,"msgFaild":"'Failed to create SCCADFormatMenu.'",
"msgNoObj":"Failed to find html object for SCCADFormatMenu."},"SCDownloadcontainerIcon":{"Attribs":[],"innerHTML":false,"msgFaild":"'Failed to create SCDownloadcontainerIcon.'","msgNoObj":"Failed to find html object for SCDownloadcontainerIcon."},"SCDownloadcontainerThumbnail":{"Attribs":[],"innerHTML":false,"msgFaild":"'Failed to create SCDownloadcontainerThumbnail.'","msgNoObj":"Failed to find html object for SCDownloadcontainerThumbnail."}},Validate:function(_ApiType,_ID){var retval=true;if(document.getElementById(_ID));
else{retval=false;SCToolbox.AddDebug(SCToolbox.ObjectManager.ValidationList[_ApiType].msgNoObj)}if(retval==true){for(var i in SCToolbox.ObjectManager.ValidationList[_ApiType].Attribs){var tmpAttrib=SCToolbox.ObjectManager.ValidationList[_ApiType].Attribs[i];if(jQuery("#"+_ID).attr(tmpAttrib)==""||jQuery("#"+_ID).attr(tmpAttrib)==null)retval=false}if(SCToolbox.ObjectManager.ValidationList[_ApiType].innerHTML==true)if(document.getElementById(_ID).innerHTML=="")retval=false;if(retval==false)SCToolbox.AddDebug(eval(SCToolbox.ObjectManager.ValidationList[_ApiType].msgFaild))}return retval},
ToolboxObjectsSettingsList:{"SCCADLink":{"Type":"ToolboxObject_CAD_Link","Settings":[{"Name":"ShowIcon","Value":false},{"Name":"PartNoFromParam","Value":false}]},"SCIconCADLink":{"Type":"ToolboxObject_CAD_Link","Settings":[{"Name":"ShowIcon","Value":true},{"Name":"PartNoFromParam","Value":false}]},"SCAttrCADLink":{"Type":"ToolboxObject_CAD_Link","Settings":[{"Name":"ShowIcon","Value":false},{"Name":"PartNoFromParam","Value":true}]},"SCAttrIconCADLink":{"Type":"ToolboxObject_CAD_Link","Settings":[{"Name":"ShowIcon",
"Value":true},{"Name":"PartNoFromParam","Value":true}]},"SCConfigurator":{"Type":"ToolboxObject_Configurator","Settings":[]},"SCProgress":{"Type":"ToolboxObject_Progress","Settings":[{"Name":"Bar","Value":false}]},"SCProgressbar":{"Type":"ToolboxObject_Progress","Settings":[{"Name":"Bar","Value":true}]},"SCCADFormatMenu":{"Type":"ToolboxObject_Format_Selector","Settings":[]},"SCDownloadcontainerIcon":{"Type":"ToolboxObject_Download_Icon","Settings":[]},"SCDownloadcontainerThumbnail":{"Type":"ToolboxObject_Download_Thumbnail",
"Settings":[]}},GetToolboxObjects:function(_ClassName){var tmpClassTranslated=SCToolbox.ClassTransformationTable.List[_ClassName];var tmpType=SCToolbox.ObjectManager.ToolboxObjectsSettingsList[_ClassName].Type;var tmpSettings=SCToolbox.ObjectManager.ToolboxObjectsSettingsList[_ClassName].Settings;jQuery("."+tmpClassTranslated).each(function(){if(this.id=="")this.id=SCToolbox.Random(8);if(SCToolbox.ObjectManager.Validate(_ClassName,this.id)==true){SCToolbox.ObjectList.Add(tmpType,this.id);for(var i in tmpSettings)SCToolbox.ObjectList.AddSetting(this.id,
tmpSettings[i].Name,tmpSettings[i].Value)}})}},Init:function(SCCC){SCToolbox.Variables.Set("SCCC",SCCC);SCToolbox.ControlPanel.Init();SCToolbox.CommandManager.INIT();SCToolbox.CommandManager.GET_DEFAULTLANG();jQuery(document).ready(function(){SCToolbox.ObjectManager.GetToolboxObjects("SCCADLink");SCToolbox.ObjectManager.GetToolboxObjects("SCIconCADLink");SCToolbox.ObjectManager.GetToolboxObjects("SCAttrCADLink");SCToolbox.ObjectManager.GetToolboxObjects("SCAttrIconCADLink");SCToolbox.ObjectManager.GetToolboxObjects("SCConfigurator");
SCToolbox.ObjectManager.GetToolboxObjects("SCProgress");SCToolbox.ObjectManager.GetToolboxObjects("SCProgressbar");SCToolbox.ObjectManager.GetToolboxObjects("SCCADFormatMenu");SCToolbox.ObjectManager.GetToolboxObjects("SCDownloadcontainerIcon");SCToolbox.ObjectManager.GetToolboxObjects("SCDownloadcontainerThumbnail");SCToolbox.ObjectManager.Draw("All");SCToolbox.CommandManager.GET_RESOURCECAD()});setInterval("SCToolbox.ObjectManager.Update(); SCToolbox.ObjectManager.Refresh();",SCToolbox.Constants.Value("INTERVAL_OBJECTMANGER"));
setInterval("for (var i in SCToolbox.ObjectList.List)\t{ if (SCToolbox.ObjectList.List[i].Type == 'ToolboxObject_Progress') SCToolbox.ObjectList.List[i].Update();\t\t}",SCToolbox.Constants.Value("INTERVAL_OBJECTLISTUPDATE"));setInterval("for (var i in SCToolbox.ObjectList.List)\t{ if (SCToolbox.ObjectList.List[i].Type == 'ToolboxObject_Progress') SCToolbox.ObjectList.List[i].Refresh();\t}",SCToolbox.Constants.Value("INTERVAL_OBJECTLISTREFRESH"))},Refresh:function(){SCToolbox.ObjectList.Clear("ToolboxObject_CAD_Link");
SCToolbox.ObjectManager.GetToolboxObjects("SCCADLink");SCToolbox.ObjectManager.GetToolboxObjects("SCIconCADLink");SCToolbox.ObjectManager.GetToolboxObjects("SCAttrCADLink");SCToolbox.ObjectManager.GetToolboxObjects("SCAttrIconCADLink");SCToolbox.ObjectManager.Draw("ToolboxObject_CAD_Link");SCToolbox.CommandManager.GET_RESOURCECAD()},ClassTransformationTable:{List:{"SCCADLink":"SCCADLink","SCIconCADLink":"SCIconCADLink","SCAttrCADLink":"SCAttrCADLink","SCAttrIconCADLink":"SCAttrIconCADLink","SCConfigurator":"SCConfigurator",
"SCProgress":"SCProgress","SCProgressbar":"SCProgressbar","SCCADFormatMenu":"SCCADFormatMenu","SCDownloadcontainerIcon":"SCDownloadcontainerIcon","SCDownloadcontainerThumbnail":"SCDownloadcontainerThumbnail"}},TransformManager:{SetObjectClassName:function(_ClassTag,_ClassName){SCToolbox.ClassTransformationTable.List[_ClassTag]=_ClassName}},EventManager:{AttachEvent:function(_Event,_ID,_Function){if(document.getElementById(_ID))switch(_Event.toUpperCase()){case "ONCLICK":document.getElementById(_ID).onclick=
new Function(_Function);break;case "ONCHANGE":document.getElementById(_ID).onchange=new Function(_Function);break;case "ONMOUSEOVER":document.getElementById(_ID).onmouseover=new Function(_Function);break;case "ONMOUSEOUT":document.getElementById(_ID).onmouseout=new Function(_Function);break}}},AddDebug:function(_Text){if(document.getElementById("SCToolboxDebug"))document.getElementById("SCToolboxDebug").innerHTML+=_Text+"<br >"},JobClass:function(_Type){this.Type=_Type;this.SCCC="";this.URL="";this.Parameters=
new Array;this.Items=new Array;this.AddParameter=function(Key,Value){this.Parameters.push(new SCToolbox.JobParameterClass(Key,Value))};this.GetParameter=function(Key){var retval="";for(var i=0;i<this.Parameters.length;i++)if(this.Parameters[i].Key==Key)retval=this.Parameters[i].Value;return retval};this.AddItem=function(Key,Value){this.Items.push(new SCToolbox.JobParameterClass(Key,Value))}},JobParameterClass:function(_Key,_Value){this.Key=_Key;this.Value=_Value},ResultClass:function(){this.Type=
"";this.Parameters=new Array;this.Items=new Array;this.AddParameter=function(Key,Value){this.Parameters.push(new SCToolbox.JobParameterClass(Key,Value))};this.GetParameter=function(Key){var retval="";for(var i=0;i<this.Parameters.length;i++)if(this.Parameters[i].Key==Key)retval=this.Parameters[i].Value;return retval}},Combo:{Clear:function(_ComboID){document.getElementById(_ComboID).options.length=0},AddOption:function(_ComboID,_Text,_Value){var _ComboPointer=document.getElementById(_ComboID);if(_ComboPointer!=
null)if(document.all&&!window.opera)_ComboPointer.add(new Option(_Text,_Value));else _ComboPointer.add(new Option(_Text,_Value),null)}},Random:function(length){var chars="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";var out="SC_";for(var i=0;i<length;i++)out+=chars.substr(Math.floor(Math.random()*chars.length),1);return out},serialize:function(obj){var returnVal;if(obj!=undefined)switch(obj.constructor){case Array:var vArr="[";for(var i=0;i<obj.length;i++){if(i>0)vArr+=",";vArr+=
SCToolbox.serialize(obj[i])}vArr+="]";return vArr;case String:returnVal=escape("'"+obj+"'");return returnVal;case Number:returnVal=isFinite(obj)?obj.toString():null;return returnVal;case Date:returnVal="#"+obj+"#";return returnVal;default:if(typeof obj=="object"){var vobj=[];for(attr in obj)if(typeof obj[attr]!="function")vobj.push('"'+attr+'":'+SCToolbox.serialize(obj[attr]));if(vobj.length>0)return"{"+vobj.join(",")+"}";else return"{}"}else return obj.toString()}return null}};
