/*
	INSTREAM SHOP SCRIPT
	All rightts are resereved, if you are not licensed to use this script please connect us
	http://instream.com.ua
*/







function CheckWindowElement(obj_id,obj_val)
{

	var ValArray=['введите Ваше имя','3(код) номер телефона','Ваш e-mail','0'];

	if (document.getElementById(obj_id)!=null)
	{
		obj=document.getElementById(obj_id);
		var check_str=obj.value;
		var inArr=$.inArray(check_str, ValArray);
			if(inArr>=0) return 0;

		if(check_str.length>=obj_val)
			return 1;
		else return 0
	}
	else return 0;
}



function InputChanged(obj,default_val,check_items_list,submit_btn_id)
{
	// проверка для статуса кнопки Отправить
	//alert(check_items_list);
	var mySplitResult = check_items_list.split(",");

	var result=1;
	var spinRes=mySplitResult.length;

  if( spinRes>0)
  {

	var i=0;
	for(i=0;i<spinRes;i++)
	{

		split_res= mySplitResult[i];
		split_more=split_res.split("=");
			split_item=split_more[0];
			split_val=split_more[1];
			res=CheckWindowElement(split_item,split_val);

			if(res==0) result=0;


	}
  }

	// обработка результатов


	if ( (obj.value==default_val) && (obj.value!='') )result=0;



	if(result==1)	document.getElementById(submit_btn_id).className='prod_btn black_btn';
	else 		document.getElementById(submit_btn_id).className='prod_btn black_btn_dis';

	//if( obj.value.length>4 )alert('val='+obj.value+' | default='+default_val+' | res='+result+'  class='+document.getElementById(submit_btn_id).className);


}

function InputChangedRed(obj,default_val,check_items_list,submit_btn_id)
{
	// проверка для статуса кнопки Отправить
	//alert(check_items_list);
	var mySplitResult = check_items_list.split(",");

	var result=1;
	var spinRes=mySplitResult.length;

  if( spinRes>0)
  {

	var i=0;
	for(i=0;i<spinRes;i++)
	{

		split_res= mySplitResult[i];
		split_more=split_res.split("=");
			split_item=split_more[0];
			split_val=split_more[1];
			res=CheckWindowElement(split_item,split_val);

			if(res==0) result=0;


	}
  }

	// обработка результатов


	if ( (obj.value==default_val) && (obj.value!='') )result=0;



	if(result==1)	document.getElementById(submit_btn_id).className='black_btn2';
	else 		document.getElementById(submit_btn_id).className='black_btn2_dis';



	//if( obj.value.length>4 )alert('val='+obj.value+' | default='+default_val+' | res='+result+'  class='+document.getElementById(submit_btn_id).className);


}






function InputClicked(obj,default_val)
{
	if(default_val==obj.value)
		obj.value='';
}

function InputBlure(obj,default_val)
{
	if (obj.value=='')
		obj.value=default_val;
}





/* ///////////////////////////////////////////////////////////////////////

	AJAX FUNCTIONS FOR INSTREAM WINDOWS

/////////////////////////////////////////////////////////////////////// */

var ajax=null;

// без изменений
function getAjax(){
if (window.ActiveXObject) // для IE
   return new ActiveXObject("Microsoft.XMLHTTP");
else if (window.XMLHttpRequest)
   return new XMLHttpRequest();
else {
   alert("Browser does not support AJAX.");
   return null;
  }
}



