// JavaScript Document

// JavaScript Document
var ie = document.all;
var nn6 = document.getElementById &&! document.all;

var isdrag = false;
var x, y;
var dobj;

//var vals = location.search.substring(1).split("=");

function funOpenerProfile(objA,sName)
{
	//objA.href ="speakers-top.htm?sName=" +sName;
	opener.location.replace("speakers-top.htm?sName=" +sName);
}	

function funGOtoProfile(objA,sName)
{
	objA.href ="speakers-top.htm?sName=" +sName;
}	

function funGOtoSynopses(objA,sName)
{
	objA.href ="synopses.htm?sName=" +sName;	
}

function funGOtoWorkshop(objA,sName)
{
	//objA.href ="preconf_synopses.htm?sName=" +sName;
	window.open ("preconf_synopses.htm?sName="+sName,"synopsis","menubar=0,resizable=0,scrollbars=yes,width=500,height=750"); 	
}

function funGOtoRed(objA,sName)
{
	window.open ("progconf_red.htm?sName="+sName,"synopsis","menubar=0,resizable=0,scrollbars=yes,width=500,height=750"); 	
}

function funGOtoGreen(objA,sName)
{
	window.open ("progconf_green.htm?sName="+sName,"synopsis","menubar=0,resizable=0,scrollbars=yes,width=500,height=750"); 	
}

function funGOtoBlue(objA,sName)
{
	window.open ("progconf_blue.htm?sName="+sName,"synopsis","menubar=0,resizable=0,scrollbars=yes,width=500,height=750"); 	
}

function funGOtoPurple(objA,sName)
{
	window.open ("progconf_purple.htm?sName="+sName,"synopsis","menubar=0,resizable=0,scrollbars=yes,width=500,height=750"); 	
}

function displaySynopsis(objProfile){
	objProfile.style.display="block"
}

function CheckDivProfile(objMain,objProfile)
{
	InitialHide("profile");
	if (objProfile.id == "aSpeaker")
	{
		objMain.style.display="block";
		divImg.style.display="block";
		divImg1.style.display="none";
		objProfile.style.display="block";
	}
	else
	{
		objMain.style.display="none";
		divImg.style.display="none";
		divImg1.style.display="block";
		objProfile.style.display="block";
	}
}
function InitialHide(checkVal)
{
	if (checkVal == "popup")
	{
		var trPic = tbodyImg.getElementsByTagName('TR');
		for(i = 0; i < trPic.length; i++)
		{
			if (trPic[i].id != "")
				trPic[i].parentNode.removeChild(trPic[i]);
	
		}
	}
	else
	{
		var trProfile = tr_Main.getElementsByTagName('Div');
		for(i = 0; i < trProfile.length; i++)
		{
			if (trProfile[i].id != "")
			{
				trProfile[i].style.display="none";
			}	
		}
		if (divProfilePic.style.display == "block")
			divProfilePic.style.display = "none";
	}
}


 function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
function CreatePopup(objDiv,objRow,sPathName)
{

InitialHide("popup");
var table = document.getElementById('tbodyImg');
var tr    = document.createElement('TR');
var td  = document.createElement('TD');
var img_= document.createElement('IMG');
tr.setAttribute('id','tr_Img');
img_.setAttribute('src','images/speakers/' + sPathName +'.jpg');
//img_.setAttribute('width','380px');
//img_.setAttribute('height','355px');
table.appendChild(tr);
tr.appendChild(td);
td.appendChild(img_);
table.style.display="block";
var xLeft = findPosX(objRow);
var xTop = findPosY(objRow);
objDiv.style.top = xTop-400;
objDiv.style.left = xLeft;
objDiv.style.display="block";

}
function Close(objDiv,objTR)
{
objTR.parentNode.removeChild(objTR);
objDiv.style.display="none";
}
function movemouse( e ) {
  if( isdrag ) {
    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
    return false;
  }
}

function selectmouse( e ) {
  var fobj       = nn6 ? e.target : event.srcElement;
  var topelement = nn6 ? "HTML" : "BODY";

  while (fobj.tagName != topelement && fobj.className != "dragme") {
    fobj = nn6 ? fobj.parentNode : fobj.parentElement;
  }

  if (fobj.className=="dragme") {
    isdrag = true;
    dobj = document.getElementById("divProfilePic");
    tx = parseInt(dobj.style.left+0);
    ty = parseInt(dobj.style.top+0);
    x = nn6 ? e.clientX : event.clientX;
    y = nn6 ? e.clientY : event.clientY;
    document.onmousemove=movemouse;
    return false;
  }
}
document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");

function vReg(){
	//window.open ('https://ies-pix2007.com/registration/', 'newwindow', config='height=800, width=900, toolbar=yes, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
	opener.location.replace('https://ies-pix2007.com/registration/');
}

function CreatePopup2(objDiv,objRow,sPathName)
{

InitialHide("popup");
var table = document.getElementById('tbodyImg');
var tr    = document.createElement('TR');
var td  = document.createElement('TD');
var img_= document.createElement('IMG');
tr.setAttribute('id','tr_Img');
img_.setAttribute('src','images/amara/' + sPathName +'.jpg');
//img_.setAttribute('width','380px');
//img_.setAttribute('height','355px');
table.appendChild(tr);
tr.appendChild(td);
td.appendChild(img_);
table.style.display="block";
var xLeft = findPosX(objRow);
var xTop = findPosY(objRow);
objDiv.style.top = xTop+380;
objDiv.style.left = xLeft;
objDiv.style.display="block";

}

function openGfk()
{
	window.open ("marketbrief-gfk.htm","synopsis","menubar=0,resizable=0,scrollbars=yes,width=500,height=750"); 	
}

function wAmara(){
	window.open ('amara-resort.htm', 'newwindow', config='height=800, width=520, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no');
}