var JMainURL = ('https:' == document.location.protocol ? 'https://' : 'http://') + document.domain + '/';

var BasketActiveTotalPrice, BasketActiveProductCount, BasketActiveUnitCount;

function updateActiveBasket(OActiveTotalPrice, OActiveProductCount, OActiveUnitCount) {
		BasketActiveUnitCount = OActiveUnitCount;
		BasketActiveProductCount = OActiveProductCount;
		BasketActiveTotalPrice = OActiveTotalPrice;
	$(document).ready(function(){
	 $("#ActiveUnitCount").html(OActiveUnitCount);
	 $("#ActiveProductCount").html(OActiveProductCount);
	 $("#ActiveTotalPrice").html(OActiveTotalPrice);
	  if ( $("#ShowBasketActiveTotalPrice").html() != "") {
		$("#ShowBasketActiveTotalPrice").html(OActiveTotalPrice);
	 }
	});
}


function CPagePopup() {
	$.fancybox.close();
}

function ShowLoadingPage() {
	$.fancybox.showActivity();
}

function HideLoadingPage() {
	$.fancybox.hideActivity();
	
}


function OpenPageLoader() {

$("#sitealertbox").attr("href", JMainURL+"CheckOutModal.asp");

	$("#sitealertbox").fancybox({
		'title'				: document.title,
		'showCloseButton'	: false,
		'modal'				: true,
		'width'				: 400,
		'height'			: 150,
		'autoScale'			: false,
		'type'				: 'iframe',
		'transitionIn'		: 'fadein',
		'transitionOut'		: 'fadeout',
		centerOnScroll : true
	});
	
	$("#sitealertbox").trigger('click');

}

function OPagePopup(OPopupA, OPopupHref, OPopupWidth, OPopupHeight, OAutoClose) {

	$(document).ready(function(){

		if (jQuery.browser.msie) {
		 OPopupWidth += 20;
		 OPopupHeight += 30;
		}

		$("#" + OPopupA).attr("href", OPopupHref);

		$("#" + OPopupA).fancybox({
			'width'				: OPopupWidth,
			'height'			: OPopupHeight,
			'autoScale'			: true,
			'transitionIn'		: 'fadein',
			'transitionOut'		: 'fadeout',
			'type'				: 'iframe',
			'title'				: document.title,
			centerOnScroll : true
		});

		$("#" + OPopupA).trigger('click');
		
		if (OAutoClose > 0) {
			setTimeout(CPagePopup, OAutoClose);
		}
		

	});

}


function goErrorPage() {

document.location.href = 'SiteError.asp';
}


function refreshpage() {
document.location.reload();
}

function parseLogoutXML(OgetLogoutXML) {
	var LogoutMessage = $(OgetLogoutXML).find("LogoutMessage").text();
	innerAlert(LogoutMessage);
	setTimeout(refreshpage, 2000);
}




function doPageLogout() {
	document.location.href=JMainURL+'UserLoginProcess.asp?action=logout&LogoutFrom=page';
}



function parsePageRegisterXML(OgetRegisterXML) {
	var RegSuccess= $(OgetRegisterXML).find("RegSuccess").text();
	var RegMessage = $(OgetRegisterXML).find("RegMessage").text();
	var RegUserName = $(OgetRegisterXML).find("RegUserName").text();
	var RegValidate = $(OgetRegisterXML).find("RegValidate").text();

	if (RegSuccess == "1") {
			
		goErrorPage();
	} else {
	
		innerAlert(RegMessage);
	
	}
	
}


