var projectPath = 'http://www.globalservicesmedia.com/'
var linkpath ='/'




function mailToFriend1(headline)
{	
	var vheadline;
	vheadline = headline.substring(18);		
	var fromURL = window.location;	
	var spaceFix = / /gi; 
	vheadline1 = vheadline.replace(spaceFix, "*");	
	window.open(projectPath+'content/general/mailToFriendV2.asp?fromURL='+ fromURL + '&title=' +vheadline ,'mywindow','Width= 500,height=450');  
	
}





function subsectionpages(id1)

{

if (id1 == 30)
   {
   window.location.href=  projectPath + 'Content/Experts.asp?sectionid='+id1;

   }

else if (id1 == 31)
   {
   window.location.href=  projectPath + 'Content/whitepaperpage.asp?sectionid='+id1;

   }	
	
	
	
else if (id1 == 32)
   {
   window.location.href=  projectPath + 'Content/casestudies.asp?sectionid='+id1;

   }	
		
else if (id1 == 39)
   {
   window.location.href=  projectPath + 'Content/General/searchEventsV2.asp?sectionid=45';

   }	
		
	
else if (id1 == 40)
   {
   window.location.href=  projectPath + 'Content/profiles.asp?sectionid='+id1;

   }	
		
else if (id1 == 41)
   {
   window.location.href=  projectPath + 'Content/videopodcasts.asp';

   }	



else
{
	window.location.href=  projectPath + 'Content/videopodcasts.asp';

 }

}






function defaultDeal(DealID,id1)
{

window.location.href= projectPath + 'content/general/searchDealV2.asp?sectionid='+id1+'&dealid='+DealID;

}



function defaultevent(eventID,id1)
{

window.location.href= projectPath + 'content/general/searcheventsV2.asp?sectionid='+id1+'&eventid='+eventID;

}







function Deal(id1)
{

window.location.href= projectPath + 'content/general/searchDealV2.asp?sectionid='+id1;

}





 function viewarticle(rticleLink)

{


window.location.href=rticleLink;
}



function viewsection(id1)

{



if (id1 == 23)
   {
   window.location.href=  projectPath + 'Content/bpo.asp?sectionid='+id1;

   }

else if (id1 == 22)
   {
   window.location.href=  projectPath + 'Content/ITO.asp?sectionid='+id1;

   }	
	
	
	
else if (id1 == 25)
   {
   window.location.href=  projectPath + 'Content/destination.asp?sectionid='+id1;

   }	
	
	
		else if (id1 == 26)
   {
   window.location.href=  projectPath + 'Content/gs100.asp?sectionid='+id1;

   }	
	
		
else if (id1 == 24)
   {
   window.location.href=  projectPath + 'Content/strategies.asp?sectionid='+id1;

   }	
		
	
else if (id1 == 28)
   {
   window.location.href=  projectPath + 'Content/specials.asp?sectionid='+id1;

   }	
		
else if (id1 == 29)
   {
   window.location.href=  projectPath + 'Content/spotlight.asp?sectionid='+id1;

   }	



else
{
	window.location.href=  projectPath + 'Content/homesection.asp?sectionid='+id1;

 }



//window.location.href=  projectPath + 'Content/homesection.asp?sectionid='+id1;




}






function searchtop(id1)
{

 var vObj;
    vObj=document.getElementById('frmSearch');
    if (vObj != null)
    {
		
        vObj.target = "_self";
		var vPath = 'general/';
		
		
			vPath = projectPath;
			
		var vURL;		
		
	
			
		
		
if (id1 == 30)
{
vPath = vPath + 'Content/Experts.asp?sectionid='+id1;

}

else if (id1 == 32)
{
vPath = vPath + 'Content/casestudies.asp?sectionid='+id1;

}	
		    
		
else if (id1 == 31)
{
vPath = vPath + 'Content/whitepaperpage.asp?sectionid='+id1;

}	
			
else if (id1 == 40)
{
vPath = vPath + 'Content/profiles.asp?sectionid='+id1;

}			
		
else if (id1 == 0)
{
vPath = vPath + 'Content/videopodcasts.asp';

}

else 
{
vPath = vPath + 'Content/newsletters.asp';

}		


		
		
		
		vURL = vPath;
		vObj.action=vURL;
		vObj.submit();
    }


}





function onclicktopsearch()
	
	{
	var name = document.getElementById("testt1") ;

name.className="menu2" ;


	}
	function onmouseouttopsearch()
	
	{
	var name = document.getElementById("testt1") ;

name.className="menu1" ;


	}




function viewsectioncategory(id1,categoryid)
	
	{
	
	
	window.location.href=  projectPath + 'Content/Homesubsectionpage.asp?sectionid='+id1+'&categoryid='+categoryid;

	
	
	}
	

