//KOde by arkebion
var processList = new Array();
var mainProcessList = new Array();
//open window
function ow(url,g,y,s)
{
var xc = (document.body.clientWidth) / 2;
var yc = (document.body.clientHeight) / 2;
if(!s)s=1;else s=0;if(!g)g=320;if(!y)y=200;var w = window.open(url,"_blank","top="+yc+",left="+xc+"directories=0,location=0,menubar=0,scrollbars=1,resizeable=1,status=0,toolbar=0,width="+g.toString()+",height="+y.toString());w.focus();
}
//advanced open window
function aow(my_url,my_settings)
{
var w = window.open(my_url,"_blank",my_settings);
w.focus()
}
//open modal
function om(url,g,y)
{
var now = new Date();
var flag = url.search(/\?/gi);
if(flag != -1)
var seperator = "&";
else
var seperator = "?";
url = url + seperator +"time="+ now.getSeconds() + now.getMinutes() + now.getHours();
if(!g)g=320;if(!y)y=200;var w = window.showModalDialog(url,window,"dialogHeight: "+y+"px; dialogWidth: "+g+"px; edge: Raised; center: Yes; resizable: Yes; status: No;Help: No;");
return w;
}
function confirmDialog(confirmationString)
{
return om("content/confirm.php?s="+confirmationString,250,200);
}
function resizeDialogToContent()
{
// resize window so there are no scrollbars visible
var dw = window.dialogWidth;
while (isNaN(dw))
{
dw = dw.substr(0,dw.length-1);
}
difw = dw - this.document.body.clientWidth;
window.dialogWidth = this.document.body.scrollWidth+difw+'px';
var dh = window.dialogHeight;
while (isNaN(dh))
{
dh = dh.substr(0,dh.length-1);
}
difh = dh - this.document.body.clientHeight;
window.dialogHeight = this.document.body.scrollHeight+difh+'px';
}
function resizeWindowToContent()
{
// resize window so there are no scrollbars visible
window.resizeTo(document.body.scrollWidth+10,document.body.scrollHeight+30);
}
function menuStart()
{
document.writeln("
");
}
function menuItem(title,url,hoverCSS,defaultCSS)
{
document.writeln("
"+title+"
");
}
function cc(obj, className)
{
obj.className = className;
}
var clickedMenuItem = 0;
function naVpreloadImages() { //v3.0
var d=document; if(d.images){ if(!d.naVp) d.naVp=new Array();
var i,j=d.naVp.length,a=naVpreloadImages.arguments; for(i=0; i 10;
}
function flatSelected(cal, date) {
var el = document.getElementById("preview");
el.innerHTML = date;
}
function showFlatCalendar() {
var parent = document.getElementById("display");
// construct a calendar giving only the "selected" handler.
var cal = new Calendar(true, null, flatSelected);
// hide week numbers
cal.weekNumbers = false;
// We want some dates to be disabled; see function isDisabled above
cal.setDisabledHandler(isDisabled);
cal.setDateFormat("%A, %B %e");
// this call must be the last as it might use data initialized above; if
// we specify a parent, as opposite to the "showCalendar" function above,
// then we create a flat calendar -- not popup. Hidden, though, but...
cal.create(parent);
// ... we can show it here.
cal.show();
}
function IstNum(evnt,obj) {
var nn=obj.value
var charCode = (navigator.appName == "Netscape") ? evnt.which : evnt.keyCode
// allow minus sign at the beginning:
if (obj.value.length==0 && charCode==45) return true
// permit 1 decimal place...
// permit 2 floating point
if (nn.indexOf(".") != -1 && obj.value.length > (nn.indexOf(".")+3))
return false;
if (charCode==46 && nn.indexOf(".")==-1) return true
// ...and numbers
if (charCode == 44 && nn.indexOf(".")==-1)
{
obj.value = obj.value + ".";
return false;
}
if (charCode > 31 && (charCode < 48 || charCode > 57 )){
return false
}
return true
}
function cancelKey(evt) {
if((evt.ctrlKey && evt.keyCode == 67) || (evt.ctrlKey && evt.keyCode == 86))
evt.returnValue = true;
else
{
evt.keyCode = 0;
evt.returnValue = false;
}
}
var activeRowColor;
function listerHighlightRow(rowId,color)
{
var row = document.getElementById(rowId);
var selected = row.getAttribute('selected');
if(selected == "false")
activeRowColor = row.style.background;
else
activeRowColor = "";
var selected = row.getAttribute('selected');
if(selected == "false")
row.style.background = color;
}
function listerLowlightRow(rowId,color)
{
var row = document.getElementById(rowId);
var selected = row.getAttribute('selected');
if(selected == "false")
{
if(activeRowColor)
row.style.background = activeRowColor;
else
{
row.style.background = color;
}
}
}
function listerSelectRow(rowId,selectedColor,color)
{
var row = document.getElementById(rowId);
var selected = row.getAttribute('selected');
if(selected == "false")
{
row.setAttribute('selected','true');
row.style.background = selectedColor;
}
else
{
row.setAttribute('selected','false');
row.style.background = color;
}
}
var separator = ","; // use comma as 000's separator
var decpoint = "."; // use period as decimal point
var percent = "%";
var currency = "$"; // use dollar sign for currency
function formatNumber(number, format, print) { // use: formatNumber(number, "format")
if (print) document.write("formatNumber(" + number + ", \"" + format + "\") ");
if (number - 0 != number) return null; // if number is NaN return null
var useSeparator = format.indexOf(separator) != -1; // use separators in number
var usePercent = format.indexOf(percent) != -1; // convert output to percentage
var useCurrency = format.indexOf(currency) != -1; // use currency format
var isNegative = (number < 0);
number = Math.abs (number);
if (usePercent) number *= 100;
format = strip(format, separator + percent + currency); // remove key characters
number = "" + number; // convert number input to string
// split input value into LHS and RHS using decpoint as divider
var dec = number.indexOf(decpoint) != -1;
var nleftEnd = (dec) ? number.substring(0, number.indexOf(".")) : number;
var nrightEnd = (dec) ? number.substring(number.indexOf(".") + 1) : "";
// split format string into LHS and RHS using decpoint as divider
dec = format.indexOf(decpoint) != -1;
var sleftEnd = (dec) ? format.substring(0, format.indexOf(".")) : format;
var srightEnd = (dec) ? format.substring(format.indexOf(".") + 1) : "";
// adjust decimal places by cropping or adding zeros to LHS of number
if (srightEnd.length < nrightEnd.length) {
var nextChar = nrightEnd.charAt(srightEnd.length) - 0;
nrightEnd = nrightEnd.substring(0, srightEnd.length);
if (nextChar >= 5) nrightEnd = "" + ((nrightEnd - 0) + 1); // round up
// patch provided by Patti Marcoux 1999/08/06
while (srightEnd.length > nrightEnd.length) {
nrightEnd = "0" + nrightEnd;
}
if (srightEnd.length < nrightEnd.length) {
nrightEnd = nrightEnd.substring(1);
nleftEnd = (nleftEnd - 0) + 1;
}
} else {
for (var i=nrightEnd.length; srightEnd.length > nrightEnd.length; i++) {
if (srightEnd.charAt(i) == "0") nrightEnd += "0"; // append zero to RHS of number
else break;
}
}
// adjust leading zeros
sleftEnd = strip(sleftEnd, "#"); // remove hashes from LHS of format
while (sleftEnd.length > nleftEnd.length) {
nleftEnd = "0" + nleftEnd; // prepend zero to LHS of number
}
if (useSeparator) nleftEnd = separate(nleftEnd, separator); // add separator
var output = nleftEnd + ((nrightEnd != "") ? "." + nrightEnd : ""); // combine parts
output = ((useCurrency) ? currency : "") + output + ((usePercent) ? percent : "");
if (isNegative) {
// patch suggested by Tom Denn 25/4/2001
output = (useCurrency) ? "(" + output + ")" : "-" + output;
}
return output;
}
function strip(input, chars) { // strip all characters in 'chars' from input
var output = ""; // initialise output string
for (var i=0; i < input.length; i++)
if (chars.indexOf(input.charAt(i)) == -1)
output += input.charAt(i);
return output;
}
function separate(input, separator) { // format input using 'separator' to mark 000's
input = "" + input;
var output = ""; // initialise output string
for (var i=0; i < input.length; i++) {
if (i != 0 && (input.length - i) % 3 == 0) output += separator;
output += input.charAt(i);
}
return output;
}
function changer(leftId,bgLink,rightId)
{
document.getElementById(bgLink).style.backgroundColor='#51A9E0';
document.getElementById(leftId).src='img/left_oval_blue.gif';
document.getElementById(rightId).src='img/right_oval_blue.gif';
}
function unChanger(leftId,bgLink,rightId)
{
document.getElementById(bgLink).style.backgroundColor='';
document.getElementById(leftId).src='img/trans.gif';
document.getElementById(rightId).src='img/trans.gif';
}
function bgChanger(bgId)
{
document.getElementById(bgId).style.backgroundImage='url(img/bg_pageNo.gif)';
}
function bgUnChanger(bgId)
{
document.getElementById(bgId).style.backgroundImage='url()';
}
function show(id)
{
document.all[id].style.visibility = "visible";
}
function hide(id, id2, id3, id4)
{
document.all[id].style.visibility = "hidden";
document.all[id2].style.visibility = "hidden";
document.all[id3].style.visibility = "hidden";
document.all[id4].style.visibility = "hidden";
}
function conChange(takeId) // change location in worldmap
{
var titleId = document.getElementById('titleId');
var linkId_1 = document.getElementById('fotoGaleri');
var loclink = document.getElementById('icon_' + takeId );
document.getElementById('info').style.visibility = 'hidden';
document.getElementById('titleDiv').style.visibility = 'visible';
document.getElementById('location').style.visibility = 'visible';
titleId.innerHTML = loclink.getAttribute('area');
linkId_1.href = loclink.href;
}
// diving location arrays
var location1 = new Array()
location1[0] = "Lokasyon Seçiniz";
location1[1] = "Sudan";
location1[2] = "G.Afrika";
location1[3] = "Malezya";
var location2 = new Array()
location2[0] = "Lokasyon Seçiniz";
location2[1] = "Türkiye Denizlerinden";
location2[2] = "Güney Kızıldeniz";
var location3 = new Array()
location3[0] = "Lokasyon Seçiniz";
location3[1] = "Malezya Sipadan";
var location4 = new Array()
location4[0] = "Lokasyon Seçiniz";
location4[1] = "Türkiye Denizlerinden";
var location5 = new Array()
location5[0] = "Lokasyon Seçiniz";
location5[1] = "Türkiye";
location5[2] = "Kızıldeniz / Sharm El Sheikh";
location5[3] = "G.Afrika";
location5[4] = "Malezya Sipadan";
location5[5] = "Malezya Lankayan";
location5[6] = "Endonezya Lembeh";
location5[7] = "Wakatobi";
var location6 = new Array()
location6[0] = "Lokasyon Seçiniz";
location6[1] = "Sharks Of S.Africa";
// location link arrays
var loclink1 = new Array()
loclink1[0] = "#";
loclink1[1] = "index.php?a=gallery&galleryId=5";
loclink1[2] = "index.php?a=gallery&galleryId=23";
loclink1[3] = "index.php?a=gallery&galleryId=4";
var loclink2 = new Array()
loclink2[0] = "#";
loclink2[1] = "index.php?a=gallery&galleryId=48";
loclink2[2] = "index.php?a=gallery&galleryId=54";
var loclink3 = new Array()
loclink3[0] = "#";
loclink3[1] = "index.php?a=gallery&galleryId=9";
var loclink4 = new Array()
loclink4[0] = "#";
loclink4[1] = "index.php?a=gallery&galleryId=49";
var loclink5 = new Array()
loclink5[0] = "#";
loclink5[1] = "index.php?a=gallery&galleryId=18";
loclink5[2] = "index.php?a=gallery&galleryId=11";
loclink5[3] = "index.php?a=gallery&galleryId=25";
loclink5[4] = "index.php?a=gallery&galleryId=21";
loclink5[5] = "index.php?a=gallery&galleryId=19";
loclink5[6] = "index.php?a=gallery&galleryId=16";
loclink5[7] = "index.php?a=gallery&galleryId=10";
var loclink6 = new Array()
loclink6[0] = "#";
loclink6[1] = "index.php?a=gallery&galleryId=70";
function showLoc(val) // taking selected diver for change location selectbox's content
{
var divloc = document.getElementById('location'); // get location div
var loclen; // gives length of location arrays
var divContent; // selectbox content
if (val != 0) // if selected a diver
{
switch (parseInt(val)) // put selected diver's diving location array length into loclen variable
{
case 1:
loclen = location1.length;
break;
case 2:
loclen = location2.length;
break;
case 3:
loclen = location3.length;
break;
case 4:
loclen = location4.length;
break;
case 5:
loclen = location5.length;
break;
case 6:
loclen = location6.length;
break;
default:
alert('Hata!');
}
divContent = '';
divloc.innerHTML = divContent;
}
else // back to orginal
{
divloc.innerHTML = '';
}
}
function linker(opval , val)
{
var lokasyon = document.getElementById('loc' + val + '_' + opval);
var loklink = eval('loclink' + val + '[' + opval +']');
var pictLink = document.getElementById('pictLink');
pictLink.href = loklink;
}