function doPageRegister() {
	var RegErrorStr = '';
	var RegErrorCount = 0;
	
	if ( $('#userrealname').val().length < 4 ) {
		RegErrorCount++;
		RegErrorStr += '<b>' + RegErrorCount + '</b> - Lütfen Adınızı Soyadınızı veya Ünvanınızı Kontrol Ediniz !<br>';
	}
	
	if ( !isvalidMail(  $('#mail1').val()  ) ) {
		RegErrorCount++;
		RegErrorStr += '<b>' + RegErrorCount + '</b> - Lütfen E-Posta Adresinizi Kontrol Ediniz !<br>';
	}
	if (  $('#mail1').val() != $('#mail2').val()  ) {
		RegErrorCount++;
		RegErrorStr += '<b>' + RegErrorCount + '</b> - E-Posta Adresiniz ve Tekrarı Uyuşmamaktadır !<br>';
	}
	if ( $('#password1').val().length < 6 || $('#password1').val().length > 30) {
		RegErrorCount++;
		RegErrorStr += '<b>' + RegErrorCount + '</b> - Şifreniz En Az 6 En Fazla 30 Karakter Olabilir !<br>';
	}
	if ( $('#password1').val() != $('#password2').val() ) {
		RegErrorCount++;
		RegErrorStr += '<b>' + RegErrorCount + '</b> - Şifreniz ve Şifrenizin Tekrarı Uyuşmamaktadır !<br>';
	}
	
	if ( $('#CaptchaCode').val().length != 5) {
		RegErrorCount++;
		RegErrorStr += '<b>' + RegErrorCount + '</b> - Lütfen Güvenlik Resmini Giriniz !<br>';
	}
	
	if (RegErrorCount > 0) {
		innerAlert(RegErrorStr);
		return false;
	} 

	var RegUserName = $('#userrealname').val();
	var RegUserMail = $('#mail1').val();
	var RegUserPass = $('#password1').val();
	var RegCaptchaCode = $('#CaptchaCode').val();
		
 $.ajax({
    type: 'POST',
    url: JMainURL+'UserRegisterProcess.asp?RegisterFrom=page',
	contentType:'application/x-www-form-urlencoded',
    data: 'RegUserName='+escape(RegUserName)+'&RegUserMail='+escape(RegUserMail)+'&RegUserPass='+escape(RegUserPass)+'&RegCaptchaCode='+escape(RegCaptchaCode),
    dataType: 'xml',
    success: parsePageRegisterXML
  });
}


function parsePageLoginXML(OgetLoginXML) {
	
	var LoginSuccess= $(OgetLoginXML).find("LoginSuccess").text();
	var LoginValidate= $(OgetLoginXML).find("LoginValidate").text();
	var LoginMessage = $(OgetLoginXML).find("LoginMessage").text();
	var LoginUserName = $(OgetLoginXML).find("LoginUserName").text();
	
	if (LoginSuccess == "1") {
		
		if (LoginValidate == "1") {
			goErrorPage();
		} else {
			innerAlert(LoginMessage);
		}
		$('#lmail').val('');
		$('#lpass').val('');
		
	} else {
		innerAlert(LoginMessage);
	}
}


function doPageLogin() {


								
			var LoginErrorStr = '';
			var LoginErrorCount = 0;

			if ( !isvalidMail(  $('#lmail').val()  ) ) {
				LoginErrorCount++;
				LoginErrorStr += '<b>' + LoginErrorCount + '</b> - Lütfen E-Posta Adresinizi Kontrol Ediniz !<br>';
			}

			if ( $('#lpass').val().length < 6 || $('#lpass').val().length > 30) {
				LoginErrorCount++;
				LoginErrorStr += '<b>' + LoginErrorCount + '</b> - Şifreniz En Az 6 En Fazla 30 Karakter Olabilir !<br>';
			}
			
			if (LoginErrorCount > 0) {
				innerAlert(LoginErrorStr);
				return false;
			} 


	var LoginUserMail = $('#lmail').val();
	var LoginUserPass = $('#lpass').val();

 $.ajax({
    type: 'POST',
    url: JMainURL+'UserLoginProcess.asp?action=login&LoginFrom=page',
	contentType:'application/x-www-form-urlencoded',
    data: 'LoginUserMail='+escape(LoginUserMail)+'&LoginUserPass='+escape(LoginUserPass),
    dataType: 'xml',
    success: parsePageLoginXML
  });
  
}


function CheckOutPopup() {
//OPagePopup("popupbox", "CheckOut.asp", 800, 520);
document.location.href = JMainURL + 'CheckOut.asp';
}

function BuyNowPopup(OProductid) {
	OPagePopup("popupbox", JMainURL+"BuyNowPopup.asp?Productid="+OProductid, 850, 280);

}