function CallOrderSubmit(url) // Заказать звонок
{

if(document.getElementById('call_order_submit_btn').className=='prod_btn black_btn')
{

	ajax=getAjax();
	var param;
	if (ajax != null)
	{


		if (document.getElementById('call_order_capture_input')!=null)
	   		param='user_name='+document.getElementById("user_name").value+'&user_phone='+document.getElementById("user_phone").value+'&calltime='+document.getElementById("calltime").value+'&edditinal='+document.getElementById("edditinal").value+'&capture_input='+document.getElementById("call_order_capture_input").value;
		else
	   		param='user_name='+document.getElementById("user_name").value+'&user_phone='+document.getElementById("user_phone").value+'&calltime='+document.getElementById("calltime").value+'&edditinal='+document.getElementById("edditinal").value+'&capture_input=0';


		// метод POST, указываем просто имя файла
		   ajax.open("POST",url,true);

		 // добавляем стандартный заголовок http
		 // посылаемый через ajax
		  ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

		   // вроде эти могут тормозить
		   ajax.setRequestHeader("Content-length", param.length);
		   ajax.setRequestHeader("Connection", "close");

		   ajax.onreadystatechange = function()
			{
		   		if(ajax.readyState==4 && ajax.status==200)
				{
		         		document.getElementById('CallOrderAjaxloderImg').style.display='none';
					result=ajax.responseText;

					//проверка на ошибки ввода информации
					var check_err=result.indexOf('Ошибка');
					if (check_err==-1) // пройдена проверка
					{

						//alert('err='+check_err);
						FloatWinClose('Window5');
						alert(result);


				        }
					else
				        {
							alert(result+'. Для отправки сообщения исправьте ошибку');

					// обновление капчи
						document.getElementById('oc_capcha_img').src ='capcha_pages.php?page=callorder&rnd='+Math.random();
						document.getElementById('call_order_capture_input').value='';
						document.getElementById('call_order_submit_btn').className='prod_btn black_btn_dis';



					}

				}
				else
				{
					document.getElementById('CallOrderAjaxloderImg').style.display='';
				}

			}


		   // посылаем наши данные или пустую строку (param="")
		   // главное не null
		   ajax.send(param);

	}


}
else
{
	alert('Заполните все отмеченные * поля');
}

}



function FAQSubmit(url) // Пожелания и вопросы
{

	//alert('url='+url);
	ajax=getAjax();
	var param;
	if (ajax != null)
	{


		if (document.getElementById('faq_capture_input')!=null)
		   param='user_name='+document.getElementById("faq_user_name").value+'&user_phone='+document.getElementById("faq_user_phone").value+'&user_mail='+document.getElementById("faq_user_mail").value+'&edditinal='+document.getElementById("faq_edditinal").value+'&capture_input='+document.getElementById("faq_capture_input").value;
		else
		   param='user_name='+document.getElementById("faq_user_name").value+'&user_phone='+document.getElementById("faq_user_phone").value+'&user_mail='+document.getElementById("faq_user_mail").value+'&edditinal='+document.getElementById("faq_edditinal").value+'&capture_input=0';

		// метод POST, указываем просто имя файла
		   ajax.open("POST",url,true);

		 // добавляем стандартный заголовок http
		 // посылаемый через ajax
		  ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

		   // вроде эти могут тормозить
		   ajax.setRequestHeader("Content-length", param.length);
		   ajax.setRequestHeader("Connection", "close");

		  ajax.onreadystatechange = function()
			{
		   		if(ajax.readyState==4 && ajax.status==200)
				{
		         		document.getElementById('faqajaxloderimg').style.display='none';
					result=ajax.responseText;
					//alert('res='+result);

					//проверка на ошибки ввода информации
					var check_err=result.indexOf('Ошибка');
					if (check_err==-1) // пройдена проверка
					{
						alert(result);
						FloatWinClose('Window6');
				        }

					else
				        {
							alert(result+'. Для отправки сообщения исправьте ошибку');

					// обновление капчи
						document.getElementById('faq_capcha_img').src ='capcha_pages.php?page=faq&rnd='+Math.random();
						document.getElementById('faq_capture_input').value='';
						document.getElementById('faq_submit_btn').className='prod_btn black_btn_dis';


					}


				}
				else
				{
					document.getElementById('faqajaxloderimg').style.display='';
				}

			}

		   // посылаем наши данные или пустую строку (param="")
		   // главное не null
		   ajax.send(param);

	}




}

function WantDiscoundShow(prod_id,prod_name)
{

	document.getElementById('want_discount_prod').innerHTML=prod_name;
	obj=document.getElementById('WantDiscount_Btn');
	fireEvent(obj,'click');

}




