﻿// JavaScript Document

        function putbanner() {
            document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"748\" height=\"300\"><param name=\"movie\" value=\"../28021120.swf\" /><param name=\"quality\" value=\"high\" /> <param name=\"wmode\" value=\"opaque\" /> <param name=\"swfversion\" value=\"8.0.35.0\" /><param name=\"expressinstall\" value=\"Scripts/expressInstall.swf\" /><object type=\"application/x-shockwave-flash\" data=\"../28021120.swf\" width=\"748\" height=\"300\"><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"opaque\" /><param name=\"swfversion\" value=\"8.0.35.0\" /><param name=\"expressinstall\" value=\"Scripts/expressInstall.swf\" /></object></object>');
        }

function putMorveOtesi(){
	//document.write('<script type=\"text/javascript\">AC_FL_RunContent( \"codebase\",\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\",\"width\",\"240\",\"height\",\"300\",\"src\",\"flash/morveotesi\",\"quality\",\"high\",\"pluginspage\",\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\",\"movie\",\"flash/31121110HP\" );</script><noscript><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"240\" height=\"300\"><param name=\"movie\" value=\"flash/31121110HP.swf\" /><param name=\"quality\" value=\"high\" /><embed src=\"flash/31121110HP.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"240\" height=\"300\"></embed></object></noscript>');
document.write('<div id=\"divMorveOtesiSwf\"  style=\"float:right;\" ></div><script type=\"text/javascript\">var fo = new FlashObject(\"flash/31121110HP.swf\",\"center_menu\",\"240\",\"300\",\"6\",\"#000000\");fo.addParam(\"menu\",\"false\");fo.addParam(\"quality\",\"best\");fo.addParam(\"salign\",\"LT\");fo.addParam(\"scale\",\"noscale\");fo.addParam(\"wmode\", \"transparent\");fo.write(\"divMorveOtesiSwf\");</script>');

}



function thumbMenu(){
  //  document.write('<script type=\"text/javascript\">AC_FL_RunContent(\"codebase\",\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\",\"width\",\"800\",\"height\",\"88\",\"src\",\"flash/menuflashv.1.0.3\",\"quality\",\"high\",\"pluginspage\",\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\",\"movie\",\"flash/menuflashv.1.0.4\" );</script><noscript><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"800\" height=\"88\"><param name=\"movie\" value=\"flash/menuflashv.1.0.4.swf\" /><param name=\"quality\" value=\"high\" /><embed src=\"flash/menuflashv.1.0.4.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"800\" height=\"88\"></embed></object></noscript>');
    document.write('<div id=\"divMenuFlashSwf\" ></div><script type=\"text/javascript\">var fo = new FlashObject(\"../flash/menuflashv.1.0.4.swf\",\"center_menu\",\"800\",\"80\",\"6\",\"#000000\");fo.addParam(\"menu\",\"false\");fo.addParam(\"quality\",\"best\");fo.addParam(\"salign\",\"LT\");fo.addParam(\"scale\",\"noscale\");fo.addParam(\"wmode\", \"transparent\");fo.write(\"divMenuFlashSwf\");</script>	');
}

 function putAnimation(content){
	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"565\" height=\"185\"><param name=\"movie\" value=\"flash/'+content+'.swf\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"flash/'+content+'.swf\" width=\"565\" height=\"185\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');
}

 
 
//function productImage(imagePath, itemCase, pid, ITitle) {
// //alert(imagePath); 
////    document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"70\" height=\"70\"><param name=\"movie\" value=\"../flash/productImage.swf?productImage=' + imagePath + '&bgColor=' + itemCase + '&pid=' + pid + '&productTitle=' + ITitle + '\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"../flash/productImage.swf?productImage=' + imagePath + '&bgColor=' + itemCase + '&pid=' + pid + '&productTitle=' + ITitle + '\" width=\"70\" height=\"70\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');
//    productImageKalip(imagePath, itemCase, pid, ITitle);
//  }