function AddBasketPopup(OProductid) {
	OPagePopup("popupbox",  JMainURL +"AddBasketPopup.asp?action=add&Productid="+OProductid, 400, 200, 2500);
	
}

function UpdateBasketPopup(OProductid, OAmount) {
	OPagePopup("popupbox", JMainURL+"AddBasketPopup.asp?action=update&ProductAmount="+OAmount+"&Productid="+OProductid, 400, 200, 2500);
}

Number.prototype.formatMoney = function(c, d, t){
var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
   return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
 };


function updateActiveBasketDiv(OProductid, OAmount) {
	if (OAmount == 0) {
		$('#A' + OProductid).val($('#A' + OProductid).attr('text'));
	} else {
		var FPrice = $('#F' + OProductid).text();
		FPrice = FPrice.replace(".","");
		FPrice = parseFloat(FPrice.replace(",", "."));
		$('#A' + OProductid).val(OAmount);
		$('#A' + OProductid).attr('text', OAmount);
		$('#T' + OProductid).html( (FPrice * OAmount).formatMoney(2, ",", "." ) );
		
	}
}


function RemoveBasketPopup(OProductid) {
	OPagePopup("popupbox", JMainURL+"RemoveBasketPopup.asp?Productid="+OProductid, 350, 200, 2500);
	if (BasketActiveUnitCount==1) {
		$("#ShowBasketToUser").html($("#BasketEmptySign").html());
	}
}

function EmptyBasketPopup() {
OPagePopup("popupbox", JMainURL+"RemoveBasketPopup.asp?Action=all", 350, 200, 2500);
$("#ShowBasketToUser").html($("#BasketEmptySign").html());
}

function BrowseProduct(OProductid, OProductName) {
OProductName = escape(OProductName);
document.location.href=JMainURL+"ShowProduct.asp?Productid=" + OProductid + "&ProductName=" + OProductName;
}

function SetPage(OPage) {

document.location.href = OPage;

}



function ReCaptcha(OGetimageid) {
	var objImage = document.images[OGetimageid];
	if (objImage == undefined) {
		return;
	}
	var GetimageTime = new Date();
	objImage.src = JMainURL+'MainFiles/ASPCaptcha.asp?CaptchaName='+OGetimageid+'&newDate=' + GetimageTime.toUTCString();

	
	if  (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
		 var ieversion=new Number(RegExp.$1);
		   if (ieversion<7) {alert('Güvenlik Resminiz Yenilenmiştir. Teşekkürler');}
	}
		
	
}


(function($) {
	$.fn.thumbPopup = function(options)
		{
			settings = jQuery.extend({
			popupId: "thumbPopup",
			popupCSS: {'padding-top':'4px','padding-left':'2px','padding-right':'2px', 'border': '1px solid #808080', 'z-order':'20000', 'z-index': '20000', 'background': '#FFFFFF'},
			cursorTopOffset: 0,
			cursorLeftOffset: 40,
			loadingHtml: "<span style='padding: 40px;'>Lutfen Bekleyiniz ...</span>"
		}, options);
		popup =
		$("<div style='text-align:center' />")
		.css(settings.popupCSS)
		.attr("id", settings.popupId)
		.css("position", "absolute")
		.appendTo("body").hide();
		$(this)
		.hover(setPopup)
		.mousemove(updatePopupPosition)
		.mouseout(hidePopup);
		
		function setPopup(event)
		{
			var fullImgURL = $(this).attr("hoverimg");
			var fullImgHeader = $(this).attr("hovername");
			if (fullImgURL.length < 4) { return false; };
			$(this).data("hovered", true);
			$("<img />")
			.bind("load", {thumbImage: this}, function(event)
			{
				if ($(event.data.thumbImage).data("hovered") == true) {
				
				$(popup).empty().append(this);
				$(popup).append('<p>' + fullImgHeader + '</p>');
					updatePopupPosition(event);
					$(popup).show();
				}
				$(event.data.thumbImage).data("cached", true);
			})
			.attr("src", fullImgURL);
			if ($(this).data("cached") != true) {
				$(popup).append($(settings.loadingHtml));
				$(popup).show();
			}
			
			updatePopupPosition(event);			
		}
		
		function updatePopupPosition(event)
		{
			var windowSize = getWindowSize();
			var popupSize = getPopupSize();
			if (windowSize.width + windowSize.scrollLeft < event.pageX + popupSize.width + settings.cursorLeftOffset){
				$(popup).css("left", event.pageX - popupSize.width - settings.cursorLeftOffset);
			} else {
				$(popup).css("left", event.pageX + settings.cursorLeftOffset);
			}
			if (windowSize.height + windowSize.scrollTop < event.pageY + popupSize.height + settings.cursorTopOffset){
				$(popup).css("top", event.pageY - (popupSize.height/2) - settings.cursorTopOffset);
			} else {
				$(popup).css("top", event.pageY - (popupSize.height/2) - settings.cursorTopOffset);
			}
		}
		
		function hidePopup(event)
		{
			$(this).data("hovered", false);
			$(popup).empty().hide();
		}
		
		function getWindowSize() {
			return {
				scrollLeft: $(window).scrollLeft(),
				scrollTop: $(window).scrollTop(),
				width: $(window).width(),
				height: $(window).height()
			};
		}
		
		function getPopupSize() {
			return {
				width: $(popup).width(),
				height: $(popup).height()
			};
		}
		return this;
	};
})(jQuery);