function WantDiscountSubmit(url) // Хочу скидку
{

	//alert('url='+url);
	ajax=getAjax();
	var param;
	if (ajax != null)
	{


		if (document.getElementById('wd_capture_input')!=null)
		   param='user_name='+document.getElementById("wd_user_name").value+'&user_phone='+document.getElementById("wd_user_phone").value+'&user_mail='+document.getElementById("wd_user_mail").value+'&edditinal='+document.getElementById("wd_edditinal").value+'&capture_input='+document.getElementById("wd_capture_input").value+'&wd_prod_hid='+document.getElementById("wd_prod_hid").value;
		else
		   param='user_name='+document.getElementById("wd_user_name").value+'&user_phone='+document.getElementById("wd_user_phone").value+'&user_mail='+document.getElementById("wd_user_mail").value+'&edditinal='+document.getElementById("wd_edditinal").value+'&capture_input=0'+'&wd_prod_hid='+document.getElementById("wd_prod_hid").value;

		// метод POST, указываем просто имя файла
		   ajax.open("POST",url,true);

		 // добавляем стандартный заголовок http
		 // посылаемый через ajax
		  ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

		   // вроде эти могут тормозить
		   ajax.setRequestHeader("Content-length", param.length);
		   ajax.setRequestHeader("Connection", "close");

		  ajax.onreadystatechange = function()
			{
		   		if(ajax.readyState==4 && ajax.status==200)
				{
		         		document.getElementById('WantDiscountAjaxloderImg').style.display='none';
					result=ajax.responseText;
					//alert('res='+result);

					//проверка на ошибки ввода информации
					var check_err=result.indexOf('Ошибка');

					if (check_err==-1) // пройдена проверка
					{
						alert(result);
						FloatWinClose('Window8');
				        }

					else
				        {


						alert(result+'. Для отправки сообщения исправьте ошибку');

					// обновление капчи
						document.getElementById('wd_capcha_img').src ='capcha_pages.php?page=wantdiscount&rnd='+Math.random();
						document.getElementById('wd_capture_input').value='';
						document.getElementById('wd_submit_btn').className='prod_btn black_btn_dis';
					}


				}
				else
				{
					document.getElementById('WantDiscountAjaxloderImg').style.display='';
				}

			}

		   // посылаем наши данные или пустую строку (param="")
		   // главное не null
		   ajax.send(param);

	}




}



function FollowSubmit(url) // Хочу скидку
{

	//alert('url='+url);
	ajax=getAjax();
	var param;
	if (ajax != null)
	{


		if (document.getElementById('fl_capture_input')!=null)
		   param='user_name='+document.getElementById("fl_user_name").value+'&user_phone='+document.getElementById("fl_user_phone").value+'&user_mail='+document.getElementById("fl_user_mail").value+'&edditinal='+document.getElementById("fl_edditinal").value+'&capture_input='+document.getElementById("fl_capture_input").value+'&follow_prod_hid='+document.getElementById("follow_prod_hid").value;
		else
		   param='user_name='+document.getElementById("fl_user_name").value+'&user_phone='+document.getElementById("fl_user_phone").value+'&user_mail='+document.getElementById("fl_user_mail").value+'&edditinal='+document.getElementById("fl_edditinal").value+'&capture_input=0'+'&follow_prod_hid='+document.getElementById("follow_prod_hid").value;

		// метод POST, указываем просто имя файла
		   ajax.open("POST",url,true);

		 // добавляем стандартный заголовок http
		 // посылаемый через ajax
		  ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

		   // вроде эти могут тормозить
		   ajax.setRequestHeader("Content-length", param.length);
		   ajax.setRequestHeader("Connection", "close");

		  ajax.onreadystatechange = function()
			{
		   		if(ajax.readyState==4 && ajax.status==200)
				{
		         		document.getElementById('FollowAjaxloderImg').style.display='none';
					result=ajax.responseText;
					//alert('res='+result);

					//проверка на ошибки ввода информации
					var check_err=result.indexOf('Ошибка');

					if (check_err==-1) // пройдена проверка
					{
						alert(result);
						FloatWinClose('Window10');
				        }

					else
				        {


						alert(result+'. Для отправки сообщения исправьте ошибку');

					// обновление капчи
						document.getElementById('fl_capcha_img').src ='capcha_pages.php?page=follow&rnd='+Math.random();
						document.getElementById('fl_capture_input').value='';
						document.getElementById('fl_submit_btn').className='prod_btn black_btn_dis';
					}


				}
				else
				{
					document.getElementById('FollowAjaxloderImg').style.display='';
				}

			}

		   // посылаем наши данные или пустую строку (param="")
		   // главное не null
		   ajax.send(param);

	}




}





