function changeImage(o){
if(document.getElementById('imgarea')){
document.getElementById('imgarea').innerHTML = '';
tb_init('a.thickbox, area.thickbox, input.thickbox');
toggleImg("images");
}
}
function toggleImg(type){
document.getElementById('previewimg').style.display = 'block';
}
function showpopup(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function numbersonly(myfield, e, dec) {
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
// control keys
if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
return true;
// numbers
else if ((("0123456789+-.()").indexOf(keychar) > -1))
return true;
// decimal point jump
else if (dec && (keychar == ".")) {
myfield.form.elements[dec].focus();
return false;
} else
return false;
}
$(document).ready(function() {
$("#currency").change(function(){var pto=$(this).val();var pprice=$('#a').val();var pfrom=$('#from').val();var dataString='a='+pprice+'&from='+pfrom+'&to='+pto;$.ajax({type:"POST",url:"currency.asp",data:dataString,cache:false,success:function(html){$("#price").html(html)}})});$( "#currency" ).append("");
var overlayW = $(window).width();
var overlayH = $(window).height();
$('div.overlay').css({width:overlayW, height:overlayH});
/*Overlay Resize*/
$(window).resize(function(){
var overlayW = $(this).width();
var overlayH = $(this).height();
$('div.overlay').css({width:overlayW, height:overlayH});
});
$('.tools_siziarayalim .fancybox').fancybox({
width: 674,
height: 594,
titleShow: false
});
/*de?i?ti
$('#menutop > ul > li').hover(function(){
$(this).addClass('active').siblings().removeClass('active');
$(this).children('div.dropdown').show().parent().siblings().children('div.dropdown').hide();
overlayOpen();
},function(){
$(this).removeClass('active');
$(this).children('div.dropdown').hide();
overlayClose();
});
*/
$('#menutop > ul > li').hover(function(){
$(this).addClass('active').siblings().removeClass('active');
$(this).children('div.mtdrop').show().parent().siblings().children('div.mtdrop').hide();
if( $(this).children('div.mtdrop').length > 0 ){
overlayOpen();
}
},function(){
$(this).removeClass('active');
$(this).children('div.mtdrop').hide();
overlayClose();
});
/*formFileBox*/
$('.formFileBox input').change(function(){
var fileValue = $(this).val();
$(this).next('span').html(fileValue);
});
$('.lngselect').hover(function() {
$(this).addClass('hovered');
$(this).children('.lngdrop').show();
}, function() {
$(this).removeClass('hovered');
$(this).children('.lngdrop').hide();
});
$('#quicktools ul li').hover(function() {
$(this).children('a').addClass('selected').parent().siblings().children('a').removeClass('selected');
$(this).stop().animate({ right : 0 }, 500);
}, function() {
var animeOld = $(this).attr('data-position');
$(this).children('a').removeClass('selected');
$(this).stop().animate({ right : '-' + animeOld }, 500);
});
$("#gmaps_ex").fancybox({
'overlayColor' : '#000',
'overlayOpacity' : 0.8,
'showCloseButton' : true,
'titlePosition' : 'outside',
'Width' : 910,
'Height' : 400,
'scrolling' : false
});
$("#gmaps").fancybox({
'width' : 980,
'height' : 460,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
});
$("#callb").fancybox({
'width' : 420,
'height' : 420,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
});
$("#viewgallery").click(function(){
$(this).lightBox({
imageLoading: 'lightbox/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon
imageBtnPrev: 'lightbox/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image
imageBtnNext: 'lightbox/lightbox-btn-next.gif', // (string) Path and the name of the next button image
imageBtnClose: 'fancybox/fancy_close.png', // (string) Path and the name of the close btn
imageBlank: 'lightbox/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel)
txtImage:'',
txtOf:'/'
},imgList,true);
return false;
});
$("#imglist a").click(function(){
toggleImg("images");
var preview_src = $(this).attr('href');
var fullsize_src = $(this).attr('href');
var fullsize_title = $(this).attr('title');
$("#previewimg").attr('src',preview_src);
$("#viewgallery").attr('href',fullsize_src);
$("#viewgallery").attr('title',fullsize_title);
return false;
});
$('#mload').hide();
$("form#formmail").submit(function(sf) {
sf.preventDefault();
if ($("input#name").val() == "" || $("input#name").val().length < 1 || $("input#name").val().length > 50) { alert("check name entered"); return false}
if ($("input#phone").val() == "" || $("input#phone").val().length < 1 || $("input#phone").val().length < 7 ) { alert("check telephone entered"); return false}
if ($("input#email").val() == "" || $("input#email").val().indexOf("@") < 0 || $("input#email").val().indexOf(".") < 0) { alert("check email entered"); return false}
if ($("input#code").val()== '' || $("input#code").val().length <1 || $("input#code").val() != 0) { alert('please check your secure code.!' ); return false }
$('#mload').fadeToggle("fast");
$.ajax({
type: "POST",
url: $(this).attr('action'),
data: $(this).serialize(),
success: function(ajaxcevap){
$('#sonuc').html(ajaxcevap + '').slideDown('slow');
}
});
});
});
function overlayOpen(){
$('div.overlay').css('display','block');
}
function overlayClose(){
$('div.overlay').css('display','none');
}