function innerAlert(xhtmlstr) {
	$("#sitealertbox").fancybox({
		'title'				: document.title,
		'showCloseButton'	: true,
		'width'				: 400,
		'height'			: 250,
		'autoScale'			: false,
		'transitionIn'		: 'fadein',
		'transitionOut'		: 'fadeout',
		'content'			: '<table border=0><tr><td width=110 align=center valign=center><img src="'+JMainURL+'images/innerAlert.gif"></td><td valign=center>' + xhtmlstr + '</td></tr></table>',
		centerOnScroll : true
	});
	
	$("#sitealertbox").trigger('click');
}

function isvalidMail(Smailstr) {
var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
return pattern.test(Smailstr);
}

function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}


function discountswf() {
	iswftxt = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="65" height="65" id="indirimdeswf" align="middle">';
	iswftxt += '<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="' + ThemeUrl + 'Contents/indiscount.swf" />';
	iswftxt += '<param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />';
	iswftxt += '<embed src="' + ThemeUrl + 'Contents/indiscount.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="65" height="65" name="indirimdeswf" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';

return iswftxt;
}






function ReOrderIcons() {

	$(document).ready(function() {


	var discountdivs = $('div.indiscountdiv');
		discountdivs.each(function() {
		
			$(this).html(discountswf());
			var imgsi = $(this).parent().find('img:first');
		var imgsipos = imgsi.position();
		$(this).css({"display":"inline", "position":"absolute", "top": imgsipos.top-15, "left": imgsipos.left-12}); 
		});

	 });

}


$(window).resize(function() {
	ReOrderIcons();

});