//function productImageKalip(imagePath, itemCase, pid, ITitle) {
//    //alert(imagePath);
//    document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"70\" height=\"70\"><param name=\"movie\" value=\"../flash/productImagekalip.swf?productImage=' + imagePath + '&bgColor=' + itemCase + '&pid=' + pid + '&productTitle=' + ITitle + '\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"../flash/productImagekalip.swf?productImage=' + imagePath + '&bgColor=' + itemCase + '&pid=' + pid + '&productTitle=' + ITitle + '\" width=\"70\" height=\"70\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');
//}



function smallProductImage(imagePath, itemCase, pid, ITitle) {
    //alert(imagePath);
    document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"70\" height=\"70\"><param name=\"movie\" value=\"/flash/product.swf?productImage=' + imagePath + '&bgColor=' + itemCase + '&pid=' + pid + '&productTitle=' + ITitle + '\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"/flash/product.swf?productImage=' + imagePath + '&bgColor=' + itemCase + '&pid=' + pid + '&productTitle=' + ITitle + '\" width=\"70\" height=\"70\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');
}

 function middleproductImage(imagePath,itemCase,pid,newImage, camImage,ITitle){ 
 
 
 if (camImage.toString().toLowerCase() =="true")
 camImage="1"; 
 else  if (camImage.toString().toLowerCase() =="false")
 camImage="0";

var strCamImage,strNewImage;
   
    if(camImage>0)// kampanyalı ürün ise camImage=="1"
        strCamImage="images/indirim.gif";   
        
    
 
    if(newImage=="2")// yeni ürün ise
        strNewImage="images/yeni.gif";
   
   
   if(newImage!="2" && camImage=="1") //yeni ürün değilse ve kampanyalı ise yeni ürün resminin yerinde indirim resmi gelir. 
   {
        strNewImage="images/indirim.gif";
        strCamImage="";
   }



   //	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"150\" height=\"150\"><param name=\"movie\" value=\"../flash/middleproductImage.swf?productImage='+imagePath+'&bgColor='+itemCase+'&pid='+pid+'&NewImage='+strNewImage+'&CamImage='+strCamImage+'\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"../flash/middleproductImage.swf?productImage='+imagePath+'&bgColor='+itemCase+'&pid='+pid+'&NewImage='+strNewImage+'&CamImage='+strCamImage+'\" width=\"150\" height=\"150\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');
   document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"150\" height=\"150\"><param name=\"movie\" value=\"../flash/middleproductImage.swf?productImage=' + imagePath + '&bgColor=' + itemCase + '&pid=' + pid + '&NewImage=' + strNewImage + '&CamImage=' + strCamImage + '&productTitle='+ITitle + '&\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"../flash/middleproductImage.swf?productImage=' + imagePath + '&bgColor=' + itemCase + '&pid=' + pid + '&NewImage=' + strNewImage + '&CamImage=' + strCamImage + '&productTitle='+ITitle +'\" width=\"150\" height=\"150\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');

}
 
 function topcontentint(){
	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"1000\" height=\"95\"><param name=\"movie\" value=\"../flash/topcontentintv1.2.swf\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"../flash/topcontentintv1.2.swf\" width=\"1000\" height=\"95\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');
}

 function topcontent(){
     document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"1000\" height=\"95\"><param name=\"movie\" value=\"../flash/topcontentv1.2.swf\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"../flash/topcontentv1.2.swf\" width=\"1000\" height=\"95\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');
}


 function productImageBig(imagePath){
 //alert(imagePath);
	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"200\" height=\"200\"><param name=\"movie\" value=\"../flash/bigproductImage.swf?productImage='+imagePath+'&bgColor=0\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"../flash/bigproductImage.swf?productImage='+imagePath+'&bgColor=1\" width=\"200\" height=\"200\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');
}

 
 function drag(){
//	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"850\" height=\"450\"><param name=\"movie\" value=\"flash/drag14121010.swf\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"flash/drag14121010.swf\" width=\"850\" height=\"450\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');


	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"850\" height=\"450\"><param name=\"movie\" value=\"drag14121010.swf\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"drag14121010.swf\" width=\"850\" height=\"450\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');
}

function LoadPictureForm(iid,l2,br, code, imgSource, www)
{ 
   window.open("/PictureAdd.aspx?I_ID="+iid+"&L2="+l2+"&br="+br+"&code="+code+"&img="+imgSource+"&www="+www,"",'height=500, width=500, scrollbars=no,resizable=no, left = 200, top = 200');
}

