function get(str){
	return document.getElementById(str);
}
function getN(str){
	return document.getElementsByName(str);
}

function RunFoo()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="650" height="250" bgcolor="#FFFFFF">\n');
    document.write('<param name="movie" value="flash/main.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" />\n');
    document.write('<embed src="flash/main.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="650" height="250" bgcolor="#FFFFFF" wmode="transparent" />\n');
    document.write('</object>\n');
}

var TheSeparator = "/";
var TheSeparator2 = ", ";
var ShowDay ="yes";
var Days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var TheDate = new Date();

var TheWeekDay = TheDate.getDay();
var Day ="";
if (ShowDay == "yes"){
    Day = Days[TheWeekDay];
    Day += "";}

var TheMonth = TheDate.getMonth() + 1;
if (TheMonth < 10) TheMonth = "0" + TheMonth;

var TheMonthDay = TheDate.getDate();
if (TheMonthDay < 10) TheMonthDay = "0" + TheMonthDay;

var TheYear = TheDate.getYear();
if (TheYear < 1000) TheYear += 1900;

var D = "";
D += TheYear;


//MAKE COLUMNS EQUAL ON SUBPAGES
function P7_colH(){
 var i,oh,hh,h=0,dA=document.p7eqc,an=document.p7eqa;if(dA&&dA.length){
 for(i=0;i<dA.length;i++){dA[i].style.height='auto';}for(i=0;i<dA.length;i++){
 oh=dA[i].offsetHeight;h=(oh>h)?oh:h;}for(i=0;i<dA.length;i++){if(an){
 dA[i].style.height=h+'px';}else{P7_eqA(dA[i].id,dA[i].offsetHeight,h);}}if(an){
 for(i=0;i<dA.length;i++){hh=dA[i].offsetHeight;if(hh>h){
 dA[i].style.height=(h-(hh-h))+'px';}}}else{document.p7eqa=1;}
 document.p7eqth=document.body.offsetHeight;
 document.p7eqtw=document.body.offsetWidth;}
}
function P7_eqT(){
 if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth){
 P7_colH();}
}
function P7_equalCols(){
 if(document.getElementById){document.p7eqc=new Array;for(var i=0;i<arguments.length;i++){
 document.p7eqc[i]=document.getElementById(arguments[i]);}setInterval("P7_eqT()",10);}
}
function P7_eqA(el,h,ht){
 var sp=2,inc=100,nh=h,g=document.getElementById(el),oh=g.offsetHeight,ch=parseInt(g.style.height);
 ch=(ch)?ch:h;var ad=oh-ch,adT=ht-ad;nh+=inc;nh=(nh>adT)?adT:nh;g.style.height=nh+'px';
 oh=g.offsetHeight;if(oh>ht){nh=(ht-(oh-ht));g.style.height=nh+'px';}
 if(nh<adT){setTimeout("P7_eqA('"+el+"',"+nh+","+ht+")",sp);}
}

function loadCurves(){
	settings3 = {
          tl: { radius: 3 },
          tr: { radius: 3 },
          bl: { radius: 0 },
          br: { radius: 0 },
          antiAlias: true,
          autoPad: true,
          validTags: ["div"]
	}
	var myBoxObjectMain = new curvyCorners(settings3, "curve3");
	myBoxObjectMain.applyCornersToAll();
}

var aryimg = new Array(2);
var arytxt = new Array(2);
var aryurl = new Array(2);
var dt = new Date();
var idx = 0;

arytxt[0] = "Magellan knows a lot about the candidates before they talk to them. It is a source of differentiation that reinforces my impression that they have a perspective on the consulting market.";
arytxt[1] = "They are committed and patient and resolute and determined to see the job through. And I have appreciated that as a client.";
arytxt[2] = "Magellan knows a lot about the candidates before they talk to them. It is a source of differentiation that reinforces my impression that they have a perspective on the consulting market.";
arytxt[3] = "They are committed and patient and resolute and determined to see the job through. And I have appreciated that as a client.";
arytxt[4] = "Magellan knows a lot about the candidates before they talk to them. It is a source of differentiation that reinforces my impression that they have a perspective on the consulting market.";

aryurl[0] = ".html";
aryurl[1] = ".html";
aryurl[2] = ".html";
aryurl[3] = ".html";
aryurl[4] = ".html";

function rotate(){
  idx = dt.getTime()%5;
  get('myText').innerHTML=arytxt[idx];
  //get('myURL').href=aryurl[idx];
}

function cBack (rText) {
//alert(rText);
	if(rText != 'false') {
		var f = get("li" + rText);
		f.parentNode.removeChild(f);
	}
}


function ajaxObject(url, callbackFunction){
 var that=this;
 this.updating = false;
 this.abort = function(){
  if (that.updating){
   that.updating=false;
   that.AJAX.abort();      
   that.AJAX=null;  
  } //if
 } //this.abort

 this.update = function(passData,postMethod){
  if (that.updating){ return false; }

  that.AJAX = null;
  if (window.XMLHttpRequest){
   that.AJAX=new XMLHttpRequest();
  } else {
   that.AJAX=new ActiveXObject("Microsoft.XMLHTTP");
  } //if window xml

  if (that.AJAX==null){
   return false;
  } else {
   that.AJAX.onreadystatechange = function(){
    if (that.AJAX.readyState==4){
     that.updating=false;
     that.callback(that.AJAX.responseText,that.AJAX.status,that.AJAX.responseXML);
     that.AJAX=null;
    }  //if that ajax
   } //onreadystate

   that.updating = new Date();
   if (/post/i.test(postMethod)){ // regExp test againt postMethod
    var uri=urlCall+'?'+that.updating.getTime();
    that.AJAX.open("POST", uri, true);
    that.AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    that.AJAX.setRequestHeader("Content-Length", passData.length);
    that.AJAX.send(passData);
   } else {
    var uri=urlCall+'?'+passData+'&timestamp='+(that.updating.getTime());
    that.AJAX.open("GET", uri, true);
    that.AJAX.send(null);
   } //if post

   return true;
  } //if that ajax null
 } //this.update

 var urlCall = url;
 this.callback = callbackFunction || function () { };
}
function delFile(fileid,filenm){
 var AJ = new ajaxObject("up.php", cBack);
 var f = get("li" + fileid);
 var txtNode = document.createTextNode("Deleting...");
 
 var link = document.createElement('div');
 link.setAttribute('style', 'color:red');
 link.appendChild(txtNode);
 f.insertBefore(link,f.firstChild);
	
 AJ.update("id=" + fileid + "&file=" + filenm, "post");
}