function viewnews(id1)

{
window.location.href=  projectPath + 'Content/newssection.asp?sectionid='+id1;
}



function viewwhitepaper(id1)

{
window.location.href=  projectPath + 'Content/whitepaperpage.asp?sectionid='+id1;
}




	



 


//-----modify and use this for fadein/fadeout effect
function fade_out (object_name) {
  var fade_steps=20;
  var milliseconds_per_fade_step=50;
 
  var object=document.getElementById(object_name);
  var vaded=object.style.opacity;
  var vaded_ie="alpha (opacity = "+vaded*100+" )";
 
  //Check if it has vaded at all
  if (vaded=="" || vaded==undefined) {
    //No, set the opacity 1
    vaded=1;
    //And update the css of the object
    object.style.opacity=vaded;
 
    //Also update the special Internet Explorer css line
    vaded_ie="alpha (opacity = "+vaded*100+" )";
    object.style.filter=vaded_ie;
 
    //Then set a timer, to call this function again after a given amount of milliseconds
    setTimeout("fade_out('"+object_name+"');", milliseconds_per_fade_step);
  }
  //Check if the div is still being faded.
  else if (vaded>0) {
    //Yes, he's still fading
    //Decrease the opacity a little
    vaded-=1/fade_steps;
    //Update the css of the object
    object.style.opacity=vaded;
 
    //Also update the special Internet Explorer css line
    vaded_ie="alpha (opacity = "+vaded*100+" )";
    object.style.filter=vaded_ie;
 
    //Then set a timer, to call this function again after a given amount of milliseconds
    setTimeout("fade_out('"+object_name+"');", milliseconds_per_fade_step);
  }
  //Check if the div has finished fading already
  else if (fade<=0) {
    //Reset the opacity to 1
    vaded="";
    object.style.opacity=vaded;
    //Make the div disappear and clear the space
    object.style.display="none";
 
    //Reset the Internet Explorer opacity
    var vaded_ie="";
    object.style.filter=vaded_ie;
  }
}




function getResult1()
{
    var vObj;
    vObj=document.getElementById('frmSearch');
    if (vObj != null)
    {
		
        vObj.target = "_self";
		var vPath = 'general/';
		
		
			vPath = projectPath;
			
		var vURL;
		vObjPath =document.getElementById('hdnDestinationPage');
		
			vPath = vPath + 'Search';
		
		vURL = vPath;
		vObj.action=vURL;
		vObj.submit();
    }
}
function search1(vSearchType)
{

	var vObj;
    vObj=document.getElementById('frmSearch');
    if (vObj != null)
    {
		var vObjPath;      
		vObjPath =document.getElementById('hdnDestinationPage');
		if (vObjPath != null)
		{
			if (vSearchType=='content')
			{
				var vWord;
				vWord =document.getElementById('txtSearchWord');
				if (vWord != null)
				{
					var vValue;
					vValue=trimAll(vWord.value);
					if (vValue =='')
					{
						//alert('enter keywords to search!');
						vWord.value='';
						vWord.focus();
						return false;
					}
					else
					{
						//searchglobal01.asp
						vObjPath.value = 'Search';
					}					
				}				
			}
			
			else
			{
				vObjPath.value = 'Search';
			}
		}
		getResult1();
		
	}
}
function checkEnterOnclick1(evtobj)
	 {
	
	 	if (window.navigator.appName=="Microsoft Internet Explorer"){
	 		if (window.event.keyCode==13){return search1('content');} }
	 	else{
	 		if (evtobj.which ==13){return search1('content');} }		
	 }





//Drop Down Tabs Menu- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Created: May 16th, 07'

