
function CallMe(id,dest)
 {    
     PageMethods.SetSc(id, CallSuccess, CallFailed, dest);
      alert('Товар добавлен в корзину.');     
 }
 
 function CallSuccess(res, destCtrl)
 {
    opener.PostBackOnMainPage();
       
 }
function CallSuccess1()
 {

   //alert('Удалили');   
    
    opener.PostBackOnMainPage();
       
 }
 
 function CallFailed(res,userContext,methodName)
 {
     alert(res.get_message());
 }
 function CallMe10(id)
 {    
 
     PageMethods.SetSc10(id, CallSuccess1, CallFailed);   
      //alert('Удалили'); 
      window.location.reload(true);          
     
 }
 function CallMe11()
 {    
     PageMethods.SetSc11(1,CallSuccess1, CallFailed);   
     //alert('Удалилены все товара для сравнения.');  
      window.location.reload(true);          
     
 }
 
 function js_AddToCart(id,dest)
 {    
     PageMethods.AddToCart(id, js_CallSuccess, CallFailed, dest);
     //tt=document.getElementById('_ctl0_Header1_idscitem');     
      alert('Товар добавлен в корзину.');     
 }
 function js_CallSuccess(res, destCtrl)
 {         
    opener.PostBackOnMainPage(); 
     return true;   
 }
 

 


function getPageWidth() {
  if (parent.document.body != null)
    if (parent.document.body.scrollWidth != null) 
		return parent.document.body.scrollWidth;
  if (parent.document.width != null) 
	return parent.document.width;
  return -1;
}

function getPageHeight() {
  if (parent.document.body != null)
    if (parent.document.body.scrollHeight != null) 
		return parent.document.body.scrollHeight;
  if (parent.document.height != null) 
	return parent.document.height;
  return -1;
}

function addbookmark()	{
  var bookmarkurl='http://store.micromark.it'
  var bookmarktitle='Magazino Micromark'
  if (document.all)
  window.external.AddFavorite(bookmarkurl,bookmarktitle);
}

 function messag() {        
     alert("Товар будет добавлен в корзину. Корзина наверху слева");
    }

function OpenNewPopupWindowWT(url, width, height) {
    window.open(url, '_blank', ',scrollbars=yes,resizable=yes,left=50px,top=50px,toolbar=yes, location=no, directories=no, status=no, menubar=yes, copyhistory=yes, width=' + width + ', height=' + height);
}

function OpenNewPopupWindow(url, width, height) {
    window.open(url, '_blank', 'toolbar=no, location=no, directories=no, status=no, menubar=no, copyhistory=yes, width=' + width + ', height=' + height);
}

function ShowWin(pagina,wintarget){
	window.open(pagina,wintarget,'width=650px,height=520px,scrollbars=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,left=50px,top=50px').focus();
}

function MaximizeWin(){
	window.top.parent.focus();
}

function CloseWin(){
	window.top.parent.close();
	window.top.parent.opener.location.reload( true );
}

function Down(){
	parent.scrollTo(getPageWidth(),getPageHeight());
	Focus();
}

function Focus(){
	parent.parent.LiveHelpButton.document.getElementById('TextToSend').focus();
}

function windowLogout() {
	window.location = 'LogOutChat.aspx';
}

function writeMessage(messageText) {
var obj = parent.document.getElementById('ChatScreen');

	if( obj.insertAdjacentHTML )
		obj.insertAdjacentHTML( 'BeforeEnd', messageText );
  	
  	else if( typeof( obj.innerHTML ) != 'undefined' )
    	obj.innerHTML += messageText;
}

