﻿var otherFunction = false; //если  установлен в true, тогда профиль не показываеться автоматически

function GetProfile(obj)
{
	//changes the border as the user click in the card
	if(document.getElementsByTagName)
	{//loop through and turn off any that are on
  var divItem = document.getElementsByTagName('DIV');
		for(var i=0; i<divItem.length; i++)
		{
		 var oldClassName = 	new String(divItem[i].className);
			divItem[i].className = oldClassName.replace('Over','');
		}
	}	
	var currentClass = new String(obj.className);
	obj.className = currentClass + 'Over'; //add the over to the cur class and replace	
	
	if(otherFunction != true)
	{	//if the otherFunction (indicates not to open profile) is false, open profile
		var femaleAccount = obj.id;	
		var navMainLocal = new String(parent.centerframe.location);
		navMainLocal = navMainLocal.toLowerCase();	
		if (!(navMainLocal.indexOf('profile.php') > -1 && navMainLocal.indexOf(femaleAccount) > -1))
		{	
			parent.centerframe.location = './profile.php?toid=' + femaleAccount;
		}	
	}
	else
	{
		otherFunction = false;
	}			
}