function InStreamLogin(SID)
{

	ajax=getAjax();
	var param;
	if (ajax != null)
	{

		var url='log_try.php?action=login&'+SID;
		param='password='+document.getElementById("password").value+'&email_address='+document.getElementById("email_address").value+'&capture_input='+document.getElementById("log_capture_input").value;
		//alert(url);

	          ajax.open("POST",url,true);
		  ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");


		   ajax.setRequestHeader("Content-length", param.length);
		   ajax.setRequestHeader("Connection", "close");

		   ajax.onreadystatechange = function()
			{
		   		if(ajax.readyState==4 && ajax.status==200)
				{

					result=ajax.responseText;
					//alert(result);
				        document.getElementById('ajaxloderimg').style.display='none';

					//проверка на ошибки ввода информации

					ind_start=result.indexOf('[*@res@*]');
					//alert('ind_st='+ind_start);

					ind_start=ind_start+9;
					var check_err=result.substr(ind_start,5);
					//alert('res='+check_err);
					if (check_err=='error')
        				{

					    	//alert('here');
						var ind_start=result.indexOf('stream_check=');
						var ind_start=ind_start+13;
						ind_end=result.indexOf('[*@lt@*]');
						//alert('start='+ind_start+'  end='+ind_end);
				        	ind_end=ind_end-ind_start;

						SCTotal=result.substr(ind_start,ind_end);

						if (SCTotal>2)
						document.getElementById('capture_box').style.display='';

					  // обновление окна авторизации
					  	ind_start=result.indexOf('box_data=');
						ind_start=ind_start+9;
						ind_end=result.indexOf('[*@bd@*]');
						//alert('start='+ind_start+'  end='+ind_end);
				        	ind_end=ind_end-ind_start;

						UpdData=result.substr(ind_start,ind_end);
						document.getElementById('LogBlockData').innerHTML=UpdData;

							//document.getElementById('capcha_img').src ='capcha_pages.php?page=login&rnd='+Math.random();

					}
					else // удачная авторизация
					{

						//alert('res=|'+check_err+'|');
						//alert(result);
						var redirect_url=result;

						window.location=redirect_url;
				        }


				}
				else
 				{

					document.getElementById('ajaxloderimg').style.display='';
   				}

   			}
			 ajax.send(param);
	}


}


function CaptchaImgRefresh(obj_id,page_nm,capt_input)
{

	random_string='capcha_pages.php?page='+page_nm+'&rnd='+Math.random();
	//alert('obj_id='+obj_id+' | page_nm='+page_nm+' | capt_input='+capt_input+' || rand='+random_string);
	document.getElementById(obj_id).src =random_string;
	document.getElementById(capt_input).value='';

	if(page_nm=='callorder') document.getElementById('call_order_submit_btn').className='prod_btn black_btn_dis';

	if(page_nm=='login')
	{
		document.getElementById('log_submit_btn').className='prod_btn black_btn_dis';
		document.getElementById('log_capture_input').value='';
	}

	if(page_nm=='follow') document.getElementById('fl_submit_btn').className='prod_btn black_btn_dis';

	if(page_nm=='wantdiscount') document.getElementById('wd_submit_btn').className='prod_btn black_btn_dis';

	if(page_nm=='faq') document.getElementById('faq_submit_btn').className='prod_btn black_btn_dis';

}


function CloseWindows()
{

document.getElementById('Window3').style.display='none';
document.getElementById('Window1').style.display='none';
document.getElementById('Window2').style.display='none';
document.getElementById('Window5').style.display='none';
document.getElementById('Window6').style.display='none';
document.getElementById('Window7').style.display='none';
document.getElementById('Window8').style.display='none';
document.getElementById('Window10').style.display='none';

document.getElementById('CompareWindow').style.display='none';
document.getElementById('OnlineSupportWindow').style.display='none';

//document.getElementById('ajaxloderimg').style.display='none';

}