/* jQuery Mega Menu v1.02
* Last updated: June 29th, 2009. This notice must stay intact for usage 
* Author: JavaScript Kit at http://www.javascriptkit.com/
* Visit http://www.javascriptkit.com/script/script2/jScale/ for full source code
*/
var jkmegamenu={

effectduration: 300, //duration of animation, in milliseconds
delaytimer: 200, //delay after mouseout before menu should be hidden, in milliseconds

//No need to edit beyond here
megamenulabels: [],
megamenus: [], //array to contain each block menu instances
zIndexVal: 1000, //starting z-index value for drop down menu
$shimobj: null,

addshim:function($){
	$(document.body).append('<IFRAME id="outlineiframeshim" src="'+(location.protocol=="https:"? 'blank.htm' : 'about:blank')+'" style="display:none; left:0; top:0; z-index:999; position:absolute; filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>')
	this.$shimobj=$("#outlineiframeshim")
},

alignmenu:function($, e, megamenu_pos){
	var megamenu=this.megamenus[megamenu_pos]
	var $anchor=megamenu.$anchorobj
	var $menu=megamenu.$menuobj
	var menuleft=($(window).width()-(megamenu.offsetx-$(document).scrollLeft())>megamenu.actualwidth)? megamenu.offsetx : megamenu.offsetx-megamenu.actualwidth+megamenu.anchorwidth //get x coord of menu
	//var menutop=($(window).height()-(megamenu.offsety-$(document).scrollTop()+megamenu.anchorheight)>megamenu.actualheight)? megamenu.offsety+megamenu.anchorheight : megamenu.offsety-megamenu.actualheight
	var menutop=megamenu.offsety+megamenu.anchorheight  //get y coord of menu
	$menu.css({"left":menuleft+"px", "top":menutop+"px"})
	this.$shimobj.css({"width":megamenu.actualwidth+"px", "height":megamenu.actualheight+"px", "left":menuleft+"px", "top":menutop+"px", "display":"block"})
},

showmenu:function(e, megamenu_pos){

	var megamenu=this.megamenus[megamenu_pos]
	var $menu=megamenu.$menuobj
	var $menuinner=megamenu.$menuinner
	if ($menu.css("display")=="none"){
		this.alignmenu(jQuery, e, megamenu_pos)
		//$menu.css("z-index", ++this.zIndexVal)
		$menu.show(this.effectduration, function(){
			$menuinner.css('visibility', 'visible')
		})
	}
	else if ($menu.css("display")=="block" && e.type=="click"){ //if menu is hidden and this is a "click" event (versus "mouseout")
		this.hidemenu(e, megamenu_pos)
	}
	return false
},

hidemenu:function(e, megamenu_pos){
	var megamenu=this.megamenus[megamenu_pos]
	var $menu=megamenu.$menuobj
	var $menuinner=megamenu.$menuinner
	$menuinner.css('visibility', 'hidden')
	this.$shimobj.css({display:"none", left:0, top:0})
	$menu.hide(this.effectduration)
},

definemenu:function(anchorid, menuid, revealtype){
	this.megamenulabels.push([anchorid, menuid, revealtype])
},

render:function($){
	for (var i=0, labels=this.megamenulabels[i]; i<this.megamenulabels.length; i++, labels=this.megamenulabels[i]){
		if ($('#'+labels[0]).length!=1 || $('#'+labels[1]).length!=1) //if one of the two elements are NOT defined, exist
			return
		this.megamenus.push({$anchorobj:$("#"+labels[0]), $menuobj:$("#"+labels[1]), $menuinner:$("#"+labels[1]).children('ul:first-child'), revealtype:labels[2], hidetimer:null})
		var megamenu=this.megamenus[i]	
		megamenu.$anchorobj.add(megamenu.$menuobj).attr("_megamenupos", i+"pos") //remember index of this drop down menu
		megamenu.actualwidth=megamenu.$menuobj.outerWidth()
		megamenu.actualheight=megamenu.$menuobj.outerHeight()
		megamenu.offsetx=megamenu.$anchorobj.offset().left
		megamenu.offsety=megamenu.$anchorobj.offset().top
		megamenu.anchorwidth=megamenu.$anchorobj.outerWidth()
		megamenu.anchorheight=megamenu.$anchorobj.outerHeight()
		$(document.body).append(megamenu.$menuobj) //move drop down menu to end of document
		megamenu.$menuobj.css("z-index", ++this.zIndexVal).hide()
		megamenu.$menuinner.css("visibility", "hidden")
		megamenu.$anchorobj.bind(megamenu.revealtype=="click"? "click" : "mouseenter", function(e){
			var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
			clearTimeout(menuinfo.hidetimer) //cancel hide menu timer
			return jkmegamenu.showmenu(e, parseInt(this.getAttribute("_megamenupos")))
		})
		megamenu.$anchorobj.bind("mouseleave", function(e){
			var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
			if (e.relatedTarget!=menuinfo.$menuobj.get(0) && $(e.relatedTarget).parents("#"+menuinfo.$menuobj.get(0).id).length==0){ //check that mouse hasn't moved into menu object
				menuinfo.hidetimer=setTimeout(function(){ //add delay before hiding menu
					jkmegamenu.hidemenu(e, parseInt(menuinfo.$menuobj.get(0).getAttribute("_megamenupos")))
				}, jkmegamenu.delaytimer)
			}
		})
		megamenu.$menuobj.bind("mouseenter", function(e){
			var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
			clearTimeout(menuinfo.hidetimer) //cancel hide menu timer
		})
		megamenu.$menuobj.bind("mouseleave", function(e){
			var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
			menuinfo.hidetimer=setTimeout(function(){ //add delay before hiding menu
				jkmegamenu.hidemenu(e, parseInt(menuinfo.$menuobj.get(0).getAttribute("_megamenupos")))
			}, jkmegamenu.delaytimer)
		})
	} //end for loop
	if(/Safari/i.test(navigator.userAgent)){ //if Safari
		$(window).bind("resize load", function(){
			for (var i=0; i<jkmegamenu.megamenus.length; i++){
				var megamenu=jkmegamenu.megamenus[i]
				var $anchorisimg=(megamenu.$anchorobj.children().length==1 && megamenu.$anchorobj.children().eq(0).is('img'))? megamenu.$anchorobj.children().eq(0) : null
				if ($anchorisimg){ //if anchor is an image link, get offsets and dimensions of image itself, instead of parent A
					megamenu.offsetx=$anchorisimg.offset().left
					megamenu.offsety=$anchorisimg.offset().top
					megamenu.anchorwidth=$anchorisimg.width()
					megamenu.anchorheight=$anchorisimg.height()
				}
			}
		})
	}
	else{
		$(window).bind("resize", function(){
			for (var i=0; i<jkmegamenu.megamenus.length; i++){
				var megamenu=jkmegamenu.megamenus[i]	
				megamenu.offsetx=megamenu.$anchorobj.offset().left
				megamenu.offsety=megamenu.$anchorobj.offset().top
			}
		})
	}
	jkmegamenu.addshim($)
}

}







