
<!--

var HelpWin

function SKPHelp(screenid,helpid)
{

if (HelpWin)
	{
	HelpWin.close()
	}

HelpWin = window.open('SKPHelpInit.asp?ScreenID=' + screenid + '&HelpID=' + helpid,'','scrollbars=yes,menubar=no,toolbar=no,location=no,resizable=no,width=420,height=250');
HelpWin.document.close();

}


//Verisign pop up
function popUp(url) {
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}




//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Date functions  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function currentDate()
{
	var cur = new Date();
	fixDate(cur);
	var str = getString(cur);
	return str
}

function makeArray() 
 {
	var args = makeArray.arguments;  
	for (var i = 0; i < args.length; i++) 
	{
	this[i] = args[i];  
	}  
	this.length = args.length;
 }
       
function fixDate(date)
 {
  var base = new Date(0);  
  var skew = base.getTime();  
  if (skew > 0) date.setTime(date.getTime() - skew);
 }
		
function getString(date)
 {
  var months = new makeArray("Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sep.", "Oct.", "Nov.", "Dec."); 
  var days = new makeArray("Sun.","Mon.", "Tue.", "Wed.", "Thu.", "Fri.", "Sat."); 
  var strYear

  if (navigator.appName.indexOf("Microsoft") != -1 )
   {
	if (parseInt(navigator.appVersion) < 4)
		strYear = date.getYear() + 1900; 	  
	else
		strYear = date.getFullYear();
   }
  else
   {	
	if (parseFloat(navigator.appVersion) <= 4.01)
		strYear = date.getYear(); 	  
	else
		strYear = date.getFullYear();
   }  
   return  days[date.getDay()] + ", " + months[date.getMonth()] + " " + date.getDate() + ", "  + strYear;
   
  }


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Menu functions  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Menu submit  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function fSubmitMenu(action,location,id)
{
if (leavePage())
	{
	document.SkillProfileForm.Action.value = action
	document.SkillProfileForm.TargetASP.value = location				//target page
	document.SkillProfileForm.TargetAction.value = id					//target action
	document.SkillProfileForm.submit()
	}
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//other functions  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function isNumeric(str) {
  var pattern = "0123456789"
  var i = 0;
  do {
    var pos = 0;
    for (var j=0; j<pattern.length; j++)
      if (str.charAt(i)==pattern.charAt(j))
        pos = 1;
    i++;
  } while (pos==1 && i<str.length)
  if (pos==0)
    return false;
  return true;
} 


function trim(str)
  {
    //this function is like the Trim function in VB
    while (str.charAt(str.length - 1)==" ")
      str = str.substring(0, str.length - 1);
    while (str.charAt(0)==" ")
      str = str.substring(1, str.length);
    return str;
  }


function leavePage()
	{
	if (pageChanged)
		{
		return confirm("Your screen data has not been saved. Do you want to continue?");
		}
	return true;
	}
	
function valueChanged()
	{
	pageChanged = true;
	document.SkillProfileForm.PageChanged.value = "Y"
	}

function fSubmit()
	{
	if (leavePage()) document.SkillProfileForm.submit();
	}

function fDeleteSubmit()
	{
	if (fDelete()) 
		{
		document.SkillProfileForm.PageChanged.value = "Y"
		document.SkillProfileForm.submit();
		}
	}


function fDeleteAction(action)
{
	if (fDelete()) 
		{
		fAction(action)
		document.SkillProfileForm.submit();
		}
}


function fAction(action)
	{
	document.SkillProfileForm.Action.value = action
	WindClose()
	}

function fProdAction(action,prid)
	{
	document.SkillProfileForm.Action.value = action
	document.SkillProfileForm.ProductID.value = prid
	}

function fMenuSectionAction(action,sec)
	{
	document.SkillProfileForm.Action.value = action
	document.SkillProfileForm.SectionMenu.value = sec
	}


function fActionStack(action,retpageloc,target)
	{
	document.SkillProfileForm.Action.value = action
	document.SkillProfileForm.StackTarget.value = target
	if(document.SkillProfileForm.CallerStack.value == "")
		{
		document.SkillProfileForm.StartStack.value = "Y"
		}
	stackarray = document.SkillProfileForm.Stack.value.split("^")
	stackarray[2] = retpageloc
	document.SkillProfileForm.Stack.value = stackarray.join("^")
	}