function BuildInStreamWin(WinType,CID,cPath)
{

//alert(WinType);

CloseWindows();






     document.getElementById('CallOrderData').style.display='none';
     document.getElementById('callorder_loader').style.display='';


	document.getElementById('FAQBoxData').style.display='none';
        document.getElementById('faq_loader').style.display='';

		document.getElementById('WantDiscountData').style.display='none';
        	document.getElementById('wd_loader').style.display='';

			document.getElementById('FollowData').style.display='none';
        		document.getElementById('fl_loader').style.display='';


				document.getElementById('CartAllData').style.display='none';
        			document.getElementById('cart_loader').style.display='';

					document.getElementById('FormOrderData').style.display='none';
        				document.getElementById('fo_loader').style.display='';



      if(CID!='') CID='&isID='+CID;
      if(cPath!='') cPath='&cPath='+cPath;

     url='build_instream_win.php?win_type='+WinType+cPath+CID;
	//alert(url);
     if (request == null)
     alert("Error creating request object!");
     request.open("GET",url,true);
     request.onreadystatechange =  function()
     {
	if (request.readyState == 4)
    	{

	      if (request.status == 200)
      		{
		       /* Получение ответа от сервера */

			var res_txt = request.responseText;
			//alert(res_txt);
			switch (WinType)
			{
			   case 'CallOrder':
      					//alert(document.getElementById('CallOrderData').innerHTML);


					document.getElementById('CallOrderData').innerHTML=res_txt;
						$("#CallOrderData").fadeIn(1000);
						$("#callorder_loader").fadeOut(1000);

     			 	break;

   			   case 'FAQ':
      					//alert(document.getElementById('CallOrderData').innerHTML);


					document.getElementById('FAQBoxData').innerHTML=res_txt;
						$("#FAQBoxData").fadeIn(1000);
						$("#faq_loader").fadeOut(1000);

     			 	break;

			   case 'Compare':

					//alert('here='+res_txt);
					document.getElementById('CompareWindowData').innerHTML=res_txt;
					if (document.getElementById('log_err_msg')!=null) { document.getElementById('log_err_msg').innerHTML=''; } document.getElementById('email_address').value=''; document.getElementById('password').value=''; document.getElementById('log_submit_btn').className='prod_btn black_btn_dis';

     			 	break;

			   case 'LoginBox':

					//alert('here='+res_txt);
					document.getElementById('LogBlockData').innerHTML=res_txt;

     			 	break;

			   case 'WantDiscount':

					//alert('WD');

					document.getElementById('WantDiscountData').innerHTML=res_txt;
					document.getElementById('want_discount_prod').innerHTML=document.getElementById('wd_flag').value;

					obj=document.getElementById('WantDiscount_Btn');
					fireEvent(obj,'click');

						$("#WantDiscountData").fadeIn(1000);
						$("#wd_loader").fadeOut(1000);

					document.getElementById('wd_prod_hid').value=document.getElementById('wd_flag').value;

     			 	break;

			  case 'Follow':

					//alert('FL');


					document.getElementById('FollowData').innerHTML=res_txt;

					var prod_name=document.getElementById('fl_flag').value;
					//alert(prod_name);

					obj=document.getElementById('Follow_Btn');
					fireEvent(obj,'click');

						$("#FollowData").fadeIn(1000);
						$("#fl_loader").fadeOut(1000);
					document.getElementById('follow_prod_hid').value=prod_name;
					document.getElementById('follow_prod').innerHTML=prod_name;
					//alert(document.getElementById('follow_prod_hid').value);

     			 	break;

			  case 'FormOrder':



					document.getElementById('FormOrderData').innerHTML=res_txt;

					var prod_name=document.getElementById('fl_flag').value;
					//alert(prod_name);

					obj=document.getElementById('OrderForm_Btn');
					fireEvent(obj,'click');

						$("#FormOrderData").fadeIn(1000);
						$("#fo_loader").fadeOut(1000);

     			 	break;


			 case 'InstreamCart':

					//alert(res_txt);
					document.getElementById('win_cart_data').innerHTML=res_txt;

						$("#CartAllData").fadeIn(1000);
						$("#cart_loader").fadeOut(1000);
					start=res_txt.indexOf('<!--CartTotal[');
					end=res_txt.indexOf(']//-->');
					tot_res=res_txt.substr(start+14,(end-(start+14)));
					//alert(tot_res);
					document.getElementById('CartWinTotal').innerHTML='Итого к оплате: '+tot_res;

     			 	break;


			   default:
      					j=k;
      				break;
			}

			//alert(res_txt);

      		}
	 }

      }
     request.send(null);



}




function FillCMPWindow(url)
{

	//alert('url='+url);

	//document.getElementById('CompareWindowData').innerHTML=document.getElementById('CompareWinBoxDiv').innerHTML;

	document.getElementById('CompareWindowData').style.display='none';
     	document.getElementById('compare_loader').style.display='';

	//alert('here');
     if (request == null)
     alert("Error creating request object!");
     request.open("GET",url,true);
     request.onreadystatechange =  function()
     {
	if (request.readyState == 4)
    	{

	      if (request.status == 200)
      		{
		       /* Получение ответа от сервера */
		       var res_txt = request.responseText;
			//alert(res_txt);

						win_obj=document.getElementById('win-reg-btn');
                        // alert(win_obj);
                        if(document.getElementById('win-reg-btn')!=null) fireEvent(win_obj,'click');

				var ind_start=res_txt.indexOf('<!-- ComparetDivData -->');
				var ind_end=res_txt.indexOf('<!-- EOFCompareDivData -->');
				ind_end=ind_end+26;

				        	ind_end=ind_end-ind_start;

						CMP_DATA=res_txt.substr(ind_start,ind_end);
						CMP_DATA=str_replace('CompareWinBoxDiv_copy', 'CompareWinBoxDiv', CMP_DATA);
						CMP_DATA=str_replace('CompareWinBoxDivClass_copy', 'CompareWinBoxDivClass', CMP_DATA);
						document.getElementById('CompareWindowData').innerHTML=CMP_DATA;



						win_obj=document.getElementById('OrderCompare_Btn');
						fireEvent(win_obj,'click');
						$("#CompareWindowData").fadeIn(1000);
						$("#compare_loader").fadeOut(1000);



						 request.send(null);
						return false;
						//alert(document.getElementById('CompareWindowData').style.display);


      		}
	 }

      }
     request.send(null);

}