function windowopen(id)
{	 
	window.location ="/productdetails.aspx?I_ID="+id;
}

 

function openCID(id)
{	 
	if (id != 51)
	  window.open('PosCID.aspx?CID='+id,'cid','dialogHeight:760px; dialogWidth:1000px;');//,'dialogHeight:760px, dialogWidth:1000px, scroll:no,resizable:no, dialogLeft:0,dialogTop:0')  
//        window.open('PosCID.aspx?CID='+id,'cid','height=760, width=1000, scrollbars=no,resizable=no, left=0,top=0')  
}	

function openCustomerService(CID,TID, IID)
{    
     window.open('customerservice.aspx?CID='+CID+'&TID='+TID+'&IID='+IID,'TId','dialogHeight:600px; dialogWidth:600px;');//,'dialogHeight:760px, dialogWidth:1000px, scroll:no,resizable:no, dialogLeft:0,dialogTop:0')  
}		

//function productImage(imagePath,itemCase,pid){
//	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"70\" height=\"70\"><param name=\"movie\" value=\"flash/productImage.swf?productImage='+imagePath+'&bgColor='+itemCase+'&pid='+pid+'\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"flash/productImage.swf?productImage='+imagePath+'&bgColor='+itemCase+'&pid='+pid+'\" width=\"70\" height=\"70\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\"></embed></object>');
//}

 


function closeModalRefreshPage()
{
// alert('closeModal');
  window.location =window.location;
}
function closeModalResponsePage(pdURL)
{
   
    
  window.location =pdURL;
}

function closeModalResfreshSelfPage(pdURL)
{//iframe den main formu refreshlemek için
    //   alert( window.parent.location);

  window.parent.location =pdURL;
}


function closeModalResfresh2SelfPage(pdURL)
{//içiçe 2 iframe  den main formu refreshlemek için
  
 
 var objprnt= window.parent;// 3d sayfasını bulur
 
 objprnt.parent.location  =pdURL; // main formu bulur
}

function EtiketLocation() 
{  
  //  window.location=window.location;
 
 // var formElement0 = document.getElementById("ctl00_ContentPlaceHolder1_rdnEtiketTip_0");
  var formElement1 = document.getElementById("ctl00_ContentPlaceHolder1_rdnEtiketTip_1");
  
  var etiketLink=document.getElementById("ctl00_ContentPlaceHolder1_hiddenEtiket").value;
  
  if(formElement1.checked)
        window.open("/"+etiketLink.replace(".aspx","_2.aspx"),"etiket");
  else
      window.open("/" + etiketLink, "etiket");
  
}



function pressEnter(e, objID) {

    if (e.keyCode == 13) //enter
    {
        //         alert(objID);
        //            alert($get(objID));
        var objClck = window.document.aspnetForm.document.getElementById(objID); //$get(objID);

        //            alert(objClck);

        objClck.click();
        //              window.document.aspnetForm.document.getElementById(objID).click(); 
    }
}
   
   
   
 function LoadCatalogForm()
{ 
   window.open("catalog.aspx?",'catalog','height=620, width=800, scrollbars=no,resizable=no, left = 200, top = 200');
}

 

 


function checkdate(sender, args) {
    var selectedDate = new Date(sender._selectedDate);
    var today = new Date();

    today.setHours(0, 0, 0, 0);


    if (selectedDate < today) //geçmiş tarih seçilemesin
    {
        sender._selectedDate = new Date();
        document.getElementById("ctl00_txtDate").value = sender._selectedDate.format(sender._format);
        sender.show();
    }
    else if ((!(selectedDate > today)) && (new Date()).getHours() >= 19) // aynı gün içinde 19dan sonra ise ertesi gün seçilebilsin
    {

        var myDate = new Date();
        myDate.setDate(myDate.getDate() + 1);

        sender._selectedDate = myDate;

        document.getElementById("ctl00_txtDate").value = sender._selectedDate.format(sender._format);
        sender.show();

    }
} 
    


//if(document.createElement) 
//{
//    window.onload = initMenu; 
    
   //window.onload a 1 kere girdiğinden, üye sayfasındaki şahıs-şirket tekionload u buraya koydum  