var tabdropdown={
	disappeardelay: 200, //set delay in miliseconds before menu disappears onmouseout
	disablemenuclick: false, //when user clicks on a menu item with a drop down menu, disable menu item's link?
	enableiframeshim: 1, //1 or 0, for true or false

	//No need to edit beyond here////////////////////////
	dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, previousmenuitem:null,
	currentpageurl: window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, ""), //get current page url (minus hostname, ie: http://www.dynamicdrive.com/)

	getposOffset:function(what, offsettype){
		var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
		var parentEl=what.offsetParent;
			while (parentEl!=null){
				totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
				parentEl=parentEl.offsetParent;
			}
		return totaloffset;
	},

	showhide:function(obj, e, obj2){ //obj refers to drop down menu, obj2 refers to tab menu item mouse is currently over
		if (this.ie || this.firefox)
			this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
		if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
			if (obj2.parentNode.className.indexOf("default")==-1) //if tab isn't a default selected one
				obj2.parentNode.className="selected"
			obj.visibility="visible"
			}
		else if (e.type=="click")
			obj.visibility="hidden"
	},

	iecompattest:function(){
		return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	},

	clearbrowseredge:function(obj, whichedge){
		var edgeoffset=0
		if (whichedge=="rightedge"){
			var windowedge=this.ie && !window.opera? this.standardbody.scrollLeft+this.standardbody.clientWidth-15 : window.pageXOffset+window.innerWidth-15
			this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
		if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
			edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
		}
		else{
			var topedge=this.ie && !window.opera? this.standardbody.scrollTop : window.pageYOffset
			var windowedge=this.ie && !window.opera? this.standardbody.scrollTop+this.standardbody.clientHeight-15 : window.pageYOffset+window.innerHeight-18
			this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
			if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
				edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
				if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
					edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
			}
			this.dropmenuobj.firstlink.style.borderTopWidth=(edgeoffset==0)? 0 : "1px" //Add 1px top border to menu if dropping up
		}
		return edgeoffset
	},

	dropit:function(obj, e, dropmenuID){
		if (this.dropmenuobj!=null){ //hide previous menu
			this.dropmenuobj.style.visibility="hidden" //hide menu
			if (this.previousmenuitem!=null && this.previousmenuitem!=obj){
				if (this.previousmenuitem.parentNode.className.indexOf("default")==-1) //If the tab isn't a default selected one
					this.previousmenuitem.parentNode.className=""
			}
		}
		this.clearhidemenu()
		if (this.ie||this.firefox){
			obj.onmouseout=function(){tabdropdown.delayhidemenu(obj)}
			obj.onclick=function(){return !tabdropdown.disablemenuclick} //disable main menu item link onclick?
			this.dropmenuobj=document.getElementById(dropmenuID)
			this.dropmenuobj.onmouseover=function(){tabdropdown.clearhidemenu()}
			this.dropmenuobj.onmouseout=function(e){tabdropdown.dynamichide(e, obj)}
			this.dropmenuobj.onclick=function(){tabdropdown.delayhidemenu(obj)}
			this.showhide(this.dropmenuobj.style, e, obj)
			this.dropmenuobj.x=this.getposOffset(obj, "left")
			this.dropmenuobj.y=this.getposOffset(obj, "top")
			this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
			this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
			this.previousmenuitem=obj //remember main menu item mouse moved out from (and into current menu item)
			this.positionshim() //call iframe shim function
		}
	},

	contains_firefox:function(a, b) {
		while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
		return false;
	},

	dynamichide:function(e, obj2){ //obj2 refers to tab menu item mouse is currently over
		var evtobj=window.event? window.event : e
		if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
			this.delayhidemenu(obj2)
		else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
			this.delayhidemenu(obj2)
	},

	delayhidemenu:function(obj2){
		this.delayhide=setTimeout(function(){tabdropdown.dropmenuobj.style.visibility='hidden'; if (obj2.parentNode.className.indexOf('default')==-1) obj2.parentNode.className=''},this.disappeardelay) //hide menu
	},

	clearhidemenu:function(){
		if (this.delayhide!="undefined")
			clearTimeout(this.delayhide)
	},

	positionshim:function(){ //display iframe shim function
		if (this.enableiframeshim && typeof this.shimobject!="undefined"){
			if (this.dropmenuobj.style.visibility=="visible"){
				this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
				this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px"
				this.shimobject.style.left=this.dropmenuobj.style.left
				this.shimobject.style.top=this.dropmenuobj.style.top
			}
		this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")? "block" : "none"
		}
	},

	hideshim:function(){
		if (this.enableiframeshim && typeof this.shimobject!="undefined")
			this.shimobject.style.display='none'
	},

isSelected:function(menuurl){
	var menuurl=menuurl.replace("http://"+menuurl.hostname, "").replace(/^\//, "")
	return (tabdropdown.currentpageurl==menuurl)
},

	init:function(menuid, dselected){
		this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
		var menuitems=document.getElementById(menuid).getElementsByTagName("a")
		for (var i=0; i<menuitems.length; i++){
			if (menuitems[i].getAttribute("rel")){
				var relvalue=menuitems[i].getAttribute("rel")
				document.getElementById(relvalue).firstlink=document.getElementById(relvalue).getElementsByTagName("a")[0]
				menuitems[i].onmouseover=function(e){
					var event=typeof e!="undefined"? e : window.event
					tabdropdown.dropit(this, event, this.getAttribute("rel"))
				}
			}
			if (dselected=="auto" && typeof setalready=="undefined" && this.isSelected(menuitems[i].href)){
				menuitems[i].parentNode.className+=" selected default"
				var setalready=true
			}
			else if (parseInt(dselected)==i)
				menuitems[i].parentNode.className+=" selected default"
		}
	}

}
