function OpenIBK(URL)
{

    var w = 800;
    var h = 530;
    var theTop=(screen.height/2)-(h/2);
    var theLeft=(screen.width/2)-(w/2);
    var options = "width=" + w + ",height=" + h + ",";
    options += "top=" + theTop + ",left=" + theLeft+ ",";
    options += "resizable=yes,scrollbars=yes,status=yes,";
    options += "menubar=no,toolbar=no,location=no,directories=no";
    var newWin = window.open(URL, '', options);
}
//***********************************************************************************
// SA. 29/10/2008
// Adding functions
// Function name:		convertBban2Iban
// Purpose:		     	To calculate the IBAN using a BBAN.
// Parameters:		    The function takes a bank account number  as a parameter 
//***********************************************************************************
function convertBban2Iban(strCusAcc)
{
	var strToBeProcessed, strIbanOneChar, strIBAN, arrIBAN, CtrlDigt, Idx;
	if (strCusAcc.length == 0) return "";
	strIBAN = ""; 
	strToBeProcessed = "6500000"+strCusAcc+"SA00"; 
	arrIBAN = strToBeProcessed.split(""); 
	// The below calculation is according to IBAN  algorithm
	for (Idx in arrIBAN)
	{	strIbanOneChar = arrIBAN[Idx];
		if (strIbanOneChar >= "A" && strIbanOneChar <= "Z")	strIBAN += strToBeProcessed.charCodeAt(Idx) - 65 + 10+"";
		else strIBAN += strIbanOneChar;
	}
	while(strIBAN.length > 5){	strIBAN = (Number(strIBAN.substring(0,5)) % 97) +""+ strIBAN.substring(5); } 
	CtrlDigt = 98 - (Number(strIBAN) % 97);
	if (String(CtrlDigt).length ==1) CtrlDigt = '0' + CtrlDigt;
	return "SA" + CtrlDigt + "6500000" + strCusAcc;
}
//***********************************************************************************

// Added by Ahmed Mohsin
// This is related with the iFrames (Display & resize)
function adjustIFrameSize (iframeWindow) {
  if (iframeWindow.document.height) {
    var iframeElement = document.getElementById(iframeWindow.name);
    iframeElement.style.height = iframeWindow.document.height + 16 + 'px';
//    iframeElement.style.width = iframeWindow.document.width + 'px';
  }
  else if (document.all) {
    var iframeElement = document.getElementById(iframeWindow.name);
    if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') 
    {
      iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
//      iframeElement.style.width = iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
    }
    else {
      iframeElement.style.height = iframeWindow.document.body.scrollHeight + 5 + 'px';
//      iframeElement.style.width = iframeWindow.document.body.scrollWidth + 10 + 'px';
    }
  }
}


    function PressRelaseLoadiFrame(iFrameName,Lang)
	{
	if ( Lang == "" ) {
		PageName = "PressRelease/SaibWP(E).PR";
		    }
	if ( Lang.toUpperCase() == "ENG" ) {
		PageName = "PressRelease/SaibWP(E).PR";
		}
	if ( Lang.toUpperCase() == "ARAB" ) {
		PageName = "PressRelease/SaibWP(A).PR";
		}
//	alert(iFrameName);
	if (document.getElementById(iFrameName).src == "" ) {
		document.getElementById(iFrameName).src = PageName + iFrameName + ".htm";
		document.getElementById(iFrameName).style.width = '590px'
		}
	}

function showhide(layer){
	if (document.getElementById(layer).style.display == "block")
	{
	document.getElementById(layer).style.display="none";
	document.getElementById(layer).style.visibility="hidden";
	}
	else
	{
	document.getElementById(layer).style.display="block";
	document.getElementById(layer).style.visibility="visible";
	}
}


function urlArb()
{
	var cURL = window.location.href;
	var sLen = cURL.length;
	var s = '/english/';
	var t = '/';
	var sIDX = cURL.lastIndexOf(s);
	var tIDX = cURL.lastIndexOf(t);
	var fileName = "printable_template.aspxl?tgt=lyt_" + cURL.substr(tIDX + 1,(sLen - tIDX )).replace('%20',' ');
    var arabicURL = cURL.substr(0,sIDX) + "/arabic/" + cURL.substr(sIDX + 9,sLen);
	window.location.href=arabicURL;

}

function urlEng()
{
	var cURL = window.location.href;
	var sLen = cURL.length;
	var s = '/arabic/';
	var t = '/';
	var sIDX = cURL.lastIndexOf(s);
	var tIDX = cURL.lastIndexOf(t);
	var fileName = "printable_template.aspxl?tgt=lyt_" + cURL.substr(tIDX + 1,(sLen - tIDX )).replace('%20',' ');
    var englishURL = cURL.substr(0,sIDX) + "/english/" + cURL.substr(sIDX + 8,sLen);
	window.location.href = englishURL;
}

// Javascript code to show hide abstract
var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true : false;
IE4=((document.all)&&(bV>=4))?true:false;
ver4 = (NS4 || IE4) ? true : false;

function expandIt(){return}

isExpanded = false;

function getIndex(el) {
	ind = null;
	for (i=0; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		if (whichEl.id == el) {
			ind = i;
			break;
		}
	}
	return ind;
}

function arrange() {
	nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
	for (i=firstInd+1; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		if (whichEl.visibility != "hide") {
			whichEl.pageY = nextY;
			nextY += whichEl.document.height;
		}
	}
}

function initIt(){
	if (IE4) {
		tempColl = document.all.tags("DIV");
		for (i=0; i<tempColl.length; i++) {
			if (tempColl(i).className == "child") tempColl(i).style.display = "none";
		}
	}
}

function expandIt(el) {
	if (!ver4) return;
	if (IE4) {expandIE(el)} 
}

function expandIE(el) { 
	whichEl = eval(el + "Child");
	whichIm = event.srcElement;
	if (whichEl.style.display == "none") {
		whichEl.style.display = "block";
		whichIm.src = "/NR/Shared/Landmark/images/nav/downblkarrow.gif";		
	}
	else {
		whichEl.style.display = "none";
		whichIm.src = "/NR/Shared/Landmark/images/nav/leftblkarrow.gif";
	}
}

onload = initIt;

// SCRIPT TO FIX THE NETSCAPE BUG THAT OCCURS ON WINDOW RESIZE
   NS4 = document.layers;
   if (NS4) {
      origWidth = innerWidth;
      origHeight = innerHeight;
   }

function reDo() {
   if (innerWidth != origWidth || innerHeight != origHeight) 
      location.reload();
}

if (NS4) onresize = reDo;

-->