function ErrorTest(url)
{

	//alert('url='+url);


     if (request == null)
     alert("Error creating request object!");
     request.open("GET",url,true);
     request.onreadystatechange =  function()
     {
	if (request.readyState == 4)
    	{

	      if (request.status == 200)
      		{
		       /* Получение ответа от сервера */
		       var res_txt = request.responseText;
			alert(res_txt);



      		}
	 }

      }
     request.send(null);

}



function FormOrderRegionChange(val,upd_obj,btn_stat)
{
	//alert(document.getElementById('user_region').value);
   //alert(val);


if(val>0)
{
   if (request == null)
     alert("Error creating request object!");


   if(upd_obj=='deliver_type_div')
	var url='form_order_change.php?reg='+val+'&btn_enabled_stat='+btn_stat;
   else
	var url='form_order_change.php?deliv='+val+'&btn_enabled_stat='+btn_stat;


     request.open("GET",url,true);
     request.onreadystatechange =  function()
     {
	if (request.readyState == 4)
    	{

	      if (request.status == 200)
      		{
		       /* Получение ответа от сервера */
		       var res_txt = request.responseText;
			if(res_txt.length>5)
			{
				document.getElementById(upd_obj).innerHTML=res_txt;
				document.getElementById('deliver_type').disabled=false;
			}
			//alert('1'+val+' stat='+document.getElementById('deliver_type').disabled);

      		}
	 }

      }
     request.send(null);


}
else
{

	document.getElementById('order_submit_btn').className='prod_btn black_btn_dis';
	document.getElementById('deliver_type').selectedIndex=0;
	document.getElementById('deliver_type').disabled=true;

}

}


function unreg_user_status(obj)
{

	if(obj.value==1)
	{
		document.getElementById('header1').innerHTML='<b>Название предприятия*</b>';
		document.getElementById('header2').innerHTML='<b>Менеджер по закупкам (ФИО)*</b>';
		document.getElementById('header3').innerHTML='<b>Директор (ФИО)</b>';
	}
	else
	{
		document.getElementById('header1').innerHTML='<b>Фамилия*</b>';
		document.getElementById('header2').innerHTML='<b>Имя*</b>';
		document.getElementById('header3').innerHTML='<b>Отчество</b>';
	}

}


function GetChangeIntervalValue()
{

	alert('here');

}


function InstreamCompareAdd(prod_id,url,comp_name)
{


	var loader_id=comp_name;
	loader_id=loader_id.replace('comp_','comp_loader');
	$("#"+loader_id).fadeIn(1000);

  var ajax_flag=document.getElementById("ajax_work").value;
  if(ajax_flag>0)
  {
	window.setTimeout("InstreamCompareAdd('"+prod_id+"','"+url+"','"+comp_name+"')", 400);
  }
  else
  {

	document.getElementById("ajax_work").value=1;
	if (request == null)
     	alert("Error creating request object!");
     	request.open("GET",url,true);
     	request.onreadystatechange = function () { UpdateCompareData(loader_id);}
     	request.send(null);
  }

}



function InstreamCompareDel(prod_id,url)
{
	//alert('url='+url+'  prod='+prod_id);
	if (request == null)
     	alert("Error creating request object!");
     	request.open("GET",url,true);
     	request.onreadystatechange = DelCPData;
     	request.send(null);

}




function InstreamCompareDelAll(url)
{
	//alert('url='+url);
	if (request == null)
     	alert("Error creating request object!");
     	request.open("GET",url,true);
     	request.onreadystatechange = DelCPData;
     	request.send(null);
	FloatWinClose('CompareWindow');
	//$("#CompareWindow").fadeOut(1000);
	//document.getElementById("CompareWindowData").style.display='none';

}






