/* Size image to popup */
function PopupPic(sPicURL) { 
     window.open( "<cfoutput>#application.rootpath#</cfoutput>/view_pic.cfm?"+sPicURL, "",  
     "resizable=1,HEIGHT=300,WIDTH=400"); 
   } 
   
   
  	function iChamaleonConcatenate(frm)
	{
		var sLogin=frm.j_username.value;
		if ((sLogin.indexOf('@') == -1) && (sLogin != ""))
		{
			frm.j_username.value = frm.j_username.value + "@ichameleongroup.com";
		}
	}

	function FrameResize(FrameID){
		if (navigator.appName=="Netscape") {
			document.getElementById(FrameID).height= eval('frames.' + FrameID + '.document.height') + 20; 
		} else {
			document.getElementById(FrameID).height= eval('frames.' + FrameID + '.document.body.scrollHeight');
		}
	}
	
	/* Used in project */
	function ToggleTable(TablePartialID){
		if ( eval(TablePartialID + 'Show').style.display == 'none' ){
			eval(TablePartialID + 'Hide').style.display = 'none';
			eval(TablePartialID + 'Show').style.display = 'inline';
		}
		else{
			eval(TablePartialID + 'Hide').style.display = 'inline';
			eval(TablePartialID + 'Show').style.display = 'none';
		}
	}
	
	/*
		Inserts an image in a table-cell
			myCellID	ID of the cell
			myImgPath	Image src
			[myAlt]		Alt for the image
			[myLink]	link for the image
			[myTarget]	target of the link [default is _self]
			[myOnClick]	onClick event of the link
	*/
	function setImageToCell( myCellID, myImgPath){
		var myImg = '';
		var content = ''
		var cellPointer = document.getElementById(myCellID);
		myTarget = '_self';
		var myAlt = '';
		
		if( arguments.length > 2 ){
			myAlt = arguments[2];
		}
		myImg = "<img src='" + myImgPath + "' border='0' alt='" + myAlt + "' title=''>";
		content = myImg;
		
		if( arguments.length > 3 ){
			if( arguments.length > 4 ){
				myTarget = arguments[4];
			}
			content = "<a href='" + arguments[3] + "' target='" + myTarget + "'";
			if( arguments.length > 5 ){
				content = content + " onClick='" + arguments[5] + "'";
			}
			content = content + ">" + myImg + "</a>";
		}
		
		cellPointer.style.display = '';
		cellPointer.innerHTML = content;
	}
	
	
	/*
		Inserts an Swf in a table-cell
			myCellId		ID of the cell
			mySwf			Swf src
			myWidth			width of the Swf
			myHeight		height of the Swf
			[myVerstion]	flash version [default is 5,0,0,0]
			[onClick]		onClick event
	*/
	function setSwfToCell ( myCellId, mySwf, myWidth, myHeight, myVars){
		var cellPointer = document.getElementById(myCellId);
		var content = '';
		var myVersion = '5,0,0,0';
		
		if( arguments.length > 4 ){
			myVersion = arguments[4];
		}
		
		content = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + myVersion + '" width="' + myWidth + '" height="' + myHeight + '"> <param name="flashVars" value="' + myVars + '"><param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="' + mySwf + '" /> <param name="quality" value="high" /> <embed src="' + mySwf + '" quality="high" width="' + myWidth + '" height="' + myHeight + '" align="middle" flashvars="' + myVars + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>'

		if( arguments.length > 5 ){
			content = "<a onclick='" + arguments[5] + "'>" + content + "</a>";
		}
		
		cellPointer.style.display = '';
		cellPointer.innerHTML = content;
	}	
	