//    window.onload = function()
window.onload=start;

function start()
    {


     //reklam.js 
    try { reklamEkle();  } catch (err) { }


//        alert(window.document.getElementsByTagName('input').item('ctl00_ContentPlaceHolder1_User1_txtGsm'));
        
         if(document.getElementById('ctl00_ContentPlaceHolder1_User1_txtHome')!=null)        FormatPhoneNumber(document.getElementById('ctl00_ContentPlaceHolder1_User1_txtHome'));
         if (document.getElementById('ctl00_ContentPlaceHolder1_User1_txtGSM') != null) FormatPhoneNumber(document.getElementById('ctl00_ContentPlaceHolder1_User1_txtGSM'));
   
         if(document.getElementById('ctl00_ContentPlaceHolder1_User1_txtTaxNo')!=null)           FormatTaxNumber(document.getElementById('ctl00_ContentPlaceHolder1_User1_txtTaxNo'));
         if(document.getElementById('ctl00_ContentPlaceHolder1_User1_txtTcKimlikNo')!=null)    FormatTcNumber(document.getElementById('ctl00_ContentPlaceHolder1_User1_txtTcKimlikNo'));      
         if(document.getElementById('ctl00_ContentPlaceHolder1_User1_txtKartNo')!=null)          FormatCardNumber(document.getElementById('ctl00_ContentPlaceHolder1_User1_txtKartNo'));
  
    

      if(document.getElementById('ctl00_ContentPlaceHolder1_txtGSM')!=null)           FormatPhoneNumber(document.getElementById('ctl00_ContentPlaceHolder1_txtGSM'));
      if(document.getElementById('ctl00_ContentPlaceHolder1_txtHome')!=null)             FormatPhoneNumber(document.getElementById('ctl00_ContentPlaceHolder1_txtHome'));
      if(document.getElementById('ctl00_ContentPlaceHolder1_txtTesTel')!=null)             FormatPhoneNumber(document.getElementById('ctl00_ContentPlaceHolder1_txtTesTel'));
      if(document.getElementById('ctl00_ContentPlaceHolder1_txtTcKimlikNo')!=null)    FormatTcNumber(document.getElementById('ctl00_ContentPlaceHolder1_txtTcKimlikNo'));


      if (document.getElementById('ctl00_ContentPlaceHolder1_User1_rdnQC') != null) sahisSirket();

          if (document.getElementById('ctl00_ContentPlaceHolder1_rdnQC') != null) sahisSirket();
      
//      if(document.getElementById('ctl00_ContentPlaceHolder1_ddlTeslimatAdresi')!=null)             sahisSirket();
      if(document.getElementById('ctl00_ContentPlaceHolder1_ddlTeslimatAdresi')!=null)             TeslimatBilgileri();


//      try { focusRakip(); } catch (err) { }
  
  
  //siparişi tamamla dan sonra geri dönmemesi için
//      if(window.location.toString().toLowerCase().indexOf('shoppingcart.aspx')!= -1)
//        history.forward();         
//      if(window.location.toString().toLowerCase().indexOf('chkbilling.aspx')!= -1)
//        history.forward(); 
        if(window.location.toString().toLowerCase().indexOf('chkout.aspx')!= -1)
        history.forward(); 



 

    try {

        if (window.location.toString().toLowerCase().indexOf("productdetails.aspx") > -1) {
            var vrTab = $find("ctl00_ContentPlaceHolder1_tcnOdeme").get_tabs()[0];
            //   alert(vrTab);
            //    alert(vrTab._header);
            //    alert(vrTab._header.innerText);
            if (vrTab != null && vrTab._header.innerText == "Kampanya") {
                Sys.UI.DomElement.removeCssClass(vrTab._header, "ajax__tab_tab");
                Sys.UI.DomElement.addCssClass(vrTab._header, "ajax__tab_tab1");

                Sys.UI.DomElement.removeCssClass(vrTab._header, "ajax__tab_outer");
                Sys.UI.DomElement.addCssClass(vrTab._header, "ajax__tab_outer1");

                Sys.UI.DomElement.removeCssClass(vrTab._header, "ajax__tab_inner");
                Sys.UI.DomElement.addCssClass(vrTab._header, "ajax__tab_inner1");

                Sys.UI.DomElement.removeCssClass(vrTab._header, "ajax__tab_body");
                Sys.UI.DomElement.addCssClass(vrTab._header, "ajax__tab_body1");

                Sys.UI.DomElement.removeCssClass(vrTab._header, "ajax__tab_header");
                Sys.UI.DomElement.addCssClass(vrTab._header, "ajax__tab_header1");
            }
        }
    } catch (err) { }

 

      
    }
      //üye sayfasındaki şahıs-şirket 
       