function fDelete()
		{
		return confirm("Are you sure to delete this item?");
		}


function fArchiveSubmit()
	{
	if (fArchive()) 
		{
		document.SkillProfileForm.PageChanged.value = "Y"
		document.SkillProfileForm.submit();
		}
	}


function fArchive()
		{
		return confirm("Are you sure to archive this item?");
		}

function fPageTop()
	{
	window.scroll(0,0);
	}

function setJump(srcloc,destloc)
	{
	document.SkillProfileForm.SrcPageTarget.value = srcloc
	document.SkillProfileForm.DestPageTarget.value = destloc
	}


function WindClose()
{

//debugger
if (ListCategoryWin)
	{
	ListCategoryWin.close()
	}

if (ListSeniorityWin)
	{
	ListSeniorityWin.close()
	}

if (ReqMetWin)
	{
	ReqMetWin.close()
	}

if (ProfileWin)
	{
	ProfileWin.close()
	}

if (HelpWin)
	{
	HelpWin.close()
	}


}

//multidimensional array
function MArray(iRows,iCols,iValue) 
{ 
var i; 
var j; 
   var a = new Array(iRows); 
   for (i=0; i < iRows; i++) 
   { 
       a[i] = new Array(iCols); 
       for (j=0; j < iCols; j++) 
       { 
           a[i][j] = iValue; 
       } 
   } 
   return(a); 
} 

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//XMLHTTP      +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function XMLHTTP(method,url,action,parameters)
{
//method: GET or POST
//url: page to get data
//action: function to be performed
//parameters: paraname1=&para1&paraname2=para2...

//code for Mozilla, Firefox, etc.
if (window.XMLHttpRequest)
	{
	var xmlhttp = new XMLHttpRequest();
	if (xmlhttp) 
		{
		xmlhttp.onreadystatechange = function() 
			{
			if (xmlhttp.readyState == 4 && (xmlhttp.status == 200 || xmlhttp.status == 304)) 
				{
				alert(xmlhttp.responseText);
				}
			};

		if(method=='GET')
			{
			xmlhttp.open('GET',url+'?Action='+action+parameters,false);
			xmlhttp.send(null);
			}
		else 
			{
			xmlhttp.open('POST',url,false);
			// many server-side scripts require the Content-Type to be set:
			xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
			xmlhttp.send('Action='+action+parameters);
			}
		return xmlhttp.responseText;	
		}
	}
// code for IE
else if (window.ActiveXObject)
	{
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	if (method=='GET')
		{
		xmlhttp.Open('GET',url+'?Action='+action+parameters, false);
		xmlhttp.send(null);
		}
	else 
		{
		xmlhttp.Open('POST',url, false);
		xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.Send('Action='+action+parameters);
		}
	return xmlhttp.responseText;
	}

}

function chart(charttype,name,action,parameters,height,width)
{
var line1
var line2
var line3
var line4
var line5
var line6
//refresh the chart
line1 = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+width+'" HEIGHT="'+height+'" id="chart" name="chart">'
line2 = '<PARAM NAME=movie VALUE="Charts/'+charttype+'">'
line3 = '<PARAM NAME="FlashVars" VALUE="&chartWidth='+width+'&chartHeight='+height+'&dataURL=SKPChartData.asp?'+escape('Action='+action+parameters)+'">'
line4 = '<PARAM NAME=quality VALUE=high>'
line5 = '<PARAM NAME=bgcolor VALUE=#FFFFFF>'
line6 = '<EMBED src="Charts/'+charttype+'" FlashVars="&chartWidth='+width+'&chartHeight='+height+'&dataURL=SKPChartData.asp?'+escape('Action='+action+parameters)+'" quality=high bgcolor=#FFFFFF WIDTH="'+width+'" HEIGHT="'+height+'" NAME="'+charttype+'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>'

document.getElementById(name).innerHTML = line1+line2+line3+line4+line5+line6

}




//-->  
  
