  function wdwOpen(id) {
    window.open('/products-popup.asp?lng=' + lng + '&id=' + id ,'product' + id, 'left='+((screen.width/2)-(650/2))+',top='+ ((screen.height/2)-(500/2)) +',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=300')

  }
  
  function depremHaritasi() {
		window.open('/depremharitasi.htm' ,'depremharitasi', 'left='+((screen.width/2)-(650/2))+',top='+ ((screen.height/2)-(500/2)) +',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=300')
  }

  function openPicture(id) {
    window.open(id, '', 'left='+((screen.width/2)-(650/2))+',top='+ ((screen.height/2)-(500/2)) +',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=300')

  }

  function showNews(id) {
    window.open('/news-details.asp?lng=' + lng + '&id=' + id ,'news' + id, 'left='+((screen.width/2)-(650/2))+',top='+ ((screen.height/2)-(500/2)) +',width=650,height=400')

  }


  function SubmitSelected(fp,errMsg,action,confirmalert,SubmitValue) {
    var ab
    ab = 0;

    for(i=0;i< fp.length;i++) {
    e=fp.elements[i];
     if (e.type=='checkbox' && e.checked) {
       ab = 1	
     }
   }

   if (ab == 0) {
     alert(errMsg)
   } else {
     if (confirm(confirmalert)) {
       fp.action = action;
	   if (SubmitValue != '') {
         fp.Submit.value = SubmitValue;
	   }
       fp.submit();
     }
   }
  }

function SubmitQuestion(fp,errMsg) {
	var obj = fp.Vote;
	var isChecked = false;
	for(var i=0;i<obj.length;i++){
		if(obj[i].checked){
			isChecked = true;
			break;
		}
	}
	if (!isChecked){
		alert(errMsg);
		return false;
     } else {
    window.open('' ,'questionnairies','left='+((screen.width/2)-(650/2))+',top='+ ((screen.height/2)-(500/2)) +',width=350,height=300')
    fp.target = 'questionnairies'
    fp.submit();
  }
}

function isEMail(strEMail) {

  if (strEMail.indexOf(" ") != -1) {
    return false;
  } else if (strEMail.indexOf("@") == -1) {
    return false;
  } else if (strEMail.indexOf("@") == 0) {
    return false;
  } else if (strEMail.indexOf("@") == (strEMail.length-1)) {
    return false;
  } 
  var retSize = customSplit(strEMail, "@", "arrayString");
  if (arrayString[1].indexOf(".") == -1) {
    return false;
  } else if (arrayString[1].indexOf(".") == 0) {
    return false;
  } else if (arrayString[1].charAt(arrayString[1].length-1) == ".") {
    return false;
  }
  return true;
}

function customSplit(strvalue, separator, arrayName) {
  var n = 0;

  if (separator.length != 0) {
    while (strvalue.indexOf(separator) != -1) {
      eval("arr"+n+" = strvalue.substring(0, strvalue.indexOf(separator));");
      strvalue = strvalue.substring(strvalue.indexOf(separator)+separator.length,
          strvalue.length+1);
      n++;
    }
    eval("arr" + n + " = strvalue;");
    arraySize = n+1;
  }
  else {
    for (var x = 0; x < strvalue.length; x++) {
      eval("arr"+n+" = \"" + strvalue.substring(x, x+1) + "\";");
      n++;
    }
    arraySize = n;
  }

  eval(arrayName + " = new makeArray(arraySize);");

  for (var i = 0; i < arraySize; i++)
    eval(arrayName + "[" + i + "] = arr" + i + ";");

  return arraySize;
}

function makeArray(IntarrSize) {

  for (var n = 0; n < IntarrSize; n++)
    this[n] = "";

  return this;

}