//}



    function RedirectForSort() {

        //        ctl00_ContentPlaceHolder1_ddlRecordCount
        //        ctl00_ContentPlaceHolder1_ddlOrder

//        var objRecordCount = document.getElementById('ctl00_ContentPlaceHolder1_ddlRecordCount');
        var objSortBy = document.getElementById('ctl00_ContentPlaceHolder1_ddlOrder');
        var objStok = document.getElementById('ctl00_ContentPlaceHolder1_chkStock');
        
//        var intRecordCount = objRecordCount[objRecordCount.selectedIndex].value;
        var intSortBy = objSortBy[objSortBy.selectedIndex].value;
        var intStok = objStok.checked;
        intStok = (intStok) ? 1 : 0;
            

          var strQuery = window.location.search.substring(1);
        
//        var intRC = strQuery.indexOf('rc=');
//        if (intRC != -1) {
//            var strEx = strQuery.substring(intRC, intRC + 5);
//               strQuery = strQuery.replace(strEx, 'rc=' + intRecordCount);
//        }
//        else {
//            strQuery = strQuery + '&rc=' + intRecordCount;
//        }



        var intSB = strQuery.indexOf('sb=');
        if (intSB != -1) {
           var   strEx1 = strQuery.substring(intSB, intSB + 5);
           strQuery = strQuery.replace(strEx1, 'sb=' + intSortBy);
        }
        else {
            if(strQuery.length>0)
                strQuery = strQuery + '&'; 
            strQuery = strQuery + 'sb=' + intSortBy;
            
//            strQuery = strQuery + '&sb=' + intSortBy;
        }



        var intSK = strQuery.indexOf('sk='); 
        if (intSK != -1) {
            var strEx2 = strQuery.substring(intSK, intSK + 4);
            strQuery = strQuery.replace(strEx2, 'sk=' + intStok);
        }
        else {
            if (strQuery.length > 0)
                strQuery = strQuery + '&';
            strQuery = strQuery + 'sk=' + intStok;
//            strQuery = strQuery + 
        }




        if (strQuery != '') strQuery = '?' + strQuery;

         
          window.location =  strQuery;
    }






    function ShowHaberVer(IID, tip) {
        {

            getPage = "/layerHaberVer.aspx?IID=" + IID + "&tip=" + tip;

            var frmHaberVer = $get("frmHaberVer");
            frmHaberVer.src = getPage; 

            var modal = $find('ctl00_ContentPlaceHolder1_mpeDualLoginAtempt'); 

            modal.show();
        }
    }



    function ShowCommentAgreed(getPage) {
        { 
           
            var frmHaberVer = $get("frmHaberVer");
            frmHaberVer.src = getPage;

            var modal = $find('ctl00_ContentPlaceHolder1_mpeDualLoginAtempt');

            modal.show();
        }
    }



    


 
    function ShowTavsiyeEt(IID) {
        { 

            getPage = "/tavsiyeet.aspx?IID=" + IID;

            var frmHaberVer = $get("frmHaberVer");
            frmHaberVer.src = getPage;

            var modal = $find('ctl00_ContentPlaceHolder1_mpeDualLoginAtempt');

            modal.show();
            
           
        }
    }



    function ShowBeniAra(IID, tip) {
        {

            getPage = "/layerBeniAra.aspx?IID=" + IID  ;

            var frmHaberVer = $get("frmHaberVer");
            frmHaberVer.src = getPage;
            //     frmHaberVer.attr('src', getPage);
            var modal = $find('ctl00_ContentPlaceHolder1_mpeDualLoginAtempt');
            modal.show();
        }
    }  

 



    function ShowSearchWishList(sText) {
        {

              getPage = "/layerSearchWish.aspx?sText=" + sText ;
  

            var frmHaberVer = $get("frmSearchW");   
            frmHaberVer.src = getPage;
          
            var modal;
            if($find('ctl00_ContentPlaceHolder1_mpeSearchW') !=null)
                modal = $find('ctl00_ContentPlaceHolder1_mpeSearchW');
            else
                modal = $find('ctl00_mpeSearchW');
              
             modal.show(); 
        }
    }


    
    function HidempeDualLoginAtempt() {
        { 
            var modal = $find('ctl00_ContentPlaceHolder1_mpeDualLoginAtempt');
            modal.hide();
        }
    }



    function clickOnce(btn) {
        // Test if we are doing a validation
        if (typeof (Page_ClientValidate) == 'function') {
            // if we are doing a validation, return if it's false
            if (Page_ClientValidate() == false) { return false; }
        }

        // Ensure that the button is not of type "submit"
        if (btn.getAttribute('type') == 'button') {
            // The msg attibute is absolutely optional
            // msg will be the text of the button while it's disabled
//            if (!msg || (msg = 'undefined')) { msg = 'Yükleniyor...'; }

//            btn.value = msg;

            // The magic :D
            btn.disabled = true;
        }

        return true;
    }


    function closeModalResponseForgotPwd() 
    {
        //iframe den main formu refreshlemek için

        var objPage = "";

        if (window.parent != null) { 
            window.parent.location = "http://www.vatanbilgisayar.com/forgotpassword.aspx";
        } else { 
            window.location = "http://www.vatanbilgisayar.com/forgotpassword.aspx";
          
        }
    }


    function closeModalResponseUser() {
        //iframe den main formu refreshlemek için

        var objPage = "";

        if (window.parent != null) {
            window.parent.location = "/user.aspx";
        } else {
            window.location = "/user.aspx";

        }
    }



    function closeModalResponseDifUser() {
        //iframe den main formu refreshlemek için

        var objPage = "";

        if (window.parent != null) {
            window.parent.location = "/userlogin.aspx";
        } else {
        window.location = "/userlogin.aspx";

        }
    }


    function findPosX(obj) {
        var curleft = 0;
        if (obj.offsetParent)
            while (1) {
            curleft += obj.offsetLeft;
            if (!obj.offsetParent)
                break;
            obj = obj.offsetParent;
        }
        else if (obj.x)
            curleft += obj.x;
        return curleft;
    }

    function findPosY(obj) {
        var curtop = 0;
        if (obj.offsetParent)
            while (1) {
            curtop += obj.offsetTop;
            if (!obj.offsetParent)
                break;
            obj = obj.offsetParent;
        }
        else if (obj.y)
            curtop += obj.y;
        return curtop;
    }




 function putL2Banner(content,queryString){
     document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/s...rsion=7,0,19,0\" width=\"776\" height=\"150\"><param name=\"movie\" value=\"/L2BANNER/'+content +'.swf?'+queryString +'\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\"><param name=\"menu\" value=\"false\"><embed src=\"/L2BANNER/'+content +'.swf?'+queryString +'\" quality=\"high\" menu=\"false\" wmode=transparent pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"776\" height=\"150\"></embed></object>');
        }


 function putL1Banner(content, queryString) {
      document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/s...rsion=7,0,19,0\" width=\"748\" height=\"150\"><param name=\"movie\" value=\"/L2BANNER/'+content +'.swf?'+queryString +'\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\"><param name=\"menu\" value=\"false\"><embed src=\"/L2BANNER/'+content +'.swf?'+queryString +'\" quality=\"high\" menu=\"false\" wmode=transparent pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"748\" height=\"150\"></embed></object>');
        }



  function putL1BannerSag(content, queryString) {
      document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/s...rsion=7,0,19,0\" width=\"240\" height=\"150\"><param name=\"movie\" value=\"/L2BANNER/' + content + '.swf?' + queryString + '\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\"><param name=\"menu\" value=\"false\"><embed src=\"/L2BANNER/' + content + '.swf?' + queryString + '\" quality=\"high\" menu=\"false\" wmode=transparent pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"240\" height=\"150\"></embed></object>');
  }
