///*********************************************************************
/// Sr No       Date        Modified By		Reason
/// 1.0			1JAN2007	NIJIL U.P.		Designed as per requirement ,to replace infragestics controls
/// 1.1			6Mar007		NIJIL U.P.		Change request from client to change the image 
/// 1.2			11Jul07		Rathish.P.		Bug fixing (Bug #108,92) - Decimal Point issue resolution
///*********************************************************************

///*************************************************************************
/*
	Name	:turn_off
	I/P		:ImageName 
			:Image ID 
	O/P		:will retain the image to default state after we move 
			 mouse away from the image 
	Version :V 1.0
*/
///*************************************************************************
function formatNumber(myNum, numOfDec) 
		{ 
			if(myNum.indexOf("$")!=-1)
			{
				myNum=myNum.substr(1);			
			}
			var decimal = 1 
			for(i=1; i<=numOfDec;i++) 
			decimal = decimal *10 

			var myFormattedNum = (Math.round(myNum * decimal)/decimal).toFixed(numOfDec) 
			return("$"+myFormattedNum) 
		} 
function turn_off(ImageName,id) 
{
  switch(id)
		{
		case 1:setimage(ImageName,"Header/Home_default.gif");break;
		case 2:setimage(ImageName,"Header/Myapplication_default.gif");break;
		case 3:setimage(ImageName,"Header/All solutions_default.gif");break;
		case 4:setimage(ImageName,"Header/My systems_default.gif");break;
		case 5:setimage(ImageName,"Header/CADModel_default.gif");break;
		case 6:setimage(ImageName,"Header/RequestQuote_default.gif");break;
		case 7:setimage(ImageName,"Header/My Account_default.gif");break;
		case 8:setimage(ImageName,"Header/Help_default.gif");break;
		case 9:setimage(ImageName,"Header/Contact Us_default.gif");break;
		}
}
///*************************************************************************
/*
	Name	:setimage
	I/P		:ImageName 
			:Image ID 
	O/P		:To set the which we need to dispaly when mouse over happens to each image 
			 If the particular image is disabled one then we should not change the image 
			 on mouse over and mouse out.So based on the image name here we can identify
			 what is teh stated of the button whether  it is disabled or not
			 
	Version :V 1.0 
*/
///*************************************************************************
function setimage(ImageName,Image)
{
		if (document.images != null) 
			{
			
				var image_con;
				image_con=StrRev(ImageName.src);
				if(image_con!="disable.gif")
				{
				ImageName.src=Image;
				}
				else
				{
				
				document.body.style.cursor = 'Arrow';
				}
			}
}
///*************************************************************************
/*
	Name	:turn_over
	I/P		:ImageName 
			:Image ID 
	O/P		:Will change the image if we keep the mouse over the 
			 image 
	Version :V 1.0
*/
///*************************************************************************
function turn_over(ImageName,id)
 {
		switch(id)
		{
		case 1:setimage(ImageName,"Header/Home_mouseover.gif");break;
		case 2:setimage(ImageName,"Header/Myapplication_mouseover.gif");break;
		case 3:setimage(ImageName,"Header/All solutions_mouseover.gif");break;
		case 4:setimage(ImageName,"Header/My systems_mouseover.gif");break;
		case 5:setimage(ImageName,"Header/CADModel_mouseover.gif");break;
		case 6:setimage(ImageName,"Header/RequestQuote_mouseover.gif");break;
		case 7:setimage(ImageName,"Header/My Account_mouseover.gif");break;
		case 8:setimage(ImageName,"Header/Help_mouseover.gif");break;
		case 9:setimage(ImageName,"Header/Contact Us_mouseover.gif");break;
		}
 }
///*************************************************************************
/*
	Name	:StrRev
	I/P		:ImageName[str] 
	O/P		:Reading the image in revers manner
	Version :V 1.0
*/
///*************************************************************************
function StrRev(str) 
{
	var revst="";
	for (i = str.length-1; i>=0; i--)
		if (str.charAt(i)=="_")
		{
		var image_con;
		image_con= revst;
		revst=StrRev(image_con); 
		return revst;
		}
		else
		{	
		revst+=str.charAt(i)
		}
	return revst;
}
///*************************************************************************
/*
	Name	 :openHelp
	I/P		 :
	O/P		 :Open help file with book marks 
	Version  :V 1.0
	Modified :Vivek
*/
///*************************************************************************
function openHelp()
{
	var loc=window.location;
	var reg1=/Specs3/;
	var reg2=/frmEnvironment/;
	var reg3=/LoadInSpace2/;
	var reg4=/MoveProfile4/;
	var reg5=/SolutionStart/;
	var reg6=/Solution3/;
	var reg7=/SelectedSolution/;

	if(reg1.test(loc)) 
		window.open("Help.html#Position","help",'width=870,height=500,left=60,top=100,scrollbars=yes,resizable=1');

	else if(reg2.test(loc)) 
		window.open("Help.html#Environment","help",'width=870,height=500,left=60,top=100,scrollbars=yes,resizable=1');

	else if(reg3.test(loc)) 
		window.open("Help.html#Loading","help",'width=870,height=500,left=60,top=100,scrollbars=yes,resizable=1');

	else if(reg4.test(loc)) 
		window.open("Help.html#MoveProfile","help",'width=870,height=500,left=60,top=100,scrollbars=yes,resizable=1');

	else if(reg5.test(loc)) 
		window.open("Help.html#Applicationparameters","help",'width=870,height=500,left=60,top=100,scrollbars=yes,resizable=1');

	else if(reg6.test(loc)) 
		window.open("Help.html#YourApplication","help",'width=870,height=500,left=60,top=100,scrollbars=yes,resizable=1');

	else if(reg7.test(loc)) 
		window.open("Help.html#SystemSpecifications","help",'width=870,height=500,left=60,top=100,scrollbars=yes,resizable=1');

	else
	
		window.open("Help.html","help",'width=870,height=500,left=60,top=100,scrollbars=yes,resizable=1');
}
     
 //function openTechSupport()
 //{	
	//window.open("TechSupport.html","TechSupport",'width=750,height=500,left=80,top=60,scrollbars=yes,resizable=1');		
 //}


///*************************************************************************
/*
	Name	 :openHelp
	I/P		 :
	O/P		 :Open help file with book marks 
	Version  :V 1.0
	Modified :Vivek
*/
///*************************************************************************
function toContact(newLocation)
{ 
   try
   {
       window.opener.parent.location.replace(newLocation);
       window.opener.parent.focus();
   }
   catch(error)
   {
       window.open(newLocation);
   }
}
//Code for footer ends
//Ver 1.2 starts
///*************************************************************************
///Code for allowing decimal point in selected Numeric text box
///	Modified :Rathish
///*************************************************************************
		var isSelect=false;
		var currobj=this;
		function TextBox_OnSelect(obj) 
		{
			currobj = obj;
			isSelect = true;
		}
		function TextBox_Onkeydown(obj) 
		{
			if(obj==currobj)
			{
				if(window.event.keyCode==190 || window.event.keyCode==110)
				{
					if(isSelect==true)
					{
						obj.value="";
						isSelect=false;
					}
				}
				else
				{
					isSelect=false;
				}
			}
		}
//Ver 1.2 ends