var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-1520074-3']);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();jQuery(document).ready(function(){cfshoppingcart_set_message_layer();jQuery('.add_to_cart_button').click(function(){var id=(jQuery(this).attr('name').split('=',2))[1];quantitySelector='.cfshoppingcart_quantity_'+id;var quantity=jQuery(quantitySelector).attr('value');if(checkNumber(quantity)==false){return;}
jQuery.ajax({url:get_get('add_to_cart',id,quantity),cache:function(){alert('通信エラーが発生しました。');},success:function(html){if(!html){alert('カートへの追加に失敗しました。やりなおしてください。');return;}
var json=eval(html);jQuery('.cfshoppingcart_widget').html(json[0]);if(json[1]){alert(json[1]);}}});});jQuery('.change_quantity_button').click(function(){var id=(jQuery(this).attr('name').split('=',2))[1];quantitySelector='.cfshoppingcart_quantity_'+id;var quantity=jQuery(quantitySelector).attr('value');if(checkNumber(quantity)==false){return;}
jQuery.ajax({url:get_get('change_quantity_commodity',id,quantity),cache:function(){alert('通信エラーが発生しました。');},success:function(html){if(!html){alert('数量の変更に失敗しました。やりなおしてください。');return;}
var json=eval(html);jQuery('.cfshoppingcart_widget').html(json[0]);if(json[1]){alert(json[1]);}}});});jQuery('.cfshoppingcart_change_quantity_button').click(function(){var id=(jQuery(this).attr('name').split('=',2))[1];quantitySelector='.cfshoppingcart_quantity_'+id;var quantity=jQuery(quantitySelector).attr('value');if(checkNumber(quantity)==false){return;}
jQuery('#cfshoppingcart_form input').attr("disabled","disabled");cfshoppingcart_message('しばらくお待ちください...');jQuery.ajax({url:get_get('change_quantity',id,quantity),cache:function(){alert('通信エラーが発生しました。');},success:function(html){if(!html){alert('数量の変更に失敗しました。やりなおしてください。');jQuery('#cfshoppingcart_form input').attr("disabled","");cfshoppingcart_message('');return;}
var json=eval(html);document.location=json[0];if(json[1]){alert(json[1]);}}});});jQuery('.cfshoppingcart_cancel_button').click(function(){var id=(jQuery(this).attr('name').split('=',2))[1];quantitySelector='.cfshoppingcart_quantity_'+id;var quantity=jQuery(quantitySelector).attr('value');if(checkNumber(quantity)==false){return;}
jQuery('#cfshoppingcart_form input').attr("disabled","disabled");cfshoppingcart_message('しばらくお待ちください...');jQuery.ajax({url:get_get('cancel',id,quantity),cache:function(){alert('通信エラーが発生しました。');},success:function(html){if(!html){alert('商品のキャンセルに失敗しました。やりなおしてください。');jQuery('#cfshoppingcart_form input').attr("disabled","");cfshoppingcart_message('');return;}
var json=eval(html);document.location=json[0];}});});});function cfshoppingcart_empty_cart(){jQuery.ajax({url:get_get('empty_cart',-1,0),cache:function(){alert('通信エラーが発生しました。');},success:function(html){if(!html){alert('Empty cart faild.');return;}
var json=eval(html);jQuery('.cfshoppingcart_widget').html(json[0]);if(json[1]){alert(json[1]);}}});}
function get_get(cmd,id,quantity){var cfshoppingcart_plugin_module_uri="http://www.activeq.co.jp/wp-content/plugins/cf-shopping-cart/module";return cfshoppingcart_plugin_module_uri+'/commu.php?cmd='+cmd+'&include='+id+'&quantity='+quantity;}
function checkNumber(quantity){if(checkIsNumber(quantity)==false){alert('正しい商品数量を入力してください。');return false;}
if(quantity<0){alert('正しい商品数量を入力してください。');return false;}
return true;}
function checkIsNumber(value){return(value.match(/[0-9]+/g)==value);}
function cfshoppingcart_message(msg){var layer='#cfshoppingcart_message_layer';if(msg){jQuery(layer).html(msg);var width=jQuery(window).width();var height=jQuery(window).height();var w=width/2;var h=height/2;var x=(width-w)/2+jQuery(window).scrollLeft();;var y=(height-h)/2+jQuery(window).scrollTop();;jQuery(layer).css('left',x);jQuery(layer).css('top',y);jQuery(layer).css("width",w+"px");jQuery(layer).css("height",h+"px");jQuery(layer).css("line-height",h+"px");jQuery(layer).css("visibility","visible");}else{jQuery(layer).css("visibility","hidden");}}
function cfshoppingcart_set_message_layer(){var popuphtml='<!-- cfshoppingcart_message_layer --><div id="cfshoppingcart_message_layer" style="position: absolute; z-index: 99; visibility: hidden; left: 45px; top: 33px;text-align:center;background:#fff09e;border:2px solid orange;"></div><!-- end of cfshoppingcart_message_layer -->';jQuery("body").append(popuphtml);}
document.write('<link rel="stylesheet" href="http://www.activeq.co.jp/wp-content/plugins/lightbox-2/Themes/Black/lightbox.css" type="text/css" media="screen" />');google.load("search","1");function initialize(){var searchControl=new google.search.SearchControl();searcher=new google.search.WebSearch();options=new google.search.SearcherOptions();searcher.setSiteRestriction("002159685159572386283:uzjezpnftnu ");searcher.setUserDefinedLabel("");searchControl.addSearcher(searcher,options);searchControl.addSearcher(new google.search.WebSearch());searchControl.addSearcher(new google.search.NewsSearch());searchControl.addSearcher(new google.search.VideoSearch());searchControl.addSearcher(new google.search.BlogSearch());searchControl.addSearcher(new google.search.ImageSearch());searchControl.addSearcher(new google.search.BookSearch());searchControl.addSearcher(new google.search.PatentSearch());searchControl.draw(document.getElementById("searchcontrol"));searchControl.execute("");}
google.setOnLoadCallback(initialize);function dsfaq_open_quest(id){document.getElementById("dsfaq_answer_"+id).innerHTML='<img src="http://www.activeq.co.jp/wp-content/plugins/wp-ds-faq/img/ajax-loader.gif" />';var mysack=new sack("http://www.activeq.co.jp/wp-content/plugins/wp-ds-faq/ajax.php");mysack.execute=1;mysack.method='POST';mysack.setVar('action','open_quest');mysack.setVar('id',id);mysack.onError=function(){alert('Ajax error. [Error id: 10]')};mysack.runAJAX();return true;}
function dsfaq_close_quest(id){document.getElementById("dsfaq_answer_"+id).innerHTML='';if(document.getElementById("dsfaq_tools_"+id)){document.getElementById("dsfaq_tools_"+id).innerHTML='';}
return true;}
