/////////////////////////////////////////////////////////////////////////////////
// Common Functions //
/////////////////////////////////////////////////////////////////////////////////
{
function CreateAJAXConnector(callback) {
var connector = false;
if (typeof XMLHttpRequest != 'undefined') {
connector = new XMLHttpRequest();
connector.onload = callback;
} else {
try {
connector = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e_depth1) {
try {
connector = new ActiveXObject('Microsoft.XMLHTTP');
} catch (e_depth2) {
connector = false;
}
}
}
return connector;
}
var AJAXConnector = CreateAJAXConnector();
function ExecuteAJAXRequest(url, callback) {
AJAXConnector = CreateAJAXConnector(callback);
AJAXConnector.open('GET', url, true);
AJAXConnector.onreadystatechange = callback;
AJAXConnector.send(null);
}
function errorString(str) {
return ""+str+" ";
}
function successString(str) {
return ""+str+" ";
}
function rowColor(that, sign)
{
that.style.background = (sign == '1') ? '#ECECEC' : '';
}
var focusedElement = null;
function accordionOnDone() {
if (focusedElement != null) {
focusedElement.focus();
focusedElement = null;
}
}
myAccordion = null;
function initDisplayEffects(stretcher,toggler) {
if(!stretcher) stretcher = "div";
if(!toggler)toggler = "td";
var stretchers = $$(stretcher + '.stretcher');
var togglers = $$(toggler + '.display');
myAccordion = new Fx.Accordion(
togglers,
stretchers,
{opacity:true, start:false, alwaysHide:true}
);
}
var activeHelpEffect = null;
function showActiveHelp(helpText, srcElement) {
helper = document.getElementById('helperBox');
helperContainer = document.getElementById('helperBoxContainer');
if (activeHelpEffect == null) {
activeHelpEffect = new fx.Opacity(helperContainer,{duration:400});
}
helper.innerHTML = helpText;
helperContainer.style.left = findPosX(srcElement) + srcElement.offsetWidth + 20 + 'px';
helperContainer.style.display = 'block';
helperContainer.style.top = (findPosY(srcElement) - parseInt(helper.offsetHeight)/2 + 22) + 'px';
activeHelpEffect.clearTimer();
activeHelpEffect.hide();
activeHelpEffect.toggle();
}
function hideActiveHelp() {
activeHelpEffect.toggle();
}
function showPopupInfo(infoText) {
_messageBox(infoText);
}
//flash detection functions and operations
var flashinstalled = 0;
var flashversion = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length)
{
x = navigator.plugins["Shockwave Flash"];
if (x)
{
flashinstalled = 2;
if (x.description)
{
y = x.description;
//flashversion = y.charAt(y.indexOf('.')-1);
flashversion = (y.charAt(y.indexOf('.')-2) + y.charAt(y.indexOf('.')-1)).trim();
}
}
else
flashinstalled = 1;
if (navigator.plugins["Shockwave Flash 2.0"])
{
flashinstalled = 2;
flashversion = 2;
}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
x = navigator.mimeTypes['application/x-shockwave-flash'];
if (x && x.enabledPlugin)
flashinstalled = 2;
else
flashinstalled = 1;
}
else
MSDetect = "true";
var flashEnabled = false;
function flashDetect()
{
if (flashinstalled == 2)
{
if (flashversion >= 8)
flashEnabled = true;
else
flashEnabled = false;
}
else
flashEnabled = false;
}
flashErrorMessage = "
Bu bölümü görebilmek için Adobe Shockwave Flash Player 8.0+ yüklemeniz gerekmektedir. İsterseniz buradan indirebilir ve bu alanı görüntüleyebilirsiniz. ";
}
/////////////////////////////////////////////////////////////////////////////////
// Registration Functions //
/////////////////////////////////////////////////////////////////////////////////
{
var validEmail = false;
function checkEmail(theSender) {
email = theSender.value.replace(/[ \t]/, '');
if (email != '') {
ExecuteAJAXRequest('_rpcWrapper.php?function=validateEmail&email='+escape(email), function() {
if (AJAXConnector.readyState == 4) {
if (AJAXConnector.responseText == 'exists') {
document.getElementById('emailResult').style.display = 'block';
document.getElementById('emailResult').innerHTML = 'Belirttiğiniz E-Posta adresiyle yapılmış bir kayıt zaten mevcut';
document.theForm.submitButton.disabled = true;
if (document.getElementById('newCustomerBox').style.height != '0px') {
document.theForm.email.focus();
} else {
hideActiveHelp();
}
} else if (AJAXConnector.responseText == 'free') {
document.getElementById('emailResult').style.display = 'none';
document.theForm.submitButton.disabled = false;
validEmail = true;
} else {
document.getElementById('emailResult').style.display = 'block';
document.getElementById('emailResult').innerHTML = 'Lütfen geçerli bir E-Posta adresi belirtiniz.';
document.theForm.submitButton.disabled = true;
if (document.getElementById('newCustomerBox').style.height != '0px') {
document.theForm.email.focus();
} else {
hideActiveHelp();
}
}
}
});
} else {
document.getElementById('emailResult').style.display = 'none';
document.theForm.submitButton.disabled = true;
}
}
var theCity = 0;
function loadCities(countryCode,theFormElement) {
if (theFormElement == null) {
theFormElement = document.theForm;
}
theFormElement.country.value = countryCode;
ExecuteAJAXRequest('_rpcWrapper.php?function=listCities&countryCode='+(countryCode), function() {
if (AJAXConnector.readyState == 4) {
eval(AJAXConnector.responseText);
var container = theFormElement.city;
while (container.options.length > 0) {
for (i=0; i < container.options.length; i++) {
container.removeChild(container.options[i]);
}
}
container.options.add(new Option('---', null));
if (Cities.length > 0) {
theIndex = -1;
for (i=0; i < Cities.length; i++) {
container.options.add(new Option(Cities[i][1], Cities[i][0]));
if (theCity == Cities[i][0]) {
theIndex = i;
}
}
if (theIndex >= 0) {
container.selectedIndex = theIndex + 1;
}
}
}
});
}
function toggleRegistrationDetails(theForm, theActiveCombo) {
if (theForm.type.value != theActiveCombo)
{
theForm.type.value = theActiveCombo;
if (theActiveCombo == 1) {
$('newCustomerBox_enterprise').style.display = 'none';
} else {
$('newCustomerBox_enterprise').style.display = 'block';
}
comboEffect.clearTimer();
comboEffect.hide();
comboEffect.toggle();
setTimeout("$('registerEmail').focus()",comboEffect.options.duration);
document.documentElement.scrollTop = 400;
} else if (document.getElementById('newCustomerBox').style.height == '0px') {
comboEffect.hide();
comboEffect.toggle();
}
}
}
/////////////////////////////////////////////////////////////////////////////////
// Ticket Management Functions //
/////////////////////////////////////////////////////////////////////////////////
{
function showNewTicketBox(theForm) {
$('titt').isreq = 1;
comboEffect.toggle();
if (theForm.action.value != 'save' && $('newTicketBox').style.height != '0px') {
setTimeout(
function(){
$("__categoryField").style.display="inline";
$("__titleField").style.display="inline";
$("__contactField").style.display="inline";
$("__suba").style.display="none";
$("__subb").style.display="none";
$("__subc").style.display="none";
$("__subd").style.display="none";
$("__titleField").style.display="inline";
comboEffect.toggle()
}
, comboEffect.options.duration+50);
}
else{
$("__suba").style.display="none";
$("__subb").style.display="none";
$("__subc").style.display="none";
$("__subd").style.display="none";
$("__titleField").style.display="inline";
$("__categoryField").style.display="inline";
$("__contactField").style.display="inline";
}
theForm.action.value = 'save';
theForm.title.value = '';
theForm.description.value = '';
}
function showActivefaqBox( theAddressList, theAddressOffset ) {
theDetails = faqList[theAddressOffset];
comboEffect.toggle();
if (comboEffect.el.style.height != '0px'){
setTimeout (
function() {
$('__title').innerHTML=theDetails[1];
$('__description').innerHTML=theDetails[2];
comboEffect.toggle();
},
comboEffect.options.duration+50
);
}
else{
$('__title').innerHTML=theDetails[1];
$('__description').innerHTML=theDetails[2];
}
}
function showActiveTicketBox(theForm, theAddressList, theAddressOffset) {
theDetails = ticketList[theAddressOffset];
$('titt').isreq = 0;
if ((theForm.action.value != 'update' || theForm.activeTicket.value != theDetails[0]) && $('newTicketBox').style.height != '0px') {
setTimeout(
function(){
$("__titleField").style.display="none";
$("__categoryField").style.display="none";
$("__contactField").style.display="none";
$("__suba").style.display="inline";
$("__subb").style.display="inline";
$("__subc").style.display="inline";
$("__subd").style.display="inline";
$("__titleField").style.display="none";
var chl = $A( $('subTalk').getElementsByTagName('TR') );
chl.each(
function(ob){
ob.parentNode.removeChild( ob );
}
)
var tls = ticketListSubs[theAddressOffset]
for(var i=0;i'+ob[1]+' / '+ob[2]+'
';
$('subTalk').appendChild( _tr );
}
$('__title').innerHTML=theDetails[1];
$('__description').innerHTML=theDetails[2];
$('__date').innerHTML=theDetails[3];
$('__subc').style.display='inline';
theForm.title.value = '';
theForm.description.value = '';
comboEffect.toggle()
}
, comboEffect.options.duration+50);
}
else{
$("__titleField").style.display="none";
$("__categoryField").style.display="none";
$("__contactField").style.display="none";
$("__suba").style.display="inline";
$("__subb").style.display="inline";
$("__subc").style.display="inline";
$("__subd").style.display="inline";
$("__titleField").style.display="none";
var chl = $A( $('subTalk').getElementsByTagName('TR') );
chl.each(
function(ob){
ob.parentNode.removeChild( ob );
}
)
var tls = ticketListSubs[theAddressOffset]
for(var i=0;i'+ob[1]+' / '+ob[2]+'
';
$('subTalk').appendChild( _tr );
}
$('__title').innerHTML=theDetails[1];
$('__description').innerHTML=theDetails[2];
$('__date').innerHTML=theDetails[3];
$('__subc').style.display='inline';
theForm.title.value = '';
theForm.description.value = '';
}
comboEffect.toggle();
theForm.activeTicket.value = theDetails[0];
theForm.action.value = 'update';
/*
theForm.title.value = theDetails[1];
theForm.description.value = theDetails[2];
*/
}
function newTicketValidate(frm){
var _des = $('descriptionq').value.replace(/&/ig, "|||");
var _tit = $('titt').value.replace(/&/ig, "|||");
var _con = $('contactq').value.replace(/&/ig, "|||");
var req= new Ajax.Request(
'_application/_faqSearch.php',
{method: 'post', parameters: 'desc='+encodeURIComponent(_des)+'&title='+encodeURIComponent(_tit)+'&contact='+encodeURIComponent(_con), onComplete:
function(){
if(arguments[0].responseText=='gotcha'){
if(confirm('Sorununuz ile alakalı daha önceden tespit edilmiş çözüm yöntemleri olabilir. \nSorunuzu göndermeden önce bunları incelemek ister misiniz? \nDiledipiniz takdirde, sorunuzu aynı şekilde gönderebilirsiniz.')){
location.href='index.php?m=faq';
}
else{
if( validate(frm) ) frm.submit()
}
}
else{
if( validate(frm) ) frm.submit();
}
}
}
);
return false;
}
}
/////////////////////////////////////////////////////////////////////////////////
// Billing Address Management Functions //
/////////////////////////////////////////////////////////////////////////////////
{
function showNewAddressBox(theForm) {
setTimeout(function(){
theForm.title.value = '';
theForm.fullname.value = '';
theForm.phone.value = '';
theForm.fax.value = '';
theForm.address.value = '';
theForm.taxOffice.value = '';
theForm.taxNumber.value = '';
theForm.country.value = 'TR';
theForm.city.value = '';
},comboEffect.options.duration+50);
comboEffect.toggle();
if (theForm.action.value != 'save' && $('newAddressBox').style.height != '0px') {
setTimeout('comboEffect.toggle()', comboEffect.options.duration+50);
}
theForm.action.value = 'save';
theForm.activeAddress.value = '';
}
function showActiveAddressBox(theForm, theAddressList, theAddressOffset) {
theDetails = theAddressList[theAddressOffset];
comboEffect.toggle();
if (theForm.action.value != 'update' && $('newAddressBox').style.height != '0px') {
setTimeout('comboEffect.toggle()', comboEffect.options.duration+50);
}
theForm.action.value = 'update';
theForm.activeAddress.value = theDetails[0];
setTimeout(function(){
theForm.title.value = theDetails[1];
theForm.fullname.value = theDetails[2];
theForm.phone.value = theDetails[3];
theForm.fax.value = theDetails[4];
theForm.address.value = theDetails[5];
theForm.taxOffice.value = theDetails[6];
theForm.taxNumber.value = theDetails[7];
if (theForm.country.value == theDetails[8]) {
theForm.city.value = theDetails[9];
} else {
theCity = theDetails[9]
loadCities(theDetails[8]);
}
}, comboEffect.options.duration+50);
}
}
/////////////////////////////////////////////////////////////////////////////////
// Product Catalog Functions //
/////////////////////////////////////////////////////////////////////////////////
{
var activeImage = 0;
var greyTimeout;
function showTemplatePreview(e) {
if (e) {
X = parseInt(e.clientX);
Y = parseInt(e.clientY) + parseInt(truebody().scrollTop);
imageElement = e.currentTarget;
imageId = imageElement.getAttribute('imageId');
} else if (event) {
X = event.clientX + truebody().scrollLeft;
Y = event.clientY + truebody().scrollTop;
imageElement = event.srcElement;
imageId = imageElement.getAttribute('imageId');
}
activeImage = imageId;
if (imagePreviewContainer == null) {
var imagePreviewContainer = document.getElementById('imagePreviewContainer');
}
if (imagePreviewContainer.contentWindow.previewImage) {
imagePreviewContainer.style.left = (X + 5) + 'px';
imagePreviewContainer.style.top = (Y -180) + 'px';
imagePreviewContainer.style.display = 'block';
imagePreviewContainer.contentWindow.previewImage(imageId);
document.onmousemove = followmouse;
}
}
function hideTemplatePreview() {
imagePreviewContainer.style.display = 'none';
}
function truebody() {
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
var offsetfrommouse = [5, -180];
var defaultimageheight = 40; // maximum image size.
var defaultimagewidth = 40; // maximum image size.
function followmouse(e) {
var xcoord = offsetfrommouse[0]
var ycoord = offsetfrommouse[1]
var docwidth = document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
var docheight = document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)
if (typeof e != "undefined") {
if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]) {
xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
} else {
xcoord += e.pageX;
}
if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]) {
ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
} else {
ycoord += e.pageY;
}
} else if (typeof window.event != "undefined") {
if (docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0]) {
xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
} else {
xcoord += truebody().scrollLeft+event.clientX
}
if (docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1])) {
ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
} else {
ycoord += truebody().scrollTop + event.clientY;
}
}
if (imagePreviewContainer.contentWindow.activeImage != activeImage) {
imagePreviewContainer.contentWindow.previewImage(activeImage);
}
imagePreviewContainer.style.left=xcoord+"px"
imagePreviewContainer.style.top=ycoord+"px"
}
function addToBasket(itemId,buyIt) {
ExecuteAJAXRequest('_rpcWrapper.php?function=addToBasket&item='+(itemId), function () {
if (AJAXConnector.readyState == 4) {
eval(AJAXConnector.responseText);
if (BasketInfo[0]) {
document.getElementById('basketBox').style.display = 'block';
document.getElementById('basketInfoContainer').innerHTML = BasketInfo[0] + ' ürün ' + BasketInfo[1] + ' YTL';
} else {
document.getElementById('basketBox').style.display = 'none';
document.getElementById('basketInfoContainer').innerHTML = '';
}
if (buyIt) {
location.href = 'https://' + location.hostname + location.pathname + '?m=order';
} else {
showPopupInfo('Ürün sepete eklendi ');
}
}
});
}
function addToBasketMain(itemId,buyIt)
{
ExecuteAJAXRequest('_rpcWrapper.php?function=addToBasket&item='+(itemId), function () {
if (AJAXConnector.readyState == 4) {
eval(AJAXConnector.responseText);
if (buyIt) {
location.href = '?m=order';
} else {
showPopupInfo('Ürün sepete eklendi ');
}
}
});
}
}
/////////////////////////////////////////////////////////////////////////////////
// Basket Item Settings Functions //
/////////////////////////////////////////////////////////////////////////////////
{
var extensionsSupported = new Array('com','net','org','info','biz');
var extensionsAll = new Array('com','net','org','info','biz','com.tr','net.tr','org.tr','nom.tr','gen.tr','name.tr','k12.tr','bel.tr','edu.tr','gov.tr','mil.tr');
function toggleDomainOptionsMenu(recordId) {
selectBox = document.getElementById('domainLocalExtension_'+recordId);
currentExtension = selectBox.options[selectBox.selectedIndex].value;
while (selectBox.hasChildNodes()) {
selectBox.removeChild(selectBox.childNodes[0]);
}
o = document.getElementById('domainLocalType_'+recordId);
option = o.options[o.selectedIndex].value;
if (option == 0) {
document.getElementById('domainCheckerButton_'+recordId).style.visibility = 'hidden';
document.getElementById('hostingPackage_'+recordId).parentNode.parentNode.style.display = 'block';
document.getElementById('hostingPackage_'+recordId).selectedIndex = 0;
theList = extensionsAll;
} else {
document.getElementById('domainCheckerButton_'+recordId).style.visibility = 'visible';
document.getElementById('hostingPackage_'+recordId).selectedIndex = 0;
document.getElementById('hostingPackage_'+recordId).parentNode.parentNode.style.display = 'none';
theList = extensionsSupported;
}
theIndex = 0;
for (i=0; i Lütfen geçerli bir alan adı belirtiniz');
focusedElement = document.getElementById('domainLocal_'+theItem);
setTimeout('accordionOnDone()', 500);
return false;
} else if (document.getElementById('hostingPackage_'+theItem).selectedIndex == 0) {
try {
document.getElementById('itemLine_'+theItem).click();
} catch(e) {
clickevent = document.createEvent("MouseEvents");
clickevent.initEvent("click", true, true);
document.getElementById('itemLine_'+theItem).dispatchEvent(clickevent);
}
if (document.getElementById('hostingPackage_'+theItem).parentNode.parentNode.style.display != 'none') {
document.getElementById('statusLocal_'+theItem).innerHTML = errorString(' Lütfen bir paket seçiniz');
} else {
document.getElementById('statusLocal_'+theItem).innerHTML = errorString(' Lütfen geçerli bir alan adı belirtiniz');
}
focusedElement = document.getElementById('domainLocal_'+theItem);
setTimeout('accordionOnDone()', 500);
return false;
}
break;
case "2":
if (document.getElementById('domainRemote_'+theItem).value == '') {
try {
document.getElementById('itemLine_'+theItem).click();
} catch(e) {
clickevent = document.createEvent("MouseEvents");
clickevent.initEvent("click", true, true);
document.getElementById('itemLine_'+theItem).dispatchEvent(clickevent);
}
document.getElementById('statusRemote_'+theItem).innerHTML = errorString(' Lütfen bir alan adı belirtiniz');
focusedElement = document.getElementById('domainRemote_'+theItem);
setTimeout('accordionOnDone()', 500);
return false;
}
break;
}
}
}
return true;
}
var selectedHostingType = 0;
function resetDomainParameters(containerId) {
selectedHostingType = document.getElementById('hostingPackage_'+containerId).selectedIndex;
document.getElementById('hostingPackage_'+containerId).selectedIndex = 0;
document.getElementById('hostingPackage_'+containerId).parentNode.parentNode.style.display = 'none';
document.getElementById('statusLocal_'+containerId).innerHTML = '';
}
var theDomainContainer = 0;
var theRes = false;
function checkDomain(containerId) {
o = document.getElementById('domainLocalType_'+containerId);
if (o.options[o.selectedIndex].value == 0) {
return;
}
theDomainContainer = containerId;
domain = document.getElementById('domainLocal_'+containerId).value + '.' + document.getElementById('domainLocalExtension_'+containerId).value;
domain = domain.replace(/[^a-zA-Z0-9\-\.]/g, '');
if (domain != '') {
theTopRow = document.getElementById('itemContainer_'+containerId);
thePropStuff = document.getElementById('itemPropertyContainer_'+containerId);
_top = findPosY(theTopRow);
_left = findPosX(theTopRow);
_width = theTopRow.offsetWidth;
_height = 253;
theInfoBox = document.getElementById('statusInfoBox');
theInfoBox.contentWindow.document.body.style.backgroundColor="#DDDDDD";
theInfoBox.style.left = _left + 'px';
theInfoBox.style.top = _top + 10 + 'px';
theInfoBox.style.width = _width + 'px';
theInfoBox.style.height = _height + 'px';
theInfoBox.style.display = 'block';
thePropStuff.style.display = 'block';
thePropStuff.style.left = (_left + _width / 2 - thePropStuff.offsetWidth / 2) + 'px';;
thePropStuff.style.top = (_top + _height / 2 - thePropStuff.offsetHeight / 2) + 'px';
ExecuteAJAXRequest('_rpcWrapper.php?function=checkDomain&domain='+escape(domain), function() {
if (AJAXConnector.readyState == 4) {
if (AJAXConnector.responseText == 'exists') {
document.getElementById('statusLocal_'+theDomainContainer).innerHTML = errorString(' Alan adı zaten mevcut');
document.getElementById('hostingPackage_'+theDomainContainer).parentNode.parentNode.style.display = 'none';
theRes = false;
} else if (AJAXConnector.responseText == 'invalid') {
document.getElementById('statusLocal_'+theDomainContainer).innerHTML = errorString(' Alan adı hatalı girilmiş');
document.getElementById('hostingPackage_'+theDomainContainer).selectedIndex = 0;
document.getElementById('hostingPackage_'+theDomainContainer).parentNode.parentNode.style.display = 'none';
theRes = false;
} else if (AJAXConnector.responseText == 'available') {
document.getElementById('statusLocal_'+theDomainContainer).innerHTML = successString('Alan adı müsait');
document.getElementById('hostingPackage_'+theDomainContainer).parentNode.parentNode.style.display = 'block';
if (document.getElementById('hostingPackage_'+theDomainContainer).selectedIndex < 1) {
document.getElementById('hostingPackage_'+theDomainContainer).selectedIndex = 1;
}
document.getElementById('domainLocal_'+containerId).fsck = 0;
theRes = true;
}
theInfoBox.style.display = 'none';
thePropStuff.style.display = 'none';
return theRes;
}
});
}
}
function removeItem(theItem, theSender) {
ExecuteAJAXRequest('_rpcWrapper.php?function=removeFromBasket&item='+(theItem), function () {
if (AJAXConnector.readyState == 4) {
eval(AJAXConnector.responseText);
if (BasketInfo[0]) {
document.getElementById('basketBox').style.display = 'block';
document.getElementById('basketInfoContainer').innerHTML = BasketInfo[0] + ' ürün ' + BasketInfo[1] + ' YTL';
} else {
document.getElementById('basketBox').style.display = 'none';
document.getElementById('basketInfoContainer').innerHTML = '';
}
theSender.parentNode.parentNode.parentNode.removeChild(theSender.parentNode.parentNode.nextSibling);
theSender.parentNode.parentNode.parentNode.removeChild(theSender.parentNode.parentNode);
theRows = document.getElementsByClassName('itemContainers');
for (i=0; i 1 && prevInput == theObject) {
document.getElementById('ccno'+(activeIndex-1)).focus();
document.getElementById('ccno'+(activeIndex-1)).select();
}
for (CCNumber='', sumLength=0, totalMaxLength=0, i=1; i <= 4; ++i) {
totalMaxLength += document.getElementById('ccno'+i).maxLength;
sumLength += document.getElementById('ccno'+i).value.length;
CCNumber += document.getElementById('ccno'+i).value;
}
if (sumLength == totalMaxLength) {
document.getElementById('installmentPrefetchInfoBox').style.display = 'block';
ExecuteAJAXRequest('_rpcWrapper.php?function=fetchInstallmentSettings&CCNumber='+escape(CCNumber), function() {
if (AJAXConnector.readyState == 4) {
eval(AJAXConnector.responseText);
if (InstallmentList.length > 0) {
if (prevCard != CardTitle) {
document.getElementById('installmentDataBox').style.display = 'block';
document.getElementById('cardTitle').innerHTML = CardTitle;
dataMainTable = document.getElementById('installmentDataTable');
for (i = dataMainTable.childNodes.length-1; i >= 0; --i) {
if (dataMainTable.childNodes[i].nodeName == 'TBODY') {
dataTable = dataMainTable.childNodes[i];
break;
}
}
if (dataTable.childNodes.length > 2) {
for (i = dataTable.childNodes.length-1; i >= 0; --i) {
dataTable.removeChild(dataTable.childNodes[i]);
}
}
for (i = 0; i < InstallmentList.length; ++i) {
tr = document.createElement('TR');
tr.style.backgroundColor = i % 2 ? '#ececec' : '#ffffff';
dataTable.appendChild(tr);
if (document.all) {
radio = document.createElement(' ');
radio.setAttribute('name', 'installment');
radio.name = 'installment';
} else {
radio = document.createElement('INPUT');
radio.setAttribute('name', 'installment');
radio.setAttribute('type', 'radio');
}
radio.value = InstallmentList[i][0];
text = document.createTextNode(' ' + InstallmentList[i][0] + ' Taksit');
monthly = (orderTotal/InstallmentList[i][0])*(1.0+InstallmentList[i][1]/100.0)
td = document.createElement('TD');
td.appendChild(radio);
td.appendChild(text);
tr.appendChild(td);
td = document.createElement('TD');
text = document.createTextNode(monthly.toFixed(2) + ' YTL');
td.appendChild(text);
tr.appendChild(td);
total = ((orderTotal)*(1.0+InstallmentList[i][1]/100.0))
td = document.createElement('TD');
text = document.createTextNode(total.toFixed(2) + ' YTL');
td.appendChild(text);
tr.appendChild(td);
}
document.getElementById('ccHolder').style.height = document.getElementById('ccHolder').scrollHeight + 'px';
prevCard = CardTitle;
}
} else {
prevCard = null;
document.getElementById('installmentDataBox').style.display = 'none';
}
document.getElementById('installmentPrefetchInfoBox').style.display = 'none';
}
});
}
return true;
}
function validateOrderSettings(theForm) {
if (theForm.paymentType[1].checked) {
for (i=1; i<=4; ++i) {
theBox = document.getElementById('ccno'+i);
if (theBox.value.match(/[^0-9]/g) || theBox.value.length != theBox.maxLength) {
alert('Lütfen kredi kartınızın numarasını kontrol ediniz');
theBox.focus();
return false;
}
}
if (theForm.ccholder.value.replace(/[ \t\n\r]/g, '') == '') {
alert('Lütfen kredi kartınızın üzerinde yazan kart sahibi bilgisini belirtiniz.');
theForm.ccholder.focus();
return false;
} else if (theForm.ccccv.value.match(/[^0-9X]/g) || theForm.ccccv.value.length <= 2) {
alert('Lütfen kredi kartınızın güvenlik numarasını kontrol ediniz.');
theForm.ccccv.focus();
return false;
} else if (theForm.ccexpmon.value.replace(/[^0-9]/g, '').length != 2) {
alert('Lütfen kredi kartınızın son kullanma tarihi için ay seçiniz.');
theForm.ccexpmon.focus();
return false;
} else if (theForm.ccexpyear.value.replace(/[^0-9]/g, '').length != 2) {
alert('Lütfen kredi kartınızın son kullanma tarihi için yıl seçiniz.');
theForm.ccexpyear.focus();
return false;
}
} else if (theForm.paymentType[0].checked) {
found = false;
for (i=0; i 0 && prevInput == theObject) {
$('keynode'+(activeIndex-1)).focus();
$('keynode'+(activeIndex-1)).select();
}
for (serial='', sumLength=0, totalMaxLength=0, i=0; i <= 3; ++i) {
totalMaxLength += $('keynode'+i).maxLength;
sumLength += $('keynode'+i).value.length;
serial += $('keynode'+i).value;
serial += (i < 3)? "-" : "";
}
if(sumLength == totalMaxLength)
{
ExecuteAJAXRequest('_rpcWrapper.php?function=checkSerial&serial='+(serial), function () {
if (AJAXConnector.readyState == 4)
{
if(trim(AJAXConnector.responseText) == "invalid")
{
$("serialResult").innerHTML = "Lütfen geçerli bir seri numarası giriniz!";
$("serialResult").style.display = "block";
$('keynode3').focus();
document.theForm.submitButton.disabled = true;
}
else
{
$("serialResult").innerHTML = "";
$("serialResult").style.display = "none";
if(validEmail)
document.theForm.submitButton.disabled = false;
}
}
});
}
}
function checkLicenseDomain(containerId) {
o = document.getElementById('domainLocalType_'+containerId);
if (o.options[o.selectedIndex].value == 0) {
return;
}
theDomainContainer = containerId;
domain = document.getElementById('domainLocal_'+containerId).value + '.' + document.getElementById('domainLocalExtension_'+containerId).value;
domain = domain.replace(/[^a-zA-Z0-9\-\.]/g, '');
if (domain != '') {
theTopRow = document.getElementById('itemContainer_'+containerId);
thePropStuff = document.getElementById('itemPropertyContainer_'+containerId);
_top = findPosY(theTopRow);
_left = findPosX(theTopRow);
_width = theTopRow.offsetWidth;
_height = 253;
theInfoBox = document.getElementById('statusInfoBox');
theInfoBox.contentWindow.document.body.style.backgroundColor="#DDDDDD";
theInfoBox.style.left = _left + 'px';
theInfoBox.style.top = _top + 10 + 'px';
theInfoBox.style.width = _width + 'px';
theInfoBox.style.height = _height + 'px';
theInfoBox.style.display = 'block';
thePropStuff.style.display = 'block';
thePropStuff.style.left = (_left + _width / 2 - thePropStuff.offsetWidth / 2) + 'px';;
thePropStuff.style.top = (_top + _height / 2 - thePropStuff.offsetHeight / 2) + 'px';
ExecuteAJAXRequest('_rpcWrapper.php?function=checkDomain&domain='+escape(domain), function() {
if (AJAXConnector.readyState == 4) {
if (AJAXConnector.responseText == 'exists') {
document.getElementById('statusLocal_'+theDomainContainer).innerHTML = errorString(' Alan adı zaten mevcut');
document.getElementById('hostingPackage_'+theDomainContainer).parentNode.parentNode.style.display = 'none';
theRes = false;
} else if (AJAXConnector.responseText == 'invalid') {
document.getElementById('statusLocal_'+theDomainContainer).innerHTML = errorString(' Alan adı hatalı girilmiş');
/*document.getElementById('hostingPackage_'+theDomainContainer).selectedIndex = 0;
document.getElementById('hostingPackage_'+theDomainContainer).parentNode.parentNode.style.display = 'none';*/
theRes = false;
} else if (AJAXConnector.responseText == 'available') {
document.getElementById('statusLocal_'+theDomainContainer).innerHTML = successString('Alan adı müsait');
/*
document.getElementById('hostingPackage_'+theDomainContainer).parentNode.parentNode.style.display = 'block';
if (document.getElementById('hostingPackage_'+theDomainContainer).selectedIndex < 1) {
document.getElementById('hostingPackage_'+theDomainContainer).selectedIndex = 1;
}
*/
document.getElementById('domainLocal_'+containerId).fsck = 0;
theRes = true;
}
theInfoBox.style.display = 'none';
thePropStuff.style.display = 'none';
return theRes;
}
});
}
}
function validateLicenseItemSettings(listedItemIDs) {
for (ndx=0; ndx < listedItemIDs.length; ndx++) {
theItem = listedItemIDs[ ndx ];
if(document.getElementById('hostingType_'+theItem))
{
switch (document.getElementById('hostingType_'+theItem).options[document.getElementById('hostingType_'+theItem).selectedIndex].value) {
case "1":
if (document.getElementById('domainLocalType_'+theItem).options[document.getElementById('domainLocalType_'+theItem).selectedIndex].value == '1' && trim(document.getElementById('domainLocal_'+theItem).value) != '' && document.getElementById('domainLocal_'+theItem).fsck == 1) {
if (!checkLicenseDomain(theItem)) {
try {
document.getElementById('itemLine_'+theItem).click();
} catch(e) {
clickevent = document.createEvent("MouseEvents");
clickevent.initEvent("click", true, true);
document.getElementById('itemLine_'+theItem).dispatchEvent(clickevent);
}
return false;
}
}
if (document.getElementById('domainLocal_'+theItem).value == '') {
try {
document.getElementById('itemLine_'+theItem).click();
} catch(e) {
clickevent = document.createEvent("MouseEvents");
clickevent.initEvent("click", true, true);
document.getElementById('itemLine_'+theItem).dispatchEvent(clickevent);
}
document.getElementById('statusLocal_'+theItem).innerHTML = errorString(' Lütfen geçerli bir alan adı belirtiniz');
focusedElement = document.getElementById('domainLocal_'+theItem);
setTimeout('accordionOnDone()', 500);
return false;
} /*else if (document.getElementById('hostingPackage_'+theItem).selectedIndex == 0) {
try {
document.getElementById('itemLine_'+theItem).click();
} catch(e) {
clickevent = document.createEvent("MouseEvents");
clickevent.initEvent("click", true, true);
document.getElementById('itemLine_'+theItem).dispatchEvent(clickevent);
}
if (document.getElementById('hostingPackage_'+theItem).parentNode.parentNode.style.display != 'none') {
document.getElementById('statusLocal_'+theItem).innerHTML = errorString(' Lütfen bir paket seçiniz');
} else {
document.getElementById('statusLocal_'+theItem).innerHTML = errorString(' Lütfen geçerli bir alan adı belirtiniz');
}
focusedElement = document.getElementById('domainLocal_'+theItem);
setTimeout('accordionOnDone()', 500);
return false;
}*/
break;
case "2":
if (document.getElementById('domainRemote_'+theItem).value == '') {
try {
document.getElementById('itemLine_'+theItem).click();
} catch(e) {
clickevent = document.createEvent("MouseEvents");
clickevent.initEvent("click", true, true);
document.getElementById('itemLine_'+theItem).dispatchEvent(clickevent);
}
document.getElementById('statusRemote_'+theItem).innerHTML = errorString(' Lütfen bir alan adı belirtiniz');
focusedElement = document.getElementById('domainRemote_'+theItem);
setTimeout('accordionOnDone()', 500);
return false;
}
break;
}
}
}
return true;
}
}