$(document).ready(function() {
	jkmegamenu.render($);
	$(function(){
	$("img[hover='yes']").thumbPopup({});
	});

 });



function replaceTR(OSTR) {
GetStr = OSTR;
GetStr = GetStr.replace(/ /g, '_');
GetStr = GetStr.replace(/ğ/g, 'g');
GetStr = GetStr.replace(/ü/g, 'u');
GetStr = GetStr.replace(/Ğ/g, 'G');
GetStr = GetStr.replace(/Ü/g, 'U');

GetStr = GetStr.replace(/İ/g, 'I');
GetStr = GetStr.replace(/ı/g, 'i');
GetStr = GetStr.replace(/ş/g, 's');
GetStr = GetStr.replace(/Ş/g, 'S');

GetStr = GetStr.replace(/Ö/g, 'O');
GetStr = GetStr.replace(/ö/g, 'o');
GetStr = GetStr.replace(/ç/g, 'c');
GetStr = GetStr.replace(/Ç/g, 'C');
return GetStr;
}
	
function replaceUrlTR(OSTR) {
GetStr = OSTR;
GetStr = GetStr.replace('%', 'Yuzde-');
GetStr = GetStr.replace('/', '-');
GetStr = GetStr.replace('\\', '-');
GetStr = GetStr.replace('+', '');
GetStr = GetStr.replace(/ /g, '-');
GetStr = GetStr.replace(/ğ/g, 'g');
GetStr = GetStr.replace(/ü/g, 'u');
GetStr = GetStr.replace(/Ğ/g, 'G');
GetStr = GetStr.replace(/Ü/g, 'U');

GetStr = GetStr.replace(/İ/g, 'I');
GetStr = GetStr.replace(/ı/g, 'i');
GetStr = GetStr.replace(/ş/g, 's');
GetStr = GetStr.replace(/Ş/g, 'S');

GetStr = GetStr.replace(/Ö/g, 'O');
GetStr = GetStr.replace(/ö/g, 'o');
GetStr = GetStr.replace(/ç/g, 'c');
GetStr = GetStr.replace(/Ç/g, 'C');
return GetStr;
}
	
	
function trim(stringToTrim)
{
return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function IsNumeric(sText) {
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++)